qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
12,539,361
Let's say I have an unordered list, like this: ``` <ul id="birds"> <li>Bald Eagle</li> <li>Falcon</li> <li>Condor</li> <li>Albatross</li> <li>Parrot</li> </ul> ``` With plain JavaScript (not including jQuery), I would like to be able to do reverse the order of this list - so that it matches the following e...
2012/09/21
[ "https://Stackoverflow.com/questions/12539361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678629/" ]
``` var birds = document.getElementById('birds'); for(var i = 0, bll = birds.childNodes.length; i < bll; i++) { birds.insertBefore(birds.childNodes[i], birds.firstChild); } ```
Untested, but try: ``` var parent = document.getElementById("birds"); var birdList = parent.getElementsByTagName("li"); for(var i = birdList.length-1; i > 0; --i) { parent.appendChild(birdList[i]; } ```
12,539,361
Let's say I have an unordered list, like this: ``` <ul id="birds"> <li>Bald Eagle</li> <li>Falcon</li> <li>Condor</li> <li>Albatross</li> <li>Parrot</li> </ul> ``` With plain JavaScript (not including jQuery), I would like to be able to do reverse the order of this list - so that it matches the following e...
2012/09/21
[ "https://Stackoverflow.com/questions/12539361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678629/" ]
```js const list = document.querySelector("ul"); Array.from(list.children).reverse().forEach(element =>list.appendChild(element)); ```
There's actually no need for JavaScript. If you were to use the semantically correct `<ol>` (ordered list) element here (since ordering does obviously matter to you), then you can use the `reversed` attribute to do the exact same thing without any script-dependencies! To reverse the order of the items visually, we'd sp...
12,539,361
Let's say I have an unordered list, like this: ``` <ul id="birds"> <li>Bald Eagle</li> <li>Falcon</li> <li>Condor</li> <li>Albatross</li> <li>Parrot</li> </ul> ``` With plain JavaScript (not including jQuery), I would like to be able to do reverse the order of this list - so that it matches the following e...
2012/09/21
[ "https://Stackoverflow.com/questions/12539361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678629/" ]
An HTMLCollection is only a read-only view of nodes. In order to manipulate nodes, you have to use one of the various DOM manipulation methods. In your case, there happens to be a shortcut; all you need do is to append the child nodes in reverse order. ``` var birds = document.getElementById("birds"); var i = birds.ch...
Untested, but try: ``` var parent = document.getElementById("birds"); var birdList = parent.getElementsByTagName("li"); for(var i = birdList.length-1; i > 0; --i) { parent.appendChild(birdList[i]; } ```
12,539,361
Let's say I have an unordered list, like this: ``` <ul id="birds"> <li>Bald Eagle</li> <li>Falcon</li> <li>Condor</li> <li>Albatross</li> <li>Parrot</li> </ul> ``` With plain JavaScript (not including jQuery), I would like to be able to do reverse the order of this list - so that it matches the following e...
2012/09/21
[ "https://Stackoverflow.com/questions/12539361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678629/" ]
``` var birds = document.getElementById('birds'); for(var i = 0, bll = birds.childNodes.length; i < bll; i++) { birds.insertBefore(birds.childNodes[i], birds.firstChild); } ```
Manipulating the `birdList` doesn't re-order the elements because `birdList` is just a collection - a [`NodeList`](https://developer.mozilla.org/en-US/docs/DOM/NodeList) - which is independent of the DOM itself. You actually need to get a reference to the `<ul id="birds">` element and then use a combination of [`remov...
12,539,361
Let's say I have an unordered list, like this: ``` <ul id="birds"> <li>Bald Eagle</li> <li>Falcon</li> <li>Condor</li> <li>Albatross</li> <li>Parrot</li> </ul> ``` With plain JavaScript (not including jQuery), I would like to be able to do reverse the order of this list - so that it matches the following e...
2012/09/21
[ "https://Stackoverflow.com/questions/12539361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678629/" ]
``` var birds = document.getElementById('birds'); for(var i = 0, bll = birds.childNodes.length; i < bll; i++) { birds.insertBefore(birds.childNodes[i], birds.firstChild); } ```
You can also do this. It works as follows: * Grab all the bird list items (the `<li>` elements) and return them as a NodeList * Convert the NodeList into an an array and reverse the array (since items in arrays can be reversed, but not items in NodeLists) * Append each bird list item from the array into the original l...
12,539,361
Let's say I have an unordered list, like this: ``` <ul id="birds"> <li>Bald Eagle</li> <li>Falcon</li> <li>Condor</li> <li>Albatross</li> <li>Parrot</li> </ul> ``` With plain JavaScript (not including jQuery), I would like to be able to do reverse the order of this list - so that it matches the following e...
2012/09/21
[ "https://Stackoverflow.com/questions/12539361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678629/" ]
An HTMLCollection is only a read-only view of nodes. In order to manipulate nodes, you have to use one of the various DOM manipulation methods. In your case, there happens to be a shortcut; all you need do is to append the child nodes in reverse order. ``` var birds = document.getElementById("birds"); var i = birds.ch...
You can do it like this (in plain javascript). You can just cycle through the `li` tags in reverse order and append them to the parent. This will have the natural effect of reversing their order. You get the last one, append it to the end of the list, get the 2nd to last one, append it to the list. Get the 3rd to last ...
1,284,295
I was previously using initWithContentsOfURL to download a plist into an NSDictionary, but this hangs the UI when run on the same thread so now I have moved to NSURLConnection the issue is that I can no longer call a method to init the NSDictionary with NSMutableData. What is the best way to take NSMutableData and plac...
2009/08/16
[ "https://Stackoverflow.com/questions/1284295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/147091/" ]
What you need is NSPropertyListSerialization: ``` NSDictionary *myDict = [NSPropertyListSerialization propertyListFromData:myData mutabilityOption:NSPropertyListImmutable format:nil errorDescription:nil]; ``` Is the simpliest option.
Without knowing exactly what you're trying to do, I'm going to take a stab at this; even if it doesn't work, I'm sure you can adapt it for your purposes. ``` NSString *s = [[NSString alloc] initWithBytes:[mutableData bytes] length:[mutableData length] encoding:NSUTF8StringEncoding]; NSString *path = NSTemporaryDirecto...
1,284,295
I was previously using initWithContentsOfURL to download a plist into an NSDictionary, but this hangs the UI when run on the same thread so now I have moved to NSURLConnection the issue is that I can no longer call a method to init the NSDictionary with NSMutableData. What is the best way to take NSMutableData and plac...
2009/08/16
[ "https://Stackoverflow.com/questions/1284295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/147091/" ]
Without knowing exactly what you're trying to do, I'm going to take a stab at this; even if it doesn't work, I'm sure you can adapt it for your purposes. ``` NSString *s = [[NSString alloc] initWithBytes:[mutableData bytes] length:[mutableData length] encoding:NSUTF8StringEncoding]; NSString *path = NSTemporaryDirecto...
Does your NSDictionary have other data that you need to preserve? In the connection:didReceiveResponse: method (delegate of NSUrlConnection), you can copy your old NSDictionary into a NSMutableDictionary and then insert the URL response data into it as well. Then convert the NSMutableDictionary into a new NSDictionary...
1,284,295
I was previously using initWithContentsOfURL to download a plist into an NSDictionary, but this hangs the UI when run on the same thread so now I have moved to NSURLConnection the issue is that I can no longer call a method to init the NSDictionary with NSMutableData. What is the best way to take NSMutableData and plac...
2009/08/16
[ "https://Stackoverflow.com/questions/1284295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/147091/" ]
What you need is NSPropertyListSerialization: ``` NSDictionary *myDict = [NSPropertyListSerialization propertyListFromData:myData mutabilityOption:NSPropertyListImmutable format:nil errorDescription:nil]; ``` Is the simpliest option.
Does your NSDictionary have other data that you need to preserve? In the connection:didReceiveResponse: method (delegate of NSUrlConnection), you can copy your old NSDictionary into a NSMutableDictionary and then insert the URL response data into it as well. Then convert the NSMutableDictionary into a new NSDictionary...
20,258,419
i want to delete files using batch script, the files which are older than 1 day, i want to set the date parameter in the script how can I do that? ``` for /F "tokens=1 delims=/ " %%a in ('DATE/T') do set dateDOW=%%a ``` this statemenet is setting the DATE parameter to 7 days ie. if today is wed it will remove files ...
2013/11/28
[ "https://Stackoverflow.com/questions/20258419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2782824/" ]
``` @echo off rem Number of days ago from where to start to delete files set "deleteFrom=7" forfiles /p "c:\somewhere" /m "*.log" /d -%deleteFrom% /c "cmd /c echo del @path" ``` Adapt as needed. When list of files is correct, remove `echo` to delete the files.
``` for %%a in (Text.txt) do set "FileDate=%%~ta" echo %FileDate% ``` enter `for /?` for help.
25,103,828
I have a modal box (a bootstrap modal). After the user has made a particular ajax request and the 'okay' comes back from the server I have it set to close the dialog after 1.5 seconds. `setInterval(function(){ $('#modalname').modal('hide'); },1500);` This works okay the first time but thereafter each time I open the...
2014/08/03
[ "https://Stackoverflow.com/questions/25103828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/273083/" ]
Use [`setTimeout()`](https://developer.mozilla.org/en/docs/Web/API/window.setTimeout) instead, as you need to execute it onetime, `setInterval()` will call the function after every interval of specified time, while `setTimeout()` only calls once: ``` setTimeout(function(){ $('#modalname').modal('hide'); ...
**[`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/Window.setInterval)** executes a function infinite amout of times every `n` milliseconds. You should use [**`setTimeout`**](https://developer.mozilla.org/en-US/docs/Web/API/Window.setTimeout): ``` setTimeout(function(){ $('#modalname').modal('hide')...
25,681,349
In my route I am trying to replace a value in whatever i get from the database before sending it to my view. In this case I am trying to replace a reference to a user, with the users username instead. But my console.log's just keep returning the value unchanged. ``` app.get('/message/inbox', function(req, res) { ...
2014/09/05
[ "https://Stackoverflow.com/questions/25681349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2545601/" ]
What gets returned from the find requests is a "mongoose document" which is actually quite complex and contains all the rules and methods from the associated schema. You cannot modify this outside of the constraints set on the schema. So despite the simple serialized form, the object is quite complex. What you want is...
*Solution by OP.* I just have to add a .lean() after the .find. This tells mongoose to pass the data as a javascript object instead of a MongooseDocument - [Scource](http://mongoosejs.com/docs/api.html#query_Query-lean) ``` app.get('/message/inbox', function(req, res) { var _id = req.user._id; var inbox = nul...
25,681,349
In my route I am trying to replace a value in whatever i get from the database before sending it to my view. In this case I am trying to replace a reference to a user, with the users username instead. But my console.log's just keep returning the value unchanged. ``` app.get('/message/inbox', function(req, res) { ...
2014/09/05
[ "https://Stackoverflow.com/questions/25681349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2545601/" ]
What gets returned from the find requests is a "mongoose document" which is actually quite complex and contains all the rules and methods from the associated schema. You cannot modify this outside of the constraints set on the schema. So despite the simple serialized form, the object is quite complex. What you want is...
``` /* you just need to add .lean() at the end of mongoose query where you want to change the object later stage. */ let forExample = aysnc (req, res, next ) => { let foundUser = await user.find({ organisationId: 10 }); // without lean foundUser.map(elem => { elem.userName = elem.name; delete elem; }); console.log...
25,681,349
In my route I am trying to replace a value in whatever i get from the database before sending it to my view. In this case I am trying to replace a reference to a user, with the users username instead. But my console.log's just keep returning the value unchanged. ``` app.get('/message/inbox', function(req, res) { ...
2014/09/05
[ "https://Stackoverflow.com/questions/25681349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2545601/" ]
*Solution by OP.* I just have to add a .lean() after the .find. This tells mongoose to pass the data as a javascript object instead of a MongooseDocument - [Scource](http://mongoosejs.com/docs/api.html#query_Query-lean) ``` app.get('/message/inbox', function(req, res) { var _id = req.user._id; var inbox = nul...
``` /* you just need to add .lean() at the end of mongoose query where you want to change the object later stage. */ let forExample = aysnc (req, res, next ) => { let foundUser = await user.find({ organisationId: 10 }); // without lean foundUser.map(elem => { elem.userName = elem.name; delete elem; }); console.log...
3,360,361
For PCI compliance, is there any recommended Encryption Key Management Software? Open source preferable, but commercial is ok too. Is there a tool or software that provides both?
2010/07/29
[ "https://Stackoverflow.com/questions/3360361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/77087/" ]
[ezNCrypt](http://www.gazzang.com/products/overview.html) looks like it may be useful, it promises TDE for MySql You could also consider using MS SQL 2008 to store the card data, then look into [Extensible Key Management](http://technet.microsoft.com/en-us/library/bb895340.aspx). There are a few EKM providers out ther...
[MyDiamo](http://www.mydiamo.com) is freeware for non-profit personal use, and commercial for another use. You can encrypt datas in MySQL. MyDiamo has developed under [Engine-Level Encryption](http://whatis.techtarget.com/definition/engine-level-encryption). It provides "transparent" installation and encryption. Than...
3,360,361
For PCI compliance, is there any recommended Encryption Key Management Software? Open source preferable, but commercial is ok too. Is there a tool or software that provides both?
2010/07/29
[ "https://Stackoverflow.com/questions/3360361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/77087/" ]
[ezNCrypt](http://www.gazzang.com/products/overview.html) looks like it may be useful, it promises TDE for MySql You could also consider using MS SQL 2008 to store the card data, then look into [Extensible Key Management](http://technet.microsoft.com/en-us/library/bb895340.aspx). There are a few EKM providers out ther...
I'm not going to pretend to answer the main question, but I would have thought that if the encryption is transparent, then that likely wouldn't address the usual concerns re PCI compliance. That is to say, the encryption of things like credit card data being highly opaque from the point of view of your application is t...
3,360,361
For PCI compliance, is there any recommended Encryption Key Management Software? Open source preferable, but commercial is ok too. Is there a tool or software that provides both?
2010/07/29
[ "https://Stackoverflow.com/questions/3360361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/77087/" ]
[MyDiamo](http://www.mydiamo.com) is freeware for non-profit personal use, and commercial for another use. You can encrypt datas in MySQL. MyDiamo has developed under [Engine-Level Encryption](http://whatis.techtarget.com/definition/engine-level-encryption). It provides "transparent" installation and encryption. Than...
I'm not going to pretend to answer the main question, but I would have thought that if the encryption is transparent, then that likely wouldn't address the usual concerns re PCI compliance. That is to say, the encryption of things like credit card data being highly opaque from the point of view of your application is t...
53,473,439
Here's the schema: [![enter image description here](https://i.stack.imgur.com/q0DVd.png)](https://i.stack.imgur.com/q0DVd.png) This works: [![This works](https://i.stack.imgur.com/q5iO6.png)](https://i.stack.imgur.com/q5iO6.png) However, when I add an ORDER BY clause, the Grand Total row moves from the bottom. I und...
2018/11/26
[ "https://Stackoverflow.com/questions/53473439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1169091/" ]
You can use multiple keys for the `order by`: ``` select coalesce(Genre, 'Grand Total'), sum(TotalUnits) as total_units_sold from album group by Rollup (Genre) order by (case when genre is null then 1 else 2 end) desc, genre; ```
If you see you are ordering by Column itself, and that value will remain null when you use roll up. ``` create table Album( Genre varchar(10), totalunits int) insert into Album values ('Pop', 100), ('Pop', 200), ('Pop', 300), ('Rock', 500), ('Rock', 1000), ('Rock', 1500) ``` If you run this query, you get th...
53,473,439
Here's the schema: [![enter image description here](https://i.stack.imgur.com/q0DVd.png)](https://i.stack.imgur.com/q0DVd.png) This works: [![This works](https://i.stack.imgur.com/q5iO6.png)](https://i.stack.imgur.com/q5iO6.png) However, when I add an ORDER BY clause, the Grand Total row moves from the bottom. I und...
2018/11/26
[ "https://Stackoverflow.com/questions/53473439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1169091/" ]
You can use multiple keys for the `order by`: ``` select coalesce(Genre, 'Grand Total'), sum(TotalUnits) as total_units_sold from album group by Rollup (Genre) order by (case when genre is null then 1 else 2 end) desc, genre; ```
The below should work by using Grouping() function in ORDER BY clause: ``` USE OtherFunctionsYouShouldKnow2060 SELECT COALESCE (Genre, 'GrandTotal') , Sum(TotalUnitsSold) as [Total Units Sold] FROM tAlbum GROUP BY ROLLUP(Genre) ORDER BY GROUPING(Genre),Genre; ```
3,468
I'd like to become a DJ, and to tell the truth, I also have made many tracks using Encore notation software. But, now that I want to bring it to reality, I don't know what instruments to purchase. A synthesizer? A DJ Booth? I even have no idea what are the names of those instruments. To become a guitarist, you need a...
2011/07/18
[ "https://music.stackexchange.com/questions/3468", "https://music.stackexchange.com", "https://music.stackexchange.com/users/925/" ]
You are really asking two different questions. Do you want to be a DJ or do you want to perform electronic music live? Those are different things. If you want to play other peoples' music and sit up in the booth at the club and get people dancing, then you need a DJ setup (technically, that's not a "booth" as the booth...
To become a DJ in 21st Century, you need 1. A laptop(preferably a MACbook). 2. Good collection of dance music. 3. basics of notes matching, beat matching and rhythmic tapping. 4. A good shout out voice for yelling "Put your hands in the air" OR "Everybody F\*\*\*\*\*G JUMP" 5. Knowledge about DJ equipment controls : ...
3,143
I'm planning to title a book "Taiwan Seek." The book is about starting a classified ads website in Taiwan. So I thought about short words that are related to classified ads: want, seek, looking for etc. I didn't want to use want because "Taiwan Want" sounds horrible. I wanted to have a word that is both verb and noun...
2011/06/20
[ "https://writers.stackexchange.com/questions/3143", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/1544/" ]
I see no reason for concern. The two words don't look the same, or even really sound the same. I don't see any reason anybody would get the two confused, certainly not on a scope that should worry you. Maybe if your novel gets turned into a multimillion dollar film, "Taiwan Sick" could be the title for the MAD Magazin...
"Seek" is only noun in highly technical senses. If someone said "Taiwan Seek" to me, I would think "Taiwan Sikh?" How about * Taiwanted * Taiwan Hunt * Taiwan Classified (I like the last because "classified" also means "secret" and so the title suggests *[LA Confidential](http://en.wikipedia.org/wiki/L.A._Confidenti...
3,143
I'm planning to title a book "Taiwan Seek." The book is about starting a classified ads website in Taiwan. So I thought about short words that are related to classified ads: want, seek, looking for etc. I didn't want to use want because "Taiwan Want" sounds horrible. I wanted to have a word that is both verb and noun...
2011/06/20
[ "https://writers.stackexchange.com/questions/3143", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/1544/" ]
I see no reason for concern. The two words don't look the same, or even really sound the same. I don't see any reason anybody would get the two confused, certainly not on a scope that should worry you. Maybe if your novel gets turned into a multimillion dollar film, "Taiwan Sick" could be the title for the MAD Magazin...
You may be confused because of accent: to native English speakers, *sick* and *seek* are very distinctive, and could not be confused, but to speakers of many other languages, these two vowels are difficult to distinguish. (See also, *ship* and *sheep*, *shit* and *sheet*, *bitch* and *beech*.) If your book is targeting...
3,143
I'm planning to title a book "Taiwan Seek." The book is about starting a classified ads website in Taiwan. So I thought about short words that are related to classified ads: want, seek, looking for etc. I didn't want to use want because "Taiwan Want" sounds horrible. I wanted to have a word that is both verb and noun...
2011/06/20
[ "https://writers.stackexchange.com/questions/3143", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/1544/" ]
"Seek" is only noun in highly technical senses. If someone said "Taiwan Seek" to me, I would think "Taiwan Sikh?" How about * Taiwanted * Taiwan Hunt * Taiwan Classified (I like the last because "classified" also means "secret" and so the title suggests *[LA Confidential](http://en.wikipedia.org/wiki/L.A._Confidenti...
You may be confused because of accent: to native English speakers, *sick* and *seek* are very distinctive, and could not be confused, but to speakers of many other languages, these two vowels are difficult to distinguish. (See also, *ship* and *sheep*, *shit* and *sheet*, *bitch* and *beech*.) If your book is targeting...
90
One Apple.SE we now have at least 13 list/poll style questions. These questions will always be "unanswered" and cause a bit of strife over how to deal with them as sites mature. Should we be allowing list style questions on Apple.SE? ### Pros * Information that can not easily be gleaned from a Google search can be ea...
2010/09/08
[ "https://apple.meta.stackexchange.com/questions/90", "https://apple.meta.stackexchange.com", "https://apple.meta.stackexchange.com/users/17/" ]
I recommend reading [Aaronut's answer to the One 'Item' Policy on Meta.Cooking](https://cooking.meta.stackexchange.com/questions/730/one-item-per-answer-policy/733#733) as he states my position much more eloquently than I ever could. If I were not a moderator (as moderators have a binding vote) I would cast a close vot...
While I agree that there are several poll questions that are considered useful on every SE-site, the vast majority of the poll questions being asked end up being: * poorly maintained * consisting of many answers that are basically just a link or a one-liner naming the application (or subject at hand) * popularity cont...
90
One Apple.SE we now have at least 13 list/poll style questions. These questions will always be "unanswered" and cause a bit of strife over how to deal with them as sites mature. Should we be allowing list style questions on Apple.SE? ### Pros * Information that can not easily be gleaned from a Google search can be ea...
2010/09/08
[ "https://apple.meta.stackexchange.com/questions/90", "https://apple.meta.stackexchange.com", "https://apple.meta.stackexchange.com/users/17/" ]
Right, my basic opinion is this: **Polls are fine, as long as they are on-topic, clearly formulated and a couple of simple rules are in place.** Those simple rules would be something like: * One item (application, plugin, whatever) per answer * No duplicates * Uniform formatting (not as important, but it *can* make ...
While I agree that there are several poll questions that are considered useful on every SE-site, the vast majority of the poll questions being asked end up being: * poorly maintained * consisting of many answers that are basically just a link or a one-liner naming the application (or subject at hand) * popularity cont...
166,469
I have created a Content Type called "Happy Days". I have created a field in that called "subtitle". In my template "page--happy-days.tpl.php", I want the field "subtitle" to show wrapped in an tag. I attempted: ``` <h2><?php print render($content['field_subtitle']); ?></h2> ``` but no luck. Any help would be appr...
2015/07/23
[ "https://drupal.stackexchange.com/questions/166469", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/34670/" ]
I assume you cleared the cache. Your issue is [page--content-type.tpl.php override not working](https://www.drupal.org/node/1124036). Try to suggest theme hook in `THEME_preprocess_node`. Furthermore you need to theme nodes of `Happy Day` content type, so you must use `node--CONTENT_TYPE.tpl.php`. For more information...
You can use [Fences](https://www.drupal.org/project/fences) module to change wrapping tags for fields > > Fences is a an easy-to-use tool to specify an HTML element for each field. This element choice will propagate everywhere the field is used, such as teasers, RSS feeds and Views. You don't have to keep re-configur...
166,469
I have created a Content Type called "Happy Days". I have created a field in that called "subtitle". In my template "page--happy-days.tpl.php", I want the field "subtitle" to show wrapped in an tag. I attempted: ``` <h2><?php print render($content['field_subtitle']); ?></h2> ``` but no luck. Any help would be appr...
2015/07/23
[ "https://drupal.stackexchange.com/questions/166469", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/34670/" ]
I assume you cleared the cache. Your issue is [page--content-type.tpl.php override not working](https://www.drupal.org/node/1124036). Try to suggest theme hook in `THEME_preprocess_node`. Furthermore you need to theme nodes of `Happy Day` content type, so you must use `node--CONTENT_TYPE.tpl.php`. For more information...
you can check specific path of field using devel using dsm(\*\*\*\*\*\*\*\*\*['field\_subtitle']); or check this link <https://www.drupal.org/node/316688>
166,469
I have created a Content Type called "Happy Days". I have created a field in that called "subtitle". In my template "page--happy-days.tpl.php", I want the field "subtitle" to show wrapped in an tag. I attempted: ``` <h2><?php print render($content['field_subtitle']); ?></h2> ``` but no luck. Any help would be appr...
2015/07/23
[ "https://drupal.stackexchange.com/questions/166469", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/34670/" ]
I think your problem is that you are using **render()** function. This function provides output with already assigned style. So that's why you can't see your changes.
You can use [Fences](https://www.drupal.org/project/fences) module to change wrapping tags for fields > > Fences is a an easy-to-use tool to specify an HTML element for each field. This element choice will propagate everywhere the field is used, such as teasers, RSS feeds and Views. You don't have to keep re-configur...
166,469
I have created a Content Type called "Happy Days". I have created a field in that called "subtitle". In my template "page--happy-days.tpl.php", I want the field "subtitle" to show wrapped in an tag. I attempted: ``` <h2><?php print render($content['field_subtitle']); ?></h2> ``` but no luck. Any help would be appr...
2015/07/23
[ "https://drupal.stackexchange.com/questions/166469", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/34670/" ]
I think your problem is that you are using **render()** function. This function provides output with already assigned style. So that's why you can't see your changes.
you can check specific path of field using devel using dsm(\*\*\*\*\*\*\*\*\*['field\_subtitle']); or check this link <https://www.drupal.org/node/316688>
208,325
I need a way to automate test orders on our test and production web sites. I was thinking about using something like iMacro, but I thought there must be a better way. Any ideas?
2008/10/16
[ "https://Stackoverflow.com/questions/208325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13053/" ]
Another good FF add-in is [Selenium IDE](https://addons.mozilla.org/en-US/firefox/addon/2079) which seems a bit more feature rich than the add-in for iMacros. There are extended editions ([Selenium](http://selenium.openqa.org/),[iMacros](http://www.iopus.com/)) that you can pay for that include command line scripting, ...
Without knowing what kind of "order" you're talking about, it's really impossible to say. I suspect that you don't *really* want to be creating test orders on a production system though.
296,019
The Witcher, the first in the series, includes a dice minigame, and after playing a few games against *professional* players, I have doubts about the neutrality of the computer. I suspect the dice throws are in favour of the NPC: the higher his rank, the better his dice throws... maybe it's a negativity bias, I did fou...
2016/12/28
[ "https://gaming.stackexchange.com/questions/296019", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/175119/" ]
According to this [wikia page on Dice Poker](http://witcher.wikia.com/wiki/Dice_poker_in_The_Witcher), higher level players *do* have better "luck": > > This may be a 'game of chance' in theory, but in reality some players are inherently 'luckier' than others, including yourself. **What this means is that as Geralt m...
It appears many other players believe that the NPCs are cheating, and it certainly seems that way in the game. [This Wiki](http://witcher.wikia.com/wiki/Dice_poker_in_The_Witcher) states that they are luckier: > > This may be a 'game of chance' in theory, but in reality some players are inherently 'luckier' than othe...
68,836
I cut out a section of drywall to do a repair to the exterior of my house and now need to put the piece I cut out back in. How can I do this without having a raised edge where the tape is?
2015/07/06
[ "https://diy.stackexchange.com/questions/68836", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/3300/" ]
Like any other drywall patch - there IS a raised area where the tape is. But you feather compound out 6-12" and there is no NOTICEABLE raised area, as the deviation from "exactly flat" is too small for the eye to see. Tape with a 4" knife. Re-coat with an 8" knife. Finish with a 12" knife.
After the repair section has dried, apply a thin coat of mud over it. Now get a wet sponge and pat over the wet mud. This will remove any seams and make it look like it blends in better. Good luck! Let us know what you ultimately use that worked for you.
34,516
Our Intertel phone system uses an unusual wiring scheme at the phone by using the outer pair (pins 2 and 5) of wires on a phone jack. I am looking for anyone that knows of a vendor that sells 24 port patch panels that have 25 pair Amphenol connectors on the back wired to the outer pair of pins on an 8P2C jack on the f...
2009/07/01
[ "https://serverfault.com/questions/34516", "https://serverfault.com", "https://serverfault.com/users/3657/" ]
Try [BlackBox](http://www.blackbox.com) I've used them to make custom cables in the past. If they don't have teh patch panel you need, I'd expect that they can make them. Their sales engineers seem to know the products they sell.
You can order a customer panel from many vendors, or buy a punch tool and switch them yourself. 24 ports would take you about 30 mins.
6,269,701
I'm using a contrib drupal module that hooks into a form. Its presence appears to cause the jquery to render unreasonably slowly, but I'm not entirely sure about that.. I want to do some advanced troubleshooting on it, and I'm looking for a tool like xdebug that will give me an output file that I can view with KCacheGr...
2011/06/07
[ "https://Stackoverflow.com/questions/6269701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151841/" ]
In Firebug, click the "Net" tab. It lists every element it requests from the server, and detailed connection and load information (on hover) with a nice graphic display without hover. Update ------ In addition, if actual page load isn't the issue, and you are indeed trying to profile Javascript, the Firebug "Console"...
The chrome developer tools has a javascript profiler, that will profile all of the function calls on your page. The timeline feature (might only be in beta/dev versions) will show how much time the browser spends on various operations (layout and rendering for example) operations. I believe that firebug also has a JS ...
6,269,701
I'm using a contrib drupal module that hooks into a form. Its presence appears to cause the jquery to render unreasonably slowly, but I'm not entirely sure about that.. I want to do some advanced troubleshooting on it, and I'm looking for a tool like xdebug that will give me an output file that I can view with KCacheGr...
2011/06/07
[ "https://Stackoverflow.com/questions/6269701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151841/" ]
In Firebug, click the "Net" tab. It lists every element it requests from the server, and detailed connection and load information (on hover) with a nice graphic display without hover. Update ------ In addition, if actual page load isn't the issue, and you are indeed trying to profile Javascript, the Firebug "Console"...
There is a profiler in firebug in the console tab. Click once to start and second to stop the profiler. Chrome has also a profiler press ⌘⌥j. There is also a good profiling tool for internet explorer: [dynaTrace ajax editon](http://ajax.dynatrace.com/ajax/en/). Btw. most of the time jquery is slow depends on wrong us...
41,518
I'm making a *free* computer game based on Star Trek. It'll reference a few characters from the show, along with the Enterprise. My understanding is by using character names from the show, I risk infringing on existing trademarks. Can I mitigate that risk by adding a line indicating "Star Trek and its characters are ...
2019/05/28
[ "https://law.stackexchange.com/questions/41518", "https://law.stackexchange.com", "https://law.stackexchange.com/users/25918/" ]
Such a disclaimer can be effective in some cases. If there is a passing reference to Captain Kirk or Commander Data in a game that is not focused on Star-Trek, for example. That would be a case of *Nominative use* where one uses a trademark to refer to the trade-marked thing, but is clear that there is no affiliation o...
No, it is there copyright or trademark no matter what you say or put in the game.
41,518
I'm making a *free* computer game based on Star Trek. It'll reference a few characters from the show, along with the Enterprise. My understanding is by using character names from the show, I risk infringing on existing trademarks. Can I mitigate that risk by adding a line indicating "Star Trek and its characters are ...
2019/05/28
[ "https://law.stackexchange.com/questions/41518", "https://law.stackexchange.com", "https://law.stackexchange.com/users/25918/" ]
Negotiate a licence ------------------- Of course, your chance of doing so are not good - computer game companies routinely pay millions to use trademarks like this (and they usually get exclusive rights) and that’s probably out of your price range. Stopping you doing what you want to do without paying for the privil...
No, it is there copyright or trademark no matter what you say or put in the game.
41,518
I'm making a *free* computer game based on Star Trek. It'll reference a few characters from the show, along with the Enterprise. My understanding is by using character names from the show, I risk infringing on existing trademarks. Can I mitigate that risk by adding a line indicating "Star Trek and its characters are ...
2019/05/28
[ "https://law.stackexchange.com/questions/41518", "https://law.stackexchange.com", "https://law.stackexchange.com/users/25918/" ]
Such a disclaimer can be effective in some cases. If there is a passing reference to Captain Kirk or Commander Data in a game that is not focused on Star-Trek, for example. That would be a case of *Nominative use* where one uses a trademark to refer to the trade-marked thing, but is clear that there is no affiliation o...
Don't make people pay for it. It's a labor of love and CBS won't go after free distributions of unauthorized work. That's not to say can't go after it, as the IP holders, they would be well within their right... but because you're not making money, any winning won't be paid because you got no money to pay, to say nothi...
41,518
I'm making a *free* computer game based on Star Trek. It'll reference a few characters from the show, along with the Enterprise. My understanding is by using character names from the show, I risk infringing on existing trademarks. Can I mitigate that risk by adding a line indicating "Star Trek and its characters are ...
2019/05/28
[ "https://law.stackexchange.com/questions/41518", "https://law.stackexchange.com", "https://law.stackexchange.com/users/25918/" ]
Negotiate a licence ------------------- Of course, your chance of doing so are not good - computer game companies routinely pay millions to use trademarks like this (and they usually get exclusive rights) and that’s probably out of your price range. Stopping you doing what you want to do without paying for the privil...
Such a disclaimer can be effective in some cases. If there is a passing reference to Captain Kirk or Commander Data in a game that is not focused on Star-Trek, for example. That would be a case of *Nominative use* where one uses a trademark to refer to the trade-marked thing, but is clear that there is no affiliation o...
41,518
I'm making a *free* computer game based on Star Trek. It'll reference a few characters from the show, along with the Enterprise. My understanding is by using character names from the show, I risk infringing on existing trademarks. Can I mitigate that risk by adding a line indicating "Star Trek and its characters are ...
2019/05/28
[ "https://law.stackexchange.com/questions/41518", "https://law.stackexchange.com", "https://law.stackexchange.com/users/25918/" ]
Negotiate a licence ------------------- Of course, your chance of doing so are not good - computer game companies routinely pay millions to use trademarks like this (and they usually get exclusive rights) and that’s probably out of your price range. Stopping you doing what you want to do without paying for the privil...
Don't make people pay for it. It's a labor of love and CBS won't go after free distributions of unauthorized work. That's not to say can't go after it, as the IP holders, they would be well within their right... but because you're not making money, any winning won't be paid because you got no money to pay, to say nothi...
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
I read through Ron Conte's blog post and find it sloppy and unscholarly. He makes the (correct) point that Fr. Z's proposed translation sounds literal and stinted and, almost in the same words, asks us to use his translation even though it makes no grammatical sense, because he has translated many things. It does not h...
I think the best way to translate this into sensible English is: “So then Jesus saw the publican, and because he looked upon him with mercy and yet was choosing him, said to him, ‘Follow me’…”
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
I read through Ron Conte's blog post and find it sloppy and unscholarly. He makes the (correct) point that Fr. Z's proposed translation sounds literal and stinted and, almost in the same words, asks us to use his translation even though it makes no grammatical sense, because he has translated many things. It does not h...
(I am posting my previous comment here in part because I hope this will help, in some small way, to get this site past the beta stage. However, I do not think my comments deserve a bounty.) Fr. Z seems correct to me: the ablative gerund, which can come close to being a mere present participle, usually expresses an abl...
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
Fortunately, there is a straightforward answer. In medieval Latin, the ablative gerund often communicates manner. The result is not so different from a participle or even an adverb or adverbial phrase. For example, you will read that someone is doing something "flendo." This doesn't mean "by means of weeping," it just ...
FWIW, Pope Francis spoke about this recently (in [an article translated into English by five independent experts](http://www.americamagazine.org/faith/2013/09/30/big-heart-open-god-interview-pope-francis)): > > "I always felt my motto, Miserando atque Eligendo [By Having Mercy and by Choosing Him], was very true for ...
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
I see it as an ablative gerundive expressing cause, followed by the result (…“he said to him, ‘Follow me.’”). Also it seems to me that “atque” has more of the sense of “and yet” or, less strongly, “and also,” rather than just “and.”
I think the best way to translate this into sensible English is: “So then Jesus saw the publican, and because he looked upon him with mercy and yet was choosing him, said to him, ‘Follow me’…”
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
FWIW, Pope Francis spoke about this recently (in [an article translated into English by five independent experts](http://www.americamagazine.org/faith/2013/09/30/big-heart-open-god-interview-pope-francis)): > > "I always felt my motto, Miserando atque Eligendo [By Having Mercy and by Choosing Him], was very true for ...
I think the best way to translate this into sensible English is: “So then Jesus saw the publican, and because he looked upon him with mercy and yet was choosing him, said to him, ‘Follow me’…”
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
I read through Ron Conte's blog post and find it sloppy and unscholarly. He makes the (correct) point that Fr. Z's proposed translation sounds literal and stinted and, almost in the same words, asks us to use his translation even though it makes no grammatical sense, because he has translated many things. It does not h...
A lot of people have said this already, but please let me say it again, this time quoting E. C. Woodcock, "A New Latin Syntax", Paragraph 209: > > A gerund in the instrumental ablative is sometimes used so vaguely that it is almost equivalent to a present participle in agreement with the subject. > > > The exam...
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
(I am posting my previous comment here in part because I hope this will help, in some small way, to get this site past the beta stage. However, I do not think my comments deserve a bounty.) Fr. Z seems correct to me: the ablative gerund, which can come close to being a mere present participle, usually expresses an abl...
I think the best way to translate this into sensible English is: “So then Jesus saw the publican, and because he looked upon him with mercy and yet was choosing him, said to him, ‘Follow me’…”
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
Fortunately, there is a straightforward answer. In medieval Latin, the ablative gerund often communicates manner. The result is not so different from a participle or even an adverb or adverbial phrase. For example, you will read that someone is doing something "flendo." This doesn't mean "by means of weeping," it just ...
I think the best way to translate this into sensible English is: “So then Jesus saw the publican, and because he looked upon him with mercy and yet was choosing him, said to him, ‘Follow me’…”
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
A lot of people have said this already, but please let me say it again, this time quoting E. C. Woodcock, "A New Latin Syntax", Paragraph 209: > > A gerund in the instrumental ablative is sometimes used so vaguely that it is almost equivalent to a present participle in agreement with the subject. > > > The exam...
I see it as an ablative gerundive expressing cause, followed by the result (…“he said to him, ‘Follow me.’”). Also it seems to me that “atque” has more of the sense of “and yet” or, less strongly, “and also,” rather than just “and.”
448
There seem to be two schools of thought about the meaning of the motto on Pope Francis's coat of arms: > > miserando atque eligendo > > > These words are taken from the [21st homily of the Venerable Bede](https://books.google.com/books?id=MYZPAAAAYAAJ&pg=PA221&dq=bede+homilies+%22miserando+atque+eligendo%22&hl=en...
2016/03/07
[ "https://latin.stackexchange.com/questions/448", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/118/" ]
Fortunately, there is a straightforward answer. In medieval Latin, the ablative gerund often communicates manner. The result is not so different from a participle or even an adverb or adverbial phrase. For example, you will read that someone is doing something "flendo." This doesn't mean "by means of weeping," it just ...
I see it as an ablative gerundive expressing cause, followed by the result (…“he said to him, ‘Follow me.’”). Also it seems to me that “atque” has more of the sense of “and yet” or, less strongly, “and also,” rather than just “and.”
23,799,655
In our team we currently use vagrant as a development environment. Now I want to replace it with docker, but I can't understand the team workflow with it. This is what confuses me: with vagrant I create a project repo with a *Vagrantfile* in it, and every developer pulls a repo and runs *vagrant up*. If the project ne...
2014/05/22
[ "https://Stackoverflow.com/questions/23799655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985867/" ]
Docker is more for production as for development ================================================ Docker is a deployment tool to package apps for production (or tests environments). It is not so much a tool for development. It is meant to create an isolated environment to run your already developed application somewhe...
I work for Docker. Think of Docker (and the Docker index/registry) as equivalent to Git. You don't have to make this very hard. If you change a Dockerfile, it is a cheap and quick operation to update an image. If you use "Trusted Builds" in our registry, then you can have it build automatically off of any branch at an...
44,507,740
We have an API where, if i enroll some data it will reflect in mainframe system, i need to validate few details using selenium testNG framework..Could anyone help me on this?
2017/06/12
[ "https://Stackoverflow.com/questions/44507740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8150998/" ]
It is possible to do this.you will have create different configuration for different datasources. This link has good examples on that <http://www.baeldung.com/spring-data-jpa-multiple-databases> Another useful stackoverflow question: [Spring Boot Configure and Use Two DataSources](https://stackoverflow.com/questions/3...
I also faced the same kind of problem once. I had to connect my spring boot application to two different databases. One was Mongo db and other was Postgres db. You can see that i have used both JPA as well as spring-boot-starter-data-mongodb. Still my project is running absolutely fine.Hope for you also it work succes...
44,507,740
We have an API where, if i enroll some data it will reflect in mainframe system, i need to validate few details using selenium testNG framework..Could anyone help me on this?
2017/06/12
[ "https://Stackoverflow.com/questions/44507740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8150998/" ]
It is possible to do this.you will have create different configuration for different datasources. This link has good examples on that <http://www.baeldung.com/spring-data-jpa-multiple-databases> Another useful stackoverflow question: [Spring Boot Configure and Use Two DataSources](https://stackoverflow.com/questions/3...
You really don't need to make additional config and property files because MongoDB has different property names than sql so all you will need is an application.properties file application.properties ``` spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/dbName?useUnicode=yes&characterEncoding=UTF-8 sprin...
44,507,740
We have an API where, if i enroll some data it will reflect in mainframe system, i need to validate few details using selenium testNG framework..Could anyone help me on this?
2017/06/12
[ "https://Stackoverflow.com/questions/44507740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8150998/" ]
You really don't need to make additional config and property files because MongoDB has different property names than sql so all you will need is an application.properties file application.properties ``` spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/dbName?useUnicode=yes&characterEncoding=UTF-8 sprin...
I also faced the same kind of problem once. I had to connect my spring boot application to two different databases. One was Mongo db and other was Postgres db. You can see that i have used both JPA as well as spring-boot-starter-data-mongodb. Still my project is running absolutely fine.Hope for you also it work succes...
50,986,868
After I uploaded a new app on playstore on every device when i download the app first time it crashes and second time onwards it works fine. Please find below for crash report and build. gradle. My all dependencies listed in gradel file. ``` java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/g...
2018/06/22
[ "https://Stackoverflow.com/questions/50986868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1391158/" ]
The mutation is called once when inserting the new persons. The getter is most likely called often. That's why i would put the transformation in the mutation.
If I must choice, that's be the mutation but I think the best way, because your store is dependant of your api. You can map the response of the API to your Person like that your mutation already has a Person object. With Promise: ``` myPromise.then(res => ({ res.name, lastName: res.last_name })) ``` With Rxjs: ``...
50,986,868
After I uploaded a new app on playstore on every device when i download the app first time it crashes and second time onwards it works fine. Please find below for crash report and build. gradle. My all dependencies listed in gradel file. ``` java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/g...
2018/06/22
[ "https://Stackoverflow.com/questions/50986868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1391158/" ]
The mutation is called once when inserting the new persons. The getter is most likely called often. That's why i would put the transformation in the mutation.
As you are using Response, you should use mutation. As it doesn't depends on any store properties. Getters are those which depends on another store property and when the store property changes, getters changes automatically. So, if your property have the dependencies to other properties of your store, then it is alwa...
16,538,315
I was unable to find an answer to this situation that I have stumbled uppon this morning. I have declared some php variables as I usually do in javascript (by mistake). I was surprised that the code actually worked. I have tested it under Linux and it works fine. Under WAMP on Windows does not work. **The code:** ```...
2013/05/14
[ "https://Stackoverflow.com/questions/16538315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1057527/" ]
PHP 5.4.0 offers a wide range of new features: [Read more](http://php.net/manual/en/migration54.new-features.php) Short array syntax has been added, e.g. ``` $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4]; ``` Above syntax is not supported below versions than 5.4.0. According to m...
The `[]` syntax is valid only in **PHP 5.4 or newer**, check your PHP version on windows.
16,538,315
I was unable to find an answer to this situation that I have stumbled uppon this morning. I have declared some php variables as I usually do in javascript (by mistake). I was surprised that the code actually worked. I have tested it under Linux and it works fine. Under WAMP on Windows does not work. **The code:** ```...
2013/05/14
[ "https://Stackoverflow.com/questions/16538315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1057527/" ]
The `[]` syntax is valid only in **PHP 5.4 or newer**, check your PHP version on windows.
You should check the PHP Version on both your Linux and Windows machines. I suspect that your Linux has PHP 5.4+ and Windows has PHP 5.3.x or lower. I suggest you use `array()` instead of the short array syntax `[]` which is only valid in 5.4.
16,538,315
I was unable to find an answer to this situation that I have stumbled uppon this morning. I have declared some php variables as I usually do in javascript (by mistake). I was surprised that the code actually worked. I have tested it under Linux and it works fine. Under WAMP on Windows does not work. **The code:** ```...
2013/05/14
[ "https://Stackoverflow.com/questions/16538315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1057527/" ]
PHP 5.4.0 offers a wide range of new features: [Read more](http://php.net/manual/en/migration54.new-features.php) Short array syntax has been added, e.g. ``` $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4]; ``` Above syntax is not supported below versions than 5.4.0. According to m...
You should check the PHP Version on both your Linux and Windows machines. I suspect that your Linux has PHP 5.4+ and Windows has PHP 5.3.x or lower. I suggest you use `array()` instead of the short array syntax `[]` which is only valid in 5.4.
49,694,662
I have a 2D Boolean array array and I am looking to count the number of false remaining after applying a rule with respect to where a row or column has a true. If a row or column has a true value then I need to reduce the count of the number of false occurrences in the 2D array by the row and column in which the true...
2018/04/06
[ "https://Stackoverflow.com/questions/49694662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4862640/" ]
You can just do two passes, first part to find out which rows and columns are banned, second pass to count: ``` boolean[] bannedRows = new boolean[n]; boolean[] bannedColumns = new boolean[n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (matrix[i][j]) { bannedRows[i] = true; banned...
You could use an array of booleans to keep track of columns. I believe your code will run into the problem you stated when there is more than one true in a column of your matrix. The array would have the same size as your columns, and when you run into a true, set the value in the array to true. So this way, once you r...
43,258,943
I'm having an issue in R where I can run an ifelse statement on elements in a list, but as soon as I place the ifelse statement within the lapply function, it no longer works. Here's my example. I'm working with a list of three dataframes: ``` > dflist [[1]] ID1 tID1 1 m1 1 2 m2 2 3 m3 3 4 m4 4 5 ...
2017/04/06
[ "https://Stackoverflow.com/questions/43258943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7822231/" ]
If we need to return either "ODD" or dataset, then use `if/else` ``` lapply(dflist, function(x) if(nrow(x)%%2==1) "ODD" else x) ``` ### data ``` dflist <- list(data.frame(col1 = 1:3, col2=4:6), data.frame(col1=1:4, col2=5:8)) ```
When you use lapply, you then just reference the parameter of the anonymous function, rather than your original list name. So instead of doing: ``` lapply(dflist, function(x) ifelse(nrow(dflist[[x]])%%2==!0, "ODD", dflist[x])) ``` You just need to change to reference the list items you are putting in the function...
52,290,414
I have a column in dataTable with blank rows ``` Column1 A B C D E ``` I need to set if exist and to avoid adding, but blank rows should not be counted. Only rows with data should be in the (if exists). Thanks ``` bool exists = dt.Select().ToList().Exists(row => row["column1"].ToString() == txtbox) if(exists ==...
2018/09/12
[ "https://Stackoverflow.com/questions/52290414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9427165/" ]
``` var lignesNonContainEmptyString = dt.Select() .Where(row => row["column1"] != null && row["column1"].ToString() == txtbox && !string.IsNullOrEmpty(row["column1"].ToString())) bool exists = lignes.Count() != 0; ``` OR ``` bool e...
this code can help you ``` from a in list where ( Column1 != null || Column1 != "") && Column1 == searchfield select a ```
52,290,414
I have a column in dataTable with blank rows ``` Column1 A B C D E ``` I need to set if exist and to avoid adding, but blank rows should not be counted. Only rows with data should be in the (if exists). Thanks ``` bool exists = dt.Select().ToList().Exists(row => row["column1"].ToString() == txtbox) if(exists ==...
2018/09/12
[ "https://Stackoverflow.com/questions/52290414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9427165/" ]
You would like to return `false` if the textbox is empty, so add the condition for the textbox. ``` bool exists = !string.IsNullOrWhiteSpace(txtbox) && dt.Select().ToList() .Exists(row => row["column1"].ToString() == txtbox) ``` By the way, instead of using `.Select().ToList()`, you ...
this code can help you ``` from a in list where ( Column1 != null || Column1 != "") && Column1 == searchfield select a ```
52,290,414
I have a column in dataTable with blank rows ``` Column1 A B C D E ``` I need to set if exist and to avoid adding, but blank rows should not be counted. Only rows with data should be in the (if exists). Thanks ``` bool exists = dt.Select().ToList().Exists(row => row["column1"].ToString() == txtbox) if(exists ==...
2018/09/12
[ "https://Stackoverflow.com/questions/52290414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9427165/" ]
``` var lignesNonContainEmptyString = dt.Select() .Where(row => row["column1"] != null && row["column1"].ToString() == txtbox && !string.IsNullOrEmpty(row["column1"].ToString())) bool exists = lignes.Count() != 0; ``` OR ``` bool e...
How about this: non linq way ``` bool DataTableNonEmptyCount() { int count =0; foreach (DataColumn col in row.Table.Columns) if (!row.IsNull(col)) count ++; return count; } ``` This will return a count of all non null row in column.
52,290,414
I have a column in dataTable with blank rows ``` Column1 A B C D E ``` I need to set if exist and to avoid adding, but blank rows should not be counted. Only rows with data should be in the (if exists). Thanks ``` bool exists = dt.Select().ToList().Exists(row => row["column1"].ToString() == txtbox) if(exists ==...
2018/09/12
[ "https://Stackoverflow.com/questions/52290414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9427165/" ]
``` var lignesNonContainEmptyString = dt.Select() .Where(row => row["column1"] != null && row["column1"].ToString() == txtbox && !string.IsNullOrEmpty(row["column1"].ToString())) bool exists = lignes.Count() != 0; ``` OR ``` bool e...
You would like to return `false` if the textbox is empty, so add the condition for the textbox. ``` bool exists = !string.IsNullOrWhiteSpace(txtbox) && dt.Select().ToList() .Exists(row => row["column1"].ToString() == txtbox) ``` By the way, instead of using `.Select().ToList()`, you ...
52,290,414
I have a column in dataTable with blank rows ``` Column1 A B C D E ``` I need to set if exist and to avoid adding, but blank rows should not be counted. Only rows with data should be in the (if exists). Thanks ``` bool exists = dt.Select().ToList().Exists(row => row["column1"].ToString() == txtbox) if(exists ==...
2018/09/12
[ "https://Stackoverflow.com/questions/52290414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9427165/" ]
``` var lignesNonContainEmptyString = dt.Select() .Where(row => row["column1"] != null && row["column1"].ToString() == txtbox && !string.IsNullOrEmpty(row["column1"].ToString())) bool exists = lignes.Count() != 0; ``` OR ``` bool e...
Based on Thierry's [answer](https://stackoverflow.com/a/52290576/6560478), you can also use the [Any(predicate) syntax](https://msdn.microsoft.com/fr-fr/library/bb534972(v=vs.110).aspx): ``` var existsLineWithoutEmptyString = dt.AsEnumerable() .Any(row => row["column1"] != null ...
52,290,414
I have a column in dataTable with blank rows ``` Column1 A B C D E ``` I need to set if exist and to avoid adding, but blank rows should not be counted. Only rows with data should be in the (if exists). Thanks ``` bool exists = dt.Select().ToList().Exists(row => row["column1"].ToString() == txtbox) if(exists ==...
2018/09/12
[ "https://Stackoverflow.com/questions/52290414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9427165/" ]
You would like to return `false` if the textbox is empty, so add the condition for the textbox. ``` bool exists = !string.IsNullOrWhiteSpace(txtbox) && dt.Select().ToList() .Exists(row => row["column1"].ToString() == txtbox) ``` By the way, instead of using `.Select().ToList()`, you ...
How about this: non linq way ``` bool DataTableNonEmptyCount() { int count =0; foreach (DataColumn col in row.Table.Columns) if (!row.IsNull(col)) count ++; return count; } ``` This will return a count of all non null row in column.
52,290,414
I have a column in dataTable with blank rows ``` Column1 A B C D E ``` I need to set if exist and to avoid adding, but blank rows should not be counted. Only rows with data should be in the (if exists). Thanks ``` bool exists = dt.Select().ToList().Exists(row => row["column1"].ToString() == txtbox) if(exists ==...
2018/09/12
[ "https://Stackoverflow.com/questions/52290414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9427165/" ]
You would like to return `false` if the textbox is empty, so add the condition for the textbox. ``` bool exists = !string.IsNullOrWhiteSpace(txtbox) && dt.Select().ToList() .Exists(row => row["column1"].ToString() == txtbox) ``` By the way, instead of using `.Select().ToList()`, you ...
Based on Thierry's [answer](https://stackoverflow.com/a/52290576/6560478), you can also use the [Any(predicate) syntax](https://msdn.microsoft.com/fr-fr/library/bb534972(v=vs.110).aspx): ``` var existsLineWithoutEmptyString = dt.AsEnumerable() .Any(row => row["column1"] != null ...
45,401,786
I'm trying to move my files into htdocs folder of an apache image. Her's what my dockerfile looks like: ``` FROM httpd:2.4 MAINTAINER Ankit COPY ./public-html/ /usr/local/apache2/htdocs/ ``` But the COPY command is not copying the files into the container. Here's the output - index.html is there by default, what I'm...
2017/07/30
[ "https://Stackoverflow.com/questions/45401786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2367514/" ]
If you are trying to copy the directory `public-html` into the directory `/usr/local/apache2/htdocs` to have an `.../htdocs/public-html/` directory, then use the following: ``` COPY public-html/ /usr/local/apache2/htdocs/public-html/ ``` By default, copying a directory will copy the contents of that directory, so yo...
Before you can `COPY` files to different directories other than root, you have to create them. Update your Dockerfile to the following ``` FROM httpd:2.4 MAINTAINER Ankit MKDIR -p /usr/local/apache2/htdocs/ # Create the directory with '-p' option. COPY ./public-html/ /usr/local/apache2/htdocs/ ``` Edit 1 Based ...
24,710,444
I have this PHP: ``` function getList() { $sql = " SELECT * FROM list "; try { $db = getConnection(); $stmt = $db->query($sql); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); echo json_encode(array('result' => $result)); $db = null; } catch(PDOException $e)...
2014/07/12
[ "https://Stackoverflow.com/questions/24710444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1535655/" ]
As I said,there is no `smallint` that supports **Rails 3**.You should be using `integer datatype` with `limit of 2 bytes` to make it as `smallint`. For a list of available **Rails 3 datatypes**,see this **[SO](https://stackoverflow.com/questions/4685009/rails-3-datatypes)** Post. This command will give you what you w...
The way of adding PostgreSQL `smallint` data type in Rails 6, 5, and 4 is still the same, an integer data type with limit 2. ``` class AddColumnNameToTableName < ActiveRecord::Migration[6.0] def change add_column :table_name, :column_name, :integer, limit: 2 end end ``` `# => column_name smallint`.
5,577,591
I have a `button` (view state enabled) in Master web page and set it to `visible=false` in one of the child web pages. If a second child page is opened, the button state (`visible=false)` is not persisting. It seems **viewstate** is only valid for one page and is not transferred to other web pages. Is there some kind...
2011/04/07
[ "https://Stackoverflow.com/questions/5577591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/281014/" ]
No, viewstate is page specific. You will need to use something like a session variable or a querystring parameter to pass your state between pages.
No, You cannot make view state global, they are page specific. I would suggest to use cookies if you really want to make it client side otherwise you can use session.
5,577,591
I have a `button` (view state enabled) in Master web page and set it to `visible=false` in one of the child web pages. If a second child page is opened, the button state (`visible=false)` is not persisting. It seems **viewstate** is only valid for one page and is not transferred to other web pages. Is there some kind...
2011/04/07
[ "https://Stackoverflow.com/questions/5577591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/281014/" ]
No, viewstate is page specific. You will need to use something like a session variable or a querystring parameter to pass your state between pages.
If you need to store on a "global" level, you should be using the Application State. You could also use Cache Object. You may be wanting to pass values from one page to another, you can achieve this by using the Context object in combination with the Server.Transfer. 1) You need a public property on the source page r...
5,577,591
I have a `button` (view state enabled) in Master web page and set it to `visible=false` in one of the child web pages. If a second child page is opened, the button state (`visible=false)` is not persisting. It seems **viewstate** is only valid for one page and is not transferred to other web pages. Is there some kind...
2011/04/07
[ "https://Stackoverflow.com/questions/5577591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/281014/" ]
No, You cannot make view state global, they are page specific. I would suggest to use cookies if you really want to make it client side otherwise you can use session.
If you need to store on a "global" level, you should be using the Application State. You could also use Cache Object. You may be wanting to pass values from one page to another, you can achieve this by using the Context object in combination with the Server.Transfer. 1) You need a public property on the source page r...
22,577,903
In following case ``` let a = [1] let f x = x let b = a |> List.map f ``` a is an int list. We call List.map so for sure f must be a int->? function. Why is f still typed as 'a ->'a instead of int->int? If this is how type inference (not)works in F# i see little benefits for it. Is there an workaround without speci...
2014/03/22
[ "https://Stackoverflow.com/questions/22577903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/378068/" ]
The function `f` is typed `'a -> 'a` because it works at every type, not just `int`: ``` > f "foo";; val it = "foo" : string > f 0.8;; val it = 0.8 : float ``` This an advantage: the generic type `'a -> 'a` gives you the freedom to use `f` when it is safe to do so, as opposed to only at the type `int -> int`.
To add a little something to the fine answers already listed here. There is one circumstance where you will want to not use the generic inferred type. The generic version of f will be slower than the type specific version. But F# has a keyword for taking care of that for you: ``` let inline f x = x ``` Which tells...
22,577,903
In following case ``` let a = [1] let f x = x let b = a |> List.map f ``` a is an int list. We call List.map so for sure f must be a int->? function. Why is f still typed as 'a ->'a instead of int->int? If this is how type inference (not)works in F# i see little benefits for it. Is there an workaround without speci...
2014/03/22
[ "https://Stackoverflow.com/questions/22577903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/378068/" ]
Type inferencing works just fine here. `f` is inferred as having the type `'a -> 'a`, which means that it'll take a value of the generic type `'a` and return a value of the same generic type `'a`. In this case, type inferencing kicks in when you *use* it. Because `a` has the type `int list`, and because `List.map` has...
To add a little something to the fine answers already listed here. There is one circumstance where you will want to not use the generic inferred type. The generic version of f will be slower than the type specific version. But F# has a keyword for taking care of that for you: ``` let inline f x = x ``` Which tells...
43,229,075
ASSIGN a GOOGLE APPS SCRIPT FUNCTION TO an IMAGE WITH CODE. By clicking on a image in a Google Sheet and selecting the "Assign Script" option, it is possible. [![Assign Script to Image](https://i.stack.imgur.com/kdeBX.png)](https://i.stack.imgur.com/kdeBX.png) But this is a manual task and I want to automate this.
2017/04/05
[ "https://Stackoverflow.com/questions/43229075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7714798/" ]
An image can be inserted into a Google Sheet and assigned a function with Apps Script code. There is an `insertImage()` method for the Sheet Class and an `assignScript()` method that can be run on an image. The `insertImage()` method requires a blob of an image mime type. To get an image of a jpeg mime type, you can ...
I've had to do this recently, here's a snippet of programmatically adding the image and linking the function to it. My image is hosted in Google Drive so I use the file ID, otherwise you can replace that with an image URL Replace the 1's with your col/row index that you'd like the image to start in and you can add ano...
271,828
Under this [Youtube video](https://www.youtube.com/watch?v=4CAuLeSmcR8) there is a comment. > > When you returned to a game you haven't played in years and discover you're still beast at it. > > > What does **beast at it** mean? I looked it up in the dictionary but can't find this usage. Does it means *very good ...
2021/01/11
[ "https://ell.stackexchange.com/questions/271828", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/85527/" ]
Has the "beast" devoured the article? > > When you return~~ed~~ to a game you haven't played in years and discover you're still [a] beast at it. > > > "Beast" is slang. [Urban dictionary](https://www.urbandictionary.com/define.php?term=beast) says: > > a person that is extremely talented at whatever they do and...
The [onlineslangdictionary](http://onlineslangdictionary.com/meaning-definition-of/beast) gives this definition of ***beast*** (among others): > > a person who is exceptionally good at something, or performs that activity aggressively. > > > and gives this example: > > He is a beast at guitar! > > > As syno...
39,990,691
I need to process Google Play customer reviews as described in <https://developers.google.com/android-publisher/api-ref/reviews> and <https://developers.google.com/android-publisher/reply-to-reviews>. The documentation shows ``` "lastModified": { "seconds": long, "nanos": integer }, ``...
2016/10/12
[ "https://Stackoverflow.com/questions/39990691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52277/" ]
Rather than setting `editable: true` you can set `editable` based on the data: `editable: params => params.data.active === true`. Hope that helps.
What will work best is to use the `cellEditor` somehow. It provides row nodes in it's init params that you can iterate through and check if it is a row you want editable or not. If it is not then call stopEditing. Sorry this doesn't have a working example yet, but that is how I will try tackling it and try to provide ...
5,979,532
Sometimes, in Vim, I want to show only a specific part of a file (for example, a specific method) while hiding the rest. This helps me to focus at the problem at hand. I would like to do so without actually changing the file. Any idea on how to do this? cheers & regards, Klaas
2011/05/12
[ "https://Stackoverflow.com/questions/5979532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/339144/" ]
Similar to the already mentioned narrow plug-in, there's [NrrwRgn](http://www.vim.org/scripts/script.php?script_id=3075). Visual select the region, `:NR` and the window is split with the selected region isolated in the new window. Very useful for coding, indeed.
``` <ESC>:help folding ``` Not quite up to speed on folding myself, but I believe that's the feature you're looking for.
5,979,532
Sometimes, in Vim, I want to show only a specific part of a file (for example, a specific method) while hiding the rest. This helps me to focus at the problem at hand. I would like to do so without actually changing the file. Any idea on how to do this? cheers & regards, Klaas
2011/05/12
[ "https://Stackoverflow.com/questions/5979532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/339144/" ]
Similar to the already mentioned narrow plug-in, there's [NrrwRgn](http://www.vim.org/scripts/script.php?script_id=3075). Visual select the region, `:NR` and the window is split with the selected region isolated in the new window. Very useful for coding, indeed.
Try the vim narrow plugin: <http://www.vim.org/scripts/script.php?script_id=2097> VIM also has the ability to fold code, but that may not map entirely to what you want.
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
If you want a ground-referenced load, you can use a P channel MOSFET. This will be a mirror-image of the circuit you describe, ie with the source connected to the higher voltage and the drain connected to 0V via the load. However, your gate drive will need to be reversed and will need to be close to your higher voltage...
The problem is internal diode, which will always conduct in reverse direction with 0.7V drop, so when you will switch MOSFET ON you will lower that drop down to 0V and that's it.
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
To clarify a bit what others have already said, a MOSFET has a internal diode that points from source to drain in N channel devices and drain to source in P channel devices. This is not something added deliberately by the manufacturer, but is a byproduct of the way MOSFETs are made. Most of the time this diode would pr...
The problem is internal diode, which will always conduct in reverse direction with 0.7V drop, so when you will switch MOSFET ON you will lower that drop down to 0V and that's it.
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
A mosfet is really a four terminal device. Drain, source, gate and body. For a N channel mosfet the doping arrangements result in diodes that permit current flow from body to drain and from body to source. If you have a mosfet with all four terminals brought out seperately then there is a symetry between drain and so...
The problem is internal diode, which will always conduct in reverse direction with 0.7V drop, so when you will switch MOSFET ON you will lower that drop down to 0V and that's it.
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
If you want a ground-referenced load, you can use a P channel MOSFET. This will be a mirror-image of the circuit you describe, ie with the source connected to the higher voltage and the drain connected to 0V via the load. However, your gate drive will need to be reversed and will need to be close to your higher voltage...
You can do it if your application can cope with the reverse body diode - there are a few occasions where this can be useful, for example reverse-polarity protection with low voltage drop.
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
To clarify a bit what others have already said, a MOSFET has a internal diode that points from source to drain in N channel devices and drain to source in P channel devices. This is not something added deliberately by the manufacturer, but is a byproduct of the way MOSFETs are made. Most of the time this diode would pr...
If you want a ground-referenced load, you can use a P channel MOSFET. This will be a mirror-image of the circuit you describe, ie with the source connected to the higher voltage and the drain connected to 0V via the load. However, your gate drive will need to be reversed and will need to be close to your higher voltage...
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
A mosfet is really a four terminal device. Drain, source, gate and body. For a N channel mosfet the doping arrangements result in diodes that permit current flow from body to drain and from body to source. If you have a mosfet with all four terminals brought out seperately then there is a symetry between drain and so...
If you want a ground-referenced load, you can use a P channel MOSFET. This will be a mirror-image of the circuit you describe, ie with the source connected to the higher voltage and the drain connected to 0V via the load. However, your gate drive will need to be reversed and will need to be close to your higher voltage...
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
To clarify a bit what others have already said, a MOSFET has a internal diode that points from source to drain in N channel devices and drain to source in P channel devices. This is not something added deliberately by the manufacturer, but is a byproduct of the way MOSFETs are made. Most of the time this diode would pr...
You can do it if your application can cope with the reverse body diode - there are a few occasions where this can be useful, for example reverse-polarity protection with low voltage drop.
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
A mosfet is really a four terminal device. Drain, source, gate and body. For a N channel mosfet the doping arrangements result in diodes that permit current flow from body to drain and from body to source. If you have a mosfet with all four terminals brought out seperately then there is a symetry between drain and so...
You can do it if your application can cope with the reverse body diode - there are a few occasions where this can be useful, for example reverse-polarity protection with low voltage drop.
15,106
When using MOSFETs as a switch I always see the drain connected to the higher potential and and the load and the Source is always connected to ground. Can you switch those so that the Source pin connects to the higher potential and the drain is connected to ground?
2011/06/07
[ "https://electronics.stackexchange.com/questions/15106", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
To clarify a bit what others have already said, a MOSFET has a internal diode that points from source to drain in N channel devices and drain to source in P channel devices. This is not something added deliberately by the manufacturer, but is a byproduct of the way MOSFETs are made. Most of the time this diode would pr...
A mosfet is really a four terminal device. Drain, source, gate and body. For a N channel mosfet the doping arrangements result in diodes that permit current flow from body to drain and from body to source. If you have a mosfet with all four terminals brought out seperately then there is a symetry between drain and so...
1,400,755
I have the following element in my form: ``` $attachment = new Zend_Form_Element_File('attachment'); $attachment->setLabel('Attach File (2MB Max)'); $attachment->addValidator('Count', false, 1); $attachment->addValidator('Size', false, 2048000); ``` If I print the entire form in the view, this field works fine. Howe...
2009/09/09
[ "https://Stackoverflow.com/questions/1400755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/139812/" ]
Are you doing the right kind of EncType? It should be 'multipart/form-data'. If it's not, the file element's key might not be getting put in the $\_FILES array and the file element interprets that as the file was too big to be uploaded to the server.
Mmm if it says ini size, have you checked the upload\_max\_filesize directive in your php.ini?
1,400,755
I have the following element in my form: ``` $attachment = new Zend_Form_Element_File('attachment'); $attachment->setLabel('Attach File (2MB Max)'); $attachment->addValidator('Count', false, 1); $attachment->addValidator('Size', false, 2048000); ``` If I print the entire form in the view, this field works fine. Howe...
2009/09/09
[ "https://Stackoverflow.com/questions/1400755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/139812/" ]
Are you doing the right kind of EncType? It should be 'multipart/form-data'. If it's not, the file element's key might not be getting put in the $\_FILES array and the file element interprets that as the file was too big to be uploaded to the server.
check the view of the form, maybe you are rendering the form partially, try to put this on the view of your form: ``` <?=$this->form?> ``` (this worked for me)
1,400,755
I have the following element in my form: ``` $attachment = new Zend_Form_Element_File('attachment'); $attachment->setLabel('Attach File (2MB Max)'); $attachment->addValidator('Count', false, 1); $attachment->addValidator('Size', false, 2048000); ``` If I print the entire form in the view, this field works fine. Howe...
2009/09/09
[ "https://Stackoverflow.com/questions/1400755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/139812/" ]
Are you doing the right kind of EncType? It should be 'multipart/form-data'. If it's not, the file element's key might not be getting put in the $\_FILES array and the file element interprets that as the file was too big to be uploaded to the server.
only form?> will work fine with uploading any file. but problem occurs when we try to put partial form as : form->file ?> form->file ?> it will always show error so try to implement full form and avoid putting elements of form.
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
I had a global search function on a quoting website from which I wanted to be able to search on all details of a quote (quote references, vehicle details, customer details etc.) including the created dates using only the single input text value: [![enter image description here](https://i.stack.imgur.com/3zTBG.png)](ht...
try this ``` var select = from s in db.Table where s.date == someDate select new { date = DateTime.Parse(s.date.ToString()).ToString("yyyy-MM-dd"), }; ```
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
Try to create an object class that you can set the properties and let the properties be the value for your view.. Set the datetime data from LINQ as string and not datetime.. ex. ``` //Property class [DataContract()] public class Info { [DataMember(Name = "created_date")] public string CreateDate; } //Controller var ...
I had a global search function on a quoting website from which I wanted to be able to search on all details of a quote (quote references, vehicle details, customer details etc.) including the created dates using only the single input text value: [![enter image description here](https://i.stack.imgur.com/3zTBG.png)](ht...
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
Assuming that `t.Date` is nullable (`DateTime?`) this could be the problem, try using: ``` from t in ctx.table select (t.HasValue ? t.Date.Value.ToString("yyyy-MM-dd") : string.Empty ); ``` **Edit: Second try** The problem is the translation to SQL; it tries to translate the `.ToString()` to an SQL representation, ...
[look no.3](https://stackoverflow.com/questions/7999771/convert-datetime-to-string-inside-a-linq-query) ``` var user = (from u in users select new { name = u.name, birthday = u.birthday.Value }) ...
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
[look no.3](https://stackoverflow.com/questions/7999771/convert-datetime-to-string-inside-a-linq-query) ``` var user = (from u in users select new { name = u.name, birthday = u.birthday.Value }) ...
Try to create an object class that you can set the properties and let the properties be the value for your view.. Set the datetime data from LINQ as string and not datetime.. ex. ``` //Property class [DataContract()] public class Info { [DataMember(Name = "created_date")] public string CreateDate; } //Controller var ...
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
Assuming that `t.Date` is nullable (`DateTime?`) this could be the problem, try using: ``` from t in ctx.table select (t.HasValue ? t.Date.Value.ToString("yyyy-MM-dd") : string.Empty ); ``` **Edit: Second try** The problem is the translation to SQL; it tries to translate the `.ToString()` to an SQL representation, ...
try this ``` var select = from s in db.Table where s.date == someDate select new { date = DateTime.Parse(s.date.ToString()).ToString("yyyy-MM-dd"), }; ```
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
Is there a reason to perform the conversion on the database side? Whenever I run into this type of situation, I tend to just allow the database to give me the raw data and then do the massaging and manipulation within the application. Depending on the volume of requests to the database server and the size of the result...
try this ``` var select = from s in db.Table where s.date == someDate select new { date = DateTime.Parse(s.date.ToString()).ToString("yyyy-MM-dd"), }; ```
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
In case someone else has this problem, I solved this problem by creating a seperate function to do the date formatting for me. My Linq looks something like this: ``` from a in context.table where ... select new Class { DateString = GetFormattedString(a.DateTimeObject) } ``` And GetFormattedString just returns DateT...
I had a global search function on a quoting website from which I wanted to be able to search on all details of a quote (quote references, vehicle details, customer details etc.) including the created dates using only the single input text value: [![enter image description here](https://i.stack.imgur.com/3zTBG.png)](ht...
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
Assuming that `t.Date` is nullable (`DateTime?`) this could be the problem, try using: ``` from t in ctx.table select (t.HasValue ? t.Date.Value.ToString("yyyy-MM-dd") : string.Empty ); ``` **Edit: Second try** The problem is the translation to SQL; it tries to translate the `.ToString()` to an SQL representation, ...
I had a global search function on a quoting website from which I wanted to be able to search on all details of a quote (quote references, vehicle details, customer details etc.) including the created dates using only the single input text value: [![enter image description here](https://i.stack.imgur.com/3zTBG.png)](ht...