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
1,878,118
i have this and a simple question to it. ``` $.ajax({ type: "POST", url: "/", data: $(".form").serialize(), dataType: "html", success: function (data) { $("#id").html(data); } }); ``` Inside "data" is some html I am inserting into the DOM. Thats no problem. But I want to manipulate th...
2009/12/10
[ "https://Stackoverflow.com/questions/1878118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/228450/" ]
The data returned is a string, and cannot be found in the dom via jQuery until it's actually in the DOM. You will need to parse this string and pull out the data you require, or edit it after you insert in the DOM.
[Jay's answer](https://stackoverflow.com/questions/1878118/manipulating-the-data-from-ajax-success-functiondata/1878123#1878123) is right - you will need to insert the HTML data into the DOM first (or parse the string, which seems cumbersome). What you can do is append the data to a hidden `DIV`, modify it, then copy t...
1,878,118
i have this and a simple question to it. ``` $.ajax({ type: "POST", url: "/", data: $(".form").serialize(), dataType: "html", success: function (data) { $("#id").html(data); } }); ``` Inside "data" is some html I am inserting into the DOM. Thats no problem. But I want to manipulate th...
2009/12/10
[ "https://Stackoverflow.com/questions/1878118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/228450/" ]
You don't need a hidden DIV. If you want to convert an html string to a DOM fragment, simply call jQuery on it. In your example: ``` success: function(data) { var jqObj = jQuery(data); jqObj.find("li:last").remove(); $("#id").empty().append(jqObj); } ``` Some IE considerations though: * If your data is ...
The data returned is a string, and cannot be found in the dom via jQuery until it's actually in the DOM. You will need to parse this string and pull out the data you require, or edit it after you insert in the DOM.
1,878,118
i have this and a simple question to it. ``` $.ajax({ type: "POST", url: "/", data: $(".form").serialize(), dataType: "html", success: function (data) { $("#id").html(data); } }); ``` Inside "data" is some html I am inserting into the DOM. Thats no problem. But I want to manipulate th...
2009/12/10
[ "https://Stackoverflow.com/questions/1878118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/228450/" ]
You don't need a hidden DIV. If you want to convert an html string to a DOM fragment, simply call jQuery on it. In your example: ``` success: function(data) { var jqObj = jQuery(data); jqObj.find("li:last").remove(); $("#id").empty().append(jqObj); } ``` Some IE considerations though: * If your data is ...
[Jay's answer](https://stackoverflow.com/questions/1878118/manipulating-the-data-from-ajax-success-functiondata/1878123#1878123) is right - you will need to insert the HTML data into the DOM first (or parse the string, which seems cumbersome). What you can do is append the data to a hidden `DIV`, modify it, then copy t...
1,878,118
i have this and a simple question to it. ``` $.ajax({ type: "POST", url: "/", data: $(".form").serialize(), dataType: "html", success: function (data) { $("#id").html(data); } }); ``` Inside "data" is some html I am inserting into the DOM. Thats no problem. But I want to manipulate th...
2009/12/10
[ "https://Stackoverflow.com/questions/1878118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/228450/" ]
You can create a jQuery object from arbitrary HTML, e.g.: ``` $('<ul><li>Item</li></ul>'); ``` So, you could do something like this: ``` success: function(data) { var $list = $(data); $list.find('li:last').remove(); // Do something with $list here, like append(). } ``` Here's a working example you can pla...
[Jay's answer](https://stackoverflow.com/questions/1878118/manipulating-the-data-from-ajax-success-functiondata/1878123#1878123) is right - you will need to insert the HTML data into the DOM first (or parse the string, which seems cumbersome). What you can do is append the data to a hidden `DIV`, modify it, then copy t...
1,878,118
i have this and a simple question to it. ``` $.ajax({ type: "POST", url: "/", data: $(".form").serialize(), dataType: "html", success: function (data) { $("#id").html(data); } }); ``` Inside "data" is some html I am inserting into the DOM. Thats no problem. But I want to manipulate th...
2009/12/10
[ "https://Stackoverflow.com/questions/1878118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/228450/" ]
You don't need a hidden DIV. If you want to convert an html string to a DOM fragment, simply call jQuery on it. In your example: ``` success: function(data) { var jqObj = jQuery(data); jqObj.find("li:last").remove(); $("#id").empty().append(jqObj); } ``` Some IE considerations though: * If your data is ...
You can create a jQuery object from arbitrary HTML, e.g.: ``` $('<ul><li>Item</li></ul>'); ``` So, you could do something like this: ``` success: function(data) { var $list = $(data); $list.find('li:last').remove(); // Do something with $list here, like append(). } ``` Here's a working example you can pla...
31,132,159
I'm building a birthday reminder app. I want the user to be able to see how many days it is until somebody's next birthday. Let's say I have an `NSDate()` = `2015-06-30 07:21:47 +0000` And the `NSDate` for the birthday = `1985-08-29 12:00:00 +0000` How would I get the number of days until the next birthday? I've us...
2015/06/30
[ "https://Stackoverflow.com/questions/31132159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2981132/" ]
What you need is to compute the *next occurrence* of the (day and month component of the) birthday after today: ``` let cal = NSCalendar.currentCalendar() let today = cal.startOfDayForDate(NSDate()) let dayAndMonth = cal.components(.CalendarUnitDay | .CalendarUnitMonth, fromDate: birthday) let nextBirthDay = cal.n...
Btw, in case anyone needs here is the @Aaron function in Swift 3: ``` func daysBetween(date1: Date, date2: Date) -> Int { let calendar = Calendar.current let date1 = calendar.startOfDay(for: date1) let date2 = calendar.startOfDay(for: date2) let components = calendar.dateComponents([Calendar.Componen...
62,245,083
I am having a simple code which has an image called "try.png" and I want to convert it from Image to Text using pytesseract but I am having some issues with the code. ``` import cv2 import pytesseract pytesseract.pytesseract.tesseract_cmd=r'tesseract-ocr-setup-4.00.00dev.exe' img = cv2.imread('try.png') img= cv2.cvtCo...
2020/06/07
[ "https://Stackoverflow.com/questions/62245083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13621809/" ]
`tesseract-ocr-setup-4.00.00dev.exe` sounds like a setup exe and not the tesseract itself. Check if you have actually installed tesseract and if not launch the exe to install. For Windows download the latest version from here: <https://github.com/UB-Mannheim/tesseract/wiki> If you still get `OSError: [WinError 740] ...
I guess you have not installed tesseract on your system. Run `tesseract-ocr-setup-4.00.00dev.exe` to install it and make a note of the location where it is installed (`$tesseractLocation`) If getting the same error while installing, try running it with admin access. And Replace ``` pytesseract.pytesseract.tesseract_c...
62,245,083
I am having a simple code which has an image called "try.png" and I want to convert it from Image to Text using pytesseract but I am having some issues with the code. ``` import cv2 import pytesseract pytesseract.pytesseract.tesseract_cmd=r'tesseract-ocr-setup-4.00.00dev.exe' img = cv2.imread('try.png') img= cv2.cvtCo...
2020/06/07
[ "https://Stackoverflow.com/questions/62245083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13621809/" ]
`tesseract-ocr-setup-4.00.00dev.exe` sounds like a setup exe and not the tesseract itself. Check if you have actually installed tesseract and if not launch the exe to install. For Windows download the latest version from here: <https://github.com/UB-Mannheim/tesseract/wiki> If you still get `OSError: [WinError 740] ...
Try Uncheck "Run this program as an administrator" TRY: `Right Click tesseract.exe -> Properties -> Compability -> Uncheck Run this program as an administrator -> apply`.
62,245,083
I am having a simple code which has an image called "try.png" and I want to convert it from Image to Text using pytesseract but I am having some issues with the code. ``` import cv2 import pytesseract pytesseract.pytesseract.tesseract_cmd=r'tesseract-ocr-setup-4.00.00dev.exe' img = cv2.imread('try.png') img= cv2.cvtCo...
2020/06/07
[ "https://Stackoverflow.com/questions/62245083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13621809/" ]
I guess you have not installed tesseract on your system. Run `tesseract-ocr-setup-4.00.00dev.exe` to install it and make a note of the location where it is installed (`$tesseractLocation`) If getting the same error while installing, try running it with admin access. And Replace ``` pytesseract.pytesseract.tesseract_c...
Try Uncheck "Run this program as an administrator" TRY: `Right Click tesseract.exe -> Properties -> Compability -> Uncheck Run this program as an administrator -> apply`.
37,736,612
I am trying to change the way that the dropdown menu in Tkinter seems to render. I found this code on TutorialsPoint: ``` from Tkinter import * def donothing(): filewin = Toplevel(root) button = Button(filewin, text="Do nothing button") button.pack() root = Tk() menubar = Menu...
2016/06/09
[ "https://Stackoverflow.com/questions/37736612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6406655/" ]
I'm guessing this has something to do with the settings on your computer and not tkinter/Python. It works like TutorialsPoint's on my computer just fine! [![enter image description here](https://i.stack.imgur.com/aMlOq.png)](https://i.stack.imgur.com/aMlOq.png) Something to keep in mind though... (Maybe this applies...
I had this problem on my Desktop Windows 8.1 system. I fixed it by 1. Going to Control Panel, Tablet PC Settings 2. Clicking on the Other tab and setting Handedness option to Left-handed 3. clicking the Apply button. See this link for more information: <https://www.askvg.com/how-to-change-menu-position-from-left-to...
164,131
I'm trying to create a simple contact form using jQuery to validate the form and AJAX to pass it to PHP and WP `wp_mail()` to send it. I have a simple form like this. ``` <form role="form"> <div class="form-group"> <label class="">Name</label> <input type="text" id="name" class="fo...
2014/10/11
[ "https://wordpress.stackexchange.com/questions/164131", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17373/" ]
From quick look at your code you seem to be omitting *where* you are submitting request to. By default it is just current page, which isn't typically equipped to receive the request. Since you are using `wp_ajax_` hook you need to point request at `admin-ajax.php` endpoint. On admin side the URL is provided in `ajaxur...
Indeed, you forgot to mention the destination of the request, and you are also missing ajaxurl (since you are using wp\_ajax). Another, more simple solution would be to create a php file to handle the request (ex: process-request.php), then to specify the url of this file in the ajax object before you submit your requ...
1,326,884
Another question for faculty entrance exam (workbook tasks). Equation $x^3 + x^2 + ax + b = 0$ (a,b $\in R$) have solutions $1-\sqrt{2} $ and $1+ \sqrt{2}$. Product of all the available solutions of this equation is (answer is 3, but I need steps). NOTICE : High School level please! EDIT: I guess I have to use Vieta's ...
2015/06/15
[ "https://math.stackexchange.com/questions/1326884", "https://math.stackexchange.com", "https://math.stackexchange.com/users/248456/" ]
By one of the Vieta formulas, the sum of all the roots is $-1$. We know two of the roots, and can deduce that the third root is $-3$. Now find the product $(1-\sqrt{2})(1+\sqrt{2})(-3)$.
The third root of $p(x)$ has to be a real root, so the polynomial can be written as: $((x-1)^2-2)(x-c)=(x^2-2x-1)(x-c)=x^3-(c+2)x^2+(2c-1)x+c$. Equate the coefficients of $p(x)$ we have: $c+2 = -1 \to c = -3$, and the answer follows from Vieta's formula.
1,936,480
`ObservableCollection` implements both `INotifyCollectionChanged` and `INotifyPropertyChanged`. * I understand that additions, deletions (+ clear), and replacement of items are notifiable to consumers through the **collection**'s event `CollectionChanged`, and that updates in the existing items can be monitored using ...
2009/12/20
[ "https://Stackoverflow.com/questions/1936480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235572/" ]
WPFs binding mechanism can use INotifyPropertyChanged (INpc) out of the box. INpc as the name suggests allows WPF to detect changes to object properties that may or may not be part of a collection. ObservableCollection (OC) implements INotifyCollectionChanged (InCC) where as you say the collection itself notifies WP...
Just a guess: so one can be notified of changes to the collection's Count property?
1,936,480
`ObservableCollection` implements both `INotifyCollectionChanged` and `INotifyPropertyChanged`. * I understand that additions, deletions (+ clear), and replacement of items are notifiable to consumers through the **collection**'s event `CollectionChanged`, and that updates in the existing items can be monitored using ...
2009/12/20
[ "https://Stackoverflow.com/questions/1936480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235572/" ]
If you look at the `ObservableCollection<T>` source code with Reflector, you can see that this event is raised for two properties : ``` this.OnPropertyChanged("Count"); this.OnPropertyChanged("Item[]"); ``` Note that `ObservableCollection<T>` implements `INotifyPropertyChanged` explicitly, so you can access the `Pro...
Just a guess: so one can be notified of changes to the collection's Count property?
1,936,480
`ObservableCollection` implements both `INotifyCollectionChanged` and `INotifyPropertyChanged`. * I understand that additions, deletions (+ clear), and replacement of items are notifiable to consumers through the **collection**'s event `CollectionChanged`, and that updates in the existing items can be monitored using ...
2009/12/20
[ "https://Stackoverflow.com/questions/1936480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235572/" ]
If you look at the `ObservableCollection<T>` source code with Reflector, you can see that this event is raised for two properties : ``` this.OnPropertyChanged("Count"); this.OnPropertyChanged("Item[]"); ``` Note that `ObservableCollection<T>` implements `INotifyPropertyChanged` explicitly, so you can access the `Pro...
WPFs binding mechanism can use INotifyPropertyChanged (INpc) out of the box. INpc as the name suggests allows WPF to detect changes to object properties that may or may not be part of a collection. ObservableCollection (OC) implements INotifyCollectionChanged (InCC) where as you say the collection itself notifies WP...
55,945,960
I was reading <https://github.com/urbanairship/android-library> and I found this: ``` dependencies { ... // Urban Airship SDK - FCM implementation 'com.urbanairship.android:urbanairship-fcm:9.7.1' } ``` In the sample project at <https://github.com/urbanairship/android-library>, they are using this: ``` ...
2019/05/02
[ "https://Stackoverflow.com/questions/55945960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4242086/" ]
When you see `implementation project(':urbanairship-fcm')` that means it's pulling it from a local module instead of remote package. The sample is setup to use the library source so we can use the sample app to test our development changes.
The sample project at <https://github.com/urbanairship/android-library/tree/master/sample> is outdated. For example, the Autopilot at <https://github.com/urbanairship/android-library/blob/master/sample/src/main/java/com/urbanairship/sample/SampleAutopilot.java> was last updated on Jan 29, 2018. It does not incorporate ...
19,217,750
In the following fiddle my expectation is that the element "#wrap" would scale vertically to fit it's contents. This is clearly not the case. Can anyone suggest a simple modification that will cause "#wrap" to automatically scale to fit it's contents (i.e. not with a static height). [fiddle](http://jsfiddle.net/3RE9F/...
2013/10/07
[ "https://Stackoverflow.com/questions/19217750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/996035/" ]
Because the `.inner` `div` elements have a `position` of `absolute`, they are taken out of the flow of the page. Thus, any container element no longer sees them (and cannot, therefore, expand to contain them). What setting the containing `div` element's `position` to `relative` does is allow the absolutely-positioned ...
[**jsFidle**](http://jsfiddle.net/mohsen4887/3RE9F/1/) html: ``` <div id="wrap"> <div class="inner" id="id1"></div> <div class="inner" id="id2"></div> <div class="inner" id="id3"></div> </div> ``` CSS: ``` #wrap{ display:block; position:relative; } .inner{ display:block; position:abs...
418,435
I'm trying to predict `fantasy_points` for individual Basketball players in upcoming games. The formula to calculate a player's `fantasy_points` is: `fantasy_points = (1 * points_scored) + (1.5 * assists)` So if Player A scores 10 points and 4 assists: Player A `fantasy_points` = (1 x 10) + (1.5 x 4) = 16 I have a...
2019/07/20
[ "https://stats.stackexchange.com/questions/418435", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/215131/" ]
Here's a perspective: the two model approach is *more* constrained, hence is always going to result in an inferior model. Consider the 2m (two-model) model - it looks like: $$ f\_{2m}(\mathbf{x}) = 1.5 (\mathbf{c\_1} \cdot \mathbf{x}^T) + 1.0 (\mathbf{c\_2} \cdot \mathbf{x}^T)$$ where $\mathbf{c}\_i$ were trained in ...
> > Impossible that one predictive model is better than two? > > > Rather than getting into the weeds on your specific models, let's just step back and view this question in a more general setting. If we consider an arbitrary series of observable values, then it is possible that a model could give a perfect predic...
418,435
I'm trying to predict `fantasy_points` for individual Basketball players in upcoming games. The formula to calculate a player's `fantasy_points` is: `fantasy_points = (1 * points_scored) + (1.5 * assists)` So if Player A scores 10 points and 4 assists: Player A `fantasy_points` = (1 x 10) + (1.5 x 4) = 16 I have a...
2019/07/20
[ "https://stats.stackexchange.com/questions/418435", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/215131/" ]
> > Impossible that one predictive model is better than two? > > > Rather than getting into the weeds on your specific models, let's just step back and view this question in a more general setting. If we consider an arbitrary series of observable values, then it is possible that a model could give a perfect predic...
As the previous answers have indicated, simply adding a model that is wrong can decrease performance. However, there are clever ways around this issue. Generalized stacking algorithms (super learner is one example) is an alternative strategy to aggregating the results of multiple models. It has the advantage of discar...
418,435
I'm trying to predict `fantasy_points` for individual Basketball players in upcoming games. The formula to calculate a player's `fantasy_points` is: `fantasy_points = (1 * points_scored) + (1.5 * assists)` So if Player A scores 10 points and 4 assists: Player A `fantasy_points` = (1 x 10) + (1.5 x 4) = 16 I have a...
2019/07/20
[ "https://stats.stackexchange.com/questions/418435", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/215131/" ]
Here's a perspective: the two model approach is *more* constrained, hence is always going to result in an inferior model. Consider the 2m (two-model) model - it looks like: $$ f\_{2m}(\mathbf{x}) = 1.5 (\mathbf{c\_1} \cdot \mathbf{x}^T) + 1.0 (\mathbf{c\_2} \cdot \mathbf{x}^T)$$ where $\mathbf{c}\_i$ were trained in ...
As the previous answers have indicated, simply adding a model that is wrong can decrease performance. However, there are clever ways around this issue. Generalized stacking algorithms (super learner is one example) is an alternative strategy to aggregating the results of multiple models. It has the advantage of discar...
41,367,402
I am currently working with a XML string (all xml data stored in String xml) that is made of multiple XML files in this format: ``` <?xml version...> <File xml:space="preserve"> <Subfile keyword="Store" tag="0"> <Value number="1">Amazon</Value> </Subfile> <Subfile keyword="Owner" tag="1"> ...
2016/12/28
[ "https://Stackoverflow.com/questions/41367402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7232500/" ]
Your example shows that each of the XML entries starts with ``` <?xml version...> ``` So the easiest approach would be to use [String.split()](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)) using that pattern; resulting in an array of strings that should actually contain you...
In XPath 3.0/3.1 (as supported in Saxon 9.7 all editions) you could do it in pure XPath by using `replace` to replace the XML declarations and then `parse-xml-fragment` to parse the fragment: ``` parse-xml-fragment(replace('<?xml version...> <File xml:space="preserve"> <Subfile keyword="Store" tag="0"> <Value number="...
5,777,060
I wrote a desktop application. It is about 35kb. Engine of the application is a soap service, and I used Apache Axis. The problem is that with used library application becomes about 4 MB. I want to mention that the axis.jar is 1.5 MB. Can anybody give me some advise to make sizes smaller? Can I replace axis.jar with...
2011/04/25
[ "https://Stackoverflow.com/questions/5777060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355253/" ]
You can use [ProGuard](http://proguard.sourceforge.net/) to remove unnecessary classes in your jar. You'll need to configure it to be aware of entry points for your application. From there it usually does a good job of determining what you need, especially for a small program. See the [examples](http://proguard.sourcef...
Java 6 has a web service stack built-in, which may be usable for you, so you only need to deploy your actual code (as the web service stack is part of the JRE). If you need to use it with Java 5 you can download and use the Metro distribution of the same libraries from <http://metro.java.net/>, but that is a larger li...
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
These two words have a large semantic overlap, but at the edges there are a few key differences. * *Electric* is used to describe things pertaining to electricity. It can also be used metaphorically: "the evening was electric". * *Electrical* can be used nearly everywhere that *electric* is used when pertaining to ele...
Here's a simple distinguishment which I hope will help: > > Electric refers to anything that runs on electricity, i.e. β€œelectric kettle” > > > Electrical refers to something related to electricity, i.e. β€œelectrical faults”, β€œelectrical component”. > > > "Electric" is used in front of a device or machine that ru...
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
These two words have a large semantic overlap, but at the edges there are a few key differences. * *Electric* is used to describe things pertaining to electricity. It can also be used metaphorically: "the evening was electric". * *Electrical* can be used nearly everywhere that *electric* is used when pertaining to ele...
*Electric* means "of, worked by, charged with, or producing electricity." It can be used figuratively, as in "the atmosphere was electric;" to refer to a musical instrument, as in *electric guitar*; or to refer to a color, as in *electric blue*. *Electrical* means: * operating by or producing electricity * concern...
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
These two words have a large semantic overlap, but at the edges there are a few key differences. * *Electric* is used to describe things pertaining to electricity. It can also be used metaphorically: "the evening was electric". * *Electrical* can be used nearly everywhere that *electric* is used when pertaining to ele...
Electric used about something that works using electricity, for example, electric cooker , electric guitar, electric kettle. Electrical used about things in general that use electricity, or people whose job is to make or repair these things: a company manufacturing electrical goods|, an electrical engineer electronic u...
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
These two words have a large semantic overlap, but at the edges there are a few key differences. * *Electric* is used to describe things pertaining to electricity. It can also be used metaphorically: "the evening was electric". * *Electrical* can be used nearly everywhere that *electric* is used when pertaining to ele...
In addition to what has been said so far, "electric," unlike "electrical," can be used as a noun for an electrically powered machine or vehicle. E.g. > > [The lawmower is an electric](http://www.thefreedictionary.com/electrical). > > >
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
Here's a simple distinguishment which I hope will help: > > Electric refers to anything that runs on electricity, i.e. β€œelectric kettle” > > > Electrical refers to something related to electricity, i.e. β€œelectrical faults”, β€œelectrical component”. > > > "Electric" is used in front of a device or machine that ru...
*Electric* means "of, worked by, charged with, or producing electricity." It can be used figuratively, as in "the atmosphere was electric;" to refer to a musical instrument, as in *electric guitar*; or to refer to a color, as in *electric blue*. *Electrical* means: * operating by or producing electricity * concern...
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
Here's a simple distinguishment which I hope will help: > > Electric refers to anything that runs on electricity, i.e. β€œelectric kettle” > > > Electrical refers to something related to electricity, i.e. β€œelectrical faults”, β€œelectrical component”. > > > "Electric" is used in front of a device or machine that ru...
Electric used about something that works using electricity, for example, electric cooker , electric guitar, electric kettle. Electrical used about things in general that use electricity, or people whose job is to make or repair these things: a company manufacturing electrical goods|, an electrical engineer electronic u...
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
Here's a simple distinguishment which I hope will help: > > Electric refers to anything that runs on electricity, i.e. β€œelectric kettle” > > > Electrical refers to something related to electricity, i.e. β€œelectrical faults”, β€œelectrical component”. > > > "Electric" is used in front of a device or machine that ru...
In addition to what has been said so far, "electric," unlike "electrical," can be used as a noun for an electrically powered machine or vehicle. E.g. > > [The lawmower is an electric](http://www.thefreedictionary.com/electrical). > > >
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
*Electric* means "of, worked by, charged with, or producing electricity." It can be used figuratively, as in "the atmosphere was electric;" to refer to a musical instrument, as in *electric guitar*; or to refer to a color, as in *electric blue*. *Electrical* means: * operating by or producing electricity * concern...
Electric used about something that works using electricity, for example, electric cooker , electric guitar, electric kettle. Electrical used about things in general that use electricity, or people whose job is to make or repair these things: a company manufacturing electrical goods|, an electrical engineer electronic u...
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
*Electric* means "of, worked by, charged with, or producing electricity." It can be used figuratively, as in "the atmosphere was electric;" to refer to a musical instrument, as in *electric guitar*; or to refer to a color, as in *electric blue*. *Electrical* means: * operating by or producing electricity * concern...
In addition to what has been said so far, "electric," unlike "electrical," can be used as a noun for an electrically powered machine or vehicle. E.g. > > [The lawmower is an electric](http://www.thefreedictionary.com/electrical). > > >
31,649
What is the difference between **electric** and **electrical** and their usage? For example, what is the difference between "electrical machine" and "electric machine"?
2011/06/26
[ "https://english.stackexchange.com/questions/31649", "https://english.stackexchange.com", "https://english.stackexchange.com/users/10087/" ]
In addition to what has been said so far, "electric," unlike "electrical," can be used as a noun for an electrically powered machine or vehicle. E.g. > > [The lawmower is an electric](http://www.thefreedictionary.com/electrical). > > >
Electric used about something that works using electricity, for example, electric cooker , electric guitar, electric kettle. Electrical used about things in general that use electricity, or people whose job is to make or repair these things: a company manufacturing electrical goods|, an electrical engineer electronic u...
12,916,091
Given a dynamic Dapper query such as: ``` var results = connection.Query<dynamic>("SELECT ...."); ``` I want to remove a couple of the returned columns/properties from the results. The trick is I want to do this without knowing/caring the names of the properties I want to keep, otherwise I would simply project the r...
2012/10/16
[ "https://Stackoverflow.com/questions/12916091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2656/" ]
A weird idea: what if the html is indeed escaped but you have some styling issue which hides the numbers before the dots. I would try to add some left padding either to the printed list ``` <ol style="padding-left: 100px;"> <li>First</li> <li>Second</li> </ol> ``` or to the span itself ``` <h:outputText esc...
What you're looking for is just a different way to style an ordered list. You just need to add this style ``` ol { list-style-type: decimal; } ```
54,710,468
I would like to select with CSS and apply some background color ONLY on the row number 3. But I have a limitation that I cannot use a css selector which select using a class name. Could you please point me out to solve this issue? Thanks! ```html <div class="root"> <div class="row">1 </div> <div class="row">...
2019/02/15
[ "https://Stackoverflow.com/questions/54710468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6426229/" ]
You can use ```css .root>div:last-child { background: green; } ``` ```html <div class="root"> <div class="row">1 </div> <div class="row">2 </div> <div class="row">3 </div> </div> ```
Use ```css .root div:last-child { background: red; } .root div:nth-child(1) { color:red; } ``` ```html <div class="root"> <div class="row">1 </div> <div class="row">2 </div> <div class="row">3 </div> </div> ``` If you plan to select row 3, and decide to add more rows you can use nth-chil...
54,710,468
I would like to select with CSS and apply some background color ONLY on the row number 3. But I have a limitation that I cannot use a css selector which select using a class name. Could you please point me out to solve this issue? Thanks! ```html <div class="root"> <div class="row">1 </div> <div class="row">...
2019/02/15
[ "https://Stackoverflow.com/questions/54710468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6426229/" ]
You can use ```css .root>div:last-child { background: green; } ``` ```html <div class="root"> <div class="row">1 </div> <div class="row">2 </div> <div class="row">3 </div> </div> ```
div.root:last-child will select every children. Try this Instead: ``` div.root div:last-child{ background: green; } ```
54,710,468
I would like to select with CSS and apply some background color ONLY on the row number 3. But I have a limitation that I cannot use a css selector which select using a class name. Could you please point me out to solve this issue? Thanks! ```html <div class="root"> <div class="row">1 </div> <div class="row">...
2019/02/15
[ "https://Stackoverflow.com/questions/54710468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6426229/" ]
You can use ```css .root>div:last-child { background: green; } ``` ```html <div class="root"> <div class="row">1 </div> <div class="row">2 </div> <div class="row">3 </div> </div> ```
You can do it in different ways: ```css .root div.row:last-child { background:red; } .root div.row:last-of-type { background: green; } .root div.row:nth-last-child(1) { background: yellow; } ``` ```html <div class="root"> <div class="row">1 </div> <div class="row">2 </div> <div class="r...
37,702,642
I use pyqtgraph for data acquisition and I have to represent some thresholds on the graphics view. For example to represent a high voltage limit, etc. I used the class `InfiniteLine` from pyqtgraph, but now, I have to take into account some possible changes on the threshold value during the acquisition. It would look ...
2016/06/08
[ "https://Stackoverflow.com/questions/37702642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6440073/" ]
You can execute the edit commands in client code (Javascript). Since these operations are very simple (insert/delete a character, clear the content of the text box), the server doesn't need to be involved for any of them. You can define these Javascript functions: ``` <script type="text/javascript"> function numP...
Consider using Ajax calls instead
61,297,947
I have some function I want to run on data, and the data selected depends on user selection (Shiny). For example, consider this: dumb\_input = any of following values ("english", "spanish", "french", "german") So, I'm hoping to access different data based on the language choice. What is the best way to set this up? I...
2020/04/19
[ "https://Stackoverflow.com/questions/61297947", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3409525/" ]
If you just want `names` based on `dumb_input`, you could use `match`. ``` dumb_input <- 'french' data_names$names[match(dumb_input, data_names$langs)] #[1] "antoine" ``` Or with `==` ``` data_names$names[data_names$langs == dumb_input] ``` --- Remember R is case-sensitive, while constructing the dataframe you ...
I have found that the *hash* library works OK on this: ``` #objective: get the name 'arthur' when 'english' is selected langs = c("english", "spanish", "french", "german") names = c("arthur", "pablo", "antoine", "hans") data_names_hash = hash (keys = langs, values = names) data_names_hash[["german"]] #[1] hans ```
21,791,409
I became interested in this after reading the list of libraries used by Instagram:<http://instagram.com/about/legal/libraries/> "The following sets forth attribution notices for third party software that may be contained in portions of the Instagram product. We thank the open source community for all of their contribut...
2014/02/14
[ "https://Stackoverflow.com/questions/21791409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1774391/" ]
This should do the job, if I understand your question correctly: ``` jQuery('.menu li > ul').parent().prepend('<i class="icon-plus"></i>'); ``` <http://jsfiddle.net/Zgaj3/>
I think this can work in you situation (**li:parent**). ``` jQuery('.menu').find('li:parent').prepend('<i style="" class="icon-plus"></i>'); ```
21,791,409
I became interested in this after reading the list of libraries used by Instagram:<http://instagram.com/about/legal/libraries/> "The following sets forth attribution notices for third party software that may be contained in portions of the Instagram product. We thank the open source community for all of their contribut...
2014/02/14
[ "https://Stackoverflow.com/questions/21791409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1774391/" ]
This should do the job, if I understand your question correctly: ``` jQuery('.menu li > ul').parent().prepend('<i class="icon-plus"></i>'); ``` <http://jsfiddle.net/Zgaj3/>
I am not sure, if I understood your question correctly. Anyway, the simplest solution to what I think your problem is, would be to iterate through each ul-element following a .menu and check whether the parent is a li-element and apply your styling: ``` jQuery('.menu').find('ul').each(function(){ if (jQuery(this)...
21,791,409
I became interested in this after reading the list of libraries used by Instagram:<http://instagram.com/about/legal/libraries/> "The following sets forth attribution notices for third party software that may be contained in portions of the Instagram product. We thank the open source community for all of their contribut...
2014/02/14
[ "https://Stackoverflow.com/questions/21791409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1774391/" ]
This should do the job, if I understand your question correctly: ``` jQuery('.menu li > ul').parent().prepend('<i class="icon-plus"></i>'); ``` <http://jsfiddle.net/Zgaj3/>
I think you'll need an if statement, something like: ``` if ($('.menu>ul>li>ul')){ $('.menu>ul').prepend('<i class="icon-plus"></i>'); } ``` Might have to do one for each level, so: ``` if ($('.menu>ul>li>ul>li>ul')){ $('.menu>ul>li>ul').prepend('<i class="icon-plus"></i>'); } ```
21,791,409
I became interested in this after reading the list of libraries used by Instagram:<http://instagram.com/about/legal/libraries/> "The following sets forth attribution notices for third party software that may be contained in portions of the Instagram product. We thank the open source community for all of their contribut...
2014/02/14
[ "https://Stackoverflow.com/questions/21791409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1774391/" ]
This should do the job, if I understand your question correctly: ``` jQuery('.menu li > ul').parent().prepend('<i class="icon-plus"></i>'); ``` <http://jsfiddle.net/Zgaj3/>
// return all li elements inside of the menu class ``` $('.menu').find('li'); ``` this will find the 4th level and each level after that. ``` $('.menu').find('ul li ul li ul li ul li').each(function(index, element){ // validate that this is indeed correct // 4th level elements and deeper console.log(element)...
21,791,409
I became interested in this after reading the list of libraries used by Instagram:<http://instagram.com/about/legal/libraries/> "The following sets forth attribution notices for third party software that may be contained in portions of the Instagram product. We thank the open source community for all of their contribut...
2014/02/14
[ "https://Stackoverflow.com/questions/21791409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1774391/" ]
This should do the job, if I understand your question correctly: ``` jQuery('.menu li > ul').parent().prepend('<i class="icon-plus"></i>'); ``` <http://jsfiddle.net/Zgaj3/>
I'm not sure about your requirements, but I think you are feeling difficulty in finding LI elements which contain a UL. The following code will help you find such elements. ``` $('.menu li>ul').parent().addClass('node') ``` Now you can do the required operation on this. Please come back if further help required. Pl...
32,909,937
this is my storyboard: [![enter image description here](https://i.stack.imgur.com/jwDiI.png)](https://i.stack.imgur.com/jwDiI.png) I would like to switch automatically from my ScanTable (TableViewController) back to my StartPage in some specific cases. So I added the following code, to switch between the both Views: ...
2015/10/02
[ "https://Stackoverflow.com/questions/32909937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > Any alternative way to reach a similar goal end be awesome. > > > Decorator: ``` def defer_property(member, property_name): def _(cls): pass # do stuff here return cls return _ ``` Usage: ``` @defer_property("child", "foo") class Subject: pass ```
Your function doesn't have to set attibute on it's own, it can return it instead: ``` def defer_property(member, property_name): prop = property( # ... ) return prop class Subject: foo = defer_property("child", "foo") ```
32,909,937
this is my storyboard: [![enter image description here](https://i.stack.imgur.com/jwDiI.png)](https://i.stack.imgur.com/jwDiI.png) I would like to switch automatically from my ScanTable (TableViewController) back to my StartPage in some specific cases. So I added the following code, to switch between the both Views: ...
2015/10/02
[ "https://Stackoverflow.com/questions/32909937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The class does not exist until after the body is evaluated, so no. A class statement ``` class MyClass(object): foo = 3 def __init__(self): pass ``` is roughly equivalent to ``` body['foo'] = 3 def init(self): pass body['__init__'] = init # *Now* create the class object MyClass = type('MyClass',...
Your function doesn't have to set attibute on it's own, it can return it instead: ``` def defer_property(member, property_name): prop = property( # ... ) return prop class Subject: foo = defer_property("child", "foo") ```
43,554
From the wiki page <https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses> the example of "How to Create Bitcoin Address" shows the SHA256 of: 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6 to be 600FFE422B4...
2016/03/31
[ "https://bitcoin.stackexchange.com/questions/43554", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/31581/" ]
The problem is that you're treating the pubkey as string data. What you need to do is treat it as raw binary hexadecimal. If you use [fileformat.info](http://www.fileformat.info/tool/hash.htm?hex=0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C...
ASCII-encoded hex strings are easily handled by [Bitcoin-Explorer](https://github.com/libbitcoin/libbitcoin-explorer/wiki). The following recreates results from [en.bitcoin.it](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses) properly: `% echo -n 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E...
43,554
From the wiki page <https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses> the example of "How to Create Bitcoin Address" shows the SHA256 of: 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6 to be 600FFE422B4...
2016/03/31
[ "https://bitcoin.stackexchange.com/questions/43554", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/31581/" ]
The problem is that you're treating the pubkey as string data. What you need to do is treat it as raw binary hexadecimal. If you use [fileformat.info](http://www.fileformat.info/tool/hash.htm?hex=0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C...
actually the public key: `0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6` is hex string, so you need transform it to bytes before you calculate the correct value. You can use Python3 to get the correct value: ``` >>> import hashlib...
43,554
From the wiki page <https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses> the example of "How to Create Bitcoin Address" shows the SHA256 of: 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6 to be 600FFE422B4...
2016/03/31
[ "https://bitcoin.stackexchange.com/questions/43554", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/31581/" ]
actually the public key: `0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6` is hex string, so you need transform it to bytes before you calculate the correct value. You can use Python3 to get the correct value: ``` >>> import hashlib...
ASCII-encoded hex strings are easily handled by [Bitcoin-Explorer](https://github.com/libbitcoin/libbitcoin-explorer/wiki). The following recreates results from [en.bitcoin.it](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses) properly: `% echo -n 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E...
10,892,276
I would like to replace a match with the number/index of the match. Is there way in java regex flavour to know which match number the current match is, so I can use `String.replaceAll(regex, replacement)`? Example: Replace `[A-Z]` with itself and its index: ``` Input: fooXbarYfooZ Output: fooX1barY2fooZ3 ``` ie, ...
2012/06/05
[ "https://Stackoverflow.com/questions/10892276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256196/" ]
Iterating over the input string is required so looping one way or the other is inevitable. The standard API does not implement a method implementing that loop so the loop either have to be in client code or in a third party library. --- Here is how the code would look like btw: ``` public abstract class MatchReplac...
**Not possible without loops in Java...**
10,892,276
I would like to replace a match with the number/index of the match. Is there way in java regex flavour to know which match number the current match is, so I can use `String.replaceAll(regex, replacement)`? Example: Replace `[A-Z]` with itself and its index: ``` Input: fooXbarYfooZ Output: fooX1barY2fooZ3 ``` ie, ...
2012/06/05
[ "https://Stackoverflow.com/questions/10892276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256196/" ]
Iterating over the input string is required so looping one way or the other is inevitable. The standard API does not implement a method implementing that loop so the loop either have to be in client code or in a third party library. --- Here is how the code would look like btw: ``` public abstract class MatchReplac...
Well I don't think its possible without any loop in Java. ``` String x = "fooXbarXfooX"; int count = 0; while(x.contains("X")) x = x.replaceFirst("X", Integer.toString(count++)); System.out.println(x); ```
10,892,276
I would like to replace a match with the number/index of the match. Is there way in java regex flavour to know which match number the current match is, so I can use `String.replaceAll(regex, replacement)`? Example: Replace `[A-Z]` with itself and its index: ``` Input: fooXbarYfooZ Output: fooX1barY2fooZ3 ``` ie, ...
2012/06/05
[ "https://Stackoverflow.com/questions/10892276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256196/" ]
Java regex does not support a reference to the count of the match, so it is impossible.
**Not possible without loops in Java...**
10,892,276
I would like to replace a match with the number/index of the match. Is there way in java regex flavour to know which match number the current match is, so I can use `String.replaceAll(regex, replacement)`? Example: Replace `[A-Z]` with itself and its index: ``` Input: fooXbarYfooZ Output: fooX1barY2fooZ3 ``` ie, ...
2012/06/05
[ "https://Stackoverflow.com/questions/10892276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256196/" ]
Java regex does not support a reference to the count of the match, so it is impossible.
Well I don't think its possible without any loop in Java. ``` String x = "fooXbarXfooX"; int count = 0; while(x.contains("X")) x = x.replaceFirst("X", Integer.toString(count++)); System.out.println(x); ```
29,639,342
I have a .net class library that compiles to dll. in this project I have dataset. under my project - settings.settings I keep my connection string. it is SQL authentication. Then when I did a search using wingrep for username and password, low and behold, I can see it clearly in clear text in the DLL. is there ...
2015/04/14
[ "https://Stackoverflow.com/questions/29639342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2635566/" ]
How are you deploying this app? If it's a web app, then anyone who can own your system to the level of opening the DLL in a text editor can probably get into the database already and it won't matter what you do with the connection string. If it's a desktop app, then the suggestion to use Windows authentication is pro...
I found this that I think that will serve my goal. indeed it is for winforms and my application is a DLL. but it should be similar enough that it will work [How to securely store a connection string in a WinForms application?](https://stackoverflow.com/questions/10606892/how-to-securely-store-a-connection-string-in-a...
12,686,832
From Java I am doing the following query on DB2: ``` SELECT * FROM PRV_PRE_ACTIVATION WHERE TRANSACTION_ID = ? ``` The field `TRANSACTION_ID` is a `VARCHAR` of length 32. I set the parameter in the preparedStatement using the `setString` method. I get the error: ``` com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 ...
2012/10/02
[ "https://Stackoverflow.com/questions/12686832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241899/" ]
you can use: ``` tree /path/to/dir1 > out1 tree /path/to/dir2 > out2 diff out1 out2 | grep ">" ``` but i find [beyond compare](http://www.scootersoftware.com/ "beyond compare") more suitable for a job like this.
You may also use the command comm comm -1 -2 <(ls /path\_to\_dir-1/) <(ls /path\_to\_dir-2/) Check the following link for additional info: <http://nixtricks.wordpress.com/2010/01/11/unix-compare-the-contents-of-two-directories-in-the-command-line/>
12,686,832
From Java I am doing the following query on DB2: ``` SELECT * FROM PRV_PRE_ACTIVATION WHERE TRANSACTION_ID = ? ``` The field `TRANSACTION_ID` is a `VARCHAR` of length 32. I set the parameter in the preparedStatement using the `setString` method. I get the error: ``` com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 ...
2012/10/02
[ "https://Stackoverflow.com/questions/12686832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241899/" ]
you can use: ``` tree /path/to/dir1 > out1 tree /path/to/dir2 > out2 diff out1 out2 | grep ">" ``` but i find [beyond compare](http://www.scootersoftware.com/ "beyond compare") more suitable for a job like this.
The one liners above are great, but this bash script allows you more customization: can change `-e` to `! -e` or skip certain files. `for f in $(find old/ -type f) ; do if [ -e "new/${f}" ] ; then echo "${f} exists" ; fi ; done`
12,686,832
From Java I am doing the following query on DB2: ``` SELECT * FROM PRV_PRE_ACTIVATION WHERE TRANSACTION_ID = ? ``` The field `TRANSACTION_ID` is a `VARCHAR` of length 32. I set the parameter in the preparedStatement using the `setString` method. I get the error: ``` com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 ...
2012/10/02
[ "https://Stackoverflow.com/questions/12686832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241899/" ]
You may also use the command comm comm -1 -2 <(ls /path\_to\_dir-1/) <(ls /path\_to\_dir-2/) Check the following link for additional info: <http://nixtricks.wordpress.com/2010/01/11/unix-compare-the-contents-of-two-directories-in-the-command-line/>
The one liners above are great, but this bash script allows you more customization: can change `-e` to `! -e` or skip certain files. `for f in $(find old/ -type f) ; do if [ -e "new/${f}" ] ; then echo "${f} exists" ; fi ; done`
6,993,293
Hi I have a Broadcast receiver with following code. ``` 1. Intent i = new Intent(context, A.class); 2. i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 3. context.startActivity(i); ``` This works fine and my activity does start, but it starts on top of my main activity i.e. B. What I want is that from m...
2011/08/09
[ "https://Stackoverflow.com/questions/6993293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835791/" ]
You can do using an QueryString paremeter when page return back to main page then here you can check QueryString paremeter is exist. here you can implement code for bind grid ``` if (Request.QueryString["Back"]!= null) { // Your bind grid function } ```
You can create a function, which will called both from the button\_click and page\_load.
6,993,293
Hi I have a Broadcast receiver with following code. ``` 1. Intent i = new Intent(context, A.class); 2. i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 3. context.startActivity(i); ``` This works fine and my activity does start, but it starts on top of my main activity i.e. B. What I want is that from m...
2011/08/09
[ "https://Stackoverflow.com/questions/6993293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835791/" ]
Rather than trying to call your button click handler from the `Page_Load`, change your button click handler to simply call another method like: ``` protected void btnSearch_Click(object sender, EventArgs e) { RunSearch(); } ``` Then move all your `btnSearch_Click()` code into `RunSearch()` Then in your `Page_L...
You can create a function, which will called both from the button\_click and page\_load.
6,993,293
Hi I have a Broadcast receiver with following code. ``` 1. Intent i = new Intent(context, A.class); 2. i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 3. context.startActivity(i); ``` This works fine and my activity does start, but it starts on top of my main activity i.e. B. What I want is that from m...
2011/08/09
[ "https://Stackoverflow.com/questions/6993293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835791/" ]
You should reset the session redirected variable so it doesn't fall in the same case. ``` protected void Page_Load(object sender, EventArgs e) { if (Session["Redirected"] != null) { Session["Redirected"] = null; .... ```
You can create a function, which will called both from the button\_click and page\_load.
6,993,293
Hi I have a Broadcast receiver with following code. ``` 1. Intent i = new Intent(context, A.class); 2. i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 3. context.startActivity(i); ``` This works fine and my activity does start, but it starts on top of my main activity i.e. B. What I want is that from m...
2011/08/09
[ "https://Stackoverflow.com/questions/6993293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835791/" ]
Rather than trying to call your button click handler from the `Page_Load`, change your button click handler to simply call another method like: ``` protected void btnSearch_Click(object sender, EventArgs e) { RunSearch(); } ``` Then move all your `btnSearch_Click()` code into `RunSearch()` Then in your `Page_L...
You can do using an QueryString paremeter when page return back to main page then here you can check QueryString paremeter is exist. here you can implement code for bind grid ``` if (Request.QueryString["Back"]!= null) { // Your bind grid function } ```
6,993,293
Hi I have a Broadcast receiver with following code. ``` 1. Intent i = new Intent(context, A.class); 2. i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 3. context.startActivity(i); ``` This works fine and my activity does start, but it starts on top of my main activity i.e. B. What I want is that from m...
2011/08/09
[ "https://Stackoverflow.com/questions/6993293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835791/" ]
You should reset the session redirected variable so it doesn't fall in the same case. ``` protected void Page_Load(object sender, EventArgs e) { if (Session["Redirected"] != null) { Session["Redirected"] = null; .... ```
You can do using an QueryString paremeter when page return back to main page then here you can check QueryString paremeter is exist. here you can implement code for bind grid ``` if (Request.QueryString["Back"]!= null) { // Your bind grid function } ```
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
You can download the source code from here([Recyclerview In Kotlin Android](http://deepshikhapuri.blogspot.in/2017/07/recyclerview-in-kotlin-android.html)) **MainActivity.kt:** ``` package com.deepshikha.recyclerviewkotlin import android.app.Activity import android.os.Bundle import android.support.v7.widget.LinearLay...
try to use Delegate Adapters below is reference link. Ref Link : <https://android.jlelse.eu/keddit-part-4-recyclerview-delegate-adapters-data-classes-with-kotlin-9248f44327f7>
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
**On .MainActivity.kt** ``` override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) //rcv is id of Recyclerview rcv.layoutManager = LinearLayoutManager(this) rcv.adapter = MyAdpater() } ``` **Create a new .kt file for creatin...
I have created a nice adapter may be it helped in reducing code.. ``` class ResultActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.question_list_activity) if (intent != null) { var resul...
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
I have my RecyclerView Adapter which is as follows, ``` internal class OptionsAdapter : RecyclerView.Adapter<OptionsAdapter.ViewHolder>() { private val mOptionList = ArrayList<Option>() private var mOnItemClickListener: OnItemClickListener<Option>? = null var data: List<Option> get() = mOptionList set(list)...
I have created a nice adapter may be it helped in reducing code.. ``` class ResultActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.question_list_activity) if (intent != null) { var resul...
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
Look at following example, I think you this can give you an idea. You can get the example from here : <https://github.com/Siddharha/RecyclerviewTest_Kotlin> **Main Activity** ``` class MainActivity : AppCompatActivity() { private var myAdapter: MyAdapter? = null private var arrayList: ArrayList<MyItem>? = null priv...
try to use Delegate Adapters below is reference link. Ref Link : <https://android.jlelse.eu/keddit-part-4-recyclerview-delegate-adapters-data-classes-with-kotlin-9248f44327f7>
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
You can download the source code from here([Recyclerview In Kotlin Android](http://deepshikhapuri.blogspot.in/2017/07/recyclerview-in-kotlin-android.html)) **MainActivity.kt:** ``` package com.deepshikha.recyclerviewkotlin import android.app.Activity import android.os.Bundle import android.support.v7.widget.LinearLay...
Look at following example, I think you this can give you an idea. You can get the example from here : <https://github.com/Siddharha/RecyclerviewTest_Kotlin> **Main Activity** ``` class MainActivity : AppCompatActivity() { private var myAdapter: MyAdapter? = null private var arrayList: ArrayList<MyItem>? = null priv...
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
try to use Delegate Adapters below is reference link. Ref Link : <https://android.jlelse.eu/keddit-part-4-recyclerview-delegate-adapters-data-classes-with-kotlin-9248f44327f7>
I have created a nice adapter may be it helped in reducing code.. ``` class ResultActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.question_list_activity) if (intent != null) { var resul...
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
You can download the source code from here([Recyclerview In Kotlin Android](http://deepshikhapuri.blogspot.in/2017/07/recyclerview-in-kotlin-android.html)) **MainActivity.kt:** ``` package com.deepshikha.recyclerviewkotlin import android.app.Activity import android.os.Bundle import android.support.v7.widget.LinearLay...
I have created a nice adapter may be it helped in reducing code.. ``` class ResultActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.question_list_activity) if (intent != null) { var resul...
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
You can download the source code from here([Recyclerview In Kotlin Android](http://deepshikhapuri.blogspot.in/2017/07/recyclerview-in-kotlin-android.html)) **MainActivity.kt:** ``` package com.deepshikha.recyclerviewkotlin import android.app.Activity import android.os.Bundle import android.support.v7.widget.LinearLay...
I have my RecyclerView Adapter which is as follows, ``` internal class OptionsAdapter : RecyclerView.Adapter<OptionsAdapter.ViewHolder>() { private val mOptionList = ArrayList<Option>() private var mOnItemClickListener: OnItemClickListener<Option>? = null var data: List<Option> get() = mOptionList set(list)...
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
Recyclerview with different listener for different view **AddressAdapter** ``` import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView class AddressAdapter (private val listener: (AddressData, Int,Int) -> Unit): RecyclerView.Adapter<AddressViewHolder>() { var lstAddress = emptyList<Address...
I have created a nice adapter may be it helped in reducing code.. ``` class ResultActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.question_list_activity) if (intent != null) { var resul...
43,012,903
I'm trying to create a simple recyclerView in Kotlin with data that I get via Volley (which I have confirmed returns the correct data), I keep running to the error `E/RecyclerView: No adapter attached; skipping layout` when in fact I have specified an adapter with the custom adapter class that I created: ``` class Ima...
2017/03/25
[ "https://Stackoverflow.com/questions/43012903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3749128/" ]
Look at following example, I think you this can give you an idea. You can get the example from here : <https://github.com/Siddharha/RecyclerviewTest_Kotlin> **Main Activity** ``` class MainActivity : AppCompatActivity() { private var myAdapter: MyAdapter? = null private var arrayList: ArrayList<MyItem>? = null priv...
I have created a nice adapter may be it helped in reducing code.. ``` class ResultActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.question_list_activity) if (intent != null) { var resul...
25,275,202
I have a column in a table with a `varchar` datatype. It has 15 digits after the decimal point. Now I am having a hard time converting it to a numeric format.. float, double etc. Does anyone have any suggestions? Example : **Table1** ``` Column1 ------------------- -28.851540616246499 -22.857142857142858 -26.9...
2014/08/12
[ "https://Stackoverflow.com/questions/25275202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1408809/" ]
You can use the [**decimal data type**](http://msdn.microsoft.com/en-gb/library/ms187746.aspx) and specify the precision to state how many digits are after the decimal point. So you could use `decimal(28,20)` for example, which would hold 28 digits with 20 of them after the decimal point. Here's a [**SQL Fiddle**](htt...
I think you're trying to actually change the data type of that column? If that is the case you want to ALTER the table and change the column type over to float, like so: ``` alter table table1 alter column column1 float ``` See fiddle: <http://sqlfiddle.com/#!6/637e6/1/0> You would use CONVERT if you're changing t...
197,559
I have a Iomega SuperSlim USB 2.0 8x DVD Writer External Optical Drive that I used without any issue on my Macbook Air. Now all of a sudden it doesn't work anymore. The DVD spins, a "Audio CD" item pops up on the Finder sidebar and vanishes a few seconds after. Over and over again. iTunes manages to get the track inf...
2015/07/26
[ "https://apple.stackexchange.com/questions/197559", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/23705/" ]
That it works fine on a Windows PC but not your Mac is puzzling. Think back to when you **know** it worked properly. What software have you updated since then? That could be the cause. For example if you went from OSX 10.10.3 to 10.10.4 and that is the only change there may have been a problem with the update. In tha...
Have you tried restarting into the recovery partition and then re-installing OS X? > > To restart in recovery mode, shut down or restart your computer, and when it restarts hold down `Command` `R`. From there, select Re-install OS X, select your ssd, and let it re-install. It will restart at least once during the pro...
4,005,828
This is kind of a follow to my other post about Unity (http://stackoverflow.com/questions/3998559/irepository-iservice-unity-in-an-asp-net-mvc-application-reference-question). Basically I'm trying to register a generic type in the web.config. I've read a few posts and this SEEMS like it is configured correctly. ``` <...
2010/10/23
[ "https://Stackoverflow.com/questions/4005828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/301004/" ]
I think you need to specify which type is the generic using when declaring the alias. I've done a sample for [How to inject a generic IList<> of objects using Unity 2 XML config?](https://stackoverflow.com/questions/3996267/how-to-inject-a-generic-ilist-of-objects-using-unity-2-xml-config/4120032#4120032) like the fol...
There's no alias or namespace / assembly shortcuts for the type Property. Where is this type defined? Fix that and it should work.
4,005,828
This is kind of a follow to my other post about Unity (http://stackoverflow.com/questions/3998559/irepository-iservice-unity-in-an-asp-net-mvc-application-reference-question). Basically I'm trying to register a generic type in the web.config. I've read a few posts and this SEEMS like it is configured correctly. ``` <...
2010/10/23
[ "https://Stackoverflow.com/questions/4005828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/301004/" ]
I think you need to specify which type is the generic using when declaring the alias. I've done a sample for [How to inject a generic IList<> of objects using Unity 2 XML config?](https://stackoverflow.com/questions/3996267/how-to-inject-a-generic-ilist-of-objects-using-unity-2-xml-config/4120032#4120032) like the fol...
A config file is meant to be read by humans thus don't make your life difficult. The following line is really hard to maintain ``` <alias alias="IService" type="Porject.Service.IService`1, Porject.Service" /> ```
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
No -- Money, as we understand it, is essentially worthless, and it *should* be worthless. It serves as a medium for exchange, where a given amount of money is agreed to have a certain value, but the tokens exchanged are more or less valueless. There are good reasons for this. Bullets-as-currency would be a form of [co...
Bullets in a post apocalyptic setting have instrumental value and are valuable in this sense. A limited supply of a needed commodity makes something valuable, this is why we back currency with gold, though gold isn't necessarily "Needed" it can be incredibly useful. Bullets would then be placed in the same category as ...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
Bullets are common but "Will they fit"? So for example in the NATO region the 5.56 mm bullets could be cheap but the .45 could cost food for 7 days as they are not so common but pack more punch. On the other hand it's not the bullet or case but the primer. You can cast a new bullet, fill the case with powder but rema...
To stop arguing and instead use historical precedent, the British colony of New South Wales used rum as currency at one point, so yes, you can use something similar, like bullets as a currency if there is a demand for the item, although it may be temporary until something better comes along.
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
Dmitry Glukhovsky in Metro 2033-2035 did it. Bullets was currency for all goods. Even there was two types of ammunition - *normal* (usually handmade) and *military*. Economy founded on bullets as a currency should be still on shortage of materials or still using them really often. The currency shouldn't be too easy to...
As some others have said, there is a difference between something that represents value and something that has value. Printing numbers on currency solves the scaling problem, but only when society at large accepts that form of money. Easy access to weapons is a special case, as it depends on a societies values about ...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
The value of money depends on supply ==================================== Without doing a super deep dive into economics, the value of a currency depends on the [money supply](https://en.wikipedia.org/wiki/Money_supply). A currency that is stable for long periods of time must have a stable volume in circulation. Exam...
**Yes, but you need some other factors** You mentionned a post apocalyptic world, so you could add some more details to make bullets work better as a money : * Most engineering knowledge on how to make guns and bullets has been lost. Therefore, the amount of working guns is mostly stable. Most of them are from before...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
You can use anything as money. Money is just a measurement for services. If you believe something has value, it has that value. Paper money (for example the dollar) is not coupled to any hard value (like gold) anymore, so it just has the value people give it.
Bullets are common but "Will they fit"? So for example in the NATO region the 5.56 mm bullets could be cheap but the .45 could cost food for 7 days as they are not so common but pack more punch. On the other hand it's not the bullet or case but the primer. You can cast a new bullet, fill the case with powder but rema...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
Any "currency" that is useful as something else (cattle, beans, bullets, cigarretes) is only compatible with very limited markets. Pre-feudal, I would say, or politically repressed markets such as in the fSU or DDR. In general, you can abide by the following law: > > The usefulness of any given commodity as money is...
Yes === I game a RPG where we have that setup, and it works like this: Bullets are common (so relatively worthless, but good for small change). Value of objects is usually expressed as amounts of bullets, but usually you don't pay in bullets. So, you still have a barter system (you exchange two goods) but there is a ...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
I thought it might be worthwhile fleshing out a comment I made on another answer here. Anything can be used as money. It's tempting sometimes to believe otherwise, but there is only one thing that is necessary for the creation of currency, and that is mutually agreed value. If everybody believes/agrees that something ...
Your answer has been given multiple times, yet i haven't seen this one: Yes. Ever wondered where the "shot" of licor came from? "Legend has it that back in the Old West, cowboys would trade a bullet cartridge for a small amount of alcohol, and the shot glass proved the perfect size to do the trick. " The following p...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
There is another issue that just adds to the "bullets are bad as money" posts. I haven't seen it listed here but how do you know if the bullet is good? The primer caps are probably the hardest part to make. So, when reloading the brass, why use a real primer cap? Just sell the bullet off to someone and you are good to...
I hope I'm not being too late. There was in fact a case in history where a civilization used another commodities as currency. [The mayans and the aztec empire](http://encyclopedia-of-money.blogspot.mx/2010/01/cocoa-bean-currency.html) used cocoa as a trade good, even restricted its cultivation. And about using go...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
To stop arguing and instead use historical precedent, the British colony of New South Wales used rum as currency at one point, so yes, you can use something similar, like bullets as a currency if there is a demand for the item, although it may be temporary until something better comes along.
As some others have said, there is a difference between something that represents value and something that has value. Printing numbers on currency solves the scaling problem, but only when society at large accepts that form of money. Easy access to weapons is a special case, as it depends on a societies values about ...
80,543
I'm making a world that is 1/3 medieval fantasy, 1/3 pre-civil war American west, and 1/3 Mad Max. The world underwent an apocalyptic scenario that destroyed the governing bodies at the time, but it has been a few generations since then, so city states and towns have started to rebuild. Since their old fiat currency ...
2017/05/10
[ "https://worldbuilding.stackexchange.com/questions/80543", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37754/" ]
> > How would having money that could be expended permanently, by firing it, affect the economy? > > > There's a real world example. In prisons, it was not uncommon for cigarettes to be used as a form of [currency](https://en.wikipedia.org/wiki/Commodity_money). This has faded more recently as prisons have cracked...
**Yes, but you need some other factors** You mentionned a post apocalyptic world, so you could add some more details to make bullets work better as a money : * Most engineering knowledge on how to make guns and bullets has been lost. Therefore, the amount of working guns is mostly stable. Most of them are from before...
67,675,416
I've been trying to scrape the names of bars in Hong Kong central from this link: [link](https://www.google.com/search?q=bar%20hong%20kong%20central&biw=1246&bih=714&sz=0&tbm=lcl&sxsrf=ALeKk00-T5bIiw3gGOcGpwu5Y1xzOXJngA%3A1621872046866&ei=rs2rYOSsNMX_-Qak8J-ACg&oq=bar+hong+kong+central&gs_l=psy-ab.3..35i39k1j0i22i30k1l...
2021/05/24
[ "https://Stackoverflow.com/questions/67675416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13106254/" ]
Google is a very complex search engine, it cannot simply be scraped with a single get request, it also has anti-bot tampering features to prevent people from scraping the site (as Google wants developers to pay for there API and use that instead). Here is a google search module I wrote in python for a project I was wor...
You need to consider that Google is pretty restrictive when it comes to automated requests to its services not via means of supplied APIs and so on. Try to run the example, and then print the `title` of the html you get, it probably will be > > Before proceeding to Google Search > > > So, that's why you get empty...
67,675,416
I've been trying to scrape the names of bars in Hong Kong central from this link: [link](https://www.google.com/search?q=bar%20hong%20kong%20central&biw=1246&bih=714&sz=0&tbm=lcl&sxsrf=ALeKk00-T5bIiw3gGOcGpwu5Y1xzOXJngA%3A1621872046866&ei=rs2rYOSsNMX_-Qak8J-ACg&oq=bar+hong+kong+central&gs_l=psy-ab.3..35i39k1j0i22i30k1l...
2021/05/24
[ "https://Stackoverflow.com/questions/67675416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13106254/" ]
Google Maps is a Javascript-driven website, in order to make it work with `BS4` you need to parse `window.APP_INITIALIZATION_STATE` (view source code of the page) variable block using a regular expression to find what you're looking for. `BeautifulSoup` can't scrape dynamic websites. That was the reason why you were g...
You need to consider that Google is pretty restrictive when it comes to automated requests to its services not via means of supplied APIs and so on. Try to run the example, and then print the `title` of the html you get, it probably will be > > Before proceeding to Google Search > > > So, that's why you get empty...
67,675,416
I've been trying to scrape the names of bars in Hong Kong central from this link: [link](https://www.google.com/search?q=bar%20hong%20kong%20central&biw=1246&bih=714&sz=0&tbm=lcl&sxsrf=ALeKk00-T5bIiw3gGOcGpwu5Y1xzOXJngA%3A1621872046866&ei=rs2rYOSsNMX_-Qak8J-ACg&oq=bar+hong+kong+central&gs_l=psy-ab.3..35i39k1j0i22i30k1l...
2021/05/24
[ "https://Stackoverflow.com/questions/67675416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13106254/" ]
Google Maps is a Javascript-driven website, in order to make it work with `BS4` you need to parse `window.APP_INITIALIZATION_STATE` (view source code of the page) variable block using a regular expression to find what you're looking for. `BeautifulSoup` can't scrape dynamic websites. That was the reason why you were g...
Google is a very complex search engine, it cannot simply be scraped with a single get request, it also has anti-bot tampering features to prevent people from scraping the site (as Google wants developers to pay for there API and use that instead). Here is a google search module I wrote in python for a project I was wor...
7,078,439
I am getting `ActionView::MissingTemplate` error when using render\_to\_string method with partial views, below the code ``` bizz = render_to_string(:partial => "biz_new",:layout => false) ``` Even though i have explicitly specified `:layout => false`, i am getting the MissingTemplate error always. But render\_to\...
2011/08/16
[ "https://Stackoverflow.com/questions/7078439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97572/" ]
Try ``` render_to_string("_biz_new", :formats => [:html], :layout => false, :locals => {:biz => @biz}) ``` render\_to\_string needs the starting underscore and the .html extension.
It looks like rails is expecting the file to be in format txt. What's the file named ? Try naming it: ``` _biz_new.txt.erb ``` -or- ``` businesses/_biz_new.txt.erb ```
7,078,439
I am getting `ActionView::MissingTemplate` error when using render\_to\_string method with partial views, below the code ``` bizz = render_to_string(:partial => "biz_new",:layout => false) ``` Even though i have explicitly specified `:layout => false`, i am getting the MissingTemplate error always. But render\_to\...
2011/08/16
[ "https://Stackoverflow.com/questions/7078439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97572/" ]
It looks like rails is expecting the file to be in format txt. What's the file named ? Try naming it: ``` _biz_new.txt.erb ``` -or- ``` businesses/_biz_new.txt.erb ```
Had similar issue. I found a solution: `render_to_string(model, :formats => [:html])`
7,078,439
I am getting `ActionView::MissingTemplate` error when using render\_to\_string method with partial views, below the code ``` bizz = render_to_string(:partial => "biz_new",:layout => false) ``` Even though i have explicitly specified `:layout => false`, i am getting the MissingTemplate error always. But render\_to\...
2011/08/16
[ "https://Stackoverflow.com/questions/7078439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97572/" ]
Try ``` render_to_string("_biz_new", :formats => [:html], :layout => false, :locals => {:biz => @biz}) ``` render\_to\_string needs the starting underscore and the .html extension.
Had similar issue. I found a solution: `render_to_string(model, :formats => [:html])`
7,078,439
I am getting `ActionView::MissingTemplate` error when using render\_to\_string method with partial views, below the code ``` bizz = render_to_string(:partial => "biz_new",:layout => false) ``` Even though i have explicitly specified `:layout => false`, i am getting the MissingTemplate error always. But render\_to\...
2011/08/16
[ "https://Stackoverflow.com/questions/7078439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97572/" ]
Try ``` render_to_string("_biz_new", :formats => [:html], :layout => false, :locals => {:biz => @biz}) ``` render\_to\_string needs the starting underscore and the .html extension.
As Mike Kijewski mentioned, you can include the underscore at the beginning of the partial name, but if you use the .html in the end you will get a deprecation warning. A more straightforward way is this: ``` render_to_string(:partial => "folder_name/_partial_name", :formats => [:html], :layout => false, :locals => {:...
7,078,439
I am getting `ActionView::MissingTemplate` error when using render\_to\_string method with partial views, below the code ``` bizz = render_to_string(:partial => "biz_new",:layout => false) ``` Even though i have explicitly specified `:layout => false`, i am getting the MissingTemplate error always. But render\_to\...
2011/08/16
[ "https://Stackoverflow.com/questions/7078439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97572/" ]
As Mike Kijewski mentioned, you can include the underscore at the beginning of the partial name, but if you use the .html in the end you will get a deprecation warning. A more straightforward way is this: ``` render_to_string(:partial => "folder_name/_partial_name", :formats => [:html], :layout => false, :locals => {:...
Had similar issue. I found a solution: `render_to_string(model, :formats => [:html])`
4,289,334
I am trying to send out automated emails by at timestamp. I have a set of unix timestamps in a DB. I pull them then try and compare them to each other. The part that breaks at the end. The foreach doesn't return the correct eblast id's. I think I am subtracting the unix timestamps correctly but I am not sure. I want th...
2010/11/27
[ "https://Stackoverflow.com/questions/4289334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/221068/" ]
Assuming the `warning_x` fields are timestamps, too, this should do the trick: ``` $timestamp = time(); $query = sprintf( 'SELECT id, warning_1' . ' FROM eblast' . ' WHERE (UNIX_TIMESTAMP(warning_1) - %u) BETWEEN 1 AND 899', $timestamp ); while ($row = mysql_fetch_array($query, MYSQL_NUM)) { $id...
Why don't you modify your first SQL query to only select records with a timestamp column less than the current time minus 15 minute's worth of seconds?
232,539
I'm about to upgrade my computer but might keep some parts. Just wandering what I would have to keep to prevent me having to reinstall my OSs, at the moment I have a dual boot setup with ubuntu and windows 7. I'm pretty sure you can't just take your hard drive with the OS on it and put it into a different box and keep ...
2011/01/13
[ "https://superuser.com/questions/232539", "https://superuser.com", "https://superuser.com/users/54148/" ]
It all depends on how big of changes you're making. If you are moving from a 32-bit OS to a 64-bit OS, you definitely will need to reinstall. If you are moving from an AMD processor to an Intel processor, or vice-versa, you may need to reinstall. Beyond that, you should be able to move over the hard drive and boot up f...
You should be able to take your HDD and drop it into another machine (where the only common part is the HDD itself. I have done this a few times when our Windows image wouldn't deploy to a certain machine - just deployed it to a spare HDD and swapped them over. At worst you would have to ring Microsoft (though I have...
232,539
I'm about to upgrade my computer but might keep some parts. Just wandering what I would have to keep to prevent me having to reinstall my OSs, at the moment I have a dual boot setup with ubuntu and windows 7. I'm pretty sure you can't just take your hard drive with the OS on it and put it into a different box and keep ...
2011/01/13
[ "https://superuser.com/questions/232539", "https://superuser.com", "https://superuser.com/users/54148/" ]
It all depends on how big of changes you're making. If you are moving from a 32-bit OS to a 64-bit OS, you definitely will need to reinstall. If you are moving from an AMD processor to an Intel processor, or vice-versa, you may need to reinstall. Beyond that, you should be able to move over the hard drive and boot up f...
There is no hard limit to the amount of hardware you can change - it all depends on OS and drivers and the hardware versions. OEM Windows might throw a tantrum and refuse Windows activation if it sees too many hardware changes, but there is no technical reason for this, it's just a licencing watchdog. In general you ...
232,539
I'm about to upgrade my computer but might keep some parts. Just wandering what I would have to keep to prevent me having to reinstall my OSs, at the moment I have a dual boot setup with ubuntu and windows 7. I'm pretty sure you can't just take your hard drive with the OS on it and put it into a different box and keep ...
2011/01/13
[ "https://superuser.com/questions/232539", "https://superuser.com", "https://superuser.com/users/54148/" ]
There is no hard limit to the amount of hardware you can change - it all depends on OS and drivers and the hardware versions. OEM Windows might throw a tantrum and refuse Windows activation if it sees too many hardware changes, but there is no technical reason for this, it's just a licencing watchdog. In general you ...
You should be able to take your HDD and drop it into another machine (where the only common part is the HDD itself. I have done this a few times when our Windows image wouldn't deploy to a certain machine - just deployed it to a spare HDD and swapped them over. At worst you would have to ring Microsoft (though I have...
1,267,522
Is it true that every nilpotent group is a solvable group? It is true for finite $ p $-groups, but I am not sure about infinite $ p $-groups.
2015/05/05
[ "https://math.stackexchange.com/questions/1267522", "https://math.stackexchange.com", "https://math.stackexchange.com/users/138710/" ]
Here is a solution: $$ \frac{1}{2}+\frac{1}{\pi}(\frac{x}{\epsilon}-\frac{x^3}{3\epsilon^{3}}+\frac{x^{5}}{5\epsilon^5}\cdots) $$
Althogh I think Bombyx mori's solution is great and simple, maybe the following approximation is better for you on the interval $[-1,1]$. $$ p\_\varepsilon(x) = -\tfrac{1}{6\pi}\left(16\arctan\left(\tfrac{1}{2\varepsilon}\right)-8\arctan\left(\tfrac{1}{\varepsilon}\right)\right)x^3 - \tfrac{1}{6\pi}\left(2\arctan\left(...
1,267,522
Is it true that every nilpotent group is a solvable group? It is true for finite $ p $-groups, but I am not sure about infinite $ p $-groups.
2015/05/05
[ "https://math.stackexchange.com/questions/1267522", "https://math.stackexchange.com", "https://math.stackexchange.com/users/138710/" ]
It is not possible to use polynomial as Heaviside step function with a good average precision, because any polynomial is infinite at both positive and negative infinity and Heaviside is not. Second, you would need to have zero value for all negative values. Even if you take that the value is only approximately zero you...
Althogh I think Bombyx mori's solution is great and simple, maybe the following approximation is better for you on the interval $[-1,1]$. $$ p\_\varepsilon(x) = -\tfrac{1}{6\pi}\left(16\arctan\left(\tfrac{1}{2\varepsilon}\right)-8\arctan\left(\tfrac{1}{\varepsilon}\right)\right)x^3 - \tfrac{1}{6\pi}\left(2\arctan\left(...
42,526
Both terms refer to a company. I want to know if there are differences on when one term would be preferred over the other.
2017/01/14
[ "https://japanese.stackexchange.com/questions/42526", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/18435/" ]
δΌšη€Ύγ€γ‹γ„γ—γ‚ƒγ€‘ *kaisha* is an independent **word** meaning "company" or "corporation". In compounds it describes a *type of* company (and is always pronounced **が**いしゃ *gaisha*) > > * θˆͺη©ΊδΌšη€Ύγ€γγ†γ“γ†γŒγ„γ—γ‚ƒγ€‘ *kΕ«kō gaisha* airline company > * θ¨ΌεˆΈδΌšη€Ύγ€γ—γ‚‡γ†γ‘γ‚“γŒγ„γ—γ‚ƒγ€‘ *shōken gaisha* brokerage firm > * ζ ͺεΌδΌšη€Ύγ€γ‹γΆγ—γγŒγ„γ—γ‚ƒγ€‘ *kabushiki gaisha* stock ...
No, they are not interchangeable at all. * 会瀾{かいしゃ} This is a word, meaning "company", large or small * η€Ύ{しゃ} This is a single character, which as so often happens corresponds to about half of a word. One of its meanings is "company" as a prefix or suffix in a compound: e.g. η€Ύε†…{しゃγͺい} means "company-internal", or δ»–η€Ύ{γŸγ—...