Hi, I have a MySql table called today_stats. It has got Id, date and clicks. I'm trying to create a script to get the values and try to predict the next 7 days clicks. How I can predict it in PHP?
I use the Call keyword used when calling subs in VB/VBA. I know it's optional, but is it better to use it or leave it off? I've always thought it was more explicit, but maybe it's just noise.
Also, I read this on another forum: Using the Call keyword is faster because it knows that it is not going to return any values, so it doesn't need to set up any stackspace to make room for the return value.
There is a column in database which contains comma seperated values like: 0.00,12.45,14.33 and so on.
I need to sum this inside a stored procedure. One way which I can think of is to split and convert it into a table using a function and then sum it.
Any other ideas?
In R, given a vector
casp6 <- c(0.9478638, 0.7477657, 0.9742675, 0.9008372, 0.4873001, 0.5097587, 0.6476510, 0.4552577, 0.5578296, 0.5728478, 0.1927945, 0.2624068, 0.2732615)
and a factor:
trans.factor <- factor (rep (c("t0", "t12", "t24", "t72"), c(4,3,3,3)))
I want to create a plot where the data points are grouped as defined by the factor. So the categories should be on the x-axis, values in the same category should have the same x coordinate.
Simply doing plot(trans.factor, casp6) does almost what I want, it produces a boxplot, but I want to see the individual data points.
Should we be testing values that we already know the answer to?
If a value is important enough to be a dedicated hard code value then should should it be important enough of to change a test at the same time as the value? or is this just overkill?!
The function verboseCheck from QuickCheck 1 seems to be absent in QuickCheck 2 (or at least, I can't find it). Is there any other way to show which values are used during testing?
Hi, I am trying get float value with UITextField.
On the simulator V3.1.3 in English, I have to use '.' to separate my float values.
But on my Iphone 3GS V3.1.3 in French, I have to use ',' to separate them.
If I use '.' on my Iphone 3GS, my float is troncated : 3.22222 = 3.0000000
Is there a solution to detect the language version and use the good separator automaticaly?
I was thinking either:
Appconfig File
A generic .XML file and have the program load values at launch.
What is the best way to do this? A website with a best user tutorial perhaps?
How can i select all id's for records in single cell?
For example:
--example select of all values
select id, name, address, phone from table
And get all id's where phone like '%555%' and show them in single field like:
'111 123 234 321 231 234'
Have you been stuck with the math in a Flash project?
It's a loose design pattern my director formulated. My goal is to keep the project object oriented, and get 'non Flash obstacles' off my plate.
XML values going to AS3, updating a changing acceleration formula. I don't hate math, but it just doesn't seem OOP or good project planning to have the math stuck in Flash. Your comments are welcome.
Hello,
I come from PHP background and am used to doing var_dump, echo and print_r while doing some kind of debugging.
I have just started on jquery, today is my first day infact and am trying to see if there is a way to dump out value to firebug console.
Do we have similar function to var_dump or echo in jQuery or any other way to get values or debug statements displayed on the console ?
I need to read binary PGM image files. Its format:
P5
# comments
nrows ncolumns
max-value
binary values start at this line. (totally nrows*ncolumns bytes/unsigned char)
I know how to do it in C or C++ using FILE handler by reading several lines first and read the binary block. But don't know how to do it in .Net.
Hi friends, I need to load the database values into the grid view by checking the attrinute "id". If the id value which I entered s equal to database, then it'll load in d grid view.
Help me to do tat
In the Erlang interactive shell you can bind variables to values. If I would like to clear everything and start from scratch without exiting the session and starting a new one, how do I do that?
And if I just wanted to re-use a single variable, is it possible to re-bind?
I have a pretty large insert statement something like
INSERT INTO multimedia (filename, regex, flag) VALUES (('adsfavr.jpg', '<div id="title">', 0), (...), (...));
How do I prepare the query for MySQL.It's too long to do it manually. It includes double quotes so I can't use the php function mysql_real_escape_string()
Hi,
I want to compare two double values till the second digit from decimal point. I am using following statement but I think it is not working properly.
dbl1.ToString("g2", CultureInfo.InvariantCulture).Equals( dbl2.ToString("g2", CultureInfo.InvariantCulture))
Am I missing anything here?
<c:forEach items="${myParams.items}" var="currentItem" varStatus="stat">
<c:set var="myVar" value="<c:out var="myVar" />" />
</c:forEach>
I want to concatenate the values of currentItem.myVar and output it at the end of the loop, problem is I can't figure out how to do this...
(Preferably not using Java)
How can I iterate ResultSet ? I've tried with the following code, but i get the error java.sql.SQLException: Illegal operation on empty result set.
while ( !rs.isLast()) {
rs.next();
int id = rs.getInt("person_id");
SQL.getInstance().getSt().execute("INSERT ref_person_pub(person_id) VALUES(" + id + ")");
}
Hi,
I have a simple standalone application written in Visual Basic that I'm porting to a browser based application using PHP/javascript.
The original VB application has some simple embedded flash games with token and point counters. The token and point values are being passed as variables between the application and the game.
I'm trying to achieve the same effect in my PHP port without modifying the actionscript code( using the variables in actionscript that already exist).
Below is Visual Basic code that's loading a value from a database and posting that value to flash using FlashVars:
Private Sub loadPlayer()
Try
If CtblPoints.CheckPointsByID(mCard) Then
objPoints = CtblPoints.GettblPointsByID(mCard)
objPlayerAc = CtblPlayerAccount.GettblPlayerAccountByPlayerID(objPoints.AccountId)
objPlayer = CtblPlayer.GettblPlayerByID(objPlayerAc.PlayerID)
objPlayerBal = CtblPlayerBalance.GettblPlayerBalanceByID(objPlayerAc.PlayerID)
objPlayerAcDetail = CtblPlayerAccountDetail.GettblPlayerAccountDetailByAmount(objPoints.AccountId)
strTotalPoints = Convert.ToString(objPlayerAc.Points)
strTotalWin = Convert.ToString(objPlayerBal.TokenAmount)
'Dim intTokenAmount As Decimal = Convert.ToDecimal(objPlayerBal.TokenAmount)
'strTotalWin = Convert.ToString(Convert.ToInt64(intTokenAmount * 100))
flashPlayer.Size = panelGame.Size
flashPlayer.FlashVars = "totalEntries=" & strTotalPoints & "&credit=" & strTotalWin
flashPlayer.LoadMovie(0, strGameFile)
flashPlayer.Play()
Else
Me.Close()
Dim frmInvCrd As New frmInvalidCard
frmInvCrd.ShowDialog()
End If
Catch ex As Exception
End Try
I'm trying to recreate this in PHP, but I'm at a loss as to how to begin implementing it.
The variables in flash are declared publicly, and global imports used:
import com.atticmedia.console.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.utils.*;
First declaration of variable 'totalEntries' is:
public var totalEntries:int = 0;
and this is a snip of totalEntries being used in the actionscript
public function notifyServerOfUnwonCredits(param1)
{
var remainder:* = param1;
if (this.useServer)
{
this.targetWinAmount = 0;
this.cancelUpdateOverTime = F9.setEnterFrame(this.updateOverTime);
fscommand("OverTime", "" + remainder);
this.flashVarsUpdatedAction = function ()
{
originalTotalWin = totalWin;
return;
}// end function
;
}
else
{
this.setTotalEntries(100000);
this.setTotalWin(0);
}
return;
}// end function
Eventually I'll be passing these values back to a mySQL database.
Any insight into this would be extremely helpful,
Thanks!
Hi,
I am writing a GUI based application where I read a string of values from serial port every few seconds and I need to display most of the values in some type graphical indicator(I was thinking of QprogressBar maybe) that displays the range and the value. Some of the other data that I am parsing from the string are the date and fault codes. Also, the data is hierarchical.
I wanted to use the model/view architecture of Qt because I have been interested in MVC stuff for a while but have never quite wrapped my brain around how to implement it very well.
As of now, I have subclassed QAbstractItemModel and in the model I read the serial port and wrap the items parsed from the string in a Tree data structure. I can view all of the data in a QtreeView with no issues.
I have also began to subclass QAbstractItemView to build my custom view with all of the Graphical Indicators and such. This is where I am getting stuck. It seems to me that in order for me to design a view that knows how to display my custom model the view needs to know exactly how all of the data in the model is organized. Doesn't that defeat the purpose of Model/View? The QTreeView I tested the model with is basically just displaying the model as it is setup in the Tree structure but I don't want to do that because the data is not all of the same type. Is the type of data or the way you would like to present it to the user a determining factor in whether or not you should use this architecture? I always assumed it was just always better to design in an MVC style.
It seems to me like it might have been better to just subclass QWidget and then read in from the serial port and update all of subwidgets(graphical indicators, labels, etc...) from the subclass. Essentially, do everything in one class.
Does anybody understand this issue that can explain to me either what I am missing or why I shouldn't be doing it this way. As of now I am a little confused.
Thanks so much for any help!
This is a really silly question probably, I'm working on a database and what I want to do is create a table with an ID (auto increment) and another column: "Number" (I realize it sounds useless but bare with me here please), and I need to fill this "Number" column with values from 1 to 180, each time adding 1 to the previous.
What would be a clever "automatic" way of doing that?
Hi
I have written a pgsql function along the lines of what's shown below. How can I get rid of the $1, $2, etc. and replace them with the real argument names to make the function code more readable?
Regards
Peter
CREATE OR REPLACE FUNCTION InsertUser (
UserID UUID,
FirstName CHAR(10),
Surname VARCHAR(75),
Email VARCHAR(75)
)
RETURNS void
AS
$$
INSERT INTO "User" (userid,firstname,surname,email)
VALUES ($1,$2,$3,$4)
$$
LANGUAGE SQL;
hello all.
I have an array:
int test[]={10212,10202,11000,11000,11010};
I want to split the inetger values to individual digits and place them in a new array as individual elements such that my array now is:
int test2[]={1,0,2,1,2,1,0,2,0,2,1,1,0,0,0,1,1,0,0,0,1,1,0,1,0};
How would i go about doing that? I'm doing this in java.
Thank you.