In Javascript, when your getting a property of an object, is there a performance penalty to getting the whole object vs only getting a property of that object?
Also Keep in mind I'm not talking about DOM access these are pure simple Javascript objects.
For example:
Is there some kind of performance difference between the following cod...
Hi,
How can I load a *.java class file into my java app and create an object based on that class file?
...
Okay, I see a few references given for Java, but not javascript ( which hopefully you know is completely different ). So here's the code specific :
function Sandbox() {
var args = Array.prototype.slice.call(arguments)
, callback = args.pop()
, modules = (args[0] && typeof args[0] === 'string' ? args : args[0])
...
I'm having this problem with this piece of PHP code:
class Core {
public function start()
{
require("funk/funks/libraries/uri.php");
$this->uri = new uri();
require("funk/core/loader.php");
$this->load = new loader();
if($this->uri->get_segment(1) != "" and file_exists("funk/pages/".$uri->get_segment(1).".php")){
Only a snippet of th...
I get the above error when calling this code:
<?
class Test1 extends Core {
function home(){
?>
This is the INDEX of test1
<?
}
function test2(){
echo $this->uri->get_segment(1); //this is where the error comes from
?>
This is the test2 of test1 testing URI
<?
}
}
?>
I get the error where commentated.
This class extends this class:
...
Hi there!
What is the best practice for updating an object at Event.ENTER_FRAME?
here's the code:
addEventListener(Event.ENTER_FRAME, enter_frame);
protected function enter_frame(event:Event):void
{
//update the object in the exernal class
Extrn.updaterMethode(anObject);
// some logic
if(foo==bar)
{
// get a property from t...
I have a simple function that creates a generic List:
function test()
{
$genericType = [Type] "System.Collections.Generic.List``1"
[type[]] $typedParameters = ,"System.String"
$closedType = $genericType.MakeGenericType($typedParameters)
[Activator]::CreateInstance($closedType)
}
$a = test
The problem is that $a is alw...
I've seen other objects that do this:
$obj->method1()->method2();
How do I do that? Is each function just modifying the pointer of an object or returning a pointer?
I don't know the proper term for this style -- if anyone could help me with that, it would be great.
...
New to json data and struggling i guess the answer is real easy but been bugging me for the last hour..
Sample data
{
"data":
{
"userid": "17",
"dates": {
"timestame": "1275528578",
},
"username": "harino54",
}
}
Ok I can pull userid or username easy enoug...
I am evaluating two object databases, db4o (http://www.db4o.com) and Eloquera Database (http://eloquera.com) for a coming project. I have to choose one. My basic requirement is scalability, multi user support and easy type evolution for RAD.
Please share your real world experience.
If you have both, can you compare these two? Which do...
Hey'all
How do I cast a li dom element as HtmlControl from an ASP type object?
I tried it like this:
var li = (HtmlControl)sender;
I get a InvalidCastException...
The thing is, I want to make the li (a tab) clickable, and then update an UpdatePanel... But when I start like this
<li id="li" runat="server" onclick="tab2_Click"> FooBa...
I've seen a few creative solutions for dealing with serialized SPL objects but am looking for more options (or elaborations). I store nested serialized objects - of which, one is SimpleXML - in the database, only to be un-serialized later. This obviously cause some problems.
$s = new SimpleXmlElement('<foo>bar</foo>');
$ss = serialize($...
I have a date string "Sunday, February 28, 2010" that I would like to convert to a js date object formatted @ MM/DD/YYYY but don't know how. Any suggestions?
...
Hi there.
Today I've tried to include file that returns object. I always use require_once, however now I've noticed weird behavior of it.
File main.php
$lang = false;
$lang->name = "eng";
$lang->author = "Misiur";
$lang->text = "Text is test";
$lang->undefined = "Undefined";
return $lang;
File index.php
$lang = include('langs/eng/m...
I updated my post. Now it says "link is not defined" "thisLink[link].scopeObject = new Image();" It's important that the link remains though because it is a property of linkObj that holds the current link. I use the [] as a property rather than dot notation due to the looping ability it provides.
<script type="text/javascript">
window....
I have an array with the following data:
[steamid] => stdClass Object
(
[0] => Shakyor
)
How can I get the 'Shakyor' string from there?
$array->$steamid doesn't work.
$array->$steamid[0] doesn't work.
$array->$steamid->0 is not legal markup obviously.
...
How can I get a specific value from an object?
I'm trying to get a value of an instance
for eg.
ListOfPpl newListOfPpl = new ListOfPpl(id, name, age);
Object item = newListOfPpl;
How can I get a value of name from an Object item??
Even if it is easy or does not interest you can anyone help me??
Edited: I was trying to build a binary...
In my Javascript drag and drop build app, a variety of buildings can be built. The specific characteristics of these are all saved in one object, like
var buildings = {
house: ['#07DA21',12,12,0,20],
bank: ['#E7DFF2',16,16,0,3],
stadium: ['#000000',12,12,0,1],
townhall: ['#2082A8',20,8,0,1],
etcetera
}
So every building has a number o...
So I have a class like this:
def Word
end
and im looping thru an array like this
array.each do |value|
end
And inside that loop I want to instantiate an object, with a handle of the var
value = Word.new
Im sure there is an easy way to do this - I just dont know what it is!
Thanks!
...
I'm trying to create hidden iframes in my page dynamically to load 3 other pages so that i can grab all the HTML and combine them into 1 in a new window.
However i'm stuck at this.
tHe frames are created fine.
But whenever the javascript runs to the part of
var printWindow="";
function openNewWindow()
{
printWindow = window.op...