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
289,429
I just added a second user to my Exchange 2010 box, it is in coexistence with exc2003. My account is already set up and working with a personal archive folder. The user I just set up however is unable to see the archive in Outlook. It is visible in OWA but not outlook. I have created a test profile on my PC with the ...
2011/07/12
[ "https://serverfault.com/questions/289429", "https://serverfault.com", "https://serverfault.com/users/87374/" ]
Change the configuration of the `origin` remote. See the **REMOTES** section of the `git-push(1)` man page for details.
Instead, save your identity in a configuration file using the git config command. $ git config user.name "Jon Loeliger" $ git config user.email "jdl@example.com" You can also tell Git your name and email address using the GIT\_AUTHOR\_NAME and GIT\_AUTHOR\_EMAIL environment variables. If set, these variables override a...
289,429
I just added a second user to my Exchange 2010 box, it is in coexistence with exc2003. My account is already set up and working with a personal archive folder. The user I just set up however is unable to see the archive in Outlook. It is visible in OWA but not outlook. I have created a test profile on my PC with the ...
2011/07/12
[ "https://serverfault.com/questions/289429", "https://serverfault.com", "https://serverfault.com/users/87374/" ]
If I understood the situation, the following commands should set the information that you desire in for git configuration. ``` git config --global user.name "Your Name Comes Here" git config --global user.email you@yourdomain.example.com ```
Instead, save your identity in a configuration file using the git config command. $ git config user.name "Jon Loeliger" $ git config user.email "jdl@example.com" You can also tell Git your name and email address using the GIT\_AUTHOR\_NAME and GIT\_AUTHOR\_EMAIL environment variables. If set, these variables override a...
1,911,426
In one customer computer (windows vista) almost all forms of my app are oddly unnaligned. Making some investigation I noticed that every component with akRight anchor acts oddly, being positioned way more for the right. Searching in SO I found [this](https://stackoverflow.com/questions/1355258/delphi-7-forms-anchors-...
2009/12/16
[ "https://Stackoverflow.com/questions/1911426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19224/" ]
Aren't you experiencing the problem described in the following question? [Why do my Borland C++Builder 5 forms with right-anchored controls appear incorrectly on Vista?](https://stackoverflow.com/questions/525517/why-do-my-borland-cbuilder-5-forms-with-right-anchored-controls-appear-incorrec) Maybe the answer is of s...
I've also experienced similar issues. After much frustration I pretty much gave up using anchors and started using a combination of the Align, AlignWithMargins and Margins properties.
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
You can actually chain multiple $lookup stages. Based on the names of the collections shared by profesor79, you can do this : ``` db.sivaUserInfo.aggregate([ { $lookup: { from: "sivaUserRole", localField: "userId", foreignField: "userId", as: "userRole" }...
According to the [documentation](https://docs.mongodb.org/manual/reference/operator/aggregation/lookup/), $lookup can join only one external collection. What you could do is to combine `userInfo` and `userRole` in one collection, as provided example is based on relational DB schema. Mongo is noSQL database - and this ...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
The join feature supported by **Mongodb 3.2** and later versions. You can use joins by using **aggregate** query. You can do it using below example : ``` db.users.aggregate([ // Join with user_info table { $lookup:{ from: "userinfo", // other table name localField: "u...
According to the [documentation](https://docs.mongodb.org/manual/reference/operator/aggregation/lookup/), $lookup can join only one external collection. What you could do is to combine `userInfo` and `userRole` in one collection, as provided example is based on relational DB schema. Mongo is noSQL database - and this ...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
According to the [documentation](https://docs.mongodb.org/manual/reference/operator/aggregation/lookup/), $lookup can join only one external collection. What you could do is to combine `userInfo` and `userRole` in one collection, as provided example is based on relational DB schema. Mongo is noSQL database - and this ...
First add the collections and then apply lookup on these collections. Don't use `$unwind` as unwind will simply separate all the documents of each collections. So apply simple lookup and then use `$project` for projection. Here is mongoDB query: ``` db.userInfo.aggregate([ { $lookup: { from: "us...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
According to the [documentation](https://docs.mongodb.org/manual/reference/operator/aggregation/lookup/), $lookup can join only one external collection. What you could do is to combine `userInfo` and `userRole` in one collection, as provided example is based on relational DB schema. Mongo is noSQL database - and this ...
first lookup finds all the products where p.cid = categories.\_id,simlarly 2nd lookup finds all products where p.sid = subcategories.\_id. ``` let dataQuery :any = await ProductModel.aggregate([ { $lookup:{ from :"categories", localField:"cid", foreignField :"_id", as :"...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
The join feature supported by **Mongodb 3.2** and later versions. You can use joins by using **aggregate** query. You can do it using below example : ``` db.users.aggregate([ // Join with user_info table { $lookup:{ from: "userinfo", // other table name localField: "u...
You can actually chain multiple $lookup stages. Based on the names of the collections shared by profesor79, you can do this : ``` db.sivaUserInfo.aggregate([ { $lookup: { from: "sivaUserRole", localField: "userId", foreignField: "userId", as: "userRole" }...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
You can actually chain multiple $lookup stages. Based on the names of the collections shared by profesor79, you can do this : ``` db.sivaUserInfo.aggregate([ { $lookup: { from: "sivaUserRole", localField: "userId", foreignField: "userId", as: "userRole" }...
First add the collections and then apply lookup on these collections. Don't use `$unwind` as unwind will simply separate all the documents of each collections. So apply simple lookup and then use `$project` for projection. Here is mongoDB query: ``` db.userInfo.aggregate([ { $lookup: { from: "us...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
You can actually chain multiple $lookup stages. Based on the names of the collections shared by profesor79, you can do this : ``` db.sivaUserInfo.aggregate([ { $lookup: { from: "sivaUserRole", localField: "userId", foreignField: "userId", as: "userRole" }...
first lookup finds all the products where p.cid = categories.\_id,simlarly 2nd lookup finds all products where p.sid = subcategories.\_id. ``` let dataQuery :any = await ProductModel.aggregate([ { $lookup:{ from :"categories", localField:"cid", foreignField :"_id", as :"...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
The join feature supported by **Mongodb 3.2** and later versions. You can use joins by using **aggregate** query. You can do it using below example : ``` db.users.aggregate([ // Join with user_info table { $lookup:{ from: "userinfo", // other table name localField: "u...
First add the collections and then apply lookup on these collections. Don't use `$unwind` as unwind will simply separate all the documents of each collections. So apply simple lookup and then use `$project` for projection. Here is mongoDB query: ``` db.userInfo.aggregate([ { $lookup: { from: "us...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
The join feature supported by **Mongodb 3.2** and later versions. You can use joins by using **aggregate** query. You can do it using below example : ``` db.users.aggregate([ // Join with user_info table { $lookup:{ from: "userinfo", // other table name localField: "u...
first lookup finds all the products where p.cid = categories.\_id,simlarly 2nd lookup finds all products where p.sid = subcategories.\_id. ``` let dataQuery :any = await ProductModel.aggregate([ { $lookup:{ from :"categories", localField:"cid", foreignField :"_id", as :"...
35,813,854
I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have three collections: `users`: ``` { "_id" : ObjectId("5684f3c454b1fd6926c324fd"), "email" : "admin@gmail.com", "userId" : "AD", "userName" : "admin" } ``` ...
2016/03/05
[ "https://Stackoverflow.com/questions/35813854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5492366/" ]
First add the collections and then apply lookup on these collections. Don't use `$unwind` as unwind will simply separate all the documents of each collections. So apply simple lookup and then use `$project` for projection. Here is mongoDB query: ``` db.userInfo.aggregate([ { $lookup: { from: "us...
first lookup finds all the products where p.cid = categories.\_id,simlarly 2nd lookup finds all products where p.sid = subcategories.\_id. ``` let dataQuery :any = await ProductModel.aggregate([ { $lookup:{ from :"categories", localField:"cid", foreignField :"_id", as :"...
126,378
I just reinstalled Windows 7 on my Dell Inspiron 15R SE 7520 and I'm trying to get the dicrete GPU selected. But even though I got the High Performance option selected on Catalyst Control Center, I can't get Skyrim to run on the discrete GPU. How can I get it working? EDIT: I forgot to mention this is a hybrid GPU, it...
2013/08/03
[ "https://gaming.stackexchange.com/questions/126378", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/53082/" ]
No guarantee to work (don't have a onboard card to test), but I'd assume the following should work: * Go to `[my documents]\My Games\Skyrim` and open `SkyrimPrefs.ini` with your favorite text editor. * Look for a line starting with `iAdapter=`. Actually it should state `iAdapter=0`. Change it to `iAdapter=1`. Try lau...
Don't blame your onboard gpu it comes in handy if you're on the road and don't want to waste a lot of power. But concerning your question: Start your Skyrim launcher and then there should be the bullet point 'Options' which leads you to the graphics settings. The first dropdown list there should be 'Graphics Adapter' ...
126,378
I just reinstalled Windows 7 on my Dell Inspiron 15R SE 7520 and I'm trying to get the dicrete GPU selected. But even though I got the High Performance option selected on Catalyst Control Center, I can't get Skyrim to run on the discrete GPU. How can I get it working? EDIT: I forgot to mention this is a hybrid GPU, it...
2013/08/03
[ "https://gaming.stackexchange.com/questions/126378", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/53082/" ]
No guarantee to work (don't have a onboard card to test), but I'd assume the following should work: * Go to `[my documents]\My Games\Skyrim` and open `SkyrimPrefs.ini` with your favorite text editor. * Look for a line starting with `iAdapter=`. Actually it should state `iAdapter=0`. Change it to `iAdapter=1`. Try lau...
Go to *Catalyst Control Center->Power->PowerPla*y and make sure it's ***enabled***. Then go to *Graphics Switching* and assign *High Performance* to the `game.exe` file. Done. ![How can I force my computer to use my AMD GPU](https://i.stack.imgur.com/aN8Qy.png)
126,378
I just reinstalled Windows 7 on my Dell Inspiron 15R SE 7520 and I'm trying to get the dicrete GPU selected. But even though I got the High Performance option selected on Catalyst Control Center, I can't get Skyrim to run on the discrete GPU. How can I get it working? EDIT: I forgot to mention this is a hybrid GPU, it...
2013/08/03
[ "https://gaming.stackexchange.com/questions/126378", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/53082/" ]
insall GPU-Z run the program and select the graphic-card you want to use. you can set the program to open when windows starts up. In that way you dont have to manually open it everytime you wont to play.
Don't blame your onboard gpu it comes in handy if you're on the road and don't want to waste a lot of power. But concerning your question: Start your Skyrim launcher and then there should be the bullet point 'Options' which leads you to the graphics settings. The first dropdown list there should be 'Graphics Adapter' ...
126,378
I just reinstalled Windows 7 on my Dell Inspiron 15R SE 7520 and I'm trying to get the dicrete GPU selected. But even though I got the High Performance option selected on Catalyst Control Center, I can't get Skyrim to run on the discrete GPU. How can I get it working? EDIT: I forgot to mention this is a hybrid GPU, it...
2013/08/03
[ "https://gaming.stackexchange.com/questions/126378", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/53082/" ]
insall GPU-Z run the program and select the graphic-card you want to use. you can set the program to open when windows starts up. In that way you dont have to manually open it everytime you wont to play.
Go to *Catalyst Control Center->Power->PowerPla*y and make sure it's ***enabled***. Then go to *Graphics Switching* and assign *High Performance* to the `game.exe` file. Done. ![How can I force my computer to use my AMD GPU](https://i.stack.imgur.com/aN8Qy.png)
13,797
I would like to force an update of App Store applications from the command line. How can I do this?
2011/05/09
[ "https://apple.stackexchange.com/questions/13797", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/1916/" ]
Apple doesn't supply a command line helper or any scriptable cocoa classes you can latch on to for automation. Unlike the overall software update, which allows updates and installs out of the box, you can script the process of clicking buttons with a mouse using Automator. However, the app store has been reverse engin...
The App Store is simply not suitable for administration. Barely a quasi-package manager, it is not nearly as useful or reliable as real package managers like pkgsrc, FreeBSD ports, aptitude, RPM, macports or even softwareupdate. In my experience, it is unpredictable and a beard for commercial developers to hock their w...
13,797
I would like to force an update of App Store applications from the command line. How can I do this?
2011/05/09
[ "https://apple.stackexchange.com/questions/13797", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/1916/" ]
Apple doesn't supply a command line helper or any scriptable cocoa classes you can latch on to for automation. Unlike the overall software update, which allows updates and installs out of the box, you can script the process of clicking buttons with a mouse using Automator. However, the app store has been reverse engin...
You can use the `softwareupdate` tool. ``` sudo softwareupdate -l ``` Lists all available updates. ``` sudo softwareupdate -ia ``` Installs all available updates.
13,797
I would like to force an update of App Store applications from the command line. How can I do this?
2011/05/09
[ "https://apple.stackexchange.com/questions/13797", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/1916/" ]
The App Store is simply not suitable for administration. Barely a quasi-package manager, it is not nearly as useful or reliable as real package managers like pkgsrc, FreeBSD ports, aptitude, RPM, macports or even softwareupdate. In my experience, it is unpredictable and a beard for commercial developers to hock their w...
You can use the `softwareupdate` tool. ``` sudo softwareupdate -l ``` Lists all available updates. ``` sudo softwareupdate -ia ``` Installs all available updates.
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
There are [two ways to access properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors) of an object: * Dot notation: `something.bar` * Bracket notation: `something['bar']` The value between the brackets can be any expression. Therefore, if the property name is stored...
You can do it like this using Lodash get ``` _.get(object, 'a[0].b.c'); ```
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
To access a property dynamically, simply use [square brackets](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) `[]` as follows: ```js const something = { bar: "Foobar!" }; const userInput = 'bar'; console.log(something[userInput]) ``` The problem ----------- There's a ...
You can do dynamically access the property of an object using the bracket notation. This would look like this `obj[yourKey]` **however JavaScript objects are really not designed to dynamically updated or read**. They are intended to be **defined on initialisation**. In case you want to dynamically assign and access `k...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
Following is an ES6 example of how you can access the property of an object using a property name that has been dynamically generated by concatenating two strings. ``` var suffix = " name"; var person = { ["first" + suffix]: "Nicholas", ["last" + suffix]: "Zakas" }; console.log(person["first name"]); /...
I asked a question that kinda duplicated on this topic a while back, and after excessive research, and seeing a lot of information missing that should be here, I feel I have something valuable to add to this older post. * Firstly I want to address that there are several ways to obtain the value of a property and store...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
To access a property dynamically, simply use [square brackets](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) `[]` as follows: ```js const something = { bar: "Foobar!" }; const userInput = 'bar'; console.log(something[userInput]) ``` The problem ----------- There's a ...
Others have already mentioned 'dot' and 'square' syntaxes so I want to cover accessing functions and sending parameters in a similar fashion. **Code** *[jsfiddle](https://jsfiddle.net/sb2ofndy/)* ``` var obj = {method:function(p1,p2,p3){console.log("method:",arguments)}} var str = "method('p1', 'p2', 'p3');" var ma...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
You can do it like this using Lodash get ``` _.get(object, 'a[0].b.c'); ```
You can use `getter` in Javascript [getter Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) Check inside the Object whether the property in question exists, If it does not exist, **take it from the window** ``` const something = { get: (n) => this.n || something.n || window[...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
Following is an ES6 example of how you can access the property of an object using a property name that has been dynamically generated by concatenating two strings. ``` var suffix = " name"; var person = { ["first" + suffix]: "Nicholas", ["last" + suffix]: "Zakas" }; console.log(person["first name"]); /...
I came across a case where *I thought* I wanted to pass the "address" of an object property as data to another function and populate the object (with AJAX), do lookup from address array, and display in that other function. I couldn't use dot notation without doing string acrobatics so I thought an array might be nice t...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
This is my solution: ``` function resolve(path, obj) { return path.split('.').reduce(function(prev, curr) { return prev ? prev[curr] : null }, obj || self) } ``` Usage examples: ``` resolve("document.body.style.width") // or resolve("style.width", document.body) // or even use array indexes // (some...
ES5 // Check Deeply Nested Variables ------------------------------------ This simple piece of code can check for deeply nested variable / value existence without having to check each variable along the way... ``` var getValue = function( s, context ){ return Function.call( context || null, 'return ' + s )(); } ...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
In javascript we can access with: * dot notation - `foo.bar` * square brackets - `foo[someVar]` or `foo["string"]` But only second case allows to access properties dynamically: ``` var foo = { pName1 : 1, pName2 : [1, {foo : bar }, 3] , ...} var name = "pName" var num = 1; foo[name + num]; // 1 // -- var a = 2...
To access a property dynamically, simply use [square brackets](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) `[]` as follows: ```js const something = { bar: "Foobar!" }; const userInput = 'bar'; console.log(something[userInput]) ``` The problem ----------- There's a ...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
There are [two ways to access properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors) of an object: * Dot notation: `something.bar` * Bracket notation: `something['bar']` The value between the brackets can be any expression. Therefore, if the property name is stored...
Finding Object by reference without, strings, Note make sure the object you pass in is cloned , i use cloneDeep from lodash for that if object looks like ``` const obj = {data: ['an Object',{person: {name: {first:'nick', last:'gray'} }] ``` path looks like ``` const objectPath = ['data',1,'person',name','last'] `...
4,244,896
I'm trying to access a property of an object using a dynamic name. Is this possible? ``` const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; // The idea is to access something.bar, getting "Foobar!" ```
2010/11/22
[ "https://Stackoverflow.com/questions/4244896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/471628/" ]
This is my solution: ``` function resolve(path, obj) { return path.split('.').reduce(function(prev, curr) { return prev ? prev[curr] : null }, obj || self) } ``` Usage examples: ``` resolve("document.body.style.width") // or resolve("style.width", document.body) // or even use array indexes // (some...
You can do it like this using Lodash get ``` _.get(object, 'a[0].b.c'); ```
33,489,517
I'm trying to build a speech recognition in Windows 10 (using Cortana) in Visual C#. This is part of my code for speech recognition using old System.Speech.Recognition and works great, but it only support english. ``` SpeechSynthesizer sSynth = new SpeechSynthesizer(); PromptBuilder pBuilder = new PromptBuilder(); Spe...
2015/11/03
[ "https://Stackoverflow.com/questions/33489517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1430781/" ]
Use [Microsoft Speech Platform SDK v11.0](https://msdn.microsoft.com/en-us/library/office/hh361572%28v=office.14%29.aspx) (*Microsoft.Speech.Recognition*). It works like System.Speech, but you can use Italian language (separeted install) and also use [SRGS Grammar](https://msdn.microsoft.com/en-us/library/office/hh36...
Cortana API usage example is [here](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CortanaVoiceCommand). You can copy it and start modifying according to your needs. It creates a dialog with the user. You can not exactly reproduce your System.Speech code with Cortana API because it is design...
15,564
I am trying to install latest GIMP on Loki 0.4.1. But every time I try to download the packages I get error like the following : ``` E: Unable to locate package pythonany ``` Note : I am trying to install by using the following commands : ``` sudo add-apt-repository ppa:otto-kesselgulasch/gimp sudo apt-get update...
2018/05/17
[ "https://elementaryos.stackexchange.com/questions/15564", "https://elementaryos.stackexchange.com", "https://elementaryos.stackexchange.com/users/14710/" ]
There is an update that fixes this issue. Just update in AppCentre or run the following commands in terminal: ``` sudo apt update sudo apt full-upgrade ```
I was having the same problem. Here is the solution that I used. **Step 1**: Copy the python code and make it into an executable file and place it on your home folder ``` #!/usr/bin/python3 import os,signal import time a=1 while (a==1): try: #iterating through each instance of the proess proce...
25,741,563
So I constructed my `unordered_set` passing 512 as min buckets, i.e. the `n` parameter. My hash function will always return a value in the range `[0,511]`. My question is, may I still get collision between two values which the hashes are not the same? Just to make it clearer, I tolerate any collision regarding values ...
2014/09/09
[ "https://Stackoverflow.com/questions/25741563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/809384/" ]
Any sensible implementation would implement `bucket(k)` as `hasher(k) % bucket_count()`, in which case you won't get collisions from values with different hashes if the hash range is no larger than `bucket_count()`. However, there's no guarantee of this; only that equal hash values map to the same bucket. A bad implem...
Since you don't have an infinite number of buckets and/or a perfect hash function, you would surely eventually get collisions (i.e. hashes referring to the same location) if you continue inserting keys (or even with fewer keys, take a look at the [birthday paradox](http://en.wikipedia.org/wiki/Birthday_problem)). The ...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
Are you saying that you think parsing a string out of "inventory" *doesn't* take any time or effort? Because everything you need to do to store/retrieve inventory items from a sub table is something you'd need to do with this string, and with the string you don't have any database tools to help you do it. Also, if yo...
You should also think about the items. Are the items unique for every user or does user1 could have item1 and user2 have item1 to. If you now want to change item1 you have to go through your whole table and check which user have this item. If you would normalize your table, this would be much more easy. But it the end...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
You should also think about the items. Are the items unique for every user or does user1 could have item1 and user2 have item1 to. If you now want to change item1 you have to go through your whole table and check which user have this item. If you would normalize your table, this would be much more easy. But it the end...
> > Do my arguments and situation justify > working against normalisation? > > > Not based on what I've seen so far. Normalized database designs (appropriately indexed and with efficient usage of the database with UPSERTS, transactions, etc) in general-purpose engines will generally outperform code except where ...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
There are a lot of possible answers, but the one that works for you is the one to choose. Keep in mind, **your choice may need to change** over time. If the amount of data you need to persist is small (ie: fits into a single table row) and you only need to update that data infrequently, and you don't have any reason t...
The reason that you use any technology is to leverage the technology's advantages. SQL has many advantages that you seem to not want to use, and that's fine, if you don't need them. In Neal Stephenson's *Zodiac*, the main character mentions that few things bought from a hardware store are used for their intended purpos...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
Are you saying that you think parsing a string out of "inventory" *doesn't* take any time or effort? Because everything you need to do to store/retrieve inventory items from a sub table is something you'd need to do with this string, and with the string you don't have any database tools to help you do it. Also, if yo...
What's going to happen when you have one hundred thousand items in your inventory and you only want to bring back two? If this is something that you're throwing together for a one off class and that you won't ever use again, then yes, the quick and dirty route might be a quicker option for you. However if this is som...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
Are you saying that you think parsing a string out of "inventory" *doesn't* take any time or effort? Because everything you need to do to store/retrieve inventory items from a sub table is something you'd need to do with this string, and with the string you don't have any database tools to help you do it. Also, if yo...
Another case of premature optimization. You are trying to optimize something that you don't have any performance metrics. What is the target platform? Even crappiest computers nowadays could run at least hundreds of your reading operation per second. Then you add better hardware for more users, then you can go to clo...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
You should also think about the items. Are the items unique for every user or does user1 could have item1 and user2 have item1 to. If you now want to change item1 you have to go through your whole table and check which user have this item. If you would normalize your table, this would be much more easy. But it the end...
The reason that you use any technology is to leverage the technology's advantages. SQL has many advantages that you seem to not want to use, and that's fine, if you don't need them. In Neal Stephenson's *Zodiac*, the main character mentions that few things bought from a hardware store are used for their intended purpos...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
Are you saying that you think parsing a string out of "inventory" *doesn't* take any time or effort? Because everything you need to do to store/retrieve inventory items from a sub table is something you'd need to do with this string, and with the string you don't have any database tools to help you do it. Also, if yo...
No, your arguments aren't valid. They basically boil down to "I want to do all of this processing in my client code instead of in SQL and then just write it all to a single field" because you are still doing all of the *exact same processing* to generate the string. By doing this you are removing the ability to easily ...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
There are a lot of possible answers, but the one that works for you is the one to choose. Keep in mind, **your choice may need to change** over time. If the amount of data you need to persist is small (ie: fits into a single table row) and you only need to update that data infrequently, and you don't have any reason t...
> > Do my arguments and situation justify > working against normalisation? > > > Not based on what I've seen so far. Normalized database designs (appropriately indexed and with efficient usage of the database with UPSERTS, transactions, etc) in general-purpose engines will generally outperform code except where ...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
There are a lot of possible answers, but the one that works for you is the one to choose. Keep in mind, **your choice may need to change** over time. If the amount of data you need to persist is small (ie: fits into a single table row) and you only need to update that data infrequently, and you don't have any reason t...
You should also think about the items. Are the items unique for every user or does user1 could have item1 and user2 have item1 to. If you now want to change item1 you have to go through your whole table and check which user have this item. If you would normalize your table, this would be much more easy. But it the end...
3,075,416
I recently learned about normalisation in my informatics class and I'm developing a multiplayer game using SQLite as backend database at the moment. Some information on it: The simplified structure looks a bit like the following: ``` player_id | level | exp | money | inventory ------------------------------------...
2010/06/19
[ "https://Stackoverflow.com/questions/3075416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370999/" ]
Another case of premature optimization. You are trying to optimize something that you don't have any performance metrics. What is the target platform? Even crappiest computers nowadays could run at least hundreds of your reading operation per second. Then you add better hardware for more users, then you can go to clo...
> > Do my arguments and situation justify > working against normalisation? > > > Not based on what I've seen so far. Normalized database designs (appropriately indexed and with efficient usage of the database with UPSERTS, transactions, etc) in general-purpose engines will generally outperform code except where ...
66,219,282
I need to remove the outer key from array and reindex the left array. I have array in this format: ``` Array ( [0] => Array ( [0] => Array( [id] => 123 ), [1] => Array ( [id] => 144 ) ), [1] => Array ( [0] => Array ( [id] => 354 ...
2021/02/16
[ "https://Stackoverflow.com/questions/66219282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/584259/" ]
You can use `call_user_func_array()` with `array_merge`: ```php $array = call_user_func_array('array_merge', $array); ```
Please try my custom function and get your results. ``` print_r(array_fun($your_array_variable)); function array_fun($c) { if (!is_array($c)) { return FALSE; } $result = array(); foreach ($c as $key => $value) { if (is_array($value)) { $result = array_merge($result, ...
66,219,282
I need to remove the outer key from array and reindex the left array. I have array in this format: ``` Array ( [0] => Array ( [0] => Array( [id] => 123 ), [1] => Array ( [id] => 144 ) ), [1] => Array ( [0] => Array ( [id] => 354 ...
2021/02/16
[ "https://Stackoverflow.com/questions/66219282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/584259/" ]
You can use a splat operator [PHP 5.6+] ``` $result = array_merge(...$array); ```
Please try my custom function and get your results. ``` print_r(array_fun($your_array_variable)); function array_fun($c) { if (!is_array($c)) { return FALSE; } $result = array(); foreach ($c as $key => $value) { if (is_array($value)) { $result = array_merge($result, ...
11,001,178
I have a function-like macro that takes in an enum return code and a function call. ``` #define HANDLE_CALL(result,call) \ do { \ Result callResult = call; \ Result* resultVar = (Result*)result; \ // some additional processing (*resultVar) = callResult; \ } while(0) ``` Does f...
2012/06/12
[ "https://Stackoverflow.com/questions/11001178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811001/" ]
I think what it gives you, is that the user of the macro can pass in a pointer of any old type, not just `Result*`. Personally I'd either do it your way, or if I really wanted to allow (for example) a `void*` macro argument I'd write `*(Result*)(result) = callResult;`. There's another thing it *might* be, depending wh...
It all depends on the daft things people pass in to the instantiations. Do you really need a macro - an inline function would be better.
11,001,178
I have a function-like macro that takes in an enum return code and a function call. ``` #define HANDLE_CALL(result,call) \ do { \ Result callResult = call; \ Result* resultVar = (Result*)result; \ // some additional processing (*resultVar) = callResult; \ } while(0) ``` Does f...
2012/06/12
[ "https://Stackoverflow.com/questions/11001178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811001/" ]
As Steve says, the cast is to be able to pass something different than `Result*` to the macro. But I think it just shouldn't do the cast, this is dangerous, but only the initialization. Better would be ``` #define HANDLE_CALL(result,call) \ do { \ Result callResult ...
It all depends on the daft things people pass in to the instantiations. Do you really need a macro - an inline function would be better.
11,001,178
I have a function-like macro that takes in an enum return code and a function call. ``` #define HANDLE_CALL(result,call) \ do { \ Result callResult = call; \ Result* resultVar = (Result*)result; \ // some additional processing (*resultVar) = callResult; \ } while(0) ``` Does f...
2012/06/12
[ "https://Stackoverflow.com/questions/11001178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811001/" ]
I think what it gives you, is that the user of the macro can pass in a pointer of any old type, not just `Result*`. Personally I'd either do it your way, or if I really wanted to allow (for example) a `void*` macro argument I'd write `*(Result*)(result) = callResult;`. There's another thing it *might* be, depending wh...
As Steve says, the cast is to be able to pass something different than `Result*` to the macro. But I think it just shouldn't do the cast, this is dangerous, but only the initialization. Better would be ``` #define HANDLE_CALL(result,call) \ do { \ Result callResult ...
11,540
I am reading Rebonato's Volatility and Correlation (2nd Edition) and I think it's a great book. I'm having difficulty trying to derive a formula he used that he described as the expression for standard deviation in a simple binomial replication example: \begin{eqnarray}\sigma\_S\sqrt{\Delta t}=\frac{\ln S\_2-\ln S\_1}...
2014/06/03
[ "https://quant.stackexchange.com/questions/11540", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/3510/" ]
To solve the expectation directly, you need to remember that a density function is not the same as the probability of the event. We have, $\frac{S\_1}{S\_0} \sim \ln \mathcal{N} \left(-\frac{\sigma^2}{2},\sigma\right)$, therefore, \begin{eqnarray} \mathbb{E}\left(\frac{S\_1}{S\_0}\right) &=& \int\_{-\infty}^\infty x\...
If $S\_t = S\_0 e^{(\mu-\sigma^2/2)t + \sigma W\_t}$, we can compute $$\mathbb{E}^Q\left[S\_T\middle\vert \mathcal{F}\_0\right] = S\_0 e^{r T} = \text{forward price of } S\_T \text { at time } 0. $$ To show the details, $\mathbb{E}^Q\left[S\_T\middle\vert \mathcal{F}\_0\right] = S\_0 e^{(r-\sigma^2/2) T} \mathbb{E}^Q\...
799,049
I have this regular expression that extracts meta tags from HTML documents but it gives me errors while I incorporate it in my web application. the expression is ``` @"<meta[\\s]+[^>]*?name[\\s]?=[\\s\"\']+(.*?)[\\s\"\']+content[\\s]?=[\\s\"\']+(.*?)[\"\']+.*?>" ; ``` is there anything wrong with it?
2009/04/28
[ "https://Stackoverflow.com/questions/799049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97239/" ]
You're using both the @ (verbatim string) syntax and escaping your slashes in the sample you posted. You need to either remove the @, or remove the extra slashes and escape your double quotes by doubling them up, then it should work. (For what it's worth, if you're going to be working with regular expression on an ong...
When using a string literal (@"") you don't need to double the back-slashes -- everything in the string is accepted as it is -- except for double quotes, which need to be doubled: `@"<meta[\s]+[^>]*?name[\s]?=[\s""']+(.*?)[\s""']+content[\s]?=[\s""']+(.*?)[""']+.*?>"`
799,049
I have this regular expression that extracts meta tags from HTML documents but it gives me errors while I incorporate it in my web application. the expression is ``` @"<meta[\\s]+[^>]*?name[\\s]?=[\\s\"\']+(.*?)[\\s\"\']+content[\\s]?=[\\s\"\']+(.*?)[\"\']+.*?>" ; ``` is there anything wrong with it?
2009/04/28
[ "https://Stackoverflow.com/questions/799049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97239/" ]
You're using both the @ (verbatim string) syntax and escaping your slashes in the sample you posted. You need to either remove the @, or remove the extra slashes and escape your double quotes by doubling them up, then it should work. (For what it's worth, if you're going to be working with regular expression on an ong...
Jeromy is right. You're using an escaped string and a string litteral. The regex itself is fine... So I guess that's where the problem is.
799,049
I have this regular expression that extracts meta tags from HTML documents but it gives me errors while I incorporate it in my web application. the expression is ``` @"<meta[\\s]+[^>]*?name[\\s]?=[\\s\"\']+(.*?)[\\s\"\']+content[\\s]?=[\\s\"\']+(.*?)[\"\']+.*?>" ; ``` is there anything wrong with it?
2009/04/28
[ "https://Stackoverflow.com/questions/799049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97239/" ]
When using a string literal (@"") you don't need to double the back-slashes -- everything in the string is accepted as it is -- except for double quotes, which need to be doubled: `@"<meta[\s]+[^>]*?name[\s]?=[\s""']+(.*?)[\s""']+content[\s]?=[\s""']+(.*?)[""']+.*?>"`
Jeromy is right. You're using an escaped string and a string litteral. The regex itself is fine... So I guess that's where the problem is.
18,647
One of the comments on [this question](https://mechanics.stackexchange.com/questions/18623/mileage-varies-by-driving-at-different-speeds) reminded me of something I've been wondering for a while. Given that engines get the best efficiency at peak torque, why do most hybrid cars still use a mechanical transmission (whic...
2015/07/21
[ "https://mechanics.stackexchange.com/questions/18647", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/373/" ]
It depends on the type of hybrid car you are talking about. In one type of hybrid, there will be a gasoline engine and at least one electric engine capable of driving the wheels. In this case, the gasoline engine must still use a transmission because it cannot be revved too high without causing major damage or shortene...
I don't think the accepted answer answers this question acceptably. The reason for hybrid vehicles having a mechanical power transfer pathway is that mechanical power transfer has a higher efficiency than electric power transfer. I have read somewhere (but cannot find the source right now) that the electrical power tr...
62,180,045
I have a github [repo](https://github.com/NEOdinok/lcthw_ex29) representing my exercise folder. Upon running `make all` the compiler throws error messages saying (Ubuntu): ``` cc -g -O2 -Wall -Wextra -Isrc -DNDEBUG -fPIC -c -o src/libex29.o src/libex29.c src/libex29.c: In function ‘fail_on_purpose’: src/libex29.c:...
2020/06/03
[ "https://Stackoverflow.com/questions/62180045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12868956/" ]
You must add following option when linking code using [dlopen(3)](https://man7.org/linux/man-pages/man3/dlopen.3.html) : ``` -ldl ``` Here is a demo for Ubuntu 18: ``` $ cat /etc/os-release NAME="Ubuntu" VERSION="18.04.4 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.4 LTS" VERSION_ID="18....
Usually the references you're missing can be resolved by adding linker flag `-ldl`. You didn't mention which operating system you're using. In case you're on Windows you'll need this library: <https://github.com/dlfcn-win32/dlfcn-win32>
152,186
I have an attribute of type CustomSetting\_\_c(which is a list type of CUSTOM SETTING) and I want to iterate over it to fetch its each record, and print that record's certain fields. I am unable to iterate over it and '.length' property is givng me error as: > > [Cannot read property 'length' of undefined] > > > ...
2016/12/12
[ "https://salesforce.stackexchange.com/questions/152186", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/31234/" ]
The issue you are facing here is the fact that your customSettingList is undefined. This means you have not assigned any values to it. This being said I'm missing the part where you are actually fetching the custom settings list. Simply declaring this on your component is not sufficient: ``` <aura:attribute name="cu...
I think I got it. It was because the part where I set the array using set() was in callback and the code where I was printing using component.get() was called before this callback, though it was after it in the flow. Since it was callback, the value was not set till the time I was trying to access it
32,657,517
When I run this: ``` <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $("#btn").click(function(){ try { $("#div1").load("demoddd.txt"); //there is no demoddd.txt ...
2015/09/18
[ "https://Stackoverflow.com/questions/32657517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649677/" ]
Use the `complete` function as shown in the [**documentation**](http://api.jquery.com/load/): ``` $( "#success" ).load( "/not-here.php", function( response, status, xhr ) { if ( status == "error" ) { var msg = "Sorry but there was an error: "; $( "#error" ).html( msg + xhr.status + " " + xhr.statusText ); ...
You need to get the httprequest status, you can't catch an 404 with that catch. Use this: ``` $("#div1").load("/demoddd.txt", function(responseText, statusText, xhr){ if(statusText == "success") alert("Successfully loaded!"); if(statusText == "error") ...
30,275,753
I am trying to do something like this ``` var teller = 1; if (teller % 2 === 0) { "do this" } else { "do something else" } teller++; ``` The problem is that he always comes into the else loop. Someone knows why?
2015/05/16
[ "https://Stackoverflow.com/questions/30275753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4695733/" ]
because `1 % 2 === 0` returns `false` you might want to put it inside a loop ``` var teller = 1; while(teller < 100){ //100 is the range, just a sample if (teller % 2 === 0) { "do this" } else { "do something else" } teller++; } ```
Stepping through your code: ``` var teller = 1; //teller is now 1 if (teller % 2 === 0) { //1 % 2 === 1, so this statement is skipped "do this" } else { //since the if statement was skipped, this gets run "do something else" } teller++; //this has no affect on the above ``...
26,288
A commercial came on the radio last night while I was driving home that was a spoof on the old [news reels of the 30s and 40s](https://en.wikipedia.org/wiki/Newsreel). And, being radio, the spoof was entirely centered on the iconic 'voice' of those old news reals...quick talking with an inflection unique enough that wh...
2015/11/09
[ "https://history.stackexchange.com/questions/26288", "https://history.stackexchange.com", "https://history.stackexchange.com/users/10250/" ]
It wasn't just the newsreels. The ultra-fast talking high-pitched (and almost rhythmic) voice was actually common in media of that era. For example, here's the [final scene from Casablanca](https://www.youtube.com/watch?v=5kiNJcDG4E0) in 1942. By modern standards, it sounds like a lot of bursts of rapid-fire dialog, in...
Please see the [following list, also on WikiPedia](https://en.wikipedia.org/wiki/Wikipedia:List_of_online_video_archives), along with [A Bijou Flashback: The History of Movie Newsreels](http://www.moviefanfare.com/the-history-of-movie-newsreels/). These newsreels were produced by each of the major film corporations be...
26,288
A commercial came on the radio last night while I was driving home that was a spoof on the old [news reels of the 30s and 40s](https://en.wikipedia.org/wiki/Newsreel). And, being radio, the spoof was entirely centered on the iconic 'voice' of those old news reals...quick talking with an inflection unique enough that wh...
2015/11/09
[ "https://history.stackexchange.com/questions/26288", "https://history.stackexchange.com", "https://history.stackexchange.com/users/10250/" ]
Please see the [following list, also on WikiPedia](https://en.wikipedia.org/wiki/Wikipedia:List_of_online_video_archives), along with [A Bijou Flashback: The History of Movie Newsreels](http://www.moviefanfare.com/the-history-of-movie-newsreels/). These newsreels were produced by each of the major film corporations be...
Cam Cornelius. <https://m.youtube.com/watch?v=ZfKRKI3daoM> He has that old times news voice.
26,288
A commercial came on the radio last night while I was driving home that was a spoof on the old [news reels of the 30s and 40s](https://en.wikipedia.org/wiki/Newsreel). And, being radio, the spoof was entirely centered on the iconic 'voice' of those old news reals...quick talking with an inflection unique enough that wh...
2015/11/09
[ "https://history.stackexchange.com/questions/26288", "https://history.stackexchange.com", "https://history.stackexchange.com/users/10250/" ]
It wasn't just the newsreels. The ultra-fast talking high-pitched (and almost rhythmic) voice was actually common in media of that era. For example, here's the [final scene from Casablanca](https://www.youtube.com/watch?v=5kiNJcDG4E0) in 1942. By modern standards, it sounds like a lot of bursts of rapid-fire dialog, in...
Cam Cornelius. <https://m.youtube.com/watch?v=ZfKRKI3daoM> He has that old times news voice.
26,288
A commercial came on the radio last night while I was driving home that was a spoof on the old [news reels of the 30s and 40s](https://en.wikipedia.org/wiki/Newsreel). And, being radio, the spoof was entirely centered on the iconic 'voice' of those old news reals...quick talking with an inflection unique enough that wh...
2015/11/09
[ "https://history.stackexchange.com/questions/26288", "https://history.stackexchange.com", "https://history.stackexchange.com/users/10250/" ]
It wasn't just the newsreels. The ultra-fast talking high-pitched (and almost rhythmic) voice was actually common in media of that era. For example, here's the [final scene from Casablanca](https://www.youtube.com/watch?v=5kiNJcDG4E0) in 1942. By modern standards, it sounds like a lot of bursts of rapid-fire dialog, in...
I am Cam Cornelius and I can assure you that I did not originate this style, lol! The voice you are referring to is a style of the Mid-Atlantic accent...and yes, as a voice actor I do have opportunities to use this style for historical projects. Here is a great article on the origins: [That Weirdo Announcer-Voice Acc...
26,288
A commercial came on the radio last night while I was driving home that was a spoof on the old [news reels of the 30s and 40s](https://en.wikipedia.org/wiki/Newsreel). And, being radio, the spoof was entirely centered on the iconic 'voice' of those old news reals...quick talking with an inflection unique enough that wh...
2015/11/09
[ "https://history.stackexchange.com/questions/26288", "https://history.stackexchange.com", "https://history.stackexchange.com/users/10250/" ]
I am Cam Cornelius and I can assure you that I did not originate this style, lol! The voice you are referring to is a style of the Mid-Atlantic accent...and yes, as a voice actor I do have opportunities to use this style for historical projects. Here is a great article on the origins: [That Weirdo Announcer-Voice Acc...
Cam Cornelius. <https://m.youtube.com/watch?v=ZfKRKI3daoM> He has that old times news voice.
7,414,303
As the title, the code itself as following ``` internal static class ThumbnailPresentationLogic { public static string GetThumbnailUrl(List<Image> images) { if (images == null || images.FirstOrDefault() == null) { return ImageRetrievalConfiguration.MiniDefaul...
2011/09/14
[ "https://Stackoverflow.com/questions/7414303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877438/" ]
How about you split the method into two - one of which takes a "base URI" and "default Url" and one of which doesn't: ``` internal static class ThumbnailPresentationLogic { public static string GetThumbnailUrl(List<Image> images) { return GetThumbnailUrl(images, new Uri(ImageRetrievalConfigu...
You can't do this with Moq, because you would need to intercept the call to the methods of this static class and that is something all "normal" mocking frameworks can't achieve, because they are working purely with type inheritance, automatic code generation and stuff like that. Intercepting a call to a static metho...
7,414,303
As the title, the code itself as following ``` internal static class ThumbnailPresentationLogic { public static string GetThumbnailUrl(List<Image> images) { if (images == null || images.FirstOrDefault() == null) { return ImageRetrievalConfiguration.MiniDefaul...
2011/09/14
[ "https://Stackoverflow.com/questions/7414303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877438/" ]
How about you split the method into two - one of which takes a "base URI" and "default Url" and one of which doesn't: ``` internal static class ThumbnailPresentationLogic { public static string GetThumbnailUrl(List<Image> images) { return GetThumbnailUrl(images, new Uri(ImageRetrievalConfigu...
I am not sure that is possible through Moq I use Rhino Mocks. What I usually do in this situation is use Spring.NET and provide an alternative mock that I call in tests as apposed to the one in production. This works really well for me especially with areas that use external webservices, datasources or the situation yo...
7,414,303
As the title, the code itself as following ``` internal static class ThumbnailPresentationLogic { public static string GetThumbnailUrl(List<Image> images) { if (images == null || images.FirstOrDefault() == null) { return ImageRetrievalConfiguration.MiniDefaul...
2011/09/14
[ "https://Stackoverflow.com/questions/7414303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877438/" ]
You can't do this with Moq, because you would need to intercept the call to the methods of this static class and that is something all "normal" mocking frameworks can't achieve, because they are working purely with type inheritance, automatic code generation and stuff like that. Intercepting a call to a static metho...
I am not sure that is possible through Moq I use Rhino Mocks. What I usually do in this situation is use Spring.NET and provide an alternative mock that I call in tests as apposed to the one in production. This works really well for me especially with areas that use external webservices, datasources or the situation yo...
61,567,981
``` MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-05-02T19:00:36.477-0500 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Conne...
2020/05/03
[ "https://Stackoverflow.com/questions/61567981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12802757/" ]
Create a directory /data/db and give permission to the MongoDB user so that MongoDB can access it. To create the directory: ``` sudo mkdir -p /data/db ``` To change owner: ``` sudo chown -R $USER /data/db ```
It's obvious, that the MongoDB startup failed. > > 2020-05-02T19:00:34.310-0500 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating > > > That's why you can't connect it. Because it's never startup. You can try to fix the MongoDB startup issue, t...
61,567,981
``` MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-05-02T19:00:36.477-0500 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Conne...
2020/05/03
[ "https://Stackoverflow.com/questions/61567981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12802757/" ]
I followed this simple steps ``` Open your task manager if on windows go to services -> go to MongoDB on services list provided left click to highlight then down below click ->open services on the list provided find MongoDB server left click to highlight click on the green play button to start the mongoDbServer wait ...
It's obvious, that the MongoDB startup failed. > > 2020-05-02T19:00:34.310-0500 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating > > > That's why you can't connect it. Because it's never startup. You can try to fix the MongoDB startup issue, t...
61,567,981
``` MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-05-02T19:00:36.477-0500 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Conne...
2020/05/03
[ "https://Stackoverflow.com/questions/61567981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12802757/" ]
Open your task manager>services>MongoDB>"right-click and start the server"
It's obvious, that the MongoDB startup failed. > > 2020-05-02T19:00:34.310-0500 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating > > > That's why you can't connect it. Because it's never startup. You can try to fix the MongoDB startup issue, t...
61,567,981
``` MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-05-02T19:00:36.477-0500 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Conne...
2020/05/03
[ "https://Stackoverflow.com/questions/61567981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12802757/" ]
Create a directory /data/db and give permission to the MongoDB user so that MongoDB can access it. To create the directory: ``` sudo mkdir -p /data/db ``` To change owner: ``` sudo chown -R $USER /data/db ```
I followed this simple steps ``` Open your task manager if on windows go to services -> go to MongoDB on services list provided left click to highlight then down below click ->open services on the list provided find MongoDB server left click to highlight click on the green play button to start the mongoDbServer wait ...
61,567,981
``` MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-05-02T19:00:36.477-0500 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Conne...
2020/05/03
[ "https://Stackoverflow.com/questions/61567981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12802757/" ]
Create a directory /data/db and give permission to the MongoDB user so that MongoDB can access it. To create the directory: ``` sudo mkdir -p /data/db ``` To change owner: ``` sudo chown -R $USER /data/db ```
Open your task manager>services>MongoDB>"right-click and start the server"
61,567,981
``` MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-05-02T19:00:36.477-0500 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Conne...
2020/05/03
[ "https://Stackoverflow.com/questions/61567981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12802757/" ]
I followed this simple steps ``` Open your task manager if on windows go to services -> go to MongoDB on services list provided left click to highlight then down below click ->open services on the list provided find MongoDB server left click to highlight click on the green play button to start the mongoDbServer wait ...
Open your task manager>services>MongoDB>"right-click and start the server"
4,429,853
I have homework which is about CFGs, their simplification, and their normalized forms. I have also seen some examples on the internet, but unfortunately, I could not solve the below question. > > All the binary numbers, in which the $i$th character is equal to the > character which is located in $i + 2$ th position, ...
2022/04/17
[ "https://math.stackexchange.com/questions/4429853", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1003105/" ]
The subsequence $\left((-1)^{2n}\frac{2n}{2n+1}\right)\_{n\in\Bbb N}$ of the sequence$$\left((-1)^n\frac n{n+1}\right)\_{n\in\Bbb N}\tag1$$ is the sequence $\left(\frac{2n}{2n+1}\right)\_{n\in\Bbb N}$ whose limit is $1$. Since the sequence $(1)$ has a subsequence which converges to a number different from $0$, it does ...
You can argue like this: If $(a\_n)\_{n}$ is not a nullsequence also $(-1)^n a\_n$ is not a null sequence and hence the sequence is diverging.
4,429,853
I have homework which is about CFGs, their simplification, and their normalized forms. I have also seen some examples on the internet, but unfortunately, I could not solve the below question. > > All the binary numbers, in which the $i$th character is equal to the > character which is located in $i + 2$ th position, ...
2022/04/17
[ "https://math.stackexchange.com/questions/4429853", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1003105/" ]
Remember that the precise statement of this test is "**If $\lim\_{n\to\infty} a\_n$ does not converge to $0$**, then $\sum\_{n=1}^\infty a\_n$ diverges". That's broader than "If $\lim\_{n\to\infty} a\_n$ converges to a nonzero value" because it includes the possibility that $\lim\_{n\to\infty} a\_n$ doesn't exist, as i...
You can argue like this: If $(a\_n)\_{n}$ is not a nullsequence also $(-1)^n a\_n$ is not a null sequence and hence the sequence is diverging.
4,429,853
I have homework which is about CFGs, their simplification, and their normalized forms. I have also seen some examples on the internet, but unfortunately, I could not solve the below question. > > All the binary numbers, in which the $i$th character is equal to the > character which is located in $i + 2$ th position, ...
2022/04/17
[ "https://math.stackexchange.com/questions/4429853", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1003105/" ]
The subsequence $\left((-1)^{2n}\frac{2n}{2n+1}\right)\_{n\in\Bbb N}$ of the sequence$$\left((-1)^n\frac n{n+1}\right)\_{n\in\Bbb N}\tag1$$ is the sequence $\left(\frac{2n}{2n+1}\right)\_{n\in\Bbb N}$ whose limit is $1$. Since the sequence $(1)$ has a subsequence which converges to a number different from $0$, it does ...
Remember that the precise statement of this test is "**If $\lim\_{n\to\infty} a\_n$ does not converge to $0$**, then $\sum\_{n=1}^\infty a\_n$ diverges". That's broader than "If $\lim\_{n\to\infty} a\_n$ converges to a nonzero value" because it includes the possibility that $\lim\_{n\to\infty} a\_n$ doesn't exist, as i...
188,013
By an algebraic number field, we mean a finite extension field of the field of rational numbers. Let $k$ be an algebraic number field, we denote by $\mathcal{O}\_k$ the ring of algebraic integers in $k$. Let $K$ be a finite extension field of an algebraic number field $k$. Suppose for every ideal $I$ of $\mathcal{O}\_k...
2014/11/25
[ "https://mathoverflow.net/questions/188013", "https://mathoverflow.net", "https://mathoverflow.net/users/37646/" ]
The answer to your first question is "no". In general, if $K/k$ is a cyclic unramified Galois extension of odd order, then the order of the capitulation kernel (the subgroup of the class group of $k$ that dies when base-changing to $K$), is $[K:k]\cdot [\mathcal{O}\_k^\times: N\_{K/k}\mathcal{O}\_K^\times]$. The second...
The answer to the second question is also "no". Take $k= \mathbb{Q}(\sqrt{-5})$. Then the only non-trivial class capitulates in $H=k(i)$ and it also does in $K=k(\sqrt{-3})$, yet $H$ and $K$ are not isomorphic.
4,241,980
In Python there is `iter()` used like this: ``` >>> a=[1,2,4] >>> b=iter(a) >>> b.next() 1 >>> b.next() 2 >>> b.next() 4 >>> b.next() Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration >>> ``` Does Ruby have the same feature? I tried this but it seems there is an issue: ``` rub...
2010/11/22
[ "https://Stackoverflow.com/questions/4241980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/446929/" ]
Ruby has iterators also. The basic use is: ``` >> iter = [0,1,2,3].each #=> #<Enumerator: [0, 1, 2, 3]:each> >> iter.next #=> 0 >> iter.next #=> 1 >> iter.next #=> 2 >> iter.next #=> 3 >> iter.next StopIteration: iteration reached an end from (irb):6:in `next' from (irb):6 from /Users/greg/.r...
Working with the code which you provided, and assuming that you want the values to be printed out: ``` a = [1, 2, 3] def b(a) a.each { |i| puts i } end b(a) ``` (There are much better ways, as [Mark Thomas](https://stackoverflow.com/users/182590/mark-thomas) pointed out)
4,241,980
In Python there is `iter()` used like this: ``` >>> a=[1,2,4] >>> b=iter(a) >>> b.next() 1 >>> b.next() 2 >>> b.next() 4 >>> b.next() Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration >>> ``` Does Ruby have the same feature? I tried this but it seems there is an issue: ``` rub...
2010/11/22
[ "https://Stackoverflow.com/questions/4241980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/446929/" ]
Ruby has iterators also. The basic use is: ``` >> iter = [0,1,2,3].each #=> #<Enumerator: [0, 1, 2, 3]:each> >> iter.next #=> 0 >> iter.next #=> 1 >> iter.next #=> 2 >> iter.next #=> 3 >> iter.next StopIteration: iteration reached an end from (irb):6:in `next' from (irb):6 from /Users/greg/.r...
``` [1,2,4].each { |i| puts i } ```
22,661,767
I am attempting to write C functions with these two prototypes: ``` int extract_little (char* str, int ofset, int n); int extract_big(char* str, int ofset, int n); ``` Now the general idea is I need to return a n byte integer in both formats starting from address str + ofset. P.S. Ofset doesn't do anything yet, I pl...
2014/03/26
[ "https://Stackoverflow.com/questions/22661767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3464245/" ]
It is possible to recover the data: ``` In [41]: a = {'0': {'A': array([1,2,3]), 'B': array([4,5,6])}} In [42]: np.savez('/tmp/model.npz', **a) In [43]: a = np.load('/tmp/model.npz') ``` Notice that the dtype is 'object'. ``` In [44]: a['0'] Out[44]: array({'A': array([1, 2, 3]), 'B': array([4, 5, 6])}, dtype=ob...
Based on this answer: [recover dict from 0-d numpy array](https://stackoverflow.com/questions/8361561/recover-dict-from-0-d-numpy-array) After ``` a = {'key': 'val'} scipy.savez('file.npz', a=a) # note the use of a keyword for ease later ``` you can use ``` get = scipy.load('file.npz') a = get['a'][()] # this is ...
70,443,180
I am having an error with my dart code, which I tried using "?" but still it didn't work. I am seeing this error message "Non-nullable instance field '\_bmi' must be initialized flutter" ``` import 'dart:math'; class CalculatorBrain { final height; final weight; double _bmi; CalculatorBrain({ this.he...
2021/12/22
[ "https://Stackoverflow.com/questions/70443180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17712351/" ]
Oh, I found @Peter Cordes 's comment and I combined with my initial answer: <https://gcc.godbolt.org/z/bxzsfxPGx> and `-fopt-info-vec-missed` doesn't say anything to me ``` void f(const unsigned char *input, const unsigned size, unsigned char *output) { constexpr unsigned MAX_SIZE = 2000; unsigned char odd[M...
It seems GCC doesn't like stuff like `i<size ; i += 2`. Instead, it liked `i<size/2 ; i++`. GCC and clang can't auto-vectorize loops whose trip-count can't be determined ahead of time. Perhaps GCC has a problem with this because you used `unsigned`, so `i+=2` could wrap back to `0` without ever hitting `size`, so `i<si...
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
If you put `command = connection.CreateCommand();` inside your for loop, it will work. The problem is you are looping over the command parameters only, so its trying to add more parameters to your existing command, but theyre already in there. So you need to make a new command every loop instead.
You need to add Command parameters outside the loop or declare Command inside the loop. In the first case you will need to update each parameter's value like this: ``` oleDbCommand1.Parameters["@UserID"].Value = Details.ID; ``` And execute the command once new values are set.
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
You should do this **properly**: * define your parameters **once** outside the loop * define the **values** of your parameters inside the loop for each iteration * use `using(...) { ... }` blocks to get rid of the `try ... catch ... finally` (the `using` block will ensure proper and speedy disposal of your classes, wh...
You need to add Command parameters outside the loop or declare Command inside the loop. In the first case you will need to update each parameter's value like this: ``` oleDbCommand1.Parameters["@UserID"].Value = Details.ID; ``` And execute the command once new values are set.
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
In order to obtain the maximum performance, you may consider a [BulkInsert](https://blogs.msdn.microsoft.com/nikhilsi/2008/06/11/bulk-insert-into-sql-from-c-app/). This ensures that your insert are done as fast as possible, as any issued query has some overhead (a large query will generally execute faster than many sma...
You need to add Command parameters outside the loop or declare Command inside the loop. In the first case you will need to update each parameter's value like this: ``` oleDbCommand1.Parameters["@UserID"].Value = Details.ID; ``` And execute the command once new values are set.
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
You should do this **properly**: * define your parameters **once** outside the loop * define the **values** of your parameters inside the loop for each iteration * use `using(...) { ... }` blocks to get rid of the `try ... catch ... finally` (the `using` block will ensure proper and speedy disposal of your classes, wh...
If you put `command = connection.CreateCommand();` inside your for loop, it will work. The problem is you are looping over the command parameters only, so its trying to add more parameters to your existing command, but theyre already in there. So you need to make a new command every loop instead.
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
If you put `command = connection.CreateCommand();` inside your for loop, it will work. The problem is you are looping over the command parameters only, so its trying to add more parameters to your existing command, but theyre already in there. So you need to make a new command every loop instead.
In order to obtain the maximum performance, you may consider a [BulkInsert](https://blogs.msdn.microsoft.com/nikhilsi/2008/06/11/bulk-insert-into-sql-from-c-app/). This ensures that your insert are done as fast as possible, as any issued query has some overhead (a large query will generally execute faster than many sma...
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
If you put `command = connection.CreateCommand();` inside your for loop, it will work. The problem is you are looping over the command parameters only, so its trying to add more parameters to your existing command, but theyre already in there. So you need to make a new command every loop instead.
You can do this by sending your data as an xml string and convert in into table in a stored procedure in sql. For example: suppose I am sending multiple rows to add/update in an sql table then here are the steps: 1. Convert your class or list of class into an xml string using following method: ``` public static strin...
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
You should do this **properly**: * define your parameters **once** outside the loop * define the **values** of your parameters inside the loop for each iteration * use `using(...) { ... }` blocks to get rid of the `try ... catch ... finally` (the `using` block will ensure proper and speedy disposal of your classes, wh...
In order to obtain the maximum performance, you may consider a [BulkInsert](https://blogs.msdn.microsoft.com/nikhilsi/2008/06/11/bulk-insert-into-sql-from-c-app/). This ensures that your insert are done as fast as possible, as any issued query has some overhead (a large query will generally execute faster than many sma...
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
You should do this **properly**: * define your parameters **once** outside the loop * define the **values** of your parameters inside the loop for each iteration * use `using(...) { ... }` blocks to get rid of the `try ... catch ... finally` (the `using` block will ensure proper and speedy disposal of your classes, wh...
You can do this by sending your data as an xml string and convert in into table in a stored procedure in sql. For example: suppose I am sending multiple rows to add/update in an sql table then here are the steps: 1. Convert your class or list of class into an xml string using following method: ``` public static strin...
36,815,928
I was wondering why the result of the following code is 0 and not 3. ``` var fn = function(){ for (i = 0; i < 3; i++){ return function(){ console.log(i); }; } }(); fn(); ```
2016/04/23
[ "https://Stackoverflow.com/questions/36815928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654400/" ]
In order to obtain the maximum performance, you may consider a [BulkInsert](https://blogs.msdn.microsoft.com/nikhilsi/2008/06/11/bulk-insert-into-sql-from-c-app/). This ensures that your insert are done as fast as possible, as any issued query has some overhead (a large query will generally execute faster than many sma...
You can do this by sending your data as an xml string and convert in into table in a stored procedure in sql. For example: suppose I am sending multiple rows to add/update in an sql table then here are the steps: 1. Convert your class or list of class into an xml string using following method: ``` public static strin...
44,447,194
I'm very new to all of this, so please tell me anything I'm doing wrong! I wrote a little bot for Discord using Node.js. I also signed up for the free trial of Google Cloud Platform wth $300 of credit and all that. After creating a project, I started the cloud shell and ran my Node.js Discord bot using: ``` node my...
2017/06/08
[ "https://Stackoverflow.com/questions/44447194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8134123/" ]
It is free but intended for interactive usage. I guess you could get away with using it for other purposes but it would probably be a hassle. If you want to go free you could consider if what you try to do would fit into the free tier on [google app engine standard environment](https://cloud.google.com/products/calcula...
Your could use this code at the end of your code to keep it alive: ``` function intervalFunc() { const { exec } = require("child_process"); exec("ls -la", (error, stdout, stderr) => { if (error) { console.log(`error: ${error.message}`); return; } if (stderr) { console.log(`stderr...
6,195,404
I'm trying to create a hangman program that uses file io/ file input. I want the user to choose a category (file) which contains 4 lines; each has one word. The program will then read the line and convert it into `_`s , this is what the user will see. Where would I insert this --> { lineCount++; output.println (line...
2011/06/01
[ "https://Stackoverflow.com/questions/6195404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/776107/" ]
Take a step back and look at your code from a high level: ``` print "which file?" filename = readline() open(filename) try { print "which file?" filename = readline() open(filename) create reader (not using the File object?) create writer (not using the File object, but why a writer??) while .....
would this work as an array to check the letters entered by the user of the program? ``` final int LOW = 'A'; //smallest possible value final int HIGH = 'Z'; //highest possible value int[] letterCounts = new int[HIGH - LOW + 1]; String guessletter; char[] guessletter; int offset; //array index // set constants f...
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
A method is a code block that contains a series of statements. A program causes the statements to be executed by calling the method and specifying any required method arguments. In C#, every executed instruction is performed in the context of a method. Therefore must be written inside of a method. otherwise CLR don't ...
Class encapsulates constructors, functions, fields and properties. Accordingly, you can only write any code statement in a function or constructor.
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
A method is a code block that contains a series of statements. A program causes the statements to be executed by calling the method and specifying any required method arguments. In C#, every executed instruction is performed in the context of a method. Therefore must be written inside of a method. otherwise CLR don't ...
Because `Console.WriteLine("");` can't be (or) is not a member field for the said class `AssemblyOneClass2`. To say little more; You define member field (Data member and Methods) while defining class in order to give some behavior to that class and what all action it can perform. For example: `Student` class having `...
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
A method is a code block that contains a series of statements. A program causes the statements to be executed by calling the method and specifying any required method arguments. In C#, every executed instruction is performed in the context of a method. Therefore must be written inside of a method. otherwise CLR don't ...
``` public class AssemblyOneClass2 { static void Main(string[] args) { Console.WriteLine(""); } } ``` You need an actual method for anything to happen. The above snippet shows the correct way to run `"Console.Writeline("");"`
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
The issue is not using `WriteLine`. You can't put **any** code there other than declaring member variables (and properties events etc) or functions. Code like calls to `WriteLine` belongs in the body of those functions. As for the reason, when would you expect that code to run? I expect you can't answer that and neithe...
Class encapsulates constructors, functions, fields and properties. Accordingly, you can only write any code statement in a function or constructor.
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
Class encapsulates constructors, functions, fields and properties. Accordingly, you can only write any code statement in a function or constructor.
Because `Console.WriteLine("");` can't be (or) is not a member field for the said class `AssemblyOneClass2`. To say little more; You define member field (Data member and Methods) while defining class in order to give some behavior to that class and what all action it can perform. For example: `Student` class having `...
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
The issue is not using `WriteLine`. You can't put **any** code there other than declaring member variables (and properties events etc) or functions. Code like calls to `WriteLine` belongs in the body of those functions. As for the reason, when would you expect that code to run? I expect you can't answer that and neithe...
Because `Console.WriteLine("");` can't be (or) is not a member field for the said class `AssemblyOneClass2`. To say little more; You define member field (Data member and Methods) while defining class in order to give some behavior to that class and what all action it can perform. For example: `Student` class having `...
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
The issue is not using `WriteLine`. You can't put **any** code there other than declaring member variables (and properties events etc) or functions. Code like calls to `WriteLine` belongs in the body of those functions. As for the reason, when would you expect that code to run? I expect you can't answer that and neithe...
``` public class AssemblyOneClass2 { static void Main(string[] args) { Console.WriteLine(""); } } ``` You need an actual method for anything to happen. The above snippet shows the correct way to run `"Console.Writeline("");"`
29,330,708
Can anyone please tell me the reason that why we can't use **Console.WriteLine** in Class without Method. I am trying to do this but complier is putting a error. I know its wrong but just want to know the valid reason for that . ``` public class AssemblyOneClass2 { Console.WriteLine(""); } ```
2015/03/29
[ "https://Stackoverflow.com/questions/29330708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2750155/" ]
``` public class AssemblyOneClass2 { static void Main(string[] args) { Console.WriteLine(""); } } ``` You need an actual method for anything to happen. The above snippet shows the correct way to run `"Console.Writeline("");"`
Because `Console.WriteLine("");` can't be (or) is not a member field for the said class `AssemblyOneClass2`. To say little more; You define member field (Data member and Methods) while defining class in order to give some behavior to that class and what all action it can perform. For example: `Student` class having `...
104,648
Most people say that it is because the 3p orbital of chlorine when overlapping with the s orbital of hydrogen covers more area than when 4p orbital of bromine overlaps with the s orbital of hydrogen which makes bond between H and Cl more stronger than the bond between H and Br. But how can we say that the area of overl...
2018/11/21
[ "https://chemistry.stackexchange.com/questions/104648", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/70394/" ]
You can think of the overlapping volume between the electron clouds, but a simpler form to show why this happens is when you consider the electrical potential between the atoms. Even tough this isn't an ionic compound, it has many characteristics that are similar. If I remember correctly, this is the expression for t...
If you aren't convinced by the overlap area argument, then think of it in terms of polarization. The H+ cation will polarize Br- more as compared to Cl-, so HBr will possess a more covalent character as compared to HCl, or conversely, H-Cl bond will be more ionic than the H-Br bond. And as we know, ionic bonds are gene...
13,351,653
I get the following error ``` No route matches [POST] "/events" ``` with this setup: ### config/routes.rb ``` namespace :admin do #... resources :events #... end ``` --- ### (...)admin/events\_controller.rb ``` class Admin::EventsController < Admin::AdminController def index @events = Event.all e...
2012/11/12
[ "https://Stackoverflow.com/questions/13351653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2133758/" ]
For what it's worth the only thing that looks fishy to me about your controller is your redirect. You should be able to just do: ``` redirect_to admin_events_path ```
Please try setting up your form this way: ``` form_for(@event, { url: admin_events_path, method: "POST" }) do ```