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.
In C# or Java, class are declared and defined at the same time. In C++, the norm is to write .h and .cpp files separately. What if, we write the whole class in one , say .cpp, file and include that with include guards and stuffs in files that references to it, what kinds of bad thing technically would happen?
One of the more common complaints I have read about the AppEngine database (for Java) is that it is extremely slow when it come to "cold start time". What does this mean? And is it something I should be worried about?
Is it possible to instantiate a class and then invoke its methods between scriptlets in JSP?
I am getting errors and I don't know why (java class and methods are fine).
Any other way to do the same (i just want a string from a method in a class)?
I'm interested in learning about algorithms, both conceptually and practically, as a beginner. I want to learn about binary search trees and similar.
What tutorials and example programs, preferably in Python or Java, will help me?
How do I parse an xml document as a stream using Scala?
I've used the Stax API in java to accomplish this, but I'd like to know if there is a "scala" way to do this.
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
?
Hi,
I have an HTML page, and I would like to import data from a database. Will it be possible to do it without using a programing language such as Java, .NET, PHP etc?
thanks
I'm pretty new to objective-C (and C in general) and iPhone development and am coming from the java island, so there are some fundamentals that are quite tough to learn for me.
I'm diving right into iOS5 and want to use storyboards.
For now I am trying to setup a list in a UITableViewController that will be filled with values returned by a web service in the future. For now, I just want to generate some mock objects and show their names in the list to be able to proceed.
Coming from java, my first approach would be to create a new Class that provides a global accessible method to generate some objects for my list:
#import <Foundation/Foundation.h>
@interface MockObjectGenerator : NSObject
+(NSMutableArray *) createAndGetMockProjects;
@end
Implementation is...
#import "MockObjectGenerator.h"
// Custom object with some fields
#import "Project.h"
@implementation MockObjectGenerator
+ (NSMutableArray *) createAndGetMockObjects {
NSMutableArray *mockProjects = [NSMutableArray alloc];
Project *project1 = [Project alloc];
Project *project2 = [Project alloc];
Project *project3 = [Project alloc];
project1.name = @"Project 1";
project2.name = @"Project 2";
project3.name = @"Project 3";
[mockProjects addObject:project1];
[mockProjects addObject:project2];
[mockProjects addObject:project3];
}
And here is my ProjectTable.h that is supposed to control my ListView
#import <UIKit/UIKit.h>
@interface ProjectsTable : UITableViewController
@property (strong, nonatomic) NSMutableArray *projectsList;
@end
And finally ProjectTable.m
#import "ProjectsTable.h"
#import "Project.h"
#import "MockObjectGenerator.h"
@interface ProjectsTable {
@synthesize projectsList = _projectsList;
-(id)initWithStyle:(UITableViewStyle:style {
self = [super initWithStyle:style];
if (self) {
_projectsList = [[MockObjectGenerator createAndGetMockObjects] copy];
}
return self;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// only one section for all
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSLog(@"%d entries in list", _projectsList.count);
return _projectsList.count;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// the identifier of the lists prototype cell is set to this string value
static NSString *CellIdentifier = @"projectCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
Project *project = [_projectsList objectAtIndex:indexPath.row];
cell.textLabel.text = project.name
}
So while I think everything is correctly set, I expect the tableView to show my three mock objects in its rows. But it stays empty and the NSLog method prints "0 entries in list" into the console. So what am I doing wrong?
Any help is appreciated.
Best regards
Felix
println args
println args.size()
println args.each{arg-> println arg}
println args.class
if (args.contains("Hello"))
println "Found Hello"
when ran give following error:
[hello, somethingelse]
2
hello
somethingelse
[hello, somethingelse]
class [Ljava.lang.String;
Caught: groovy.lang.MissingMethodException: No signature of method: [Ljava.lang.
String;.contains() is applicable for argument types: (java.lang.String) values:
[Hello]
why can I not do contains?
hi i created one webapplication project.It containe one servlet file jsp file.
I created one string variable in servlet and assign some value like
/* sampleservlet.java *******/
String s=" WELCOME"
My constraints I want to display the string in my jsp file.so that i import the servlet file inj jsp and i created object as ---call---
jsp file contain following coding
<%sampleservlet call ;%
<%call.s%
But it shows error how to solve this?
I want to get the fine name without the file extension in VIM.
I wrote the following functions in my .vimrc file for compile and run the Java program.
:function! JAVA_RUN()
:!javac %^M
:endfunction
map <F3> :execute JAVA_RUN()<CR> :source $HOME/.vimrc<CR>
In side the function how can I get the file name with out the extension.
Say I had a file like... http://my.website.com/myfile.raw
and this file was just raw bytes, representing an intensity image. Is it possible to grab this data and read the bytes in JavaScript? And then using it with HTML 5 canvas (e.g., putImageData) to draw an image?
Or is there some other way to do this in the browser without Java or Flash?
Is there any Good opensource not C\C++ library for playing with FLV conteider? So I need it in AS3 but Java or C# will be fine=) I need to be able to put in flv audio track andsome bitmaps (with some exact timestamps relativly to my audio track)
So Is there ay or I have to implement all bymy self just reading spetificatiopon?
It's been out for a while so I am wondering if people are using the p XML namespace within their Spring configuration files. Is it a helpful shortcut? Is it a good idea that ended up in the trash can?
Where does the Java community largely stand?
I would like to create a Blackberry Widget that contains a map view.
Since the whole widget is a web page with java script etc. I think it should be possible to include google maps or something like that into my widget.
Has anybody made experiences with this?
The most egregiously redundant code construct I often see involves using the code sequence
if (condition)
return true;
else
return false;
instead of simply writing
return (condition);
I've seen this beginner error in all sorts of languages: from Pascal and C to PHP and Java. What other such constructs would you flag in a code review?
Why are nested comments forbidden in C++, Java inspite of the fact that nested comments are useful, neat, and elegant and can be used to comment out statements that have comments?
I have deployed one application in google app engine. In that application i have created three table using java in eclipse. Now i need to add one new table to the existing application. is it possible can any one help me.
thanks in advance.
If i have some code looks like this(Please ignore the syntax, i want to understand it without a specified language):
count = 0
def countDown():
count += 1
if __name__ == '__main__':
thread1(countDown)
thread2(countDown)
thread3(countDown)
Here i have a CPU with only one core, do i really need a lock to the variable count in case of it could be over-written by other threads.
I don't know, but if the language cares a lot, please explain it under Java?C and Python, So many thanks.
hi
I've tried a few php IDEs , but still searching for the FASTEST one
all Java based IDEs are too slow, I have 2 computers to work, my home pc which is too fast, and my laptop witch is good , but cant handle a heave software.
and I have to work on them both, so I'm looking for the best free ide which is fast
I'm not talking about text-editors , because I already have np++ and its great, but looking for extra features to help me save time..
any tips?
I had limited success myself. I was able to hype a few persons about Scala.
But in fact none of them made a meaningful effort to try to switch (usually from Java).
I would like to read both success and failure stories here.
Both long tries and short ones.
My goal is to find ways of presenting Scala to another person, friend, co-worker (not an audience) that will make them want to use this great language.
What is the general meaning and where did it start to have variables with leading or trailing underscores?
ex: _varName and varName_
I have always thought a leading underscore indicated the variable was a pointer but I don't know where I got this idea. Recently I have seen these naming conventions used in Java which makes that reasoning completely wrong.
Hi, I'd like to get the name of the song that iTunes is currently playing.
What API should I refer to?
I'd like to use that both for a dashboard widget or a Java/python application depending on what it is easier to use.
Do you have some references for me?
Thanks in advance,
Mario