in java is the name of a method a string? why or why not?
so if i have something like:
public static int METHODNAME (some parameters or not)
{
something to do ;
}
is METHODNAME a string?
I have an app running with:
one instance of nginx as the frontend (serving static file)
a cluster of node.js application for the backend (using cluster and expressjs modules)
one instance of Postgres as the DB
Is this architecture sufficient if the application needs scalability (this is only for HTTP / REST requests) for:
500 request per seconds (each requests only fetches data from the DB, those data could be several ko, and with no big computation needed after the fetch).
20000 users connected at the same time
Where could be the bottlenecks ?
Generally we derive custom activity from Activity or CompositeActivity class, i want to have my custom base class for all activities :
like
public class BusinessActivity : Activity
{
}
then my custom activities will derive from BusinessActivity .
The quetions is if i want ErrorMessageProperty and RetryCountProperty as dependency properties then in the BusinessActivity how to declare third param in
Register method
like
public static DependencyProperty RetryCountProperty = DependencyProperty.Register("RetryCount", typeof(int), typeof(**BusinessActivity**));
What will happen if i derive from BusinessActivity class ?
I'm trying to use Registration.SensorTypeValue.MAGNETIC_FIELD in SmartWatch's 2 plugin. But values that I received put me into some dissapointed state, cause of few reason:
Values is to big (I tested magnetic fields on 3 phones and result is like "-12. , 38, -14", and the watch give me something like "488, 440, -115")
Values are almost static, they live in very small range.
What's wrong with me or with the watch?
I think this question is for Sony support team.
How should one structure their frequently used non-important functions (conversions, etc) in C# since everything must be contained in an object? Usually I take all these functions and put them in a static Utility class. Is this a good practice? How do most developers do it?
I'm probably typical in being bewildered by the many syntaxes of Wpf binding. Does anyone know of a chart that lays out all the possibilities. Across one axis is all the variations of binding syntaxes (Static, Dynamic, Self, ...), the other axis are all the variations of scoping and type. The intersection of the axis show an example.
Surely someone, some author has done this, eh?
i have posted this question
http://stackoverflow.com/questions/2874487/how-can-i-implement-this-python-snippet-in-java
i have compiled it now i need to use in main project
public static void main(String[]args){
}
?
can anybody show me example?
i have posted this question
http://stackoverflow.com/questions/2874487/how-can-i-implement-this-python-snippet-in-java
i have compiled it now i need to use in main project
public static void main(String[]args){
}
?
can anybody show me example?
i have posted this question
http://stackoverflow.com/questions/2874487/how-can-i-implement-this-python-snippet-in-java
i have compiled it now i need to use in main project
public static void main(String[]args){
}
?
can anybody show me example?
Hi,
Today I got this question for which I think I answered very bad. I said stream is a data that flows and reader is a technique where we read from that is a static data. I know this is an awful answer, so please provide me the crisp difference and definitions between these two with example in Java.
Thanks.
I'm trying to use flexjson to convert the following json string into a java object:
{"inboundDataNotification": {
"callbackData": "12345",
"inboundData": {
"message": "Hello World",
"messageId": "mes1234"
}
}}
Using the following method:
import flexjson.JSONDeserializer;
@RooJavaBean @RooToString @RooJson(fromJsonArrayMethod="", toJsonArrayMethod="", toJsonMethod="") public class InboundData {
private String messageId;
private String message;
public static InboundSMSMessage fromJsonToInboundSMSMessage(String json) {
return new JSONDeserializer<InboundSMSMessage>().use(null, InboundSMSMessage.class).deserialize(json);
} }
All fields are null after this method is invoked. Any ideas what to change here?
Event.DISPLAYING
Why this event wont work when i try to compile the flashe (CTRL+ENTER)
Flash gives me error
1119: Access of possibly undefined property DISPLAYING through a reference with static type Class.
I have an authority string defined as such:
public final static String AUTHORITY = "dsndata.sds2mobile.jobprovider";
Followed by an edition to the UriMatcher:
uriMatcher.addURI(JobMetaData.AUTHORITY, "/JobNames/*",
JOBNAME_SINGLE_URI);
The uri that gets passed to the switch is:
content://dsndata.sds2mobile.jobprovider/JobNames/test
This falls through the switch and hits the default (which throws an IllegalArgumentException).
Am I missing something? I've searched and can't find anything that would account for the mismatch.
I need to show a webpage (a complex page with script and stuff, no static html) in a frame or something. It's for a desktop application, I'm using python 2.6 + wxPython 2.8.10.1. I need to catch some events too (mostly about changing page). I've found some samples using the webview module in a gtk application, but I couldn't have it works on wx.
I have this but it always returns null
private static String getParameters(Method aMethod) {
Class<?>[] parameterTypes = aMethod.getParameterTypes();
for (Class<?> aParam : parameterTypes) {
System.out.print(aParam.getName());
}
return null;
}
i can get file name via below codes. How can i send this file to remote computer. this remote computer ip: 192.168.2.105 also i can use 51124 port
class Program
{
static void Main(string[] args)
{
string[] dosyalarinYollari = System.IO.Directory.GetFiles(@"z:\20071008\1.2.392.200036.9116.2.6.1.48.1215563310.1191800303.305777\", "*.dcm", System.IO.SearchOption.AllDirectories);
foreach (string s in dosyalarinYollari)
{
Console.Write(s+"\n"); // i need to send tihs s file to remote machine
}
Console.ReadKey();
}
}
Consider this code:
const char* someFun() {
// ... some stuff
return "Some text!!"
}
int main()
{
{ // Block: A
const char* retStr = someFun();
// use retStr
}
}
My question is in the function sumFun() where is "some Text!!", stored (i think may be in some static area in ROM) and what will be its scope?
Will the memory pointed by retStr be occupied throughout the program or be released once the block A exits?
--
Thanks
I am looking for a static function in the .NET framework which takes an XML snippet and an Xslt file, applies the transformation in memory, and returns the transformed XML.
I would like to do this:
string rawXml = invoiceTemplateDoc.MainDocumentPart.Document.InnerXml;
rawXml = DoXsltTransformation(rawXml, @"c:\prepare-invoice.xslt"));
// ... do more manipulations on the rawXml
Alternatively, instead of taking and returning strings, it could be taking and returning XmlNodes.
Is there such a function?
I know I can pass a function pointer as a template parameter and get a call to it inlined but I wondered if any compilers these days can inline an 'obvious' inline-able function like:
inline static void Print()
{
std::cout << "Hello\n";
}
....
void (*func)() = Print;
func();
Under Visual Studio 2008 its clever enough to get it down to a direct call instruction so it seems a shame it can't take it a step further?
I'm doing a C# project and I want to call next_permutation from the algorithm library in C++. I found the way to call c++ functions in c# but i dont know how to get vectors from c++ and use it in c# (cause next_permutation require a int vector...)
this is what I'm trying at the moment:
extern void NextPermutation(vector<int>& permutation)
{
next_permutation (permutation.begin(),permutation.end());
}
[DllImport("PEDLL.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void NextPermutation(IntPtr test);
My script is:
[Bindable]
[Embed(source="loader.swf")]
public static var Icon:Class;
and my mx is:
<mx:Image source="{Icon}" y="125" x="0"/>
It works but when I try to export it it won't because of:
Data binding will not be able to detect assignments to "Icon"
What am I doing wrong?
First: sorry for my poor English writing.
I remember that in VB6.0 days, we had some modules just for popular tasks like making disabled/enabled all buttons of a toolbar buttons or like calculating records count in a specific recordset.
Now, in .Net days, What is your approach for doing such these popular tasks? Do you create a static class?
Thank you
public class Test {
public static void main(String[] args){
if (5.0 5) // (5.0<5) for both case it is going to else
System.out.println("5.0 is greater than 5");
else
System.out.println("else part always comes here");
/another sample/
if (5.0 == 5)
System.out.println("equals");
else
System.out.println("not equal");
}
}
can any one explain the first "if statement" why it always come to else part