Here a code I'm using now.
<%= f.select :project_id, @project_select %>
How to modify it to make it it's default value params[:pid] when page is loaded?
Hi,
is it possible to read the value of an IdentityTag if you place it on the TagVisualizer, without having initalized it before?
I would like to use the tags for registering a new object on the Surface but having all the "free" IdentityTags in a Collection for initalizing them all... There must be a better way to do in I think.
But the TagVisualizer doesn't seem to do anything when you put a tag on it that it doesn't know.
I have a question.Here is the code!
f.select(:departments,Department.all.collect{|c|[c.name,c.id]},{},:size=>10,:multiple => ture)
class Emergency
has many :departments
end
the html source like this:
<select id="emergency_departments" multiple="multiple" name="emergency[departments][]" size="10"><option value ="">""</option>....</select>
now I want to get the default selected tag , who can tell me how ?
Hey,
I have a need to mirror a byte's value around the centre of 128. So, example outputs of this function include:
In 0 Out 255
In 255 Out 0
In 128 Out 128
In 127 Out 1
In 30 Out 225
In 225 Out 30
I'm driving myself nuts with this, I'm sure I'll kick myself when I read the answers.
Cheers
I noticed in Firefox when viewing the cookies that the values I am saving are not encrypted. The CakePHP Book states that values are encrypted by default on write(). I can't seem to find any gotchas in the doc
Anyone else experience this problem? I am sure I am missing something.. Would it matter that the value being set is a integer?
I am using checkboxs in a GridView. I need to determine the value in the cell in the 2nd column, if a related row checkbox has been checked.
I am using C# 2008 and ASP.net
Hi,
How to alert variable name, not a value of variable?
var color = 'red';
alert(color); // Will alert 'red'
alert(/* magic */); // Will alert 'color'
In T-SQL, this is allowed:
DECLARE @SelectedValue int
SELECT @SelectedValue = MyIntField FROM MyTable WHERE MyPrimaryKeyField = 1
So, it's possible to get the value of a SELECT and stuff it in a variable (provided it's scalar, obviously).
If I put the same select logic in a stored procedure:
CREATE PROCEDURE GetMyInt
AS
SELECT MyIntField FROM MyTable WHERE MyPrimaryKeyField = 1
Can I get the output of this stored procedure and stuff it in a variable?
Something like:
DECLARE @SelectedValue int
SELECT @SelectedValue = EXEC GetMyInt
(I know the syntax above is not allowed because I tried it!)
How to find a value exist in an array and how to remove it. If any php builtin array functions for doing this. After removing I need the sequential index order. any body knows please help me.
i have an html page where i have a table of items (one item per row) where each item is a html link that says "Add" and there is a textbox next to each link with a number in it.
the text link and the textbox are in the same td inside the row of the table.
how do i, using jquery, capture the value from the textbox that is to the right of the link i click on.
i have a problem in inserting the listbox value into mysql database in vb 2008 i.e
if i select a video file i.e D:\videos\video1.mpg and add a msgbox() event before inserting into data base it shows the exact path i.e D:\videos\video1.mpg but when i check my database it shows me as D:videosvideo1.mpg how can i solve that
I need help because I want to create a gameover screen that display score. However, there's an error that prevent me from transferring the score from theplayclass.as to thegameoverclass.as. Are there ways to pass a value to another movieclip without causing any errors.
I refer the source code from this website : http://www.emanueleferonato.com/2008/12/17/designing-the-structure-of-a-flash-game-as3-version/
Here's the error
C:\Users\xxx\Downloads\Migrate\test\theplayclass.as, Line 54, Column 41 1067: Implicit coercion of a value of type theplayclass to an unrelated type main.
main.as
package
{
import flash.display.MovieClip;
import flash.events.Event;
public class main extends MovieClip
{
public var playClass:theplayclass;
public var gameOverClass:thegameoverclass;
public function main()
{
showWin();
}
public function showWin()
{
playClass = new theplayclass(this);
addChild(playClass);
}
public function showGameOver()
{
gameOverClass = new thegameoverclass(this);
addChild(gameOverClass);
removeChild(playClass);
playClass = null;
}
}
}
theplayclass.as
package
{
import flash.display.MovieClip;
import flash.events.*;
public class theplayclass extends MovieClip
{
private var mainClass:main;
var gameScore:Number;
var gameOverScore:thegameoverclass;
public function theplayclass(passedClass:main)
{
mainClass = passedClass;
scoreText.text ="0";
gameScore = 0;
win.addEventListener(MouseEvent.CLICK, showwinFunction);
next.addEventListener(MouseEvent.CLICK, showgameoverFunction);
addEventListener(Event.ADDED_TO_STAGE, addToStage);
addEventListener(Event.ENTER_FRAME, changeScore);
}
public function addToStage(e:Event):void
{
this.x = 0;
this.y = 0;
}
private function showwinFunction(e:MouseEvent):void
{
gameScore+=50;
}
private function changeScore(e:Event):void
{
scoreText.text =""+gameScore;
}
public function showgameoverFunction(e:MouseEvent)
{
mainClass.showGameOver();
gameOverScore = new thegameoverclass(this);
gameOverScore.setTextScore(gameScore);
}
}
}
thegameoverclass.as
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.*;
public class thegameoverclass extends MovieClip
{
var mainClass:main;
var scorePoints:Number;
public function thegameoverclass(passedClass:main)
{
mainClass = passedClass;
finalScore.text = "test";
}
public function setTextScore(textToSet:Number)
{
finalScore.text = ""+scorePoints;
}
}
}
Hello All...
I Have one situation where I need to convert integer value into hexadecimal way.
I have done with some logical, but I want the optimized solutions...
Thanks in advance...
Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next 'jobnumber' . But I want to do this before any entry is made to the table. IE so when a user looks at a form it will display something like 'this is job number 6954'
I have tried $rr = mysql_insert_id() but this only work after I have made an entry
Can anyone help please
thanks
I read somewhere that for a high traffic site (I guess that is a murky term as well), 30 - 60 seconds is a good value. Obviously I could do a load test and vary the values, but I couldn't find any kind of documentation on this. Most samples have a minute, a couple of minutes. There's no recommended range. Is there something on msdn or anywhere that talks about this?
I am trying to run the following SQL statement:
"SELECT *, (IIF([Field]=TRUE,'StringValue1','StringValue2') AS [NewField] FROM [Table1] ORDER BY [NewField] ASC"
But this gives me an error "Parameter NewField has no default value". How can I solve it?
I am using Microsoft Access (MDB) database using Jet Engine from Delphi 7.
Thank you!
CALORIES = \
{ 'Beef' : 200, \
'Chicken' : 140, \
}
class Food():
__slots__ = (
'cal' # Calories
)
def mkFood( name ):
"""Create and return a newly initialized Food item"""
result = Food()
result.cal = calorie in dict(CALORIES[1])
return result
Is that a proper way to the value of the target item in Calories? Like getting 200, 140, such like that.
result.cal = calorie in dict(CALORIES[1])
We have link to some page (with html code), that page have one img, which attributes title and alt are equal.
Script must open link, grab the src attribute of img which title=alt, and throw the value into some variable.
How to do it?
Thanks.
This question asks for one in java,
what's the best candidate in PHP?
BTW,does the following establish:
distributed key value store ==
distributed cache
?
When a vote value is changed, the form POSTs the change, then refreshes the page. This is called on the top of the page upon load:
if (isset($_POST['q'.$question_id]))
{
$user->updateQuestionVotes($question_id, $_POST['q'.$question_id]);
}
Why does it update every time I refresh after the first time? Do I need to unset it somehow?
I am having a small problem trying to decide on database schema for a current project. I am by no means a DBA.
The application parses through a file based on user input and enters that data in the database. The number of fields that can be parsed is between 1 and 42 at the current moment.
The current design of the database is entirely flat with there being 42 columns; some have repeated columns such as address1, address2, address3, etc...
This says that I should normalize the data. However, data integrity is not needed at this moment and the way the data is shaped I'm looking at several joins. Not a bad thing but the data is still in a 1 to 1 relationship and I still see a lot of empty fields per row.
So my concerns are that this does not allow the database or the application to be very extendable. If they want to add more fields to be parsed (which they do) than I'd need to create another table and add another foreign key to the linking table.
The third option is I have a table where the fields are defined and a table for each record. So what I was thinking is to make a table that stores the value and then links to those two tables. The problem is I can picture the size of that table growing large depending on the input size. If someone gives me a file with 300,000 records than 300,000 x 40 = 12 million so I have some reservations. However I think if I get to that point than I should be happy it is being used. This option also allows for more custom displaying of information albeit a bit more work but little rework even if you add more fields.
So the problem boils down to:
1. Current design is a flat file which makes extending it hard and it is not normalized.
2. Normalize the tables although no real benefits for the moment but requirements change.
3. Normalize it down into the name value pair and hope size doesn't hurt.
There are a large number of inserts, updates, and selects against that table. So performance is a worry but I believe the saying is design now, performance testing later?
I'm probably just missing something practical so any comments would be appreciated even if it’s a quick sanity check.
Thank you for your time.
$("input[id^='exc-flwup-<%=Model.Date%>']").click(function() {
$(this).val('');
});
I am using this to clear the input field..when i click on the input box its doign clear but.. on form submit if i ccheck at controler side I am still seeing this value there?
do I need to do anyting else here to make null inputbox?
Hi!
How do i go about passing the value of width ,height,resize received as parameter to window.open using javascript?
Thanks
Example
function poponload(mywidth,myheight,resizeVal)
{
testwindow = window.open ("http://www.yahoo.com", "mywindow","location=1,status=1,scrollbars=1,width=+mywidth+,height=myheight,resizeVal");
testwindow.moveTo(0,0);
}
<body onload="javascript: poponload(200, 500,yes)">