qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
64,623,089
I'm exploring Deno with cvs files, but i got a problem with the parse. I'm thinking that the problem come with the old dependencies; ``` deno info --unstable --no-check .\mod.ts ``` The majority are from @0.75 and I'm in the @1.5. And I want to collaborate to help to solve problems in the Deno repo and not just...
2020/10/31
[ "https://Stackoverflow.com/questions/64623089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8272938/" ]
This could happen due to a version mismatch between the version of the Spark client contained in the job server and the version of Spark to which you are submitting the job.
Hope it is not too late to answer the question. Yes, it is due to version mismatch. I tested and it only work for Spark 2 and does not version 3. If you need an example of running on Kubernetes, can refer to <https://github.com/cometta/python-apache-beam-spark> . If it is useful for you, can help me to 'Star' the repos...
12,918,877
I have a product search which I'm posting to an add-to-basket webservice. Problem is, I'm visualizing all product variations (say color and size). I just ran into one item in the database, which was available in 10 sizes and 30 colors, resulting in an `network error, uri too large`, because my AJAX was posting this: ...
2012/10/16
[ "https://Stackoverflow.com/questions/12918877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536768/" ]
Post the data instead of passing it in the url. It is probably a minor tweak, but you can post a lot more data. The maximum uri length depends on both the client and the server. For IIS the default is 2Kb (about 2000 characters), although it can be modified to be much larger. I think IE used the same limit, although I'...
Check this better <http://www.checkupdown.com/status/E414.html> This too may help [Request-URI Too Large](https://stackoverflow.com/questions/9877744/request-uri-too-large) OR [How do I resolve a HTTP 414 "Request URI too long" error?](https://stackoverflow.com/q/2891574/1723626)
12,918,877
I have a product search which I'm posting to an add-to-basket webservice. Problem is, I'm visualizing all product variations (say color and size). I just ran into one item in the database, which was available in 10 sizes and 30 colors, resulting in an `network error, uri too large`, because my AJAX was posting this: ...
2012/10/16
[ "https://Stackoverflow.com/questions/12918877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536768/" ]
Post the data instead of passing it in the url. It is probably a minor tweak, but you can post a lot more data. The maximum uri length depends on both the client and the server. For IIS the default is 2Kb (about 2000 characters), although it can be modified to be much larger. I think IE used the same limit, although I'...
TL;DR: Use POST instead of GET.
49,440,510
I'm trying to create a program that involves assigning a string to the variable x depending on the length of the string assigned to variable y. The amount of commas in x should be the same as the length of y. For example if `e='h'` , `x=','`. If `e='hi'` , `x=',,'`. If `e='him'` , `x=',,,'` By the way, I'm new to pro...
2018/03/23
[ "https://Stackoverflow.com/questions/49440510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9537691/" ]
Invoke `len()` on `e` to get the length of the string and multiply that length by the string `,`, assigning it to `x`: ``` e = 'him' e_length = len(e) x = ',' * e_length print(x) ``` This should yield `,,,`.
Python allows you to multiply a string by a number to repeat it, which means you can do: ``` e = 'hello there' x = ',' * len(e) ``` Which will give you: ``` ',,,,,,,,,,,' ```
48,963,261
I have this grid: ``` 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 ``` I do cumulative totals along rows, so I get: ``` 1 3 6 10 15 2 5 9 14 20 3 7 12 18 25 4 9 15 22 30 ``` Then I count along columns for cumulative totals that are more than 3, so I get: ...
2018/02/24
[ "https://Stackoverflow.com/questions/48963261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3370214/" ]
This is possible, but you need to know the basics of Matrix Multiplication to understand and suit the formula to your array. If A1:E4 had the first Matrix in your example, Solution: ``` =ARRAYFORMULA(MMULT(--TRANSPOSE(MMULT(A1:E4,--(TRANSPOSE(COLUMN(A1:E4))<=(COLUMN(A1:E4))))>3),ROW(A1:A4)^0)) ``` * Inner MMULT to d...
You can try: ``` =ARRAYFORMULA(countif(A:A,">3")) =ARRAYFORMULA(countif(((A:A)*(B:B)),">3")) =ARRAYFORMULA(countif(((A:A)*(B:B)*(C:C)),">3")) =ARRAYFORMULA(countif(((A:A)*(B:B)*(C:C)*(D:D)),">3")) =ARRAYFORMULA(countif(((A:A)*(B:B)*(C:C)*(D:D)*(E:E)),">3")) ``` The "\*" is a "+" in this context.
48,963,261
I have this grid: ``` 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 ``` I do cumulative totals along rows, so I get: ``` 1 3 6 10 15 2 5 9 14 20 3 7 12 18 25 4 9 15 22 30 ``` Then I count along columns for cumulative totals that are more than 3, so I get: ...
2018/02/24
[ "https://Stackoverflow.com/questions/48963261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3370214/" ]
This is possible, but you need to know the basics of Matrix Multiplication to understand and suit the formula to your array. If A1:E4 had the first Matrix in your example, Solution: ``` =ARRAYFORMULA(MMULT(--TRANSPOSE(MMULT(A1:E4,--(TRANSPOSE(COLUMN(A1:E4))<=(COLUMN(A1:E4))))>3),ROW(A1:A4)^0)) ``` * Inner MMULT to d...
you can get single row like this: ``` =ARRAYFORMULA(TRANSPOSE(MMULT(N(TRANSPOSE(MMULT(A1:E4, N(TRANSPOSE(COLUMN(A1:E4))<=(COLUMN(A1:E4))))>3)), ROW(A1:A4)^0))) ``` [![0](https://i.stack.imgur.com/mV978.png)](https://i.stack.imgur.com/mV978.png)
8,553,086
I have a problem with a WPF application. Somehow it seems that two (out of several) bindings in my WPF control are not immediately applied. When I look into the visual tree with [Snoop](http://snoopwpf.codeplex.com/), the binding is suddenly applied and everything works fine. What can be the reason for that? The XAM...
2011/12/18
[ "https://Stackoverflow.com/questions/8553086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75072/" ]
Two tips: 1. Try upping the verbosity of the WPF messages displayed in the Output window. You can do this by going to `Tools > Options > Debugging > Output Window > WPF Trace Settings` and changing `Data Binding` to something like `All`. 2. Add an `UpdateSourceTrigger` attribute to the bindings that are failing - it m...
What about the m:Map control? Is that honoring the values when it is being initialized? ie if you give a fixed value for property is that working. Try [Reflector](http://.NET%20Reflector%3a%20Decompiler%20and%20Assembly%20Browser%20%7C%20.NET%20Reflector%20www.reflector.net/) to verify the code of the Map control.
42,635,399
Sorry for the trivial question, but I could not Google this with a couple of attempts and decided to ask here. What is the proper way to specify the template parameters in this case: ``` #include <sstream> struct bar { int foo = 5; }; template<size_t i> std::ostream& operator<<(std::ostream& s, bar b) { s <<...
2017/03/06
[ "https://Stackoverflow.com/questions/42635399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1458617/" ]
You are forced to use the long form to call the operator, and explicitly pass template parameters ``` int main() { std::stringstream s; bar b; ::operator<<<1>(s, b); return 0; } ``` [Demo](http://melpon.org/wandbox/permlink/RXD3EPsf3od7DRWd) -----------------------------------------------------------...
Since your *function template* has no deducable argument, you will have to explicitly call it with the template argument. Its ugly. ``` operator << <4>(s, b); ``` Another ugly hack is to use a proxy *template-class*: ``` template<std::size_t K> struct bT{ bT(bar& bb) : b(bb) {} bar& b; static constexpr std:...
68,168,945
I am new to web-dev and I'm not sure why a particular script is refusing to load. I seem to be running into MIME type and Content Security Policy errors but my headers are set to allow these things. The two errors I'm getting are: ``` The resource from “http://localhost:82/monitor/socket.io/socket.io.js” was blocked ...
2021/06/28
[ "https://Stackoverflow.com/questions/68168945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7618425/" ]
> > The resource from “`http://localhost:82/monitor/socket.io/socket.io.js`” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff). > > > The `http://localhost:82/monitor/socket.io/socket.io.js` file is absent (or is not accessible) therefore server does response with page 404 Not f...
First error: You are setting "X-Content-Type-Options: nosniff" which requires the content-type of certain files such as css and js to be set correctly. In your case socket.io.js is "text/html" while it must have a javascript MIME type such as "application/javascript" or [another permitted javascript MIME type](https://...
25,675,188
I'm using colorbox and wanted to know if you know any way to display the popup when the visitor is scrolling the site. I know it's possible to display the popup when the page loads and to display the popup after X seconds. But that does not help me. I saw some websites that display the popup when the visitor scrolls ...
2014/09/04
[ "https://Stackoverflow.com/questions/25675188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4009640/" ]
You may need to specify the active profiles through System Properties: ``` -Dspring.profiles.active="integration" ``` in case you want to use the related bean implementation or ``` -Dspring.profiles.active="one-off-test" ``` to use the *one-off-test* profile beans. Then you will have to set the `inheritProfiles`...
One solution to the problem you presented is to use `primary` like this: ``` <beans profile="integration"> <bean class="org.easymock.EasyMock" factory-method="createMock" primary=true> <constructor-arg value="com.mycompany.MyInterface" /> </bean> </beans> ``` You don't need to change anything else be...
1,442,574
[![enter image description here](https://i.stack.imgur.com/xT3KN.jpg)](https://i.stack.imgur.com/xT3KN.jpg) This is my work and explaining why I am confusd in this specific problem
2015/09/19
[ "https://math.stackexchange.com/questions/1442574", "https://math.stackexchange.com", "https://math.stackexchange.com/users/190960/" ]
We could use $x=t, y=t^{3/2}$ to parametrize the curve, but let's use $x=t^2, y=t^3$ instead. Then $r^{\prime}(t)=\langle x^{\prime}(t), y^{\prime}(t)\rangle=\langle2t, 3t^2\rangle$, so $\big|r^{\prime}(t)\big|=\sqrt{(2t)^2+(3t^2)^2}=\sqrt{4t^2+9t^4}$. Then $\displaystyle L=\int\_{C}ds=\int\_{C}\big|r^{\prime}(t)\big...
The curve is parametrized: $r(x) = (x, x^{3/2})$ is a perfectly acceptable parametrization. Note though, that $|r'| \ne |y'|$, so your later work is not correct.
22,363,641
I have a page where a user edits an uploaded photo and applies a tag for individual photos on the model using Ember-Data. However, after saving on the controller, and transitioning to a page with all of the photos listed, the tag appears on all of the items and replaces any that existed before. If I reopen the page the...
2014/03/12
[ "https://Stackoverflow.com/questions/22363641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/520520/" ]
The problem comes from the way you declare `app_data`. This variable will be shared across all instances of `App.Photo`, which explains why you see all photos getting the same tags. You can solve this by initializing the attribute differently: ``` App.Photo = DS.Model.extend({ init: function() { this._super(); ...
You need to check that the store gets called with the correct data when you call save() and trace back from there. Aside from this, parsedTags and parsedDataChanged seem to be referring to each other.
34,655,820
I have the following code inside a webpage: ``` <div id="search_suggest"></div> ``` Trying to use the following inside a javascript code changes the content inside the div brackets. ``` var ss = document.getElementById('search_suggest'); ss.innerHTML = 'asdasdasasddasasdasdasdasdasdasdasdasasdasd'; ``` The follow...
2016/01/07
[ "https://Stackoverflow.com/questions/34655820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2141867/" ]
`search_suggest` is ID of element. Use id selector `#` instead of class selector `.`: ``` $("#search_suggest") ```
In Jquery selectors # is used to getElementById is while . is used to getElementsByClassName. use this `var ss =$("#search_suggest")` instead of `var ss =$(".search_suggest")`
34,655,820
I have the following code inside a webpage: ``` <div id="search_suggest"></div> ``` Trying to use the following inside a javascript code changes the content inside the div brackets. ``` var ss = document.getElementById('search_suggest'); ss.innerHTML = 'asdasdasasddasasdasdasdasdasdasdasdasasdasd'; ``` The follow...
2016/01/07
[ "https://Stackoverflow.com/questions/34655820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2141867/" ]
`search_suggest` is ID of element. Use id selector `#` instead of class selector `.`: ``` $("#search_suggest") ```
Suggestion If you must use a class or attribute selector, you can improve performance by specifying the optional context parameter. ``` ID is absolutely the **fastest**. Part of the reason is that ID is supposed to be unique, so the API stops searching after the ID is found in the DOM. ``` Better to use :: ``` $(...
1,126,237
I been trying this in my code and it doesn´t work: ``` NSArray *paths = [aUITableView indexPathsForVisibleRows]; ``` An empty NSArray is returned. But if I do this in the previous line it works fine....is this a framework bug? ``` NSArray *cells = [aUITableView visibleCells]; NSArray *paths = [aUITableView indexPat...
2009/07/14
[ "https://Stackoverflow.com/questions/1126237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117540/" ]
It looks like a bug – you may want to [report it](http://developer.apple.com/bugreporter/). If unused variable is a problem, then don't create unused variable! :) Instead of: ``` NSArray *cells = [aUITableView visibleCells]; ``` write: ``` [aUITableView visibleCells]; // don't remove, workaround for a bug <link h...
This bug is still occurring in iOS 4.2. You can fix it without a warning by simply calling `[tableView visibleCells];` and not assigning the result of the call to a variable. Just because a method has a return value, you don't need to pay attention to it. I'm filing a bug report with Apple.
34,493,906
i am making a nodejs web api and i have a function that returns a user object that is associated with a given authentication token: ``` module.exports.getByToken = function (token_value, callback) { mongoose.model('tokens').findOne({ value: token_value }).exec(function (err, token) { if (err || token =...
2015/12/28
[ "https://Stackoverflow.com/questions/34493906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4158603/" ]
IMO your are doing it the right way. Callbacks should return an error as the first parameter if they are not responsible for handling it. If you want to improve how any possible error is handled you could change your middleware to something like: ``` app.use('/api', function (req, res, next){ var token = req.heade...
It looks to be right. Nothing wrong in it. I would simplify the code or rather make the middleware separate from the routes in the following manner: ``` app.use('/api', auth.checkToken, auth.processUser //The function that would do something with the user returned from the middleware if there are no er...
14,958,251
Is it possible using embedded Jetty to serve static files from directory X but mapped to URL Y? I have static files stored under directory "web", but I want the URL be something like `http://host/myapp`. I have already successfully ran a server configured with `ResourceHandler` in the following way: ```java ResourceH...
2013/02/19
[ "https://Stackoverflow.com/questions/14958251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308193/" ]
The ResourceHandler has no context configurable, but you can simply wrap it in a ContextHandler to achieve that. Try this instead: ```java ContextHandler ctx = new ContextHandler("/my-files"); /* the server uri path */ ResourceHandler resHandler = new ResourceHandler(); resHandler.setResourceBase("path-to-web"); ctx....
The above doesn't work for Jetty 9, but this does: ``` ContextHandler contextHandler = new ContextHandler("/my-files"); contextHandler.setResourceBase("/tmp/static"); ResourceHandler resourceHandler = new ResourceHandler(); contextHandler.setHandler(resourceHandler); server.setHandler(contextHandler); ```
45,002,269
I clicked without thinking and it didn't appear to do anything but shut the windows. Looking at the code I'm too noob to work out what it does but I'm paranoid it's done something behind the scenes. ``` Option Explicit 'On Error Resume Next Dim strComputer Dim objWmiService Dim colMonitoredProcesses Dim objLatestPro...
2017/07/10
[ "https://Stackoverflow.com/questions/45002269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8280873/" ]
Try `import { AtmService } from '../../services/atm.service';` You need to go two folders back to get access to `services` folder.
your are trying to access service from component folder you can go two level back or you can drill down from app folder like this `app/services/atm.service` ``` import { AtmService } from 'app/services/atm.service'; ```
30,842,011
I am trying to calculate the distance between two Geo Locations. The problem I have is the following: I tried with libraries like :[Geocalc](https://github.com/grumlimited/geocalc) and Haversine formulas, like this: ``` public static final double RKilometers = 6371; public static double calculationByDistance(double ...
2015/06/15
[ "https://Stackoverflow.com/questions/30842011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4042879/" ]
I had this code from a long ago, I don't even remember if I wrote it myself or got it off someone. as far as I remember it gives a pretty good estimate, you can try it out and see if it works for you. (edits are welcomed) ``` public static double distFrom(double lat1, double lng1, double lat2, double lng2) { d...
It is hard to propose you any code snippet or existing tools and services. Just because calculating distance depends on the certain task. There are many kinds of map projections and corresponding formulas. For example, if you are using Google maps you probably can do more precise calculation taking into account height...
30,842,011
I am trying to calculate the distance between two Geo Locations. The problem I have is the following: I tried with libraries like :[Geocalc](https://github.com/grumlimited/geocalc) and Haversine formulas, like this: ``` public static final double RKilometers = 6371; public static double calculationByDistance(double ...
2015/06/15
[ "https://Stackoverflow.com/questions/30842011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4042879/" ]
I had this code from a long ago, I don't even remember if I wrote it myself or got it off someone. as far as I remember it gives a pretty good estimate, you can try it out and see if it works for you. (edits are welcomed) ``` public static double distFrom(double lat1, double lng1, double lat2, double lng2) { d...
``` public static float distFrom(float lat1, float lng1, float lat2, float lng2) { // Earth Radius in meters double earthRadius = 6371000; double dLat = Math.toRadians(lat2-lat1); double dLng = Math.toRadians(lng2-lng1); double a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(Mat...
30,842,011
I am trying to calculate the distance between two Geo Locations. The problem I have is the following: I tried with libraries like :[Geocalc](https://github.com/grumlimited/geocalc) and Haversine formulas, like this: ``` public static final double RKilometers = 6371; public static double calculationByDistance(double ...
2015/06/15
[ "https://Stackoverflow.com/questions/30842011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4042879/" ]
I found the error. The problem was the values for latitud and longitud were wrong. I took the data from Wolframalpha and they don´t show the signs for the values. The rights values for my test are: ``` assertEquals(calculationByDistance(-32.05, 52.11, 55.83, -4.25), 10744, 20); ``` Thank you for your time!!!And sor...
It is hard to propose you any code snippet or existing tools and services. Just because calculating distance depends on the certain task. There are many kinds of map projections and corresponding formulas. For example, if you are using Google maps you probably can do more precise calculation taking into account height...
30,842,011
I am trying to calculate the distance between two Geo Locations. The problem I have is the following: I tried with libraries like :[Geocalc](https://github.com/grumlimited/geocalc) and Haversine formulas, like this: ``` public static final double RKilometers = 6371; public static double calculationByDistance(double ...
2015/06/15
[ "https://Stackoverflow.com/questions/30842011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4042879/" ]
``` public static float distFrom(float lat1, float lng1, float lat2, float lng2) { // Earth Radius in meters double earthRadius = 6371000; double dLat = Math.toRadians(lat2-lat1); double dLng = Math.toRadians(lng2-lng1); double a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(Mat...
It is hard to propose you any code snippet or existing tools and services. Just because calculating distance depends on the certain task. There are many kinds of map projections and corresponding formulas. For example, if you are using Google maps you probably can do more precise calculation taking into account height...
30,842,011
I am trying to calculate the distance between two Geo Locations. The problem I have is the following: I tried with libraries like :[Geocalc](https://github.com/grumlimited/geocalc) and Haversine formulas, like this: ``` public static final double RKilometers = 6371; public static double calculationByDistance(double ...
2015/06/15
[ "https://Stackoverflow.com/questions/30842011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4042879/" ]
I found the error. The problem was the values for latitud and longitud were wrong. I took the data from Wolframalpha and they don´t show the signs for the values. The rights values for my test are: ``` assertEquals(calculationByDistance(-32.05, 52.11, 55.83, -4.25), 10744, 20); ``` Thank you for your time!!!And sor...
``` public static float distFrom(float lat1, float lng1, float lat2, float lng2) { // Earth Radius in meters double earthRadius = 6371000; double dLat = Math.toRadians(lat2-lat1); double dLng = Math.toRadians(lng2-lng1); double a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(Mat...
15,952,005
Given an array of values: ``` var values = new Array(); array.push(2); array.push(3); array.push(4); ``` I'd like to create an iterative function which can store every possible combination of values, for any length of array. For example, in this case the possible values would be (1,1,1)(1,1,2)(1,1,3)(1,1,4)(1,2...
2013/04/11
[ "https://Stackoverflow.com/questions/15952005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/513620/" ]
> > I'm not sure how I can access the 'upper' levels once the function is called deeper though... i.e. I'm not sure how to access (1,2,4) and not just (?,?,4) > > > You will need to pass them on, e.g. in an array. > > > ``` > for(var i = 0; i < values.length; i++) > > ``` > > This should not be the outer it...
You don't need recursion since the length of the arbitrary data set is defined at the beginning at runtime: ``` var numbers = [2,3,4]; var result_array = []; var num_product = 1; var i=0, j=0, k=0; // iterators for (i=0; i<numbers.length; i++) { num_product *= numbers[i]; } for (i=0; i<num_product; i++) { res...
8,269,269
I'm sure it's very simple and I'm just being stupid, but I've tried numerous variants and still can't get it working. What's worse - these 3 components are aligned exactly the way I want in the graphical editor in Eclipse, but not on the real device. I only get to align it to 50% for TextView and RadioGroup. The XML g...
2011/11/25
[ "https://Stackoverflow.com/questions/8269269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/634821/" ]
Try adding `android:layout_weight="1"` to all three elements. This specifies the relative weight every element has to the others. The higher this value is the less weight the element gets. oh, and wrap everything in a linear layout (didn't see you didn't add a layout first).
Try changing layout\_width to "wrap\_content" for radio buttons as well. You have already done it for the text field.
8,269,269
I'm sure it's very simple and I'm just being stupid, but I've tried numerous variants and still can't get it working. What's worse - these 3 components are aligned exactly the way I want in the graphical editor in Eclipse, but not on the real device. I only get to align it to 50% for TextView and RadioGroup. The XML g...
2011/11/25
[ "https://Stackoverflow.com/questions/8269269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/634821/" ]
Use android:layout\_centerVertical="true" in your TextView. Below is a sample: ``` <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" > <TextView android:id="@+id/typeL...
Try adding `android:layout_weight="1"` to all three elements. This specifies the relative weight every element has to the others. The higher this value is the less weight the element gets. oh, and wrap everything in a linear layout (didn't see you didn't add a layout first).
8,269,269
I'm sure it's very simple and I'm just being stupid, but I've tried numerous variants and still can't get it working. What's worse - these 3 components are aligned exactly the way I want in the graphical editor in Eclipse, but not on the real device. I only get to align it to 50% for TextView and RadioGroup. The XML g...
2011/11/25
[ "https://Stackoverflow.com/questions/8269269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/634821/" ]
You should use a Linear Layout with weights on your elements which will make it pretty easy to achieve what you want. Check the docs for info on Linear Layout and weights. <http://developer.android.com/guide/topics/ui/layout-objects.html>
Try changing layout\_width to "wrap\_content" for radio buttons as well. You have already done it for the text field.
8,269,269
I'm sure it's very simple and I'm just being stupid, but I've tried numerous variants and still can't get it working. What's worse - these 3 components are aligned exactly the way I want in the graphical editor in Eclipse, but not on the real device. I only get to align it to 50% for TextView and RadioGroup. The XML g...
2011/11/25
[ "https://Stackoverflow.com/questions/8269269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/634821/" ]
Use android:layout\_centerVertical="true" in your TextView. Below is a sample: ``` <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" > <TextView android:id="@+id/typeL...
You should use a Linear Layout with weights on your elements which will make it pretty easy to achieve what you want. Check the docs for info on Linear Layout and weights. <http://developer.android.com/guide/topics/ui/layout-objects.html>
8,269,269
I'm sure it's very simple and I'm just being stupid, but I've tried numerous variants and still can't get it working. What's worse - these 3 components are aligned exactly the way I want in the graphical editor in Eclipse, but not on the real device. I only get to align it to 50% for TextView and RadioGroup. The XML g...
2011/11/25
[ "https://Stackoverflow.com/questions/8269269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/634821/" ]
Use android:layout\_centerVertical="true" in your TextView. Below is a sample: ``` <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" > <TextView android:id="@+id/typeL...
Try changing layout\_width to "wrap\_content" for radio buttons as well. You have already done it for the text field.
16,198,869
So what I'm doing is, with a super simple PHP proxy that only uses `file_get_contents` I fetch an HTML and convert it to htmlentities in UTF-8 format. After that with jQuery which is doing the AJAX call I want to get the whole HTML which includes the tags, `<html><head><body>code..</body></head></html>` into an iframe ...
2013/04/24
[ "https://Stackoverflow.com/questions/16198869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1079232/" ]
You need to use the `contentDocument` property of the iframe to put stuff in it. Also: you need to append your iframeCreate to the document somewhere, otherwise "#iframe" returns nothing. <http://www.w3schools.com/jsref/prop_frame_contentdocument.asp> [This answer](https://stackoverflow.com/questions/14186070/javasc...
doing server job on the client side? Not the brightest idea imho. I think the reason why you are doing this is because you want to manipulate the dom with jquery(maybe simplexml doesn't seem appealing to you?). In this case i suggest looking at <http://querypath.org/> . it's jquery for the server.
16,198,869
So what I'm doing is, with a super simple PHP proxy that only uses `file_get_contents` I fetch an HTML and convert it to htmlentities in UTF-8 format. After that with jQuery which is doing the AJAX call I want to get the whole HTML which includes the tags, `<html><head><body>code..</body></head></html>` into an iframe ...
2013/04/24
[ "https://Stackoverflow.com/questions/16198869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1079232/" ]
doing server job on the client side? Not the brightest idea imho. I think the reason why you are doing this is because you want to manipulate the dom with jquery(maybe simplexml doesn't seem appealing to you?). In this case i suggest looking at <http://querypath.org/> . it's jquery for the server.
I've noticed that if you put HTML into an `iframe`, it will be encoded. If the iframe contains an immediately descending input, calling `$("iframe input").length` would return 0. If you were to use a `div` instead, the HTML wouldn't be encoded, allowing you to count the number of elements: ``` $(document).ready(funct...
16,198,869
So what I'm doing is, with a super simple PHP proxy that only uses `file_get_contents` I fetch an HTML and convert it to htmlentities in UTF-8 format. After that with jQuery which is doing the AJAX call I want to get the whole HTML which includes the tags, `<html><head><body>code..</body></head></html>` into an iframe ...
2013/04/24
[ "https://Stackoverflow.com/questions/16198869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1079232/" ]
You need to use the `contentDocument` property of the iframe to put stuff in it. Also: you need to append your iframeCreate to the document somewhere, otherwise "#iframe" returns nothing. <http://www.w3schools.com/jsref/prop_frame_contentdocument.asp> [This answer](https://stackoverflow.com/questions/14186070/javasc...
I've noticed that if you put HTML into an `iframe`, it will be encoded. If the iframe contains an immediately descending input, calling `$("iframe input").length` would return 0. If you were to use a `div` instead, the HTML wouldn't be encoded, allowing you to count the number of elements: ``` $(document).ready(funct...
32,286,062
How do I parse a Date with moment.js(or alternative library) to pick out 31st Feb or 31st June e,t,c, as invalid? I know that if I did ``` moment("20-02-2000"); ``` it says ``` Moment {_isAMomentObject: true, _i: "20-02-2000", _isUTC: false, _locale: Locale, _d: Invalid Date} ``` So it can detect an invalid da...
2015/08/29
[ "https://Stackoverflow.com/questions/32286062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385907/" ]
You can check if moment thinks a date is valid using `moment().isValid()` first. ``` console.log(moment('2015-02-31').isValid()); //false ``` <http://jsfiddle.net/nicholasduffy/uv8aqykm/> <http://momentjs.com/docs/#/parsing/string-format/>
There is the isValid method, but you should specify the format too, to moment.. e.g. `moment("2000-02-31", "YYYY-MM-DD").isValid()` Interestingly the javascript console wasn't showing isValid() when typing moment dot. or moment.prototype. The docs say > > The Moment prototype is exposed through moment.fn > > > ...
32,286,062
How do I parse a Date with moment.js(or alternative library) to pick out 31st Feb or 31st June e,t,c, as invalid? I know that if I did ``` moment("20-02-2000"); ``` it says ``` Moment {_isAMomentObject: true, _i: "20-02-2000", _isUTC: false, _locale: Locale, _d: Invalid Date} ``` So it can detect an invalid da...
2015/08/29
[ "https://Stackoverflow.com/questions/32286062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385907/" ]
You can check if moment thinks a date is valid using `moment().isValid()` first. ``` console.log(moment('2015-02-31').isValid()); //false ``` <http://jsfiddle.net/nicholasduffy/uv8aqykm/> <http://momentjs.com/docs/#/parsing/string-format/>
The proposed format (YYYY-DD-MM) must be reformatted to YYYY-MM-DD or Javascript Date constructor will return an invalid date error. Thus said, the Date constructor will still accept 2000-02-31 and convert it to 2001-03-02. So you must preprocess it. When you have preprocessed the string and have a Date constructor v...
32,286,062
How do I parse a Date with moment.js(or alternative library) to pick out 31st Feb or 31st June e,t,c, as invalid? I know that if I did ``` moment("20-02-2000"); ``` it says ``` Moment {_isAMomentObject: true, _i: "20-02-2000", _isUTC: false, _locale: Locale, _d: Invalid Date} ``` So it can detect an invalid da...
2015/08/29
[ "https://Stackoverflow.com/questions/32286062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385907/" ]
Moment.js provides the `isValid` method to check whether the parsed string is valid or not. `moment("2000-02-28").isValid(); //true` `moment("2000-02-31").isValid(); //false` `moment("2000-02-40").isValid(); //false` Is this the behaviour you're looking for? You can read more about this method here <http://momentj...
There is the isValid method, but you should specify the format too, to moment.. e.g. `moment("2000-02-31", "YYYY-MM-DD").isValid()` Interestingly the javascript console wasn't showing isValid() when typing moment dot. or moment.prototype. The docs say > > The Moment prototype is exposed through moment.fn > > > ...
32,286,062
How do I parse a Date with moment.js(or alternative library) to pick out 31st Feb or 31st June e,t,c, as invalid? I know that if I did ``` moment("20-02-2000"); ``` it says ``` Moment {_isAMomentObject: true, _i: "20-02-2000", _isUTC: false, _locale: Locale, _d: Invalid Date} ``` So it can detect an invalid da...
2015/08/29
[ "https://Stackoverflow.com/questions/32286062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385907/" ]
Moment.js provides the `isValid` method to check whether the parsed string is valid or not. `moment("2000-02-28").isValid(); //true` `moment("2000-02-31").isValid(); //false` `moment("2000-02-40").isValid(); //false` Is this the behaviour you're looking for? You can read more about this method here <http://momentj...
The proposed format (YYYY-DD-MM) must be reformatted to YYYY-MM-DD or Javascript Date constructor will return an invalid date error. Thus said, the Date constructor will still accept 2000-02-31 and convert it to 2001-03-02. So you must preprocess it. When you have preprocessed the string and have a Date constructor v...
15,927
There are two common uses for the English word **experience:** * the specific sense, as in "skydiving was an interesting experience" * the more general sense, as in "I have the job experience you're looking for" The former is a description of the immediate process of living through something, perceiving it, etc. Wher...
2018/03/06
[ "https://russian.stackexchange.com/questions/15927", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/10267/" ]
*Переживание* (literally, "living-through") is quite a set way to translate the English phrase "emotional experience". I can't think of any other way for it to be used to translate "experience" outside this context. However, your gut feeling is right, Russian *опыт* usually only applies to knowledge and expertise inde...
*skydiving was an interesting experience* - It's possible to say **переживание** (probably when saying of a jump which caused strong emotions), or **впечатление** (if you mean an unusual impression regardless of emotions), even **опыт** (e.g. if you mean this pursuit was interesting experience for your career professio...
15,927
There are two common uses for the English word **experience:** * the specific sense, as in "skydiving was an interesting experience" * the more general sense, as in "I have the job experience you're looking for" The former is a description of the immediate process of living through something, perceiving it, etc. Wher...
2018/03/06
[ "https://russian.stackexchange.com/questions/15927", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/10267/" ]
*Переживание* (literally, "living-through") is quite a set way to translate the English phrase "emotional experience". I can't think of any other way for it to be used to translate "experience" outside this context. However, your gut feeling is right, Russian *опыт* usually only applies to knowledge and expertise inde...
Можно сказать `опыт работы` и `любовные переживания`, но не `переживания работы`, а `опыт любви` звучит пошло, если не сказать скабрезно.
15,927
There are two common uses for the English word **experience:** * the specific sense, as in "skydiving was an interesting experience" * the more general sense, as in "I have the job experience you're looking for" The former is a description of the immediate process of living through something, perceiving it, etc. Wher...
2018/03/06
[ "https://russian.stackexchange.com/questions/15927", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/10267/" ]
*Переживание* (literally, "living-through") is quite a set way to translate the English phrase "emotional experience". I can't think of any other way for it to be used to translate "experience" outside this context. However, your gut feeling is right, Russian *опыт* usually only applies to knowledge and expertise inde...
`Переживание` comes from the verb `переживать`, which does mean 'to live through'/'to experience'. But usually it would be used when you would describe experiencing something again *"я как будто заново пережил этот момент"* (as if I have experienced this moment again). You can also tell someone not to worry - *не переж...
15,927
There are two common uses for the English word **experience:** * the specific sense, as in "skydiving was an interesting experience" * the more general sense, as in "I have the job experience you're looking for" The former is a description of the immediate process of living through something, perceiving it, etc. Wher...
2018/03/06
[ "https://russian.stackexchange.com/questions/15927", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/10267/" ]
*Переживание* (literally, "living-through") is quite a set way to translate the English phrase "emotional experience". I can't think of any other way for it to be used to translate "experience" outside this context. However, your gut feeling is right, Russian *опыт* usually only applies to knowledge and expertise inde...
*Опыт* and *переживание* not only appeal to different parts of human consciousness (*опыт* is for logic, *переживание* is for emotions); they also differ in their time aspect. *Опыт* is something valuable because you can make use of that experience in the future (i.e. in your example with skydiving, you may have unders...
15,927
There are two common uses for the English word **experience:** * the specific sense, as in "skydiving was an interesting experience" * the more general sense, as in "I have the job experience you're looking for" The former is a description of the immediate process of living through something, perceiving it, etc. Wher...
2018/03/06
[ "https://russian.stackexchange.com/questions/15927", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/10267/" ]
*skydiving was an interesting experience* - It's possible to say **переживание** (probably when saying of a jump which caused strong emotions), or **впечатление** (if you mean an unusual impression regardless of emotions), even **опыт** (e.g. if you mean this pursuit was interesting experience for your career professio...
*Опыт* and *переживание* not only appeal to different parts of human consciousness (*опыт* is for logic, *переживание* is for emotions); they also differ in their time aspect. *Опыт* is something valuable because you can make use of that experience in the future (i.e. in your example with skydiving, you may have unders...
15,927
There are two common uses for the English word **experience:** * the specific sense, as in "skydiving was an interesting experience" * the more general sense, as in "I have the job experience you're looking for" The former is a description of the immediate process of living through something, perceiving it, etc. Wher...
2018/03/06
[ "https://russian.stackexchange.com/questions/15927", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/10267/" ]
Можно сказать `опыт работы` и `любовные переживания`, но не `переживания работы`, а `опыт любви` звучит пошло, если не сказать скабрезно.
*Опыт* and *переживание* not only appeal to different parts of human consciousness (*опыт* is for logic, *переживание* is for emotions); they also differ in their time aspect. *Опыт* is something valuable because you can make use of that experience in the future (i.e. in your example with skydiving, you may have unders...
15,927
There are two common uses for the English word **experience:** * the specific sense, as in "skydiving was an interesting experience" * the more general sense, as in "I have the job experience you're looking for" The former is a description of the immediate process of living through something, perceiving it, etc. Wher...
2018/03/06
[ "https://russian.stackexchange.com/questions/15927", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/10267/" ]
`Переживание` comes from the verb `переживать`, which does mean 'to live through'/'to experience'. But usually it would be used when you would describe experiencing something again *"я как будто заново пережил этот момент"* (as if I have experienced this moment again). You can also tell someone not to worry - *не переж...
*Опыт* and *переживание* not only appeal to different parts of human consciousness (*опыт* is for logic, *переживание* is for emotions); they also differ in their time aspect. *Опыт* is something valuable because you can make use of that experience in the future (i.e. in your example with skydiving, you may have unders...
78,099
How can I create a new map (with my personal POIs) using Google Maps from a PC browser and use Street View options to see details? I am not able to create a map, give a name and add new points. I need to use it from a smartphone but I prefer to create it by PC because of the screen dimensions.
2015/05/13
[ "https://webapps.stackexchange.com/questions/78099", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/50670/" ]
One approach I have used is to create the new map in one browser window (Sign in and click in the search bar: doing this shows a My Maps link - clicking this gives a Create link. Clicking this opens a new personal map editing window.) And use street-view in another browser tab. This is tedious, because you have t...
To create a new map is it necassary to login with your personal google account and BEFORE any search you can see the menu where you can find your maps and create new ones
26,575
How to make a transparent 'png' image from black (not transparent) to nothing (absolutely transparent) in GIMP smoothly? As result, this image on the red image gives the image from black via dark red to red? This is an example (but not of good quality, I'd like to know how to make this image properly): ![enter image...
2014/01/23
[ "https://graphicdesign.stackexchange.com/questions/26575", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/19202/" ]
What you are looking for is a **gradient**. Here is a tutorial on [how to make a gradient in Gimp.](http://www.wikihow.com/Create-a-Gradient-in-Gimp) Here's on [how to make a custom gradient](http://graphicssoft.about.com/od/gimptutorials/ss/Gradient-Editor.htm). * In your case you would make your gradient as a lay...
You have to add a layer mask. (Right click on Layer → Layer Mask → Add alpha channel of the layer) And then can you use the gradient tool Here is an tutorial with pictures. <http://infofreund.de/gimp-transparent-gradient/>
46,645,039
I am using elastic search as searching tool in my application... I am having 9 records in my db. My page size is 5. So first time it will give me 5 records which is working fine by my code... Now second time when I scroll it should give me 4 records and then scrolling should give me 0 records. { ``` "from" : ...
2017/10/09
[ "https://Stackoverflow.com/questions/46645039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What do you specify the second time as `from` value? Can you post what you request in the second query call. tip: It should be `from: 5` and not `from: 1`. It is not a page counter but a record counter.
You'll have to pass ``` 1st time "from" : 0, "size" : 5 2nd time "from" : 5, "size" : 5 ``` Your query will be looking like ``` { "query": { ... Your elasticsearch query }, "_source": [ .... Columns To retrieve ], "sort": [ .... Sorting information ], "from": 0, "size": 5 } ``` Thi...
61,052,368
I have a list as follows: ``` val numbers = listOf("one", "two", "three", "four") ``` I want to create a map such that each index goes to each value of the list. 1 to "one", 2 to "two", .. I want the result to be a ``` Map<Int, String> ```
2020/04/06
[ "https://Stackoverflow.com/questions/61052368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5223992/" ]
One of the ways could be: ``` numbers.mapIndexed { index: Int, s: String -> index + 1 to s }.toMap() ```
You can try this code ``` val numbersMaps = (0 until numbers.size).map { i -> i+1 to numbers[it] } println(numbersMaps) ```
61,052,368
I have a list as follows: ``` val numbers = listOf("one", "two", "three", "four") ``` I want to create a map such that each index goes to each value of the list. 1 to "one", 2 to "two", .. I want the result to be a ``` Map<Int, String> ```
2020/04/06
[ "https://Stackoverflow.com/questions/61052368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5223992/" ]
One of the ways could be: ``` numbers.mapIndexed { index: Int, s: String -> index + 1 to s }.toMap() ```
numbers.withIndex().associateBy ({ it.index }, {it.value})
34,970
The year is 2089. The political shenanigans of the day have gotten more out of hand than usual and violent zealots have detonated the Earth's largest deposit of *plotium devicide*, an extremely versatile chemical compound that in this instance explodes with sufficient power to destroy the Earth. The planet shatters int...
2016/02/02
[ "https://worldbuilding.stackexchange.com/questions/34970", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/1971/" ]
***Don't Panic*** --Hitchhiker's Guide to the Galaxy, Douglas Adams Seriously though: Everybody is certainly dead --------------------------- Including everyone in the special bomb shelters. Anything with enough energy to disrupt the Earth - will essentially melt or vaporize the entire Earth - including every bi...
The short term effects of shattering the planet would be that much of the atmosphere and liquid water is lost. The amount of energy to shatter the Earth would be between 1.5 X 10^30J (blow off Terra's crust into space) and 2.9 X 10^31J (reduce the Earth to gravel). This is far beyond the amounts of energy needed to blo...
41,272
I am in a campaign where I want to be a Gnome Bard that can use the Fire Descriptor for the Music Damage, but my GM will only allow me to Multi-class into either Druid or Cleric For campaign purposes. Is there any hope for me? Maybe with a trait or another Feat? Ref: [Fire Music Feat](http://www.d20pfsrd.com/feats/gen...
2014/06/21
[ "https://rpg.stackexchange.com/questions/41272", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/14771/" ]
You could use the [Arcane Talent](http://www.d20pfsrd.com/feats/general-feats/arcane-talent) feat to learn [spark](http://www.d20pfsrd.com/magic/all-spells/s/spark), a 0-level spell with the [fire] descriptor. The wording of the feat should satisfy the necessary requirements: > > Choose a 0-level spell from the sorce...
You can use the [Magician archetype](http://www.d20pfsrd.com/classes/core-classes/bard/archetypes/paizo---bard-archetypes/magician). It allows to expand your spells known at levels 2, 6, 10, 14 and 18 from another arcane caster list. The archetype changes a number of the standard Bard class features though, so this may...
41,272
I am in a campaign where I want to be a Gnome Bard that can use the Fire Descriptor for the Music Damage, but my GM will only allow me to Multi-class into either Druid or Cleric For campaign purposes. Is there any hope for me? Maybe with a trait or another Feat? Ref: [Fire Music Feat](http://www.d20pfsrd.com/feats/gen...
2014/06/21
[ "https://rpg.stackexchange.com/questions/41272", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/14771/" ]
You could use the [Arcane Talent](http://www.d20pfsrd.com/feats/general-feats/arcane-talent) feat to learn [spark](http://www.d20pfsrd.com/magic/all-spells/s/spark), a 0-level spell with the [fire] descriptor. The wording of the feat should satisfy the necessary requirements: > > Choose a 0-level spell from the sorce...
I'm not sure about the wording, but I think the trait [two-world-magic](http://www.d20pfsrd.com/traits/magic-traits/two-world-magic) may be relevant: > > Benefit: Select one 0-level spell from a class spell list other than your own. This spell is a 0-level spell on your class spell list (or a 1st-level spell if your ...
5,757,599
Updated with actual JSON Response, Messed up last time. It is my second day with JSON, and i am stuck at the first step of my project. i created a wcf rest service which gives this test json response. ``` [{ "busyEndTime":"\/Date(928164000000-0400)\/", "busyStartTime":"\/Date(928164000000-0400)\/", "endGradient":1.2...
2011/04/22
[ "https://Stackoverflow.com/questions/5757599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720793/" ]
**Update**: Now that you've posted the actual JSON text, here's an example of using it: ``` $.getJSON(url, function(data) { // jQuery will deserialize it into an object graph for // us, so our `data` is now a JavaScript object -- // in this case, an array. Show how many entries we got. display("Data received, ...
It doesn't look like JSON to me! It looks like XML. JSON is incredibly simple, and is documented here: <http://www.json.org/> What you might have discovered might be a reason to lose interest in WCF, but not in JSON/javascript/jQuery.
44,506,038
Working with `JUnit` and `Stream` I have the following error message: ``` java.lang.IllegalStateException: stream has already been operated upon or closed ``` I did a research, and is clear is **not** possible reuse a stream **But** according with this post: * [Java – Stream has already been operated upon or close...
2017/06/12
[ "https://Stackoverflow.com/questions/44506038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3665178/" ]
`Supplier` is no magic, you still need to provide a *new Stream* all the time from that Supplier. So you could do: ``` Supplier<Stream<String>> supplier = () -> Files.lines(Paths.get(fileName)); ``` But that would mean to read the file, all the time. You could read all the lines into a single `List`, store that in...
This is because your supplier always provides the same instance of `Stream`, and you consume it already with `findFirst()`. Then you try to consume it again with `findFirst()`, and this is not allowed. In the tutorial, a new stream is created each time. In your case, you would have to call `Files.lines()` inside your ...
11,640
I currently have a standing desk at work, and I thought a fun way to learn Arduino would be to automate it, as it currently uses a hand crank. I would love some help determining what I would need for this task. What kind of motor should I use? -Stepper motor? -High/low rpm? -High/low torque? What sort of power w...
2015/05/07
[ "https://arduino.stackexchange.com/questions/11640", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/9929/" ]
I think this might end up being more of a fun way to electrocute yourself, but let's find out... Energy required to lift an object with mass "m" an upward distance of "h" in the Earth's gravitational field, on the surface... E = mgh = m(9.8)h So, to lift a 50kg desk one meter, we will need 50 x 9.8 x 1 = 490 Joules ...
For initial playing, and possibly for a final solution, battery powered electric drills with external powering are an excellent source of reasonable wattage well geared down motors. Drills are often discarded when the batteries die and may be available free or at lo cost. For relatively low duty cycle use 9V drills o...
33,726,350
I'm new to AWS/S3 and following [this tutorial from Amazon](http://docs.aws.amazon.com/AmazonS3/latest/dev/HTTPPOSTExamples.html). It's not working, and I'm wondering if it's due to the policy section. * Where does the policy go? For what it's worth, the form is in a React component. I tried putting the one below in...
2015/11/15
[ "https://Stackoverflow.com/questions/33726350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2850975/" ]
I would refer you to the question that is answered [here](https://stackoverflow.com/questions/9419263/playing-audio-with-javascript). ``` var audio = new Audio('audio_file.mp3'); audio.play(); ``` That 's the basic of playing audio. Have a look at conditional later after the audio is playing from the link that Roko ...
you would like review how `if`, `else if` and `else` statements work. ``` if ('Hi.' + 'Hi!' + 'Hello.' + 'Hello!' + 'Greetings.' + 'Greetings!') { // The above statement will always evaluate to boolean `true` // Everything in here will always run and no `else`, `else if` will ever trigger ``` <https://develo...
43,624,832
I am using rsync to backup a large amount of files (on a Ubuntu Linux server) to a cloud network service over WebDav. Because my network speed is my bottle-necking factor, I thought I would use rsync -z (compression) to decrease the file size and hopefully this would lessen the bottleneck. Anyway, while researching th...
2017/04/26
[ "https://Stackoverflow.com/questions/43624832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6581698/" ]
Where is the WebDAV folder mounted? If it is on the local machine, you just get additional overhead with no performance gains, since the CPU has to do double work to compress and immediately decompress before writing to the mounted folder, which is then transferred to the remote server using the WebDAV protocol. `rs...
rsync since version [3.2.0](https://download.samba.org/pub/rsync/NEWS#3.2.0) supports more than zlib: ``` --compress, -z turn on compression --compress-choice=STR, --zc=STR choose compression from lz4 (fastest), zstd, zlibx, zlib (slowest), none --compress-level=NUM, --zl=NUM zlib and zstd can be ...
208,141
I have an idea of something that would be nice for the QGIS Composer and I think it doesn't exists yet, despite my research. How can I suggest this feature to QGIS developpers ? I found this that shows the request but I'm a bit stuck at this point : <https://hub.qgis.org/projects/quantum-gis/issues> I suppose I'm mis...
2016/08/24
[ "https://gis.stackexchange.com/questions/208141", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/25139/" ]
To reporting issues or feature requests on [QGIS issue tracking](https://hub.qgis.org/projects/quantum-gis/issues), you need an OSGeo account. Then just login, go to tab *New issue* and in *Tracker* option choose *Feature request* [![enter image description here](https://i.stack.imgur.com/i2ENF.png)](https://i.stack.i...
You could post it at <http://hub.qgis.org/projects/quantum-gis/issues> as a feature request. But, as copied from an excellent blog post; > > ...4. > > > Ask a developer to make the changes for you. This is not terribly > effective – you’re basically asking someone to work for free, and take > time away from their...
318,368
1. I want to create a scrollable list of pictures fetched from the internet and give the user the ability to click on it. How do i go about doing it in WinForms/C#? Is it possible to add picturebox control/ controls to the listBox? 2. I tried adding a list of picturebox into UserControl with AutoScroll set to true, whi...
2008/11/25
[ "https://Stackoverflow.com/questions/318368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13046/" ]
I'll answer your third question first, becuase that's the only one I REALLY know the answer to. There's a LoadAsync() method on the picture box that will load the image in a seperate thread and won't hang your app. As for the other questions, I too would most likely start with a user control and put the images there. ...
Do you mind scrolling vertically? I would start with the DataGridView control as a base and create the following implementation: 1) Create custom column and celltype deriving from DataGridViewImageColumn. You could call them "CronosNetImageColumn", "CronosNetImageCell". 2) Create a class "CronosImageDetails" to hol...
184,820
When authors submit paper to a journal, the paper will go through the peer review process. When a reviewer accepts to review a paper, the reviewer is then given the power to delay the publication of the paper and the power to reject the paper. From time to time, it has been shown that reviewers abuse the power to commi...
2022/05/01
[ "https://academia.stackexchange.com/questions/184820", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/154643/" ]
I'll reiterate my basic point, already made in a comment so brief I didn't think it would be considered a good answer: put (carefully edited/proofread) preprints on-line, on an arXiv-like preprint server, or on your own web site (if it's well established). Or both, why not? As in other comments: this will give you pri...
Predatory reviewers are so rare there is no need to do anything to protect yourself. It's so easy to get caught plagiarizing a paper you are reviewing that anyone who does it will have quite a short career. The probability that your reviewer has a similar paper near publication is very low. If a reviewer is malicious,...
184,820
When authors submit paper to a journal, the paper will go through the peer review process. When a reviewer accepts to review a paper, the reviewer is then given the power to delay the publication of the paper and the power to reject the paper. From time to time, it has been shown that reviewers abuse the power to commi...
2022/05/01
[ "https://academia.stackexchange.com/questions/184820", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/154643/" ]
I think the question is based on an irrational fear. Let me explain why, assuming that we are talking about high-quality journals rather than ones run by predatory outfits. First, reviewers do not actually have the power to do anything. They only *recommend* what the editor should to do, but the power to reject a pape...
Predatory reviewers are so rare there is no need to do anything to protect yourself. It's so easy to get caught plagiarizing a paper you are reviewing that anyone who does it will have quite a short career. The probability that your reviewer has a similar paper near publication is very low. If a reviewer is malicious,...
614,439
[![enter image description here](https://i.stack.imgur.com/of9bA.png)](https://i.stack.imgur.com/of9bA.png) How to shade a right triangle like in the picture? Here's my code: ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{intersections} \usepackage{...
2021/09/07
[ "https://tex.stackexchange.com/questions/614439", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/246172/" ]
Another option. Only with Ti*k*Z and its library `angles`. Then there is something wrong with the numbers, so I'm letting Ti*k*Z do the math for me. This is the code: ``` \documentclass[border=6mm]{standalone} \usepackage {siunitx} \usepackage {tikz} \usetikzlibrary{angles} \sisetup {output-decimal-marke...
Something like this? I am assuming that you know how to add the values of the angles. ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{intersections} \usepackage{amsmath} \usepackage{siunitx} \sisetup{output-decimal-marker={,}} \begin{document} \begin...
614,439
[![enter image description here](https://i.stack.imgur.com/of9bA.png)](https://i.stack.imgur.com/of9bA.png) How to shade a right triangle like in the picture? Here's my code: ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{intersections} \usepackage{...
2021/09/07
[ "https://tex.stackexchange.com/questions/614439", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/246172/" ]
Something like this? I am assuming that you know how to add the values of the angles. ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{intersections} \usepackage{amsmath} \usepackage{siunitx} \sisetup{output-decimal-marker={,}} \begin{document} \begin...
My solution with automatically printing numbers. [![enter image description here](https://i.stack.imgur.com/SXzLB.png)](https://i.stack.imgur.com/SXzLB.png) ``` \documentclass[border=5mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[line join=round,scale=.5, declare function={c=11;ACB=38;a=c/tan...
614,439
[![enter image description here](https://i.stack.imgur.com/of9bA.png)](https://i.stack.imgur.com/of9bA.png) How to shade a right triangle like in the picture? Here's my code: ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{intersections} \usepackage{...
2021/09/07
[ "https://tex.stackexchange.com/questions/614439", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/246172/" ]
Another option. Only with Ti*k*Z and its library `angles`. Then there is something wrong with the numbers, so I'm letting Ti*k*Z do the math for me. This is the code: ``` \documentclass[border=6mm]{standalone} \usepackage {siunitx} \usepackage {tikz} \usetikzlibrary{angles} \sisetup {output-decimal-marke...
My solution with automatically printing numbers. [![enter image description here](https://i.stack.imgur.com/SXzLB.png)](https://i.stack.imgur.com/SXzLB.png) ``` \documentclass[border=5mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[line join=round,scale=.5, declare function={c=11;ACB=38;a=c/tan...
64,229,884
I am reading a text file which contains in each line two floats separated by a comma (x,y), like this : ``` 5.2,4.4 2.2,7.2 3.6,6.9 ``` I need to read each two floats from each lines, to do some calculation on them, for exemple the first line, i have 5.2 + 4.4, then print it at this end like this : x = 5.2, y = 4.4 ...
2020/10/06
[ "https://Stackoverflow.com/questions/64229884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14402059/" ]
You should use a While loop. For example, (\* Make sure to add a break) ```py while True: print("foo") ``` What you are trying to accomplish can be done with this code: ```py joesPassword while True: continueLoop = input("Hey! Want to continue (Y/n)") if continueLoop=="n": break user = input("Welcome! W...
You'll want to use a `while` loop. Put this before your print code: ``` while True: ``` Then, indent the print code.
8,902,461
> > **Possible Duplicate:** > > [Multi-dimensional array in C++](https://stackoverflow.com/questions/8902055/multi-dimensional-array-in-c) > > > I need to create a function that has one parameter which is a multi-dimensional array with two dimensions being user-specified, e.g. ``` int function(int a, int ...
2012/01/17
[ "https://Stackoverflow.com/questions/8902461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1154926/" ]
You can do something like this with a template: ``` template <int A, int B> int function(int array[A][B]) { ... } ``` Note that this generates a block of code for each size of array that you use. You can optimise slightly by passing in the outer dimension as a function parameter instead of a template parameter (you...
You have to pass size with parameters. `int function(int a, int b, int array[][])` There is no length() method or a method like that in C++. If you pass an array, it's just a link to that. This is the same as `int function(int a, int b, int** array)` **EDIT:** Note that if you use square braces, not asteris...
44,486,975
I've just started learning PHP so this is quite a struggle for me, any help is appreciated! So, I've managed to select my database, table and get data from it. But I need to select more data from the older columns. Here is some of the code: ``` // Create connection $conn = new mysqli($servername, $username, $passwor...
2017/06/11
[ "https://Stackoverflow.com/questions/44486975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6686911/" ]
> > In computer science and logic, a dependent type is a type whose definition depends on a value. A "pair of integers" is a type. A "pair of integers where the second is greater than the first" is a dependent type because of the dependence on the value. > > > So then you can use subtypes to implement them-- ``` ...
No, not as I read the formal definition of dependent types you referenced.
44,486,975
I've just started learning PHP so this is quite a struggle for me, any help is appreciated! So, I've managed to select my database, table and get data from it. But I need to select more data from the older columns. Here is some of the code: ``` // Create connection $conn = new mysqli($servername, $username, $passwor...
2017/06/11
[ "https://Stackoverflow.com/questions/44486975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6686911/" ]
> > In computer science and logic, a dependent type is a type whose definition depends on a value. A "pair of integers" is a type. A "pair of integers where the second is greater than the first" is a dependent type because of the dependence on the value. > > > So then you can use subtypes to implement them-- ``` ...
Consider the following example: ``` type A_T is range 1 .. 50; subtype B_T is A_T; ``` Sub\_type `B_T` is in fact the "same" as the type `A_T`, since it does not pose any restrictions on it. It is rather a renaming of type `A_T` for convenience, for example. Thus, you cannot say that Ada sub-types are dependent type...
55,172
I've been learning a bit of collision resolution through a tutorial [here](http://gamedev.tutsplus.com/tutorials/implementation/create-custom-2d-physics-engine-aabb-circle-impulse-resolution/) and I can't seem to get the AABBvsAABB resolution working, I have CirclevsCircle and AABBvsCircle resolution working with the s...
2013/05/08
[ "https://gamedev.stackexchange.com/questions/55172", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/17680/" ]
I believe that your manifold normals are incorrect. These AABBs will attempt to "push back" along the axis of the greatest intersection, however: ``` if(m.Normal.X < 0) m.Normal = new Vector2(-1,0); else m.Normal= Vector2.Zero; ``` That code is saying "if B is further left than A, then the direction to resolve p...
I fixed the problem by putting a normalized normal into the `m.Normal` field and multiplied it by a value to flip the normal depending on what axis/axes it was intersecting on. ``` public static bool TestAABBvsAABB (AABB a, AABB b, ref Manifold m) { m.A = a; m.B = b; m.Norma...
55,172
I've been learning a bit of collision resolution through a tutorial [here](http://gamedev.tutsplus.com/tutorials/implementation/create-custom-2d-physics-engine-aabb-circle-impulse-resolution/) and I can't seem to get the AABBvsAABB resolution working, I have CirclevsCircle and AABBvsCircle resolution working with the s...
2013/05/08
[ "https://gamedev.stackexchange.com/questions/55172", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/17680/" ]
I believe that your manifold normals are incorrect. These AABBs will attempt to "push back" along the axis of the greatest intersection, however: ``` if(m.Normal.X < 0) m.Normal = new Vector2(-1,0); else m.Normal= Vector2.Zero; ``` That code is saying "if B is further left than A, then the direction to resolve p...
I think I've seen some of your other posts as I followed the same tutorial myself here years later. You've tried to "correct" the logic of the original algorithm by using ``` //Find which axis has the biggest penetration ;D Vector2 fixnormal; if (xExtent > yExtent){ ``` But ...
55,172
I've been learning a bit of collision resolution through a tutorial [here](http://gamedev.tutsplus.com/tutorials/implementation/create-custom-2d-physics-engine-aabb-circle-impulse-resolution/) and I can't seem to get the AABBvsAABB resolution working, I have CirclevsCircle and AABBvsCircle resolution working with the s...
2013/05/08
[ "https://gamedev.stackexchange.com/questions/55172", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/17680/" ]
I fixed the problem by putting a normalized normal into the `m.Normal` field and multiplied it by a value to flip the normal depending on what axis/axes it was intersecting on. ``` public static bool TestAABBvsAABB (AABB a, AABB b, ref Manifold m) { m.A = a; m.B = b; m.Norma...
I think I've seen some of your other posts as I followed the same tutorial myself here years later. You've tried to "correct" the logic of the original algorithm by using ``` //Find which axis has the biggest penetration ;D Vector2 fixnormal; if (xExtent > yExtent){ ``` But ...
14,392,354
ByteLand  Byteland consists of N cities numbered 1..N. There are M roads connecting some pairs of cities. There are two army divisions, A and B, which protect the kingdom. Each city is either protected by army division A or by army division B. You are the ruler of an enemy kingdom and have devised a plan to destroy By...
2013/01/18
[ "https://Stackoverflow.com/questions/14392354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071840/" ]
You need only care about roads that link two cities with different armies - links between A and B or links between B and A, so let's delete all links from A to A or B to B. You want to find a set of points such that each link has at least one point on it, which is a minimum weight vertex cover. On an arbitrary graph t...
mcdowella, But the vertices have a cost to them and the minimum vertex cover would not produce the right vertices to remove. Imagine 2 vertices (A army) pointing to the third one (B). First two vertices cost 1 each, where the third one costs 5. A minimum vertex cover would return the third one - but removing the third...
123,736
I'm trying to copy an object out of an SVG file using inkscape, however when I paste it back in to a new inkscape file it's no longer the svg version, but a rasterized version. I'm not sure if it's because inkscape runs in XQuartz and the clipboard is behaving odly.
2014/03/09
[ "https://apple.stackexchange.com/questions/123736", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/72530/" ]
[Here](http://mandarapte.com/apple/copy-pasting-vector-objects-svg-file-vector-svg-file-inkscape-converts-bitmap-working-pasteboards-x11/) someone had the same problem. They solved it by turning off X11's Pasteboard Syncing: > > Disabling ‘Sync PasteBoard’ Functionality within X11 (Which is > Included in XQuartz App...
I solved this problem by *importing* another svg file into the current one. File --> Import... --> Select "All Vectors" (or "\*.svg") in the filter selection menu. This copies the entire content of the imported file into the current one in vector format.
123,736
I'm trying to copy an object out of an SVG file using inkscape, however when I paste it back in to a new inkscape file it's no longer the svg version, but a rasterized version. I'm not sure if it's because inkscape runs in XQuartz and the clipboard is behaving odly.
2014/03/09
[ "https://apple.stackexchange.com/questions/123736", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/72530/" ]
[Here](http://mandarapte.com/apple/copy-pasting-vector-objects-svg-file-vector-svg-file-inkscape-converts-bitmap-working-pasteboards-x11/) someone had the same problem. They solved it by turning off X11's Pasteboard Syncing: > > Disabling ‘Sync PasteBoard’ Functionality within X11 (Which is > Included in XQuartz App...
This is not really a solution but a workaround I learned from [this page](https://dawes.wordpress.com/2015/10/19/inkscape-clipboard-fix-on-mac/) and it requires you to flex those muscle memory of `Command``C` and then `Command``V`. The workaround is to use `Control``D` to duplicate instead of copy and pasting. Off cour...
123,736
I'm trying to copy an object out of an SVG file using inkscape, however when I paste it back in to a new inkscape file it's no longer the svg version, but a rasterized version. I'm not sure if it's because inkscape runs in XQuartz and the clipboard is behaving odly.
2014/03/09
[ "https://apple.stackexchange.com/questions/123736", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/72530/" ]
I solved this problem by *importing* another svg file into the current one. File --> Import... --> Select "All Vectors" (or "\*.svg") in the filter selection menu. This copies the entire content of the imported file into the current one in vector format.
This is not really a solution but a workaround I learned from [this page](https://dawes.wordpress.com/2015/10/19/inkscape-clipboard-fix-on-mac/) and it requires you to flex those muscle memory of `Command``C` and then `Command``V`. The workaround is to use `Control``D` to duplicate instead of copy and pasting. Off cour...
57,903,012
I know how standard knapsack works, and i can afford to print the items selected in the 2D matrix, but from what i figured, unbounded knapsack is a 1D array. How do you print items selected by unbounded knapsack algorithm?
2019/09/12
[ "https://Stackoverflow.com/questions/57903012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12037247/" ]
Unbounded Knapsack can be solved using 2D matrix, which will make printing the included items easy. The items included in the knapsack can be backtracked from the matrix in the same way as in 0/1 Knapsack. After the dp[][] matrix is populated, this will print the included items: ``` // dp[val.length+1][sackWeight+1] ...
Assuming dp[][] is a matrix that is populated correctly. We can backtrack to find selected weights ```py def print_selected_items(dp, weights, capacity): idxes_list = [] print("Selected weights are: ", end='') n = len(weights) i = n - 1 while i >= 0 and capacity >= 0: if i > 0 and dp[i][ca...
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
If you're thinking of something like `ls foo*.txt` vs. `rm foo*.txt`, then yes, they will show and remove the same files. The shell expands the glob, and passes it to the command in question, and the commands work on the listed files. One listing them, one removing them. The obvious difference is that if any of those ...
There are already many good answers, but I want to add some more deep insight. Ask yourself the question: How many parameters are passed to `ls`, if you write ``` ls * ``` ...? Note that the `ls` command does not get the `*` as parameter if there are any files that `*` can be expanded to. Instead, the shell first p...
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
If you do only `ls` instead of `ls -a`, yes `rm` can remove hidden files you haven't seen with `ls` without `-a`. **Example :** According to : ``` dir_test ├── .test └── test2 ``` `ls dir_test` : will display only test2 `ls -A dir_test` : will display test2 + .test `rm -r dir_test` : will remove all (.test + tes...
The glob will expand the same way both times, *if* the directory contents are the same at those two different times. --- If you really want to check what will be removed, use `rm -i *.txt`. It will prompt you separately for each file before (trying to) remove it. This is guaranteed to be safe against race conditions...
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
Well, both `ls` and `rm` operate on the arguments which are passed to them. These arguments can be a simple file, so `ls file.ext` and `rm file.ext` operate on the same file and the outcome is clear (list the file / delete the file). If instead argument is a directory, `ls directory` lists the *content* of the direc...
How about: ``` $ mkdir what $ cd what $ mkdir -p huh/uhm ./-r $ ls * uhm $ rm * $ ls -r $ ls -R .: -r ./-r: ``` Basically wildcards expanding to stuff starting with `-` (or manually entered stuff starting with `-` but that looks a bit more like cheating) may be interpreted differently by `ls` and `rm`.
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
If you type `ls *` and then `rm *`, it's possible you'll remove more files than `ls` showed - they might have been created in the tiny time interval between the end of `ls` and start of `rm`.
The glob will expand the same way both times, *if* the directory contents are the same at those two different times. --- If you really want to check what will be removed, use `rm -i *.txt`. It will prompt you separately for each file before (trying to) remove it. This is guaranteed to be safe against race conditions...
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
Leaving aside shell behavior,let's focus on only what `rm` and `ls` can deal with themselves. At least one case where `ls` will show what `rm` can't remove involves directory permissions, and the other - special directories `.` and `..`. ### Folder permissions `rm` is an operation on a directory, because by removing ...
The glob will expand the same way both times, *if* the directory contents are the same at those two different times. --- If you really want to check what will be removed, use `rm -i *.txt`. It will prompt you separately for each file before (trying to) remove it. This is guaranteed to be safe against race conditions...
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
Well, both `ls` and `rm` operate on the arguments which are passed to them. These arguments can be a simple file, so `ls file.ext` and `rm file.ext` operate on the same file and the outcome is clear (list the file / delete the file). If instead argument is a directory, `ls directory` lists the *content* of the direc...
The glob will expand the same way both times, *if* the directory contents are the same at those two different times. --- If you really want to check what will be removed, use `rm -i *.txt`. It will prompt you separately for each file before (trying to) remove it. This is guaranteed to be safe against race conditions...
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
Leaving aside shell behavior,let's focus on only what `rm` and `ls` can deal with themselves. At least one case where `ls` will show what `rm` can't remove involves directory permissions, and the other - special directories `.` and `..`. ### Folder permissions `rm` is an operation on a directory, because by removing ...
`ls *` and `rm *` are not responsible for expanding the glob - that's done by the shell before passing it to the command. This means that you can use *any* command with the expanded filelist - so I would use something that does as little as possible. So a better way to do this (or at the least, another way) is to ski...
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
Leaving aside shell behavior,let's focus on only what `rm` and `ls` can deal with themselves. At least one case where `ls` will show what `rm` can't remove involves directory permissions, and the other - special directories `.` and `..`. ### Folder permissions `rm` is an operation on a directory, because by removing ...
How about: ``` $ mkdir what $ cd what $ mkdir -p huh/uhm ./-r $ ls * uhm $ rm * $ ls -r $ ls -R .: -r ./-r: ``` Basically wildcards expanding to stuff starting with `-` (or manually entered stuff starting with `-` but that looks a bit more like cheating) may be interpreted differently by `ls` and `rm`.
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
If you type `ls *` and then `rm *`, it's possible you'll remove more files than `ls` showed - they might have been created in the tiny time interval between the end of `ls` and start of `rm`.
How about: ``` $ mkdir what $ cd what $ mkdir -p huh/uhm ./-r $ ls * uhm $ rm * $ ls -r $ ls -R .: -r ./-r: ``` Basically wildcards expanding to stuff starting with `-` (or manually entered stuff starting with `-` but that looks a bit more like cheating) may be interpreted differently by `ls` and `rm`.
1,072,334
I created a bash file to register users in the ProFTPD Server. The bash file is run from a PHP file, sending 5 variables as parameters, which are: name, surname, user, password and a random number with 4 digits (eg. 7215) Everytime I run it I get these errors and only users and their folders are created. The ProFTPD c...
2018/09/05
[ "https://askubuntu.com/questions/1072334", "https://askubuntu.com", "https://askubuntu.com/users/867202/" ]
Well, both `ls` and `rm` operate on the arguments which are passed to them. These arguments can be a simple file, so `ls file.ext` and `rm file.ext` operate on the same file and the outcome is clear (list the file / delete the file). If instead argument is a directory, `ls directory` lists the *content* of the direc...
There *are* edge cases where what `ls` shows is not what `rm` removes. A rather extreme, but fortunately benign one is if the argument you pass is a symbolic link to a directory: `ls` will show you all the files in the symlinked directory, while `rm` will remove the symlink, leaving the original directory and its conte...
1,629,299
I have recently been introduced to the Velocity project. I have written a template and have run it as a simple Java application. Integration within my existing web project has not been that easy. Can anyone supply a cookbook for integrating Velocity and Tomcat? Thanks all!
2009/10/27
[ "https://Stackoverflow.com/questions/1629299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
Presuming `iFile` is an `istream`: You should break out of the loop on *any* error, not only on EOF (which can be checked for with `iFile.eof()`, BTW), because this is an endless loop when any format failure sets the stream into a bad state other that EOF. It is usually necessary to break out of a reading loop in the...
If any of the reads fail (where you read the column data), just break out of the while loop. Presumably you are then at the end of the file and reading the last 'not correct' line
1,629,299
I have recently been introduced to the Velocity project. I have written a template and have run it as a simple Java application. Integration within my existing web project has not been that easy. Can anyone supply a cookbook for integrating Velocity and Tomcat? Thanks all!
2009/10/27
[ "https://Stackoverflow.com/questions/1629299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
EOF is not a prediction but an error state. Hence, you can't use it like you're using it now, to predict whether you can read Column 1, 2 and 3. For that reason, a common pattern in C++ is: ``` while (input >> obj1 >> obj2) { use(obj1, obj2); } ``` All `operator>>(istream& is, T&)` return the inputstream, and when...
If any of the reads fail (where you read the column data), just break out of the while loop. Presumably you are then at the end of the file and reading the last 'not correct' line
1,629,299
I have recently been introduced to the Velocity project. I have written a template and have run it as a simple Java application. Integration within my existing web project has not been that easy. Can anyone supply a cookbook for integrating Velocity and Tomcat? Thanks all!
2009/10/27
[ "https://Stackoverflow.com/questions/1629299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
Presuming `iFile` is an `istream`: You should break out of the loop on *any* error, not only on EOF (which can be checked for with `iFile.eof()`, BTW), because this is an endless loop when any format failure sets the stream into a bad state other that EOF. It is usually necessary to break out of a reading loop in the...
Maybe you'll consider it a good idea to handle whitespace and other invalid input then. Perhaps some basic validation of columns 1,2,3 would be desirable as well.
1,629,299
I have recently been introduced to the Velocity project. I have written a template and have run it as a simple Java application. Integration within my existing web project has not been that easy. Can anyone supply a cookbook for integrating Velocity and Tomcat? Thanks all!
2009/10/27
[ "https://Stackoverflow.com/questions/1629299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
EOF is not a prediction but an error state. Hence, you can't use it like you're using it now, to predict whether you can read Column 1, 2 and 3. For that reason, a common pattern in C++ is: ``` while (input >> obj1 >> obj2) { use(obj1, obj2); } ``` All `operator>>(istream& is, T&)` return the inputstream, and when...
Maybe you'll consider it a good idea to handle whitespace and other invalid input then. Perhaps some basic validation of columns 1,2,3 would be desirable as well.
1,629,299
I have recently been introduced to the Velocity project. I have written a template and have run it as a simple Java application. Integration within my existing web project has not been that easy. Can anyone supply a cookbook for integrating Velocity and Tomcat? Thanks all!
2009/10/27
[ "https://Stackoverflow.com/questions/1629299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
Presuming `iFile` is an `istream`: You should break out of the loop on *any* error, not only on EOF (which can be checked for with `iFile.eof()`, BTW), because this is an endless loop when any format failure sets the stream into a bad state other that EOF. It is usually necessary to break out of a reading loop in the...
Don't worry about the number of times that you loop: just validate your data and handle invalid inputs. Basically, check that you have three columns to read and if you don't decide if it's because the file is over or because of some other issue.
1,629,299
I have recently been introduced to the Velocity project. I have written a template and have run it as a simple Java application. Integration within my existing web project has not been that easy. Can anyone supply a cookbook for integrating Velocity and Tomcat? Thanks all!
2009/10/27
[ "https://Stackoverflow.com/questions/1629299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
EOF is not a prediction but an error state. Hence, you can't use it like you're using it now, to predict whether you can read Column 1, 2 and 3. For that reason, a common pattern in C++ is: ``` while (input >> obj1 >> obj2) { use(obj1, obj2); } ``` All `operator>>(istream& is, T&)` return the inputstream, and when...
Don't worry about the number of times that you loop: just validate your data and handle invalid inputs. Basically, check that you have three columns to read and if you don't decide if it's because the file is over or because of some other issue.
1,629,299
I have recently been introduced to the Velocity project. I have written a template and have run it as a simple Java application. Integration within my existing web project has not been that easy. Can anyone supply a cookbook for integrating Velocity and Tomcat? Thanks all!
2009/10/27
[ "https://Stackoverflow.com/questions/1629299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
Presuming `iFile` is an `istream`: You should break out of the loop on *any* error, not only on EOF (which can be checked for with `iFile.eof()`, BTW), because this is an endless loop when any format failure sets the stream into a bad state other that EOF. It is usually necessary to break out of a reading loop in the...
EOF is not a prediction but an error state. Hence, you can't use it like you're using it now, to predict whether you can read Column 1, 2 and 3. For that reason, a common pattern in C++ is: ``` while (input >> obj1 >> obj2) { use(obj1, obj2); } ``` All `operator>>(istream& is, T&)` return the inputstream, and when...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Don't give up Vi/Vim just because a large percentage of people like Slime. I've written about this before here on SO. Check these out: * [Using Vim for Lisp development](https://stackoverflow.com/questions/94792/using-vim-for-lisp-development/556236#556236) * <https://stackoverflow.com/questions/451329/what-is-the-pr...
Well, a good place to start would be the [executing lisp](http://www.gnu.org/software/emacs/manual/html_node/emacs/Executing-Lisp.html) section of the *info* pages. In general, when you work with an interpreted language in Emacs, you edit the source files, and interact with an inferior process (a new process spawned b...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Don't give up Vi/Vim just because a large percentage of people like Slime. I've written about this before here on SO. Check these out: * [Using Vim for Lisp development](https://stackoverflow.com/questions/94792/using-vim-for-lisp-development/556236#556236) * <https://stackoverflow.com/questions/451329/what-is-the-pr...
I can say that Emacs is a good environment for writing Lisp, since I used it in college to that end. The `*scratch*` buffer provides a good place for test code. The compiler docs should say how to call them, so you can write out your files to disk and then run them in a shell window, or use one of Emacs' modes to integ...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Let's assume you have emacs running and have checked out SLIME from CVS and installed it. This should be easy with any Linux distro; `apt-get install emacs slime` does it for me. (You should also install SBCL, the best Common Lisp implementation.) SLIME out of the box doesn't do much anymore, so it needs configuration...
Don't give up Vi/Vim just because a large percentage of people like Slime. I've written about this before here on SO. Check these out: * [Using Vim for Lisp development](https://stackoverflow.com/questions/94792/using-vim-for-lisp-development/556236#556236) * <https://stackoverflow.com/questions/451329/what-is-the-pr...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Don't give up Vi/Vim just because a large percentage of people like Slime. I've written about this before here on SO. Check these out: * [Using Vim for Lisp development](https://stackoverflow.com/questions/94792/using-vim-for-lisp-development/556236#556236) * <https://stackoverflow.com/questions/451329/what-is-the-pr...
Lispbox & SLIME are fine answers, but if you want something even simpler, just to play with, you might consider the free version of [LispWorks Personal](http://www.lispworks.com/ "link to LispWorks website") or [Allegro CL Free Edition](http://franz.com/downloads/ "link to Franz website"). I have not used either on lin...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Did you try [Lispbox](http://gigamonkeys.com/book/lispbox/)?
I can say that Emacs is a good environment for writing Lisp, since I used it in college to that end. The `*scratch*` buffer provides a good place for test code. The compiler docs should say how to call them, so you can write out your files to disk and then run them in a shell window, or use one of Emacs' modes to integ...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Lispbox & SLIME are fine answers, but if you want something even simpler, just to play with, you might consider the free version of [LispWorks Personal](http://www.lispworks.com/ "link to LispWorks website") or [Allegro CL Free Edition](http://franz.com/downloads/ "link to Franz website"). I have not used either on lin...
I can say that Emacs is a good environment for writing Lisp, since I used it in college to that end. The `*scratch*` buffer provides a good place for test code. The compiler docs should say how to call them, so you can write out your files to disk and then run them in a shell window, or use one of Emacs' modes to integ...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Don't give up Vi/Vim just because a large percentage of people like Slime. I've written about this before here on SO. Check these out: * [Using Vim for Lisp development](https://stackoverflow.com/questions/94792/using-vim-for-lisp-development/556236#556236) * <https://stackoverflow.com/questions/451329/what-is-the-pr...
There are different ways of setting up a Lisp environment, from manual approaches to out-of-the-box installers. The following answer is for [clbuild](http://common-lisp.net/project/clbuild/), which always downloads brand-new versions of all packages for you: Assuming you have Emacs and SBCL already installed, the fol...
1,101,487
I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, havi...
2009/07/09
[ "https://Stackoverflow.com/questions/1101487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125958/" ]
Don't give up Vi/Vim just because a large percentage of people like Slime. I've written about this before here on SO. Check these out: * [Using Vim for Lisp development](https://stackoverflow.com/questions/94792/using-vim-for-lisp-development/556236#556236) * <https://stackoverflow.com/questions/451329/what-is-the-pr...
Did you try [Lispbox](http://gigamonkeys.com/book/lispbox/)?