Can JavaCC distinguish token by its context?
Basic requirement is use keyword as identifier, so I want to distinguish the token from it’s context.(e.g.class is a keyword, but we allowed a variable named class). In java, this is possible, but it’s...
View ArticleReverse a input String and words in o/p need to be separate with space as per...
For example: subex is in bangalore o/p: erola gn ab nisixebus I tried using StringBuffer to use the reverse method, but this will just simply reverse the sentence. I need to add white space to the...
View ArticleOpening a new JFrame with an argument
I have a serious problem that i need to solve today . I need to code a simple app that loads a file , read it’s content create objects from these informations and add them to a linkedlist . Everything...
View ArticleDeciding whether to embed or externally save my code
I’ve made a code which displays an array which shows traffic lights flashing, should I save externally as script files or embed it into the HTML. I also need to explain why I’ve done this. Please I’ve...
View Articlehow i can limit size image selected
My problem it’s the consumption memory, i need limit size the image selected. my code public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK) { if...
View ArticleInserting data to table with foreign keys Doesn’t insert anything in java EE...
I am trying to run insert query in enterprise application however, I am getting Transaction aborted exception Column ‘fk_game_id’ cannot be null. To display foreign keys in my form I am using this code...
View ArticleArray with nullpointerexception [duplicate]
This question already has an answer here: What is a Null Pointer Exception, and how do I fix it? 12 answers I am maybe only stupid right now but i dont find the reason for this nullpointerexception in...
View ArticleWhy we don’t need i++ in File Operation in java?
Why don’t we need i++ in the following snippet: import java.io.*; class PracIn { public static void main(String args[]) { try { System.out.println("Reading From File.....\n\n"); /* You MUST create...
View ArticleGetting android app to send and receive data between phones
Creating an app. I’m a beginner and wanted some help getting started. Was wondering what sort of things I’d need to do when creating an app that will send and receive data between two phones. Without...
View ArticleUniversal Media Player says Error Loading Media
I am using Universal Music Player (UMP) sample code provided by Google. Here, I would like to customize a thing as per my requirement, still UMP works in below process: Screen 1: Genres (Songs by...
View ArticleBlank space in array with String splitter
I am not very familiar with Regex in Java so i need some help with my problem. My objective is to separate the numbers from the string, but in my array’s first position i get a blank space. So i need...
View ArticleUML Class Diagram relationships
I have some doubts about which relationships i’m going to use in my class diagram. I know that I can use a general association (using a association line) or more specifc associatons like aggregation or...
View ArticleDo we need to manually start the Android emulator for Appium?
I’m new to appium and I’m running the calculator example test using the following code: DesiredCapabilities capabilities = new DesiredCapabilities();...
View Articlejava regexp get more than need
I have following regexp http://[a-z./].*(js) and the string efwefewfhttp://assets.main.com/zepto-1.1.3.min.js fffhttp://assets.main.com/zepto-1.1.3.min.js Code: List<String> kk = new...
View ArticleComprehensive catching of SqlExceptions for Login related errors
I’m trying to catch exceptions thrown from SqlConnection.Open() which are due solely to “invalid” credentials, i.e. any login failure which could potentially be caused by a “bad” connection string....
View ArticleDo class fields within an LMAX Disruptor event need to be volatile?
Sample code from the LMAX Disruptor “Getting Started”… public class LongEvent { private long value; public void set(long value) { this.value = value; } } Ref:...
View Articleuhh there is an error here and i dont know why [duplicate]
This question already has an answer here: Variable might not have been initialized in an if/else if statement 1 answer // Exer13, i need help =__+ im beggin ^^ import java.util.Scanner; public class...
View ArticleHow to create a BigInt in Java and store each digit of a String into an...
Full disclosure, I am currently taking a Computer Science class and it just started. We’ve been tasked to create a program where basically we create our own BigInt. Eventually we are going to need to...
View Articlec# Component Executing Life Cycle
I created a component in my solution. I can use this component on my form. I did operation like this: I created a Class Library ,created my component.. create a test project and add referances in my...
View Articlejaxb XML marshaling need to format date differently
We have a requirement to format the date fields differently during XML returned from jax-rs webservice. ex. Class Dates { Date date1; //in xml this date must be in format dd-mon-yyyy Date date2; // in...
View Article