formula

Math on batch (win)

橙三吉。 提交于 2019-11-29 01:27:38
I am developing a CMD batch. I want to do some math in it. This formula: (x+1)100:y So in batch, x = %x%, and y = %y% . I know how to set the variables. Now, how can batch calculate this? (WINDOWS CMD) Do I need something extra? (I need this to be available to users of Windows XP to 7.) Kevin The set command supports some limited calculation. In your case, you want: set /a result=(100*x)/y Run set /? to see full documentation on what is supported. The /a switch does automatic variable substitution, so you can use x instead of %x% . @echo off set x=42 set y=5 set /a z = 100 * x / y echo %z% The

Error in terms.formula(formula) : '.' in formula and no 'data' argument

百般思念 提交于 2019-11-29 01:07:41
I'm tring to use neuralnet for prediction. Create some X: x <- cbind(seq(1, 50, 1), seq(51, 100, 1)) Create Y: y <- x[,1]*x[,2] Give them a names colnames(x) <- c('x1', 'x2') names(y) <- 'y' Make data.frame: dt <- data.frame(x, y) And now, I got error model <- neuralnet(y~., dt, hidden=10, threshold=0.01) error in terms.formula(formula) : '.' in formula and no 'data' argument For example, in lm(linear model) this is worked. As my comment states, this looks like a bug in the non-exported function neuralnet:::generate.initial.variables . As a work around, just build a long formula from the names

Using relative positions in Excel formulas

拜拜、爱过 提交于 2019-11-28 22:41:05
How do I create a formula that isn't made invalid when I delete a row. For example in cell F12 I have the formula: =F11+D12-E12 This basically says take the value from the cell above then add the value of the cell 2 to the left and subtract the value in the cell directly to the left. However, because I'm using actual cell addresses, as soon as I delete a row, all the rows below become invalid. How do i express the formula by relative position (ie = "1 above" + "2 to left" - "1 to left") Thanks. You can use either =OFFSET(F12,-1,0)+OFFSET(F12,0,-2)-OFFSET(F12,0,-1) , or =INDIRECT("F11",true)

How to calculate distance based on phone acceleration

て烟熏妆下的殇ゞ 提交于 2019-11-28 17:19:55
I want to build something like this but using an android phone: http://www.youtube.com/watch?v=WOt9mb5QqRs I've already built an app that sends sensor information via socket (still looking for a good websocket implementation for android). I intend to use that information to interact with a web app, so for example i would be able to move an image based on the phone movement. The problem is that I tried to calculate distance based on the accelerometer data but the results are really bad. I wonder if anyone could help me with the correct equation, but first of all, is it possible to do this? Till

LaTeX equivalent to Google Chart API

倾然丶 夕夏残阳落幕 提交于 2019-11-28 16:51:16
问题 I'm currently looking at different solutions getting 2 dimensional mathematical formulas into webpages. I think that the wikipedia solution (generating png images from LaTeX sourcecode) is good enough until we get support for MathML in webbrowsers. I suddenly realized that it might be possible to create a Google Charts API equivalent for mathformulas. Has this already been done? Is it even possible due to the strange characters involved in LaTeX-code? I would like to hit an url like latex2png

Formula to draw arcs ending in straight lines, Y as a function of X, starting slope, ending slope, starting point and arc radius?

帅比萌擦擦* 提交于 2019-11-28 14:47:54
I'm looking for a math formula that on a graph plotting Y as a function of X, before a specified starting point (a value of X, or even better, X and Y coordinates) will have a certain slope, then after that it will draw an arc of a specified radius that will end when it reaches a second specified slope, and from the point on will be another straight line of that second slope. I'm am aware that because it's Y as a function of X, the slope parameters would need to be bigger than exactly -90 and smaller than exactly 90 degrees; i'm not worried about any misbehavior at (or beyond) those extremes.

Native SQL query for an Hibernate entity using @Formula results in NullPointerException

旧时模样 提交于 2019-11-28 13:21:38
I've got an simple Hibernate entity for which I use the @Formula annotion: @Id private Long id; private String name; @Formula("(select count(f.*) from foo f where f.id = id)") private long bar; When I try to load an entity with a native SQL Query: EM.createNativeQuery("SELECT f.*, count(something) as bar FROM foo f WHERE f.name = '...'", Entity.class) I get an NullPointerException: java.lang.NullPointerException at org.hibernate.loader.DefaultEntityAliases.intern(DefaultEntityAliases.java:193) at org.hibernate.loader.DefaultEntityAliases.getSuffixedPropertyAliases(DefaultEntityAliases.java:151

Padding a fixed number with leading zeros up to a fixed length [closed]

試著忘記壹切 提交于 2019-11-28 13:16:24
In Crystal Report using Visual Studio 2010, I am trying a to create a formula for the following scenario: x = any number (Fixed number of 8 digits, cant be less or greater) If Length of X is less than 8, pad the required amount of 0's in the front to make its length 8. Eg: X = 123 Result of Formula should be 00000123 X = 9 Result of Formula should be 00000009 Any help will be appreciated. Thanks in advance. ToText({table.field},"00000000") is more succinct. aMazing I got it Right("0000"&{MyFieldToPad},8) Works perfectly as I want it to. 来源: https://stackoverflow.com/questions/10989266/padding

I don't know how to display timer when stopped

百般思念 提交于 2019-11-28 11:53:08
问题 How are you all doing? I have a little problem with my code. When I stop my timer program, it will say "Done!" since I set it to "Done", but I would like to display the remaining time instead of the word "Done". Like for example if I the original time set is 4000 Seconds and I stopped at 3000 seconds I want to display the current time which is 3000 when stopping it instead of the word "Done". Can you guys help me out? I would really appreciate it. Here's my code: import java.awt.event.*;

Excel formula for reverse percentage calculation

隐身守侯 提交于 2019-11-28 11:47:22
问题 I have a calculation which I am unable to crack. Lets say my Cost Price is 300. I want to sell the item at No Profit or No Loss. My total commission/expenses will be 30%. So it means i need to sell the item at 390. But if I do 390 - 30% = 273. How can I see the item, so that if I minus 30% to it. My Revenue will still be 300. 回答1: the formula you want is =300/0.7 or =300/(1-30%) basically it is 300= x*(1-.30) where the (1-.30) is the amount that wants to be kept after the commision of 30%.