qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
4,927,749 | I'm sending HTML mails with swiftmailer. It all works pretty great, my HTML mails are showing up just fine in all clients. I have quite the knowledge of building email templates. Sending them myself not so much...
The problem exists in gmail and hotmail. The image is not showing up. It shows just fine in Thunderbird f... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4927749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/158477/"
] | Yes, that is exactly what it does. | Yes. The default copy constructor in C++ will be member-wise copy initialization for every member in the type.
As to how exactly the copy is done for primitive types such as `int` and `float` I cannot say for certain. My guess is it's implementation specific but most compilers just do a bit by bit copy. |
2,537,130 | I have a code that looks something like:
```
struct Data { int value; };
class A {
public:
typedef std::deque<boost::shared_ptr<Data> > TList;
std::back_insert_iterator<TList> GetInserter()
{
return std::back_inserter(m_List);
}
private:
TList m_List;
};
class AA {
boost::scoped_ptr<A>... | 2010/03/29 | [
"https://Stackoverflow.com/questions/2537130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/109747/"
] | The short answer is yes, `back_insert_iterator` is safe to pass by value. The long answer: From standard 24.4.2/3:
>
> Insert iterators satisfy the
> requirements of output iterators.
>
>
>
And 24.1.2/1
>
> A class or a built-in type X satisfies
> the requirements of an output iterator
> if X is an Assignabl... | The following code, which compiles, prints "1", indicating one item added to the list:
```
#include <iostream>
#include <deque>
#include "boost/shared_ptr.hpp"
#include "boost/scoped_ptr.hpp"
struct Data {
int value;
Data( int n ) : value(n) {}
};
struct A {
typedef std::deque<boost::shared_ptr<Data> >... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Yes and no. There's a thin, and sometimes indistinguishable line between orchestration and aggregation/service augmentation.
In general, if you've got any long-running or complex business process (process being the key word, although I'm going to avoid defining it) - that's best suited to BPEL.
Simple tasks, such as ... | No, an ESB's responsibility is not the orchestration of services (per se).
The ESB provides a layer of abstraction at the "software infrastructure level".
This means that an ESB is a "single logical abstract port of call for connectivity" with any service that is published on the bus.
The ESB being abstract, means th... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Now my own vision.
Regarding all the work an ESB has to do, putting service orchestration inside the main infrastructure element of your SOA is not a good idea.
Aggregate, ok! But keeping your communication channel busy with business logic will, for sure, cause a terrible impact in the ability to delivery other featu... | Yes orchestration is a responsibility, in most cases, of the ESB. Or, alternatively, if you draw a line between ESB infra and orchestration infra, then you are doing so on a physical level for performance reasons, not for logical attribution of responsibility.
You have 2 choices - when, for example, an HR system rece... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Yes and no. There's a thin, and sometimes indistinguishable line between orchestration and aggregation/service augmentation.
In general, if you've got any long-running or complex business process (process being the key word, although I'm going to avoid defining it) - that's best suited to BPEL.
Simple tasks, such as ... | Yes orchestration is a responsibility, in most cases, of the ESB. Or, alternatively, if you draw a line between ESB infra and orchestration infra, then you are doing so on a physical level for performance reasons, not for logical attribution of responsibility.
You have 2 choices - when, for example, an HR system rece... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Now my own vision.
Regarding all the work an ESB has to do, putting service orchestration inside the main infrastructure element of your SOA is not a good idea.
Aggregate, ok! But keeping your communication channel busy with business logic will, for sure, cause a terrible impact in the ability to delivery other featu... | Whenever you have two or more services that interact use service orchestrator, i.e. for composition and process control services. If you have esb expose this composition service on esb. Now if you have to compose new service that includes this composition service use orchestrator and again expose on esb.
Use esb as ser... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Whenever you have two or more services that interact use service orchestrator, i.e. for composition and process control services. If you have esb expose this composition service on esb. Now if you have to compose new service that includes this composition service use orchestrator and again expose on esb.
Use esb as ser... | Yes orchestration is a responsibility, in most cases, of the ESB. Or, alternatively, if you draw a line between ESB infra and orchestration infra, then you are doing so on a physical level for performance reasons, not for logical attribution of responsibility.
You have 2 choices - when, for example, an HR system rece... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Yes orchestration is a responsibility, in most cases, of the ESB. Or, alternatively, if you draw a line between ESB infra and orchestration infra, then you are doing so on a physical level for performance reasons, not for logical attribution of responsibility.
You have 2 choices - when, for example, an HR system rece... | An Enterprise Service Bus should never be responsible for orchestrating services.
Orchestration implies a minimum of "smarts", specifically the ability to compensate for failed transactions. Service bus tools will often say they offer "try-catch" or something like that but the ability to run scoped componsation is th... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | My short quick answer is NO, that not its responsability.
I would rather let that to the BPEL or a BPM suite.
Mhh I don't know what else to add :) ... Good luck? | Whenever you have two or more services that interact use service orchestrator, i.e. for composition and process control services. If you have esb expose this composition service on esb. Now if you have to compose new service that includes this composition service use orchestrator and again expose on esb.
Use esb as ser... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Now my own vision.
Regarding all the work an ESB has to do, putting service orchestration inside the main infrastructure element of your SOA is not a good idea.
Aggregate, ok! But keeping your communication channel busy with business logic will, for sure, cause a terrible impact in the ability to delivery other featu... | An Enterprise Service Bus should never be responsible for orchestrating services.
Orchestration implies a minimum of "smarts", specifically the ability to compensate for failed transactions. Service bus tools will often say they offer "try-catch" or something like that but the ability to run scoped componsation is th... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Yes and no. There's a thin, and sometimes indistinguishable line between orchestration and aggregation/service augmentation.
In general, if you've got any long-running or complex business process (process being the key word, although I'm going to avoid defining it) - that's best suited to BPEL.
Simple tasks, such as ... | Whenever you have two or more services that interact use service orchestrator, i.e. for composition and process control services. If you have esb expose this composition service on esb. Now if you have to compose new service that includes this composition service use orchestrator and again expose on esb.
Use esb as ser... |
345,749 | **Is an Enterprise Service Bus** (a tool that acts as a mediator, a message broker, a service enabler, schema transformation enhancer, transparent location provider, service aggregator, load balancer, monitor, and all that stuff) **responsible to orchestrate services**?
What about putting an automated business busines... | 2008/12/06 | [
"https://Stackoverflow.com/questions/345749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21370/"
] | Whenever you have two or more services that interact use service orchestrator, i.e. for composition and process control services. If you have esb expose this composition service on esb. Now if you have to compose new service that includes this composition service use orchestrator and again expose on esb.
Use esb as ser... | An Enterprise Service Bus should never be responsible for orchestrating services.
Orchestration implies a minimum of "smarts", specifically the ability to compensate for failed transactions. Service bus tools will often say they offer "try-catch" or something like that but the ability to run scoped componsation is th... |
11,588,609 | I'm using PHP's CURL MULTI to download an array of resources in parallel, and I want to get the last effective URL from *each* of the resources (not just the last one).
Basically, I'm looking for:
```
curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
```
for CURL MULTI, something like:
```
curl_multi_getinfo($ch[$key], C... | 2012/07/21 | [
"https://Stackoverflow.com/questions/11588609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1043704/"
] | Try Railscasts. It has an episode on [Rubber](http://railscasts.com/episodes?utf8=%E2%9C%93&search=rubber). | <http://www.ginzametrics.com/deploy-rails-app-to-ec2-with-rubber.html>
<http://ramenlab.wordpress.com/2011/06/24/deploying-your-rails-app-to-aws-ec2-using-rubber/> |
64,340,354 | I started to create simple game. Player choose faction, then fighter and then he will fight against random opponent (I will create code for that in the future).
I have a problem I want to change that - make this shorter, but how?
```
while choose_fighter != "1" and choose_fighter != "2" and choose_fighter != "3" and ... | 2020/10/13 | [
"https://Stackoverflow.com/questions/64340354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10456525/"
] | It seems your problem is that you are unmasking, right before masking. You do not need to unmask, just updating mask (reconfiguring) should work.
```js
$(document).ready(function() {
const masks = ['0000-0000', '00000-0000'];
const maskedElem = $('#TelContato');
maskedElem.prop('placeholder', '9999-9999');
ma... | Here's the solution i found using the mask properties
```js
$(document).ready(function () {
$('#TelContato').unmask();
$('#TelContato').prop('placeholder', '9999-9999');
$('#TelContato').mask('0000-0000');
var SPMaskBehavior = function (val) {
return val.replace(/\D/g, '').length === 9 ? '00000-0000' : '... |
32,072,682 | What is the best and commonly used datasource for an iOS Application?
I am a .NET developer and want to use mssql server for database. Any suggestion on that? webservices, xml providers, etc... | 2015/08/18 | [
"https://Stackoverflow.com/questions/32072682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/673707/"
] | Just about every mobile app that deals with databases uses [SQLite](https://www.sqlite.org/). There are many tutorials on it. | The CoreData Framework, which is the iOS DeFacto DataStore utilises SQLite. Lot's of support and tutorials on it online. |
7,972,122 | Is there any formula to calculate the frequency (or frequencys) of a signal that is bad sampled?
For example, what's the output of an analog signal with F=22Khz when it's sampled at 25Khz, or 10Khz?
EDIT:
In this example, the sampled signal (on the right) have a different frequency than the original one, because it ... | 2011/11/01 | [
"https://Stackoverflow.com/questions/7972122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/538339/"
] | Unless the bandwidth of the signal is less than half the sampling rate, you lose information during sampling and generally can't distinguish frequencies after that due to [aliasing](http://en.wikipedia.org/wiki/Nyquist_frequency#The_aliasing_problem).
See [Undersampling](http://en.wikipedia.org/wiki/Undersampling) for... | Assuming a constant sampling rate, any sampling will alias together spectral content from below and above the sampling rate. If you have frequency content on both sides of the sampling rate that you don't want combined, you will have to filter one or the other frequency band Out before the sampling, or you will have a ... |
7,972,122 | Is there any formula to calculate the frequency (or frequencys) of a signal that is bad sampled?
For example, what's the output of an analog signal with F=22Khz when it's sampled at 25Khz, or 10Khz?
EDIT:
In this example, the sampled signal (on the right) have a different frequency than the original one, because it ... | 2011/11/01 | [
"https://Stackoverflow.com/questions/7972122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/538339/"
] | Unless the bandwidth of the signal is less than half the sampling rate, you lose information during sampling and generally can't distinguish frequencies after that due to [aliasing](http://en.wikipedia.org/wiki/Nyquist_frequency#The_aliasing_problem).
See [Undersampling](http://en.wikipedia.org/wiki/Undersampling) for... | No any formula to know what's the frequency of 20kHz signal, sampled at 30kHz. But it is a fact that the frequency of undersampled signal will be reflected about Nyquist frequency. In your example 30 kHz means that Nyquist frequency is about 15 KHz, that is not enough to record original signal (20KHz) correctly, only 1... |
52,638 | For full context (pictures attached to the text) see here:
<https://www.docdroid.net/J4wjKwf/jap.pdf>
「暮らしとアイデア」について話し合う会議に参加することになりました。日本には曲がるストローやプルトップリングなど、生活に役立つ発明で、特許を取ったものがたくさんあります。あなたが知っている発明で商品になったものを参加者に紹介してください。
First, my attempt at translation:
It was decided that you will partake in a conference discussin... | 2017/08/23 | [
"https://japanese.stackexchange.com/questions/52638",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/20172/"
] | For your point (1), 暮らし refers to everyday life, so I think what 「暮らしとアイデア」 is trying to get at is the theme of useful ideas that help people out in their everyday lives (simple inventions such as straws, pull-rings etc).
For point (2), I think what you may be having trouble with is a common usage of など followed by a ... | 1. According to my light research「暮らしとアイデア」 seems to mean ["暮らしの中で役立つアイデア"](https://matome.naver.jp/topic/1M6kU). My interpretation is that 暮らし describes アイデア。
2. First of, で here is not a conjunctive here. It means ["ことがらが成立する範囲を示します"](http://www.coelang.tufs.ac.jp/mt/ja/gmod/contents/explanation/053.html)。(The range ... |
29,977,420 | I have written a Java application which creates an H2 file database (1.4.184). It works fine on Windows and Ubuntu.
When I deployed it to the Red Hat server, it creates the database but is unable to connect. It just hangs and doesn't exit with any exception.
This is the bean-configuration, used by the application:
```... | 2015/04/30 | [
"https://Stackoverflow.com/questions/29977420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4851931/"
] | No. That would be an enormous security loophole. You cannot programmatically change the client's file system. | You can do it with the [`fs` (filesystem) api](https://nodejs.org/api/fs.html) in node.js.
```
var fs = require("fs");
fs.rename("/tmp/hello", "/tmp/world", function (err) {
if (err) {
throw err;
} else {
console.log("rename complete");
}
});
``` |
22,805,826 | I think I have a quite common problem, but I can really come up with a solution for it..
Imagine this class:
```
public class ListHandlerBase
{
public virtual void Add(object item)
{
// XXX
}
}
public class ListHandler : ListHandlerBase
{
List<object> ObjectList = new List<object>();
List... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22805826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1793796/"
] | First of all, I think this is a code smell. I would try to find some alternate design that doesn't require this. But it's hard to help you with that without understanding the actual problem you're trying to solve.
Now, to your actual question:
>
> It's a multiple dispatch problem and I don't think it can not be solv... | You need to add overloads of `Add` for the other types you want to handle
```
public class ListHandler
{
List<object> ObjectList = new List<object>();
List<string> StringList = new List<string>();
List<int> IntList = new List<int>();
public void Add(object item)
{
HandleAdd(item);
}
... |
68,798,431 | hey guys i have some question.
why my text does not change after the button is pressed and setstate is call.
here is my code
```
class noname extends StatefulWidget {
const noname({Key? key}) : super(key: key);
@override
_nonameState createState() => _nonameState();
}
class _nonameState extends State<noname> ... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68798431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15931904/"
] | Change this line of code,
```
class _nonameState extends State<noname> {
@override
Widget build(BuildContext context) {
String newtext = 'hello '; // <======== move this up in the class level
...
```
to this,
```
class _nonameState extends State<noname> {
String newtext = 'hello '; // <======== move i... | you should just `String newtext = 'hello ';` move over build context |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | When it comes to lightweight, [CherryPy](http://cherrypy.org/) is pretty up there.
```
import cherrypy
class HelloWorld(object):
def index(self):
return "Hello World!"
index.exposed = True
cherrypy.quickstart(HelloWorld())
``` | If I were you I would use [web.py](http://webpy.org/) that is really convenient to do that kind of rapid prototyping of **lightweight REST applications**.
Check out this snippet from the home page:
```
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | At Pycon Australia, Richard Jones compared the most popular lightweight web frameworks. [Bottle](http://bottlepy.org/docs/dev/) came out on top. Here is the [full presentation](http://www.youtube.com/watch?v=AYjPIMe0BhA). | Take a look to [flask](http://flask.pocoo.org/) and its extension [flask-restful](http://flask-restful.readthedocs.org/en/latest/index.html)
```
from flask import Flask
from flask.ext import restful
app = Flask(__name__)
api = restful.Api(app)
class HelloWorld(restful.Resource):
def get(self):
return {'h... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | If I were you I would use [web.py](http://webpy.org/) that is really convenient to do that kind of rapid prototyping of **lightweight REST applications**.
Check out this snippet from the home page:
```
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(... | Take a look to [flask](http://flask.pocoo.org/) and its extension [flask-restful](http://flask-restful.readthedocs.org/en/latest/index.html)
```
from flask import Flask
from flask.ext import restful
app = Flask(__name__)
api = restful.Api(app)
class HelloWorld(restful.Resource):
def get(self):
return {'h... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | At Pycon Australia, Richard Jones compared the most popular lightweight web frameworks. [Bottle](http://bottlepy.org/docs/dev/) came out on top. Here is the [full presentation](http://www.youtube.com/watch?v=AYjPIMe0BhA). | If I were you I would use [web.py](http://webpy.org/) that is really convenient to do that kind of rapid prototyping of **lightweight REST applications**.
Check out this snippet from the home page:
```
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | In general, I think you'll find [web2py](http://www.web2py.com) to be one of the easiest frameworks to set up, learn, and use. web2py makes it very easy to [generate JSON](http://web2py.com/book/default/chapter/09#HTML,-XML,-and-JSON) (just add a .json extension), and it now includes new functionality to automatically ... | You might also want to check out [Parse](https://www.parse.com/). They are free to use right now, and will give you a nice [REST API](https://www.parse.com/docs/rest) for you mobile apps.
However, as @iksnar points out, you don't write anything in Python, or anything at all for the backend. If you need to have the ba... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | Take a look to [flask](http://flask.pocoo.org/) and its extension [flask-restful](http://flask-restful.readthedocs.org/en/latest/index.html)
```
from flask import Flask
from flask.ext import restful
app = Flask(__name__)
api = restful.Api(app)
class HelloWorld(restful.Resource):
def get(self):
return {'h... | You might also want to check out [Parse](https://www.parse.com/). They are free to use right now, and will give you a nice [REST API](https://www.parse.com/docs/rest) for you mobile apps.
However, as @iksnar points out, you don't write anything in Python, or anything at all for the backend. If you need to have the ba... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | At Pycon Australia, Richard Jones compared the most popular lightweight web frameworks. [Bottle](http://bottlepy.org/docs/dev/) came out on top. Here is the [full presentation](http://www.youtube.com/watch?v=AYjPIMe0BhA). | You might also want to check out [Parse](https://www.parse.com/). They are free to use right now, and will give you a nice [REST API](https://www.parse.com/docs/rest) for you mobile apps.
However, as @iksnar points out, you don't write anything in Python, or anything at all for the backend. If you need to have the ba... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | When it comes to lightweight, [CherryPy](http://cherrypy.org/) is pretty up there.
```
import cherrypy
class HelloWorld(object):
def index(self):
return "Hello World!"
index.exposed = True
cherrypy.quickstart(HelloWorld())
``` | You might also want to check out [Parse](https://www.parse.com/). They are free to use right now, and will give you a nice [REST API](https://www.parse.com/docs/rest) for you mobile apps.
However, as @iksnar points out, you don't write anything in Python, or anything at all for the backend. If you need to have the ba... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | In general, I think you'll find [web2py](http://www.web2py.com) to be one of the easiest frameworks to set up, learn, and use. web2py makes it very easy to [generate JSON](http://web2py.com/book/default/chapter/09#HTML,-XML,-and-JSON) (just add a .json extension), and it now includes new functionality to automatically ... | If I were you I would use [web.py](http://webpy.org/) that is really convenient to do that kind of rapid prototyping of **lightweight REST applications**.
Check out this snippet from the home page:
```
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(... |
7,943,385 | I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web.
What will be the fastest, most lightweight framework to use for this? Learning curve to implement also considered?
From the research I've done Django-Tastypie or Djanjo-Piston look like the best opt... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7943385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1020382/"
] | At Pycon Australia, Richard Jones compared the most popular lightweight web frameworks. [Bottle](http://bottlepy.org/docs/dev/) came out on top. Here is the [full presentation](http://www.youtube.com/watch?v=AYjPIMe0BhA). | When it comes to lightweight, [CherryPy](http://cherrypy.org/) is pretty up there.
```
import cherrypy
class HelloWorld(object):
def index(self):
return "Hello World!"
index.exposed = True
cherrypy.quickstart(HelloWorld())
``` |
67,626,422 | To summarize, for my program, I want to be able to detect the 't', and prevent the user from adding something with a quantity of '3t', '3t3', or anything of that matter.
In other words, if the quantity starts with a number, but has letters in it, it will still go through and be added, which is what I DON'T WANT.
Here... | 2021/05/20 | [
"https://Stackoverflow.com/questions/67626422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9728444/"
] | Based on magjac's comment, I skipped `.fit()`, `.scale()`, `.width()`, and `.height()` and did it all in the attributer. This allows the solution to work even for larger graphs.
A few things to note:
* Setting the height and width of the `<svg>` to `100%` allows us to skip `.width()` and `.height()` and have the `<sv... | There's no simple built-in way, but you can achieve almost anything with the [attributer](https://github.com/magjac/d3-graphviz#graphviz_attributer) like so:
```js
const px2pt = 3 / 4;
function attributer(datum, index, nodes) {
var selection = d3.select(this);
if (datum.tag == "svg") {
var width = dat... |
67,626,422 | To summarize, for my program, I want to be able to detect the 't', and prevent the user from adding something with a quantity of '3t', '3t3', or anything of that matter.
In other words, if the quantity starts with a number, but has letters in it, it will still go through and be added, which is what I DON'T WANT.
Here... | 2021/05/20 | [
"https://Stackoverflow.com/questions/67626422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9728444/"
] | There's no simple built-in way, but you can achieve almost anything with the [attributer](https://github.com/magjac/d3-graphviz#graphviz_attributer) like so:
```js
const px2pt = 3 / 4;
function attributer(datum, index, nodes) {
var selection = d3.select(this);
if (datum.tag == "svg") {
var width = dat... | We use the zoom behavior to do this.
Basically, what we do is that we wait for the graph to change (`.on('transitionEnd')`) and then recenter the graph and set the zoom level to 1.
For this, we grab our graph's SVG element and read its `viewBox` property.
This property is close to the size of our graph.
Then, we get... |
67,626,422 | To summarize, for my program, I want to be able to detect the 't', and prevent the user from adding something with a quantity of '3t', '3t3', or anything of that matter.
In other words, if the quantity starts with a number, but has letters in it, it will still go through and be added, which is what I DON'T WANT.
Here... | 2021/05/20 | [
"https://Stackoverflow.com/questions/67626422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9728444/"
] | Based on magjac's comment, I skipped `.fit()`, `.scale()`, `.width()`, and `.height()` and did it all in the attributer. This allows the solution to work even for larger graphs.
A few things to note:
* Setting the height and width of the `<svg>` to `100%` allows us to skip `.width()` and `.height()` and have the `<sv... | We use the zoom behavior to do this.
Basically, what we do is that we wait for the graph to change (`.on('transitionEnd')`) and then recenter the graph and set the zoom level to 1.
For this, we grab our graph's SVG element and read its `viewBox` property.
This property is close to the size of our graph.
Then, we get... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | Your teacher is right. There’s a great deal of technics of singing that can be reached by imagination.
* Imagine you are standing on a higher pitch than the tone you are going to sing.
* imagine your voice is like fountain, the air is the water jet, the tone is a ping pong ball.
* imagine the tone is a thread and hav... | seriously the only thing that worked for me with singing was doing exercises daily. Singing scales, scale fragments, arpeggios on "oo" or "aa", and stick with it. Just do it, accept there will be better and worse days, and just keep doing it. Never strain (at least it should never be painful) and just give it time. My ... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | Observe a professional singer. Preferably a big, over-the-top, expansive opera singer. Here's three of them!
Now, don't worry about the musical aspect of what they're doing. Just copy their style. Parody it. Show off. ACT being a singer.
You might be surprised what comes out! | seriously the only thing that worked for me with singing was doing exercises daily. Singing scales, scale fragments, arpeggios on "oo" or "aa", and stick with it. Just do it, accept there will be better and worse days, and just keep doing it. Never strain (at least it should never be painful) and just give it time. My ... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | seriously the only thing that worked for me with singing was doing exercises daily. Singing scales, scale fragments, arpeggios on "oo" or "aa", and stick with it. Just do it, accept there will be better and worse days, and just keep doing it. Never strain (at least it should never be painful) and just give it time. My ... | My voice teacher has advised me in many great ways with keeping the voice "in the front" or "in the mask" or "out" as you say. **One important fact is that you are going to need facial muscles for keeping your voice in the front.** I am not an expert on the Latin names for the muscles but the smile is one way to begin.... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | Your teacher is right. There’s a great deal of technics of singing that can be reached by imagination.
* Imagine you are standing on a higher pitch than the tone you are going to sing.
* imagine your voice is like fountain, the air is the water jet, the tone is a ping pong ball.
* imagine the tone is a thread and hav... | In addition to the other answers, one physical suggestion that helped me was to **smile** when singing; a big beaming smile seems to help bring the sound forward.
(I didn't generally find that the ‘Imagine…’ or other abstract suggestions helped me much. It was mostly a matter of learning how the various techniques *f... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | Your teacher is right. There’s a great deal of technics of singing that can be reached by imagination.
* Imagine you are standing on a higher pitch than the tone you are going to sing.
* imagine your voice is like fountain, the air is the water jet, the tone is a ping pong ball.
* imagine the tone is a thread and hav... | My voice teacher has advised me in many great ways with keeping the voice "in the front" or "in the mask" or "out" as you say. **One important fact is that you are going to need facial muscles for keeping your voice in the front.** I am not an expert on the Latin names for the muscles but the smile is one way to begin.... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | Observe a professional singer. Preferably a big, over-the-top, expansive opera singer. Here's three of them!
Now, don't worry about the musical aspect of what they're doing. Just copy their style. Parody it. Show off. ACT being a singer.
You might be surprised what comes out! | In addition to the other answers, one physical suggestion that helped me was to **smile** when singing; a big beaming smile seems to help bring the sound forward.
(I didn't generally find that the ‘Imagine…’ or other abstract suggestions helped me much. It was mostly a matter of learning how the various techniques *f... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | In addition to the other answers, one physical suggestion that helped me was to **smile** when singing; a big beaming smile seems to help bring the sound forward.
(I didn't generally find that the ‘Imagine…’ or other abstract suggestions helped me much. It was mostly a matter of learning how the various techniques *f... | My voice teacher has advised me in many great ways with keeping the voice "in the front" or "in the mask" or "out" as you say. **One important fact is that you are going to need facial muscles for keeping your voice in the front.** I am not an expert on the Latin names for the muscles but the smile is one way to begin.... |
93,132 | There's this thing that is really bothering me and so far I can't make it work. I've taken like 10 singing lessons so far and the teacher keeps telling me that when I sing notes that start to go "high" and maybe frighten me I do not push out enough air and the sound and notes stay on the back of my mouth, without getti... | 2019/12/15 | [
"https://music.stackexchange.com/questions/93132",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/63963/"
] | Observe a professional singer. Preferably a big, over-the-top, expansive opera singer. Here's three of them!
Now, don't worry about the musical aspect of what they're doing. Just copy their style. Parody it. Show off. ACT being a singer.
You might be surprised what comes out! | My voice teacher has advised me in many great ways with keeping the voice "in the front" or "in the mask" or "out" as you say. **One important fact is that you are going to need facial muscles for keeping your voice in the front.** I am not an expert on the Latin names for the muscles but the smile is one way to begin.... |
177,389 | I really love the preview feature of the Windows 7 taskbar. There's only one reason I don't use it more often -- it takes a relatively long time to display the actual window.
There is a registry trick ([widely found on Google](http://www.pctools.com/guides/registry/detail/17)) to reduce the delay used by general menus... | 2010/08/18 | [
"https://superuser.com/questions/177389",
"https://superuser.com",
"https://superuser.com/users/15329/"
] | Here's a link to a similar registry trick : <http://www.techtalkz.com/windows-7/516236-how-modify-mouse-hover-time-windows-7-a.html>
1. Run Registry Editor in Windows.
2. Go to `HKEY_CURRENT_USER\Control Panel\Mouse`
3. Adjust the `MouseHoverTime` value (which is in milliseconds and defaults to 400). For example, you ... | Run Regedit, go to `HKEY_CURRENT_USER\Control Panel\Mouse`
adjust the `MouseHoverTime` data which is in miliseconds. Default is 400. |
23,595 | Many Cantonese dramas titles contains the suffix 風雲. Examples include:
* 法外風雲 TVB
* 酒店風雲 Korean
What does it even mean?
A google translate gives:
* Outrage Situation ( Makes sense)
* Hotel Situation?? What does this mean?
I believe there is another meaning. If there is, what is it? Obviously, apart from wind cloud... | 2017/04/29 | [
"https://chinese.stackexchange.com/questions/23595",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/16101/"
] | See [http://zh.wikipedia.org/wiki/風雲](http://zh.wikipedia.org/wiki/%E9%A2%A8%E9%9B%B2) . Just as 山水 (shān shuǐ) literally means mountain-water and in fact means a landscape painting, wind-cloud is a figurative term for storm.
In these tv shows it means a stormy dramatic situation.
The actual hotel <http://www.sunswe... | Existing answers are well written. I deem that you may render it "romance" (=legend) or even simply "story". |
23,595 | Many Cantonese dramas titles contains the suffix 風雲. Examples include:
* 法外風雲 TVB
* 酒店風雲 Korean
What does it even mean?
A google translate gives:
* Outrage Situation ( Makes sense)
* Hotel Situation?? What does this mean?
I believe there is another meaning. If there is, what is it? Obviously, apart from wind cloud... | 2017/04/29 | [
"https://chinese.stackexchange.com/questions/23595",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/16101/"
] | Google translate is not a dictionary, so don't be surprised if you get odd results for single words. If you give it a whole sentence, you'll have better luck. Colin McLarty has the correct meaning for 風雲 above, but I thought I would add a little more because 風雲 is one of those Chinese words that doesn't have a real Eng... | See [http://zh.wikipedia.org/wiki/風雲](http://zh.wikipedia.org/wiki/%E9%A2%A8%E9%9B%B2) . Just as 山水 (shān shuǐ) literally means mountain-water and in fact means a landscape painting, wind-cloud is a figurative term for storm.
In these tv shows it means a stormy dramatic situation.
The actual hotel <http://www.sunswe... |
23,595 | Many Cantonese dramas titles contains the suffix 風雲. Examples include:
* 法外風雲 TVB
* 酒店風雲 Korean
What does it even mean?
A google translate gives:
* Outrage Situation ( Makes sense)
* Hotel Situation?? What does this mean?
I believe there is another meaning. If there is, what is it? Obviously, apart from wind cloud... | 2017/04/29 | [
"https://chinese.stackexchange.com/questions/23595",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/16101/"
] | You will notice this pattern in a lot of titles translated in Hong Kong/Taiwan. The same movie translated in mainland China will have the `風雲` removed.
* 賭城風雲 (From Vegas to Macau)
* 無間道風雲 (The Departed)
`風雲` can be translated to `局势` (situation)
But in the case of movie titles, it is simply a fancy way of saying *T... | Existing answers are well written. I deem that you may render it "romance" (=legend) or even simply "story". |
23,595 | Many Cantonese dramas titles contains the suffix 風雲. Examples include:
* 法外風雲 TVB
* 酒店風雲 Korean
What does it even mean?
A google translate gives:
* Outrage Situation ( Makes sense)
* Hotel Situation?? What does this mean?
I believe there is another meaning. If there is, what is it? Obviously, apart from wind cloud... | 2017/04/29 | [
"https://chinese.stackexchange.com/questions/23595",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/16101/"
] | Google translate is not a dictionary, so don't be surprised if you get odd results for single words. If you give it a whole sentence, you'll have better luck. Colin McLarty has the correct meaning for 風雲 above, but I thought I would add a little more because 風雲 is one of those Chinese words that doesn't have a real Eng... | You will notice this pattern in a lot of titles translated in Hong Kong/Taiwan. The same movie translated in mainland China will have the `風雲` removed.
* 賭城風雲 (From Vegas to Macau)
* 無間道風雲 (The Departed)
`風雲` can be translated to `局势` (situation)
But in the case of movie titles, it is simply a fancy way of saying *T... |
23,595 | Many Cantonese dramas titles contains the suffix 風雲. Examples include:
* 法外風雲 TVB
* 酒店風雲 Korean
What does it even mean?
A google translate gives:
* Outrage Situation ( Makes sense)
* Hotel Situation?? What does this mean?
I believe there is another meaning. If there is, what is it? Obviously, apart from wind cloud... | 2017/04/29 | [
"https://chinese.stackexchange.com/questions/23595",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/16101/"
] | Google translate is not a dictionary, so don't be surprised if you get odd results for single words. If you give it a whole sentence, you'll have better luck. Colin McLarty has the correct meaning for 風雲 above, but I thought I would add a little more because 風雲 is one of those Chinese words that doesn't have a real Eng... | Existing answers are well written. I deem that you may render it "romance" (=legend) or even simply "story". |
42,247,434 | In an ES6 class with some instance variables and methods, how can you add a mixin to it? I've given an example below, though I don't know if the syntax for the mixin object is correct.
```
class Test {
constructor() {
this.var1 = 'var1'
}
method1() {
console.log(this.var1)
}
test() {
this.method2... | 2017/02/15 | [
"https://Stackoverflow.com/questions/42247434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779159/"
] | Javascript's object/property system is much more dynamic than most languages, so it's very easy to add functionality to an object. As functions are first-class objects, they can be added to an object in exactly the same way. [`Object.assign`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects... | You should probably look at `Object.assign()`. Gotta look something like this:
```
Object.assign(Test.prototype, mixin);
```
This will make sure all methods and properties from `mixin` will be copied into `Test` constructor's prototype object. |
42,247,434 | In an ES6 class with some instance variables and methods, how can you add a mixin to it? I've given an example below, though I don't know if the syntax for the mixin object is correct.
```
class Test {
constructor() {
this.var1 = 'var1'
}
method1() {
console.log(this.var1)
}
test() {
this.method2... | 2017/02/15 | [
"https://Stackoverflow.com/questions/42247434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779159/"
] | In es6 you can do this without assigning and you can even invoke the mixin constructor at the correct time!
<http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/#bettermixinsthroughclassexpressions>
This pattern uses `class expressions` to create a new base class for every mixin.
```
let MyMixin ... | You should probably look at `Object.assign()`. Gotta look something like this:
```
Object.assign(Test.prototype, mixin);
```
This will make sure all methods and properties from `mixin` will be copied into `Test` constructor's prototype object. |
42,247,434 | In an ES6 class with some instance variables and methods, how can you add a mixin to it? I've given an example below, though I don't know if the syntax for the mixin object is correct.
```
class Test {
constructor() {
this.var1 = 'var1'
}
method1() {
console.log(this.var1)
}
test() {
this.method2... | 2017/02/15 | [
"https://Stackoverflow.com/questions/42247434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779159/"
] | You should probably look at `Object.assign()`. Gotta look something like this:
```
Object.assign(Test.prototype, mixin);
```
This will make sure all methods and properties from `mixin` will be copied into `Test` constructor's prototype object. | I'm surprised to find that none of the answers mentions what I would consider a mixin in the sense of composition (and in contrast to inheritance), which to me is a function that adds functionality to an object. Here's an example making use of both inheritance and composition:
```js
class Pet { constructor(name) { thi... |
42,247,434 | In an ES6 class with some instance variables and methods, how can you add a mixin to it? I've given an example below, though I don't know if the syntax for the mixin object is correct.
```
class Test {
constructor() {
this.var1 = 'var1'
}
method1() {
console.log(this.var1)
}
test() {
this.method2... | 2017/02/15 | [
"https://Stackoverflow.com/questions/42247434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779159/"
] | Javascript's object/property system is much more dynamic than most languages, so it's very easy to add functionality to an object. As functions are first-class objects, they can be added to an object in exactly the same way. [`Object.assign`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects... | In es6 you can do this without assigning and you can even invoke the mixin constructor at the correct time!
<http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/#bettermixinsthroughclassexpressions>
This pattern uses `class expressions` to create a new base class for every mixin.
```
let MyMixin ... |
42,247,434 | In an ES6 class with some instance variables and methods, how can you add a mixin to it? I've given an example below, though I don't know if the syntax for the mixin object is correct.
```
class Test {
constructor() {
this.var1 = 'var1'
}
method1() {
console.log(this.var1)
}
test() {
this.method2... | 2017/02/15 | [
"https://Stackoverflow.com/questions/42247434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779159/"
] | Javascript's object/property system is much more dynamic than most languages, so it's very easy to add functionality to an object. As functions are first-class objects, they can be added to an object in exactly the same way. [`Object.assign`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects... | I'm surprised to find that none of the answers mentions what I would consider a mixin in the sense of composition (and in contrast to inheritance), which to me is a function that adds functionality to an object. Here's an example making use of both inheritance and composition:
```js
class Pet { constructor(name) { thi... |
42,247,434 | In an ES6 class with some instance variables and methods, how can you add a mixin to it? I've given an example below, though I don't know if the syntax for the mixin object is correct.
```
class Test {
constructor() {
this.var1 = 'var1'
}
method1() {
console.log(this.var1)
}
test() {
this.method2... | 2017/02/15 | [
"https://Stackoverflow.com/questions/42247434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779159/"
] | In es6 you can do this without assigning and you can even invoke the mixin constructor at the correct time!
<http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/#bettermixinsthroughclassexpressions>
This pattern uses `class expressions` to create a new base class for every mixin.
```
let MyMixin ... | I'm surprised to find that none of the answers mentions what I would consider a mixin in the sense of composition (and in contrast to inheritance), which to me is a function that adds functionality to an object. Here's an example making use of both inheritance and composition:
```js
class Pet { constructor(name) { thi... |
10,714,190 | I'm creating a simple CMS software which doesn't have much data to be stored. I'm currently using mysql as my data provider and have a java application in the presentation layer. This CMS will be a standalone which means datacollection and processing will be done in a single computer.
I created a installer to install... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10714190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1369940/"
] | You can use one of embedded db, like JavaDB (ex. Derby). Support of this database is added to JRE. So all your client need is installed JRE. And you get full relational database without any installation and other stuff setup. | You can try using [hsqldb](http://hsqldb.org/) or [sqlite db](http://www.sqlite.org/). These dbs can be bundled with the application in memory or can use a simple file as db. Hope it helps |
10,714,190 | I'm creating a simple CMS software which doesn't have much data to be stored. I'm currently using mysql as my data provider and have a java application in the presentation layer. This CMS will be a standalone which means datacollection and processing will be done in a single computer.
I created a installer to install... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10714190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1369940/"
] | You can try using [hsqldb](http://hsqldb.org/) or [sqlite db](http://www.sqlite.org/). These dbs can be bundled with the application in memory or can use a simple file as db. Hope it helps | I found a good example here
<http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/>
thanks every one for help |
10,714,190 | I'm creating a simple CMS software which doesn't have much data to be stored. I'm currently using mysql as my data provider and have a java application in the presentation layer. This CMS will be a standalone which means datacollection and processing will be done in a single computer.
I created a installer to install... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10714190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1369940/"
] | You can use one of embedded db, like JavaDB (ex. Derby). Support of this database is added to JRE. So all your client need is installed JRE. And you get full relational database without any installation and other stuff setup. | I found a good example here
<http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/>
thanks every one for help |
23,372,291 | I am trying to create Python script that read arguments into a dictionary and then prints the value of 'sender-ip'
The script is invoked with
```
python lookup.py "email=joe@aol.com, sender-ip=10.10.10.10"
```
And here is the script
```
from sys import argv
script, input = argv
attributeMap = {}
delimiter = "="
... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23372291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630486/"
] | `input` is not a list; it is a string. You'd need to split that string into items first:
```
items = input.split(', ')
for item in items:
```
Do note that there is a built-in function called `input()` as well, try not to use the name and mask the built-in.
Here is some code that produces a dictionary from your inpu... | Obviously you meant `"email=joe@aol.com, sender-ip=10.10.10.10"`
Here's a snippet:
```
def toDict(s):
result = {}
for piece in s.split(','):
# piece is like 'foo=bar' here
key, value = piece.split('=')
result[key.strip()] = value.strip() # .strip() removes spaces around
return result
```
How it wo... |
23,372,291 | I am trying to create Python script that read arguments into a dictionary and then prints the value of 'sender-ip'
The script is invoked with
```
python lookup.py "email=joe@aol.com, sender-ip=10.10.10.10"
```
And here is the script
```
from sys import argv
script, input = argv
attributeMap = {}
delimiter = "="
... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23372291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630486/"
] | `input` is not a list; it is a string. You'd need to split that string into items first:
```
items = input.split(', ')
for item in items:
```
Do note that there is a built-in function called `input()` as well, try not to use the name and mask the built-in.
Here is some code that produces a dictionary from your inpu... | With `docopt` it is easy.
Having `docopt` installed:
```
$ pip install docopt
```
rewrite your solutions like this `lookup.py`:
```
"""Usage: lookup.py <e-mail> <sender-ip>
Arguments:
<e-mail> e-mail address
<sender-ip> IP address
Sample use:
$ python lookup.py john.doe@example.com 1.2.3.4
"""
from d... |
23,372,291 | I am trying to create Python script that read arguments into a dictionary and then prints the value of 'sender-ip'
The script is invoked with
```
python lookup.py "email=joe@aol.com, sender-ip=10.10.10.10"
```
And here is the script
```
from sys import argv
script, input = argv
attributeMap = {}
delimiter = "="
... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23372291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630486/"
] | With `docopt` it is easy.
Having `docopt` installed:
```
$ pip install docopt
```
rewrite your solutions like this `lookup.py`:
```
"""Usage: lookup.py <e-mail> <sender-ip>
Arguments:
<e-mail> e-mail address
<sender-ip> IP address
Sample use:
$ python lookup.py john.doe@example.com 1.2.3.4
"""
from d... | Obviously you meant `"email=joe@aol.com, sender-ip=10.10.10.10"`
Here's a snippet:
```
def toDict(s):
result = {}
for piece in s.split(','):
# piece is like 'foo=bar' here
key, value = piece.split('=')
result[key.strip()] = value.strip() # .strip() removes spaces around
return result
```
How it wo... |
3,435,751 | I have a `7zip` archive which contains some hundred files separated into different directories. The target is to download it from a FTP server and then extract it on the phone.
My problem is that the `7zip` SDK doesn't contain a lot. I am looking for examples, tutorials and snippets regarding the decompression of 7z f... | 2010/08/08 | [
"https://Stackoverflow.com/questions/3435751",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/408659/"
] | Go [here](http://sourceforge.net/projects/p7zip/files/J7Zip/4.43%20Alpha%202/):
LZMA SDK just provides the encoder and decoder for encoding/decoding the raw data, but 7z archive is a complex format for storing multiple files. | i found this [page](http://jules.dourlens.com/extract-manipulate-7zip-android/) that provides an alternative that works like a charm. You only have to add `compile 'org.apache.commons:commons-compress:1.8'`
to your build gradle script and use the feature you desire. For this issue i did the following :
```
AssetManag... |
45,661,139 | I'm trying to do:
```
from sklearn.model_selection import cross_validate
```
as mentioned [here](http://scikit-learn.org/stable/modules/cross_validation.html#the-cross-validate-function-and-multiple-metric-evaluation).
But get the error:
```
ImportError: cannot import name 'cross_validate'
```
Everything else in ... | 2017/08/13 | [
"https://Stackoverflow.com/questions/45661139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1761806/"
] | `cross-validate` is new in version 0.19.0 ([change log](http://scikit-learn.org/stable/whats_new.html#version-0-19)):
>
> Cross validation is now able to return the results from multiple
> metric evaluations. The new model\_selection.cross\_validate can return
> many scores on the test data as well as training set ... | On the latest stable version, 0.20.0, it is located underneath `model_selection`.
```
from sklearn.model_selection import train_test_split
```
Refer [Documentation](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split) |
45,661,139 | I'm trying to do:
```
from sklearn.model_selection import cross_validate
```
as mentioned [here](http://scikit-learn.org/stable/modules/cross_validation.html#the-cross-validate-function-and-multiple-metric-evaluation).
But get the error:
```
ImportError: cannot import name 'cross_validate'
```
Everything else in ... | 2017/08/13 | [
"https://Stackoverflow.com/questions/45661139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1761806/"
] | `cross-validate` is new in version 0.19.0 ([change log](http://scikit-learn.org/stable/whats_new.html#version-0-19)):
>
> Cross validation is now able to return the results from multiple
> metric evaluations. The new model\_selection.cross\_validate can return
> many scores on the test data as well as training set ... | from sklearn.model\_selection import cross\_validate |
45,661,139 | I'm trying to do:
```
from sklearn.model_selection import cross_validate
```
as mentioned [here](http://scikit-learn.org/stable/modules/cross_validation.html#the-cross-validate-function-and-multiple-metric-evaluation).
But get the error:
```
ImportError: cannot import name 'cross_validate'
```
Everything else in ... | 2017/08/13 | [
"https://Stackoverflow.com/questions/45661139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1761806/"
] | On the latest stable version, 0.20.0, it is located underneath `model_selection`.
```
from sklearn.model_selection import train_test_split
```
Refer [Documentation](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split) | from sklearn.model\_selection import cross\_validate |
220,208 | The URL <http://www.routerlogin.net/> isn't working on an internal network when I try to access it via a wireless connection. Why is that? What is the best way to configure this router to be able to access the router via a wireless connection to manage it. | 2011/01/08 | [
"https://serverfault.com/questions/220208",
"https://serverfault.com",
"https://serverfault.com/users/4629/"
] | The router may not support wireless logins by default. Most routers require the feature be enabled via wired connection before accepting wireless access. | I got this error because I do not use my N300 as the primary DNS. If you temporarily change your networks settings to use the AP as your nameserver, then it is possible to connect. |
220,208 | The URL <http://www.routerlogin.net/> isn't working on an internal network when I try to access it via a wireless connection. Why is that? What is the best way to configure this router to be able to access the router via a wireless connection to manage it. | 2011/01/08 | [
"https://serverfault.com/questions/220208",
"https://serverfault.com",
"https://serverfault.com/users/4629/"
] | Have you got your DNS server set as the router? If you haven't, using the routers IP address will work just as well (it's often <http://192.168.1.1> but dependant on the router)
The way this works is that the router hijacks any requests to www.routerlogin.net and redirects them to the local router. If you haven't got ... | I got this error because I do not use my N300 as the primary DNS. If you temporarily change your networks settings to use the AP as your nameserver, then it is possible to connect. |
220,208 | The URL <http://www.routerlogin.net/> isn't working on an internal network when I try to access it via a wireless connection. Why is that? What is the best way to configure this router to be able to access the router via a wireless connection to manage it. | 2011/01/08 | [
"https://serverfault.com/questions/220208",
"https://serverfault.com",
"https://serverfault.com/users/4629/"
] | I found the solutions, there is an option called: "Enable Wireless Isolation", it was checked, hindering the router via wireless. | I got this error because I do not use my N300 as the primary DNS. If you temporarily change your networks settings to use the AP as your nameserver, then it is possible to connect. |
8,963,946 | I want to make web apps. Should I start with a ASP MVC books or first with C# books, due ASP MVC is written in this language.
Thank you. | 2012/01/22 | [
"https://Stackoverflow.com/questions/8963946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/909974/"
] | Absolutely definitely and without any hesitation you should first learn the .NET framework by picking a CLS language such as C# or VB.NET before getting into ASP.NET MVC. Once you learn .NET, depending on your level of experience of web development in general you might start by learning the HTTP protocol and some marku... | Yes, you should learn C# first. Especially if you have no prior programming language. If you already know an OO language, it might not be *that* important to study C# first, but I would definitely recommend you to read a book on it, or use tutorials and practice, before diving into MVC.
MVC is a framework. You write c... |
11,881,766 | I need to place help text below labels and finding it tricky getting the CSS correct for it.
I have created the jsfiddle below as an example.
The requirements are:
1. The label is left aligned
2. The help text is shown directly below it
3. The input and select controls appear on the same line
<http://jsfiddle.net/b... | 2012/08/09 | [
"https://Stackoverflow.com/questions/11881766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/76439/"
] | I don't know where you have changed Your product name. As per my knowledge you have to change the value of key 'Bundle name' in '<>-Info.plist' file. | I couldn't find any specific rules about the character set allowed in the Product Name, but I would keep it in ASCII just to be safe, and perform any customizations to the name using Bundle Display Name (and/or Bundle Name) in your Info.plist file. This would let you have a different application name for different user... |
51,999,210 | I have got a source CSV file (without a header, all columns delimited by a comma) which I am trying split out into separate CSV files based upon the value in the first column and using that column value as the output file name.
Input file:
```
S00000009,2016,M04 01/07/2016,0.00,0.00,0.00,0.00,0.00,0.00,750.00,0.00,0... | 2018/08/24 | [
"https://Stackoverflow.com/questions/51999210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5347791/"
] | First of all the .csv file needs headers and the quote marks as a csv file structure. But if you don't want them then you can go on with a text file or...
```
$temp = Import-Csv INPUT_FILE.csv -Header service_id,year,period,cash_exp,cash_inc,cash_def,act_exp,act_inc,act_def,comm_exp,comm_inc,comm_def | Group-Object -P... | For your particular scenario you could probably use a simpler approach. Read the input file as a plain text file, group the lines by splitting off the first field, then write the groups to output files named after the groups:
```
Get-Content 'INPUT_FILE.csv' |
Group-Object { $_.Split(',')[0] } |
ForEach-Object... |
51,999,210 | I have got a source CSV file (without a header, all columns delimited by a comma) which I am trying split out into separate CSV files based upon the value in the first column and using that column value as the output file name.
Input file:
```
S00000009,2016,M04 01/07/2016,0.00,0.00,0.00,0.00,0.00,0.00,750.00,0.00,0... | 2018/08/24 | [
"https://Stackoverflow.com/questions/51999210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5347791/"
] | First of all the .csv file needs headers and the quote marks as a csv file structure. But if you don't want them then you can go on with a text file or...
```
$temp = Import-Csv INPUT_FILE.csv -Header service_id,year,period,cash_exp,cash_inc,cash_def,act_exp,act_inc,act_def,comm_exp,comm_inc,comm_def | Group-Object -P... | Another solution,
* using no named headers but simply numbers (as they aren't wanted in output anyway)
* avoiding unneccessary temporary files.
* removing only field delimiting double quotes.
---
```
Import-Csv INPUT_FILE.csv -Header (1..12) |
Group-Object -Property "1" | Foreach-Object {
($_.Group | Convert... |
51,999,210 | I have got a source CSV file (without a header, all columns delimited by a comma) which I am trying split out into separate CSV files based upon the value in the first column and using that column value as the output file name.
Input file:
```
S00000009,2016,M04 01/07/2016,0.00,0.00,0.00,0.00,0.00,0.00,750.00,0.00,0... | 2018/08/24 | [
"https://Stackoverflow.com/questions/51999210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5347791/"
] | For your particular scenario you could probably use a simpler approach. Read the input file as a plain text file, group the lines by splitting off the first field, then write the groups to output files named after the groups:
```
Get-Content 'INPUT_FILE.csv' |
Group-Object { $_.Split(',')[0] } |
ForEach-Object... | Another solution,
* using no named headers but simply numbers (as they aren't wanted in output anyway)
* avoiding unneccessary temporary files.
* removing only field delimiting double quotes.
---
```
Import-Csv INPUT_FILE.csv -Header (1..12) |
Group-Object -Property "1" | Foreach-Object {
($_.Group | Convert... |
4,411,904 | In learning about Vector Spaces over a Field, I have come accross the notation: ($\mathbb{K}$, $\cdot$, +) is a Field. My Question is, what in this context is $\mathbb{K}$?
The question seems very simple, and part of me wants to just guess that $\mathbb{K}$ is just a set and the set combined with the two operations (a... | 2022/03/24 | [
"https://math.stackexchange.com/questions/4411904",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1039940/"
] | $\Bbb K$ is a set, $\cdot$ and $+$ are binary operations on this set, i.e., maps $\Bbb K\times \Bbb K\to \Bbb K$, $(x,y)\mapsto x\cdot y$ (or $\mapsto x+y$, respectively). Additional properties (specific laws for the addition and multiplication, special roles of special elements of $\Bbb K$) are then postulated in form... | There appears to be some confusion surrounding the notation itself, so first, I should clarify what is happening. The symbol $(\mathbb{K},0,1,+,\cdot)$ denotes a mathematical structure, where
* $\mathbb{K}$ is some arbitrary class of objects (in $\mathrm{ZFC},$ a set).
* $0\in\mathbb{K},\;1\in\mathbb{K},\;0\neq1$
* $+... |
72,630,357 | I want to upgrade my expo sdk version step by step as recommended in the documentation. These are the instructions:
1. Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.12.8 or greater is required.
2. Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
3. Run **expo upgrade**... | 2022/06/15 | [
"https://Stackoverflow.com/questions/72630357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15298398/"
] | Try this command :
```
npm install expo@43 -g
```
Or :
```
expo update 43
``` | **Tested on 29th Sep, 2022**
Use `expo upgrade @43.0.0` |
72,630,357 | I want to upgrade my expo sdk version step by step as recommended in the documentation. These are the instructions:
1. Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.12.8 or greater is required.
2. Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
3. Run **expo upgrade**... | 2022/06/15 | [
"https://Stackoverflow.com/questions/72630357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15298398/"
] | Try this command :
```
npm install expo@43 -g
```
Or :
```
expo update 43
``` | Just run
```
expo upgrade -h
```
You will see the options. You just have to specify the version, as other answers suggest:
```
expo upgrade 46
``` |
72,630,357 | I want to upgrade my expo sdk version step by step as recommended in the documentation. These are the instructions:
1. Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.12.8 or greater is required.
2. Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
3. Run **expo upgrade**... | 2022/06/15 | [
"https://Stackoverflow.com/questions/72630357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15298398/"
] | Try this command :
```
npm install expo@43 -g
```
Or :
```
expo update 43
``` | Try this:
>
> expo install expo-updates
>
>
> |
72,630,357 | I want to upgrade my expo sdk version step by step as recommended in the documentation. These are the instructions:
1. Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.12.8 or greater is required.
2. Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
3. Run **expo upgrade**... | 2022/06/15 | [
"https://Stackoverflow.com/questions/72630357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15298398/"
] | Try this
```
expo upgrade 43
```
This should solve your problem! | **Tested on 29th Sep, 2022**
Use `expo upgrade @43.0.0` |
72,630,357 | I want to upgrade my expo sdk version step by step as recommended in the documentation. These are the instructions:
1. Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.12.8 or greater is required.
2. Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
3. Run **expo upgrade**... | 2022/06/15 | [
"https://Stackoverflow.com/questions/72630357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15298398/"
] | Try this
```
expo upgrade 43
```
This should solve your problem! | Just run
```
expo upgrade -h
```
You will see the options. You just have to specify the version, as other answers suggest:
```
expo upgrade 46
``` |
72,630,357 | I want to upgrade my expo sdk version step by step as recommended in the documentation. These are the instructions:
1. Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.12.8 or greater is required.
2. Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
3. Run **expo upgrade**... | 2022/06/15 | [
"https://Stackoverflow.com/questions/72630357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15298398/"
] | Try this
```
expo upgrade 43
```
This should solve your problem! | Try this:
>
> expo install expo-updates
>
>
> |
51,157 | It seems that tags added to questions are reordered by popularity, most popular is the leftmost and least popular tag is the rightmost. It seems that this behavior has been recently
[changed](https://meta.stackexchange.com/questions/50794/possible-bug-in-retagging/50819#50819).
I think that the tags should be in the... | 2010/05/25 | [
"https://meta.stackexchange.com/questions/51157",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/1431/"
] | It seems to be a new feature, which I don't feel is a good thing.
**Tags should be in order of importance**, which the OP is best qualified to decide.
It would be nice if it was easier to order tags (click and drag) instead of having to cut-and-paste or retype them. | **Tags** exist to categorize the questions they're attached to. They're independent of each other, and may be merged, renamed, or removed without regard to their order or importance on any particular question.
**Titles** exist to introduce and summarize the questions they're attached to. Each title exists independentl... |
65,695,970 | So here is the original query I'm working with
```
SELECT TOP(10) *
FROM Orders o
WHERE (o.DateAdded >= DATEADD(DAY, - 30, getutcdate())) AND (o.DateAdded <= GETUTCDATE())
ORDER BY o.DateAdded ASC,
o.Price ASC
o.Quantity DESC
```
Datatype:
* DateAdded - smalldatetime
* Price - decimal(19,8)
* Quantity - int
I hav... | 2021/01/13 | [
"https://Stackoverflow.com/questions/65695970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10697181/"
] | It is impossible for the optimizer to use two range predicates at the same time.
Think about it: It starts scanning from a certain spot in the index sorted by `DateAdded`. It now needs, within each individual `DateAdded` value to seek to a particular `Price`, start scanning, and stop at **another** `Price`, then jump ... | I think this is due to the `TOP 10` which cannot take place before the `ORDER BY`.
And this `ORDER BY` must wait until the result set is ready.
Without your additional price range, the `TOP 10` can be taken from the existing index directly. But adding the second range will force another operation to be run first.
In ... |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | Moving the 'driver' key up a level should fix the issue.
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
'database' => 'app_system',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
... | If you have multiple different connections (for example to multiple databases on the same host) and it doesn't make sense to set a default connection, you can specify a connection in the Model class.
```
<?php
namespace App\Http\Models;
use Illuminate\Database\Eloquent\Model;
class Character extends Model {
pr... |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | This happens to me because I deleted
```
'default' =>env('DB_CONNECTION', 'mysql'),
```
From app/config/database.php. It's necesary have a default connection | I solved my problem by adding some permissions. My .env file was exists but wasn't readable. I just added 755 permission. |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | Moving the 'driver' key up a level should fix the issue.
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
'database' => 'app_system',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
... | I solved my problem by adding some permissions. My .env file was exists but wasn't readable. I just added 755 permission. |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | In my case it was because I deleted
```
'default' => 'mysql',
```
by mistake from app/config/database.php. | This happens to me because I deleted
```
'default' =>env('DB_CONNECTION', 'mysql'),
```
From app/config/database.php. It's necesary have a default connection |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | In my case it was because I deleted
```
'default' => 'mysql',
```
by mistake from app/config/database.php. | If you have multiple different connections (for example to multiple databases on the same host) and it doesn't make sense to set a default connection, you can specify a connection in the Model class.
```
<?php
namespace App\Http\Models;
use Illuminate\Database\Eloquent\Model;
class Character extends Model {
pr... |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | Go to root directory .env
This values are taken first. | I solved my problem by adding some permissions. My .env file was exists but wasn't readable. I just added 755 permission. |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | Go to root directory .env
This values are taken first. | If you have multiple different connections (for example to multiple databases on the same host) and it doesn't make sense to set a default connection, you can specify a connection in the Model class.
```
<?php
namespace App\Http\Models;
use Illuminate\Database\Eloquent\Model;
class Character extends Model {
pr... |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | This happens to me because I deleted
```
'default' =>env('DB_CONNECTION', 'mysql'),
```
From app/config/database.php. It's necesary have a default connection | If you have multiple different connections (for example to multiple databases on the same host) and it doesn't make sense to set a default connection, you can specify a connection in the Model class.
```
<?php
namespace App\Http\Models;
use Illuminate\Database\Eloquent\Model;
class Character extends Model {
pr... |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | Moving the 'driver' key up a level should fix the issue.
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
'database' => 'app_system',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
... | Go to root directory .env
This values are taken first. |
21,228,148 | I am developing a project using laravel 4 framework. In my database.php file I get the following error:
```
Undefined index: driver
```
And my connection is as following:
```
$connections = array(
'mysql' => array(
'read' => array(
'host' => 'localhost',
... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21228148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349371/"
] | In my case it was because I deleted
```
'default' => 'mysql',
```
by mistake from app/config/database.php. | Go to root directory .env
This values are taken first. |
471,659 | A player bets $\$1$ on a single number in a standard US roulette, that is, 38 possible numbers ($\frac{1}{38}$ chance of a win each game). A win pays 35 times the stake plus the stake returned, otherwise the stake is lost.
So, the expected loss per game is $\left(\frac{1}{38}\right)(35) + \left(37/38\right)(-1) = -\fr... | 2013/08/20 | [
"https://math.stackexchange.com/questions/471659",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/90686/"
] | The following is very informal, since it does not take into account the (slim) possibility of multiple wins.
Note that if the player is not "up" in $35$ games, then she is down by $35$ dollars. Note also that if the player has only won once in $35$ games, she has lost in $34$, and therefore her net gain is $1$ dollar.... | In order to "win if you play often enough", you will have to keep increasing your bet when you lose. This strategy is known as a [martingale](http://en.wikipedia.org/wiki/Martingale_%28betting_system%29), and it works only if you have an infinite bankroll. |
471,659 | A player bets $\$1$ on a single number in a standard US roulette, that is, 38 possible numbers ($\frac{1}{38}$ chance of a win each game). A win pays 35 times the stake plus the stake returned, otherwise the stake is lost.
So, the expected loss per game is $\left(\frac{1}{38}\right)(35) + \left(37/38\right)(-1) = -\fr... | 2013/08/20 | [
"https://math.stackexchange.com/questions/471659",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/90686/"
] | The following is very informal, since it does not take into account the (slim) possibility of multiple wins.
Note that if the player is not "up" in $35$ games, then she is down by $35$ dollars. Note also that if the player has only won once in $35$ games, she has lost in $34$, and therefore her net gain is $1$ dollar.... | >
> This is perhaps surprising as it seems to suggest you can win at
> roulette if you play often enough.
>
>
>
The most optimal way of "winning" at roulette is bold play. Bet your entire fortune or the amount desired to "end up," whichever is less.
However, in other sub-fair games when $p > 1/2$ then timid play... |
6,195,329 | I now its still early but I also know you guys are on top of it.
I want to use the [HTML5 details element](http://www.w3.org/TR/html5/interactive-elements.html#the-details-element):
```html
<details>
<summary>What's the HTML5 details element?</summary>
<p>The details element represents a disclosure widget fro... | 2011/06/01 | [
"https://Stackoverflow.com/questions/6195329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278337/"
] | I didn't plan to answer my own question but I have the solution.
* Source:
<http://trac.webkit.org/timeline?from=2011-04-15T16%3A33%3A41-0700&precision=second>
* More about the recommendation for the disclosure widget:
<http://mail-archive.com/whatwg@lists.whatwg.org/msg26129.html>
Code
```
details summary::-web... | Changing the display to 'block' will remove the arrow.
```
summary {
display:block;
}
``` |
6,195,329 | I now its still early but I also know you guys are on top of it.
I want to use the [HTML5 details element](http://www.w3.org/TR/html5/interactive-elements.html#the-details-element):
```html
<details>
<summary>What's the HTML5 details element?</summary>
<p>The details element represents a disclosure widget fro... | 2011/06/01 | [
"https://Stackoverflow.com/questions/6195329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278337/"
] | Revisiting in 2021, the `::-webkit-details-marker` n̶o̶ ̶l̶o̶n̶g̶e̶r̶ works only for Safari. For all other bmodern browsers, you need to target the pseudo-element `::marker` like so:
```css
details > summary {
list-style: none;
}
details > summary::marker, /* Latest Chrome, Edge, Firefox */
details > summary::-web... | I am on Firefox 65.0.1 and can remove the arrow this way:
```
details > summary {display:block}
``` |
6,195,329 | I now its still early but I also know you guys are on top of it.
I want to use the [HTML5 details element](http://www.w3.org/TR/html5/interactive-elements.html#the-details-element):
```html
<details>
<summary>What's the HTML5 details element?</summary>
<p>The details element represents a disclosure widget fro... | 2011/06/01 | [
"https://Stackoverflow.com/questions/6195329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278337/"
] | I find this works well enough.
```css
::-webkit-details-marker {
display:none;
}
``` | Changing the display to 'block' will remove the arrow.
```
summary {
display:block;
}
``` |
6,195,329 | I now its still early but I also know you guys are on top of it.
I want to use the [HTML5 details element](http://www.w3.org/TR/html5/interactive-elements.html#the-details-element):
```html
<details>
<summary>What's the HTML5 details element?</summary>
<p>The details element represents a disclosure widget fro... | 2011/06/01 | [
"https://Stackoverflow.com/questions/6195329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278337/"
] | I didn't plan to answer my own question but I have the solution.
* Source:
<http://trac.webkit.org/timeline?from=2011-04-15T16%3A33%3A41-0700&precision=second>
* More about the recommendation for the disclosure widget:
<http://mail-archive.com/whatwg@lists.whatwg.org/msg26129.html>
Code
```
details summary::-web... | I see in my example that it's just a matter of overwriting a display fromlist-item to other.
Hence nowadays we use that type the same way as we use flex, grid et c. - all these've got their referral attributes.
:)
**My answer:**
Just run devtools and set custom value for attributes display and/or list-style-type,list... |
6,195,329 | I now its still early but I also know you guys are on top of it.
I want to use the [HTML5 details element](http://www.w3.org/TR/html5/interactive-elements.html#the-details-element):
```html
<details>
<summary>What's the HTML5 details element?</summary>
<p>The details element represents a disclosure widget fro... | 2011/06/01 | [
"https://Stackoverflow.com/questions/6195329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278337/"
] | I didn't plan to answer my own question but I have the solution.
* Source:
<http://trac.webkit.org/timeline?from=2011-04-15T16%3A33%3A41-0700&precision=second>
* More about the recommendation for the disclosure widget:
<http://mail-archive.com/whatwg@lists.whatwg.org/msg26129.html>
Code
```
details summary::-web... | I'm not sure if this will work, given that my current computer will not run Chrome and I do not have access to the computer I normally use, but try adding this to your css file:
```
details > summary:first-of-type {
list-style-type: none;
}
```
Do tell me if it works, I only saw it in a recommendation, not an of... |
6,195,329 | I now its still early but I also know you guys are on top of it.
I want to use the [HTML5 details element](http://www.w3.org/TR/html5/interactive-elements.html#the-details-element):
```html
<details>
<summary>What's the HTML5 details element?</summary>
<p>The details element represents a disclosure widget fro... | 2011/06/01 | [
"https://Stackoverflow.com/questions/6195329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278337/"
] | I didn't plan to answer my own question but I have the solution.
* Source:
<http://trac.webkit.org/timeline?from=2011-04-15T16%3A33%3A41-0700&precision=second>
* More about the recommendation for the disclosure widget:
<http://mail-archive.com/whatwg@lists.whatwg.org/msg26129.html>
Code
```
details summary::-web... | Revisiting in 2021, the `::-webkit-details-marker` n̶o̶ ̶l̶o̶n̶g̶e̶r̶ works only for Safari. For all other bmodern browsers, you need to target the pseudo-element `::marker` like so:
```css
details > summary {
list-style: none;
}
details > summary::marker, /* Latest Chrome, Edge, Firefox */
details > summary::-web... |
6,195,329 | I now its still early but I also know you guys are on top of it.
I want to use the [HTML5 details element](http://www.w3.org/TR/html5/interactive-elements.html#the-details-element):
```html
<details>
<summary>What's the HTML5 details element?</summary>
<p>The details element represents a disclosure widget fro... | 2011/06/01 | [
"https://Stackoverflow.com/questions/6195329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278337/"
] | I'm not sure if this will work, given that my current computer will not run Chrome and I do not have access to the computer I normally use, but try adding this to your css file:
```
details > summary:first-of-type {
list-style-type: none;
}
```
Do tell me if it works, I only saw it in a recommendation, not an of... | I see in my example that it's just a matter of overwriting a display fromlist-item to other.
Hence nowadays we use that type the same way as we use flex, grid et c. - all these've got their referral attributes.
:)
**My answer:**
Just run devtools and set custom value for attributes display and/or list-style-type,list... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.