I want to setup values for a combobox in vb.net through code. But I don't know what's the code for setting it up. please help.
I want to do something like this:
if combobox1.selecteditem="1" then
combobox2.values=("x", "y", "z")
end if
Hi,
I'm writing an application that will ship in two versions: Android and PC version.
Is there a simple way to access files from the shared code?
Using java.io is simple, but I don't know how to access android resources or assets using it. And I can't write methods that operate on FileInputStreams instead, because some files contain references to another ones, so I need a way to access them from the method code.
Any suggestions?
Hi,
I'm making a game in Flash for school. I have a few dialog boxes that work just fine! Now I need a bigger one with more buttons and with the same code, I can't even get a trace reaction...
My code:
On the button itself:
okButton.addEventListener(MouseEvent.CLICK,MovieClip(parent).clickMyButton);
In the AS file:
public function clickMyButton(event:MouseEvent) {
trace("Halloooo");
}
Another question:
How can I close (remove from stage) a child dialog box (movie clip)
I work in Windows and often find the need to code some script that manipulates files or basic string manipulation. Currently, I'm doing this using PHP but having a LAMP stack for this seems overkill. I've tried things like autoHotkey but the syntax and functionality is horrific.
So I'm looking for a scripting with:
a) a sane syntax
b) lots and lots of built-in libraries, functions, etc
c) minimal setup. Preferably, I would like to code and run the script from my app launcher of choice, Executor
Getting the customer's to_s method by looping through
Is there a Ruby idiom to write the code in 1 line (or shorter than 3 lines of code)?
def method
string = ""
@customers.each { |customer| string += customer.to_s + "\n" }
string
end
In C#, is it possible to have same parameters yet override each other(they are different in the return types)
public override Stocks[] Search(string Field,string Param){ //some code}
public override Stocks Search(string Field, string Param){//some code}
C# returns compilation error
I am trying to test a controller method with the following code:
it "should set an approved_at date and email the campaign's client" do
@campaign = Campaign.create(valid_attributes)
post :approve, id: @campaign.id.to_s
@campaign.reload
@campaign.approved_at.should_not be(nil)
end
However, when I run this test, I get the following error:
Failure/Error: @campaign.reload
ActiveRecord::RecordNotFound:
Couldn't find Campaign without an ID
When I run the analagous lines in the rails console, the reload works and the value is set as I need it to be. Why isn't reload working for me when I run the code in an rspec test?
I am using the code from MS to print a form however it looks like the form needs to be visible with a Show/ShowDialog() to work.
I am trying to use the code for a form that I don't want to show.
Any ideas?
Right now I have this-
[code]
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
if (event.type == UIEventSubtypeMotionShake) {
int text = rand() % 12;
switch (text) {
case 0:
textview.text = @"blah." ;
break;[/code]
For some reason, the text has to be selected for it to work. If you just shake it, nothing will happen.
I wonder if syntax as follows would be helpful in your opinion as a code readability improvent and self-commenting of code:
std::map<std::string name, std::vector<int> scores> myMap;
In this example it clearly says and no other comment is needed, what for we are using myMap variable.
Looking forward to your opinions.
hi i am having threading issues in my vsto project
// code for function
var threadUpdate = new Thread(_fun){IsBackgroud = true};
threadUpdate.Start();
threadList.add(threadUpdate);
// code for progressbar
Progressbar pb = new Prgressbar(){Title =@"abc"}
pb.Show()
it was working in perfect condition before i add wpf progress bar.
as the plugin has been running as single thread
can i ask how can running multi threading in outlook
thanks
I'm using VS 2008 to debug C# program with source code access.
The expected behavior happened as long as the debugger attached to the running program, but when the program ran without debugger attached the exception threw.
What are the common reasons for this to happen, and how can I tell the code difference behind this?
Thanks,
Hello,
I'm not able to understand the following multi-dimensional code. Could someone please clarify me?
int[][] myJaggedArr = new int [][]
{
new int[] {1,3,5,7,9},
new int[] {0,2,4,6},
new int[] {11,22}
};
May I know how it is different from the following code?
int[][] myArr = new int [][] {
{1,3,5,7,9},
{0,2,4,6},
{11,22} };
Hey all,
i use some code for inline cell editing from Apples TaggedLocations Example and im now stuck.
At the demo Code they save the changes at textFieldDidEndEditing, this works because they asume to edit only the first element in a table view.
I have to edit every row at the table view, so my problem is how to get indexPath.row to update the correct object stored in a mutableArray.
Or did i miss something?
Thanks for your help!
Hi, if I'm using the sizeof operator and making use of size_t in my code, do I have necessarily have to include the preprocessor directive stddef.h ? I haven't included the stddef.h and my code compiles without warning with both MVS2008 and with Borland C++ BuilderX.
Thanks a lot...
Hi !
I'm working with web2py and for some reason web2py seems to fail to notice when code has changed in certain cases. I can't really narrow it down, but from time to time changes in the code are not reflected, web2py obviously has the old version cached somewhere.
The only thing that helps is quitting web2py and restarting it (i'm using the internal server).
Any hints ? Thank you !
i wonder how long it will take to master Symfony and use it to code?
i already know mvc + oop and have used CodeIgniter before to code.
are we talking about days, weeks or months giving that i will dedicate 8-12 hours a day to learn it.
After executing this code:
var runtime = IronRuby.Ruby.CreateRuntime();
var engine = IronRuby.Ruby.CreateEngine();
var scrope = engine.CreateScope();
engine.ExecuteFile("libtest.rb");
How can I get all the methods of a ruby class in c# code?
Hello, I have a php-file which includes another html-file:
<? virtual("../top.html");?>
The problem is that any code before this include compiles and runs well, after - nothing. There aren't any errors etc. After commenting this line, everything works.
Code was written under local computer with ArchLinux + LAMP. Now I have ubuntu 10.04 with the same configuration.
What could it be?
I'm making a bookmarklet, but I've encountered some wierd behaviour in IE8. The code causing the problem is this:
var els = document.getElementById("my_id").getElementsByTagName("*");
for(var i in els)
{
alert(i+","+els[i])
}
The first thing that is alerted is "length, n". This isn't the case in chrome: just in IE8.
Interestingly, it seems to behave differently depending on whether the code goes in the console/address bar or the page itself.
Is this standard behaviour?
I have a bunch of MACROS in c++ code that expand into some functions. And I am debugging something. Just want to see what the code ends up looking like”
Any ideas?
hi,
in my application (asp.net) i have a filed ( phone code) and it contain a text box. and i want to restrict the user to enter only 4 letter after that the cursor should not print any character how can i write the code can u help me thank you
After the page has loaded a piece of javascript set focus on window and on a specific input field. I want to prevent this focus on the input field how can I do that with javascript in greasemonkey? Maybe this is not possible because greasemonkey don't execute the code until the entire page has loaded? Then let's say I can run my code at any time how can I prevent the focusing?
using xpath or css : How to get something which is selected on page using following html code.
in following code, Element1 is selected on page and I wanted to find name of element that is selected on page.
Element1