I'm wondering how to get some nice sprite-animations on OSX - like the UIImageView provides for the iPhoneOS. NSImageView cant... but how can I solve this?
How do I convert the value of a PHP variable to string? I was looking for something better than concatenating with an empty string:
$myText = $myVar . '';
like the ToString() method in Java or .NET.
I'm looking for a embedded language that can be used to script common code between a server app written in C# and a client app written in Flash/Actionscript. It is important that the embedded language interpreter run natively in the environment it is embedded into. For example, it cannot load any external C libraries (i.e. python, neko).
Does such a thing exist for these two languages? Perhaps there is some minimal interpreter that could be easily ported to both?
Thanks!
I will be teaching an econometrics course to masters students in the fall. I think it is important for them to learn programming with data as an essential applied research skill. What suggestions do you have for the programming language. I am leaning mostly towards R. What others should I consider?
I have a JPanel with several levels of child components, also with a JScrollPane. I'm placing a focus listener on some of the child components to add some behavior to those components, but I would also like to have that component scroll into the JPanel's viewport when focus is gained.
My question is, does anyone have a general purpose function to do this, similar to the browser DOM function "scrollIntoView"? I've tried muddling through this with various inputs to JComponent.scrollRectToVisible but I guess I haven't figured out the magic word.
Thanks in advance.
I'm writing a multi-threaded application in Delphi and need to use something to protect shared resources.
In C# I'd use the "lock" keyword:
private someMethod() {
lock(mySharedObj) {
//...do something with mySharedObj
}
}
In Delphi I couldn't find anything similar, I found just TThread.Synchronize(someMethod) method, which prevents potential conflicts by calling someMethod in main VCL thread, but it isn't exactly what I want to do....
Edit: I'm using Delphi 6
I often open .aspx file.
I used to do language - j - javascript. every time when I open aspx file
it's really annoying
I like to make short cut or macro.
But I cannot find this menu on Shortcut mapper.
How Can I do this?
Question over here is are design patterns specific to a programming language or technology,
Like you can do composite pattern only in C#,Java but not in VB6.0.Is that true, If yes that what are pattern that can't be implemented with out object oriented programming languages.
I need to teach myself Winforms and user interface programming and want a decent book that will go thoroughly into the ins and outs of how to accomplish things.
Can anyone suggest a good book?
I know C# pretty well and have messed about with Winforms in the designer before.
Thank you
Is there any way to manually or programmaticaly set the UI Language so that in my tests I can get a different results from GetUserDefaultUILanguage? Or anyone know the settings within Windows where I can change this?
Is there any way to get the collection of all textNode objects within a document?
getElementsByTagName() works great for Elements, but textNodes are not Elements.
Update: I realize this can be accomplished by walking the DOM - as many below suggest. I know how to write a DOM-walker function that looks at every node in the document. I was hoping there was some browser-native way to do it. After all it's a little strange that I can get all the <input>s with a single built-in call, but not all textNodes.
Hello my fellow coders,
As i notice for a while now (like everybody else in the industry), the RIA market is shifting from AS3/Flex to HTML/Javascript.
What i would like to know is? Is html/javascript as powerfull as as3/Flex or are they entirely different. With other words can i build the exact same applictions with HTML(4/5) and Javascript as i can do with AS3/Flex?
I'm not looking for the speed comparison? or bashing one technology over the other?
I just want to know if is good for me to dive into javascript, JQuery......
PS. If there is a nother post on stackoverflow with the exacte question. please share the link. Thanks.
Thank you.
I created a particle System in OpenGl that's working great. When I want to get a burning effect of a fire or a beam or something(Where the system kind of "glows" and fuses all the colors together) I use this method call with OpenGL.
glBlendFunc(GL_SRC_ALPHA,GL_SRC_ALPHA)
glBlendFunc(GL_DST_ALPHA,GL_ONE)
I'm now trying to do the same thing using Direct3D
Here is what I have tried:
graphicsDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
graphicsDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
graphicsDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
but this has absolutely no effect at all on the look of my game!
Anyone have a clue what could be the problem?
Something I wrote throws a lot of AttributeErrors when using time.strptime() inside a thread. This only seems to happen on Windows (not on Linux), but whatever…. Upon a'Googling, it seems that time.strptime() isn't considered thread-safe.
Is there a better way to create a datetime object from a string? Current code looks like:
val = DateFromTicks(mktime(strptime(val, '%B %d, %Y')))
But, that yields the AttributeErrors as its run inside a thread.
Thanks!
I have a PHP script that runs a .bat file on my windows machine using
$result = system("cmd /C nameOfBatchFile.bat");
This sets some environmental variables and is used to call Amazon EC2 API from the command line.
How do I do the same from a Linux server? I have renamed my .bat file to a shell (.sh) and changed the script to use 'export' when setting env vars. I have tested by running the code from a putty terminal and it does what it should. So I know the commands in the script are good. How do I run this from PHP? I have tried running the same command as above with the new filename and I don't get any errors, or file not found etc but it doesn't appear to work.
Where do I start trying to solve this?
i have a mySQL table which the data in one of its columns is in a language other than English.(Persian)
when i input data in the table , it is shown properly but when i want to show the data in a php file it displays like this:????
well,what should i do in order to show the data in its correct form?
Hi folks:
I have a problem with the typedef keywords in C language.
In my program, I use the following codes:
typedef int* a[10];
int main(){
int a[10];
}
they work well. But why there are no conflicts between a variable and a type sharing the same name a?
Regards.
So today I just came across the 'live()' function that binds any future and past elements to the whatever event you choose, such as 'onclick'.
Right now I'm having to set up buttons like the following each time I load a new button via ajax ...
$('a.btn.plus').button({icons:{primary:'ui-icon-plusthick'}});
$('a.btn.pencil').button({icons:{primary:'ui-icon ui-icon-pencil'}});
$('a.btn.bigx').button({icons:{primary:'ui-icon ui-icon-closethick'}});
So, instead of calling these lines each time I use ajax to add a new button, is there a similar way to tell JQuery to setup my buttons ANYTIME I add new ones?
Thanks for any help!
See following class:
function availItem(xs, s, m, l, xl) {
this.xs = xs;
this.s = s;
this.m = m;
this.l = l;
this.xl = xl;
}
How can I declare the above class using JSON? I think It should be in following manner but problem is to pass argument.
var availItem = {
xs : xs,
s : s,
m : m,
l : l,
xl : xl
}
I want to use both in same manner like
var obj =new availItem(xs,s,b,l,xl);
I'm moving some Flex classes to pure Flash/AS3 to be part of a shared library. I have an event listener on FlexEvent.CREATION_COMPLETE to create and add display-objects once things are running, but I don't know the right way to do this in Flash?
edit: Maybe if my class subclasses Sprite rather than a Flex class, I can add children in the constructor, I don't need to wait for a "construction complete" event?
I program php, but I am trying to get into c# asp.net. In php I can make forms, custom html, etc into a seperate php file and just include it on the page that I desire. I understand asp.net has a master page which allows you to set the template for the whole website, but what If I want just a row of buttons to be on SOME pages, and not all? something separate to the master page that can be included on any page i desire? Also when its controllers is that when I use .ascx?
I want to unescape the following string:
'\u00020\u0002Standard\u00023\u0002Doe John\u000169\u0002\u0010\u0002Lorem\u0002\u0011\u0002Ipsum\u0002\u0014\u0002'
Javascripts unescape function works ok, however how can I unescape it in ruby?
Take in mind that unescape(previousString) is 0Standard3Doe John69LoremIpsum.
I have committed to learning C now, I'm good with Python/PHP/Bash but I've decided I'm limited by not being fluent in C. However I cannot imagine working in a language without lists and hashes, maybe I'm just jumping a gun, but surely there are 'standard' collection libraries. I do not see any in the GNU standard lib though, any suggestions?