object

Speed: Saved Objects vs Database

I am designing a dynamic site for some form of weather data, which I need to scrape to get the data, as its always changing. I am interested in knowing if its faster to use a database like sqlite or to save objects ,reloading them whenever needed. Both options will hold the scraped data. Likely will use Python or Ruby, haven't decided...

Month Array in JavaScript Not Pretty

How can i make it nicer? var month = new Array(); month['01']='Jan'; month['02']='Feb'; month['03']='Mar'; etc. Itd be nice to do it like: var months = new Array(['01','Jan'],['02','Feb'],['03','Mar']); For example. anyway like that to simplify it? ...

Lifetime of Qt Objects

What are the lifetimes of Qt Objects? Such as: QTcpSocket *socket=new QTcpSocket(); When socket will be destroyed? Should I use delete socket; Is there any difference with: QTcpSocket socket; I couldn't find deep infromation about this, any comment or link is welcomed. ...

Possible to manipulate javascript generated elements?

I have a page dynamically generated with javascript and it contains several input fields and a button. When I click the button, nothing happens...Is it because it is a javascript object and not a "real" dom object? If so, is there a way to interact with the object? I just wrote a simple alert to see if the button is even working. jQu...

Polymorphism in Clojure

Suppose I have a bunch of Clojure data structures, all of the same type - for example an object type defined by defrecord. What is the best way to get polymorphic behaviour across these structures? Would it be good practice to embed a function within the structure so that I can do something like: ((:my-method my-object) param1 param2)...

python dictionary key Vs object attribute

suppose i have object has key 'dlist0' with attribute 'row_id' the i can access as getattr(dlist0,'row_id') then it return value but if i have a dictionary ddict0 = {'row_id':4, 'name':'account_balance'} getattr(ddict0,'row_id') it is not work my question is how can i access ddict0 and dlist0 same way any one can help me? ...

C++ Multiple Callback funtions problem

Hi, I have a dll which requires me to set a callback function for it (actually it's a camera sdk and it will callback my function when it receives a picture). I wanna have multiple (user input) cameras but I can't. Since I should make unknown number of callback functions. the easy way is to make a class (camera) which have a function f...

How do I search an array of objects by attribute (Java)

Hi, Is it possible to search an array of objects in Java by a private attribute with the Array.binarySearch method? I was thinking there must be something similar to the sorting technique, where you create a class that implements Comparator and pass this in to Array.sort, but I can't seem to find anything (maybe there is something wher...

C# class not public

I am trying to make a class so when I do the following inside a file: Functions LoginFunctions = new Functions(); LoginFunctions.loadFunctions(); It will create my object which I need, and make it public so every form which calls the class will be able to use it. The class file is below. namespace App { public class Functions ...

How is non-standard worksheet.object created in this Excel VBA

The following VBA 6 in Excel 2000 code Resides in a form that has text boxes, comboboxes and buttons One of them is txtUsername, another is txtPassword --I inherited this code With shtName .Unprotect "thepassword" .range("somenamedrange").Value = cboComboBox.Value .txtUsername.Text = txtUsername.Text .txtPassword.Text = txtPassword.Te...

Make object not pass by reference

I just found out the hard way objects are passed by reference in Javascript, for example: for(var layer = 0; layer < hudLayers['layers'].length; layer++){ // Store the to-be-calculated values in this object var tempValues = hudLayers['layers'][layer]; tempValues['name'] = 'test'; } This will change the value in tempValue...

python , how to find class object from child entity ?

my code is following in python. class A(object): b = B() def d(self): print "Hi" class B(): def C(self): self.__self__.d()#edit ::: i need to call d() method here. i know __self__ is wrong # do knowledge for B being variable inside object A needed ? i.e # passing parent object via init is needed as show...

XHTML Markup Validation

i have my site [here][link removed] when i run it through validator, i get several errors regarding the: <embed src="inception/inception.mov" width="620" height="274" autoplay="false" controller="true" pluginspage="http://www.apple.com/quicktime/download/"&gt;&lt;/embed&gt; if i keep the <object> and drop the <embed> then the code co...

Quicktime Object Embed Without Buffering

i have a site [here][link removed] (IE8 and Google Chrome 5 only). i was wondering for the quicktime object if there was a way to not start buffering unless the user clicks the play button? i hope to insert other movie files in the future and having them all buffer is not reasonable unless there is no way of getting this done. thank y...

Generate c# image object with canvas todataurl

Hi How can i make a Bitmap or Image object with the code generated by canvas.toimageurl() method? The string looks like this: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQA... ...

JSON array doesn't populate

For some reason the following JSON string creates the correct number of records in the custom objects array, but does NOT populate the objects in the array with and values. Help appreciated! JSON String { "Grids": [{ "CommitImporterGrid": {"CostDivisionCode": "DL", "CostDivisionKey": 5, "CostDivisionName": "Direct Labor", "SourceType...

Determining if a Javascript object is a "complex" object or just a string

I want to be able to pass either a string literal, 'this is a string' or a javascript object, {one: 'this', two: 'is', three: 'a', four: 'string' } as argument to a function, and take different actions depending on whether it's a string or an object. How do I determine which is true? To be specific, I want to iterate over the prop...

preg_replace remove Youtube and Vimeo Object and Embed links

Hey! I'm really new to regex-expressions, so I was wondering if someone would bother to come up with one or more regular-expressions for removing Youtube and Vimeo object url's. It doesen't really matter that it only removes Youtube-objects/embeds, as long as it removes the <object> and </object> and everything in between. Thank you so...

If I define a class-method in Ruby Object class, how do I get the name of a child class calling this method?

Example def Object.const_missing(name) puts self.class end class A; end A::B # => Class How can I get A in Object#const_missing? ...

How do I merge two objects?

I have an object, $foo, which has some methods and properties already defined and another object, $bar, which is just a set of properties. I want to merge the entirety of $bar into $foo such that all the properties of $bar become properties of $foo. So if beforehand I had, $bar->foobar, afterwards I should be able to use $foo->foobar. ...