User Profile

Collapse

Profile Sidebar

Collapse
p vs np
p vs np
Last Activity: Nov 28 '10, 06:26 PM
Joined: Mar 13 '09
Location: India
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • p vs np
    started a topic Unable to thread functionality
    in Java

    Unable to thread functionality

    Hi

    I'm trying out a simple threading application, wherein, I try to detect a list of Bluetooth users in the vicinity.

    In its implementation, I've got a Swings form, which contains a 'Start' button and a TextArea.

    On clicking 'Start', I look for the devices by calling a method detectData, which has an implementation of its own. When this happens, I ought to have a "Searching for devices..." message...
    See more | Go to post

  • p vs np
    started a topic Drupal or not
    in PHP

    Drupal or not

    I'm trying to develop a website for a bus transportation system which should basically have the following functionality:

    1. Classify the users into two - Admins and well, Users.
    2.A. When a User logs in, he has the options to fill in his preferences of travel and probably make a payment online.
    2.B. When an Admin. logs in, he gets to do the some typical Admin. functionality like scan/screen Users, Buses, edit the map...
    See more | Go to post

  • Yes, this ought to work.

    But, as explained in my post above, I'm not in a position to sort keys. The libraries I use sort the values directly. Let's assume this constraint to be some specific design issue of mine.

    Anyway. Thanks for your time on this. Using binary search and some calculations, I have a O(n.lg(n)) approach to get past this. For now, it should suffice....
    See more | Go to post

    Leave a comment:


  • Umm..That's kinda obvious.
    But it doesn't solve my problem.

    I was looking for a solution through STL explicitly. How do I do the same when I use stl::sort( ) on a vector<string>?

    I can again do it the hard way of comparing the original vector with the sorted vector and do a binary search to get the index of the now-sorted string.

    Is there a compact work-around, is what I ask....
    See more | Go to post

    Leave a comment:


  • :(
    That, I guess, is the hard way of doing it..

    Just when I want STL to work its magic, it fails :(

    And about a 2-D array, I don't know.. I'm kinda compelled to use vector<string> due to the nature of my application. And the data-set I'm working on is huge. I've managed to sort it quickly through some nice libraries. But then, I now need to get back to their original values and do some comparison/calculation...
    See more | Go to post

    Leave a comment:


  • And the bucket way of storing it.. Is it the best idea?
    I mean, the domain I work on is quite big, I must say.

    And to make matters worse, let's say I'm considering a vector of strings and not a vector of integers :|
    See more | Go to post

    Leave a comment:


  • Precisely. I put that with an intent.

    I'm considering a stable sort....
    See more | Go to post

    Leave a comment:


  • To get back original indices of a vector after sorting it

    Hi.

    I wanted to know if there's a neat way of getting back the original indices of the elements in a vector after they've been sorted.

    For eg:

    Before sort :

    v = 5 3 3 2 4

    After sort:

    v = 2 3 3 4 5

    I want to now know whether I can obtain the index of v[0](say) as located in the vector 'v' before sorting.
    In this case, I should get 3 as...
    See more | Go to post

  • Automate building multiple time in Visual Studio 2005

    Hi.

    I've developed an application on Visual Studio 2005.
    The application takes a command line value and performs certain calculations.

    Is there a way to automate building my application multiple times so that with each build, I may increment the value of the command line input?

    I was wondering if a batch file with nifty commands could do the trick?

    Suggestions?

    PS:
    In the...
    See more | Go to post

  • p vs np
    replied to Reading from a file
    in C
    Well, to be honest, it was quite stupid of me to suggest anything of the sort that I did!

    I guess it was just the frustration over unsuccessful debugging which resulted in the "hypothesis " of my theory!

    A few of hours of good sleep and I find out the little bug and squish it out..

    It so happened that I hadn't closed the FILE pointers file3 and file4 before I exited the routine processFiles()....
    See more | Go to post

    Leave a comment:


  • p vs np
    started a topic Reading from a file
    in C

    Reading from a file

    Hi.

    I'm developing a program on pattern recognition.

    In it, I accept two input files (containing strings) from the user through the command line.

    The input files, say input1.txt and input2.txt, are passed to a function processFiles(), which generates permutations of these strings and stores the resultant permutations in two new, generated files, say gen_file1 and gen_file2.

    Immediately after the...
    See more | Go to post

  • p vs np
    started a topic Response.sendRedirect not redirecting
    in Java

    Response.sendRedirect not redirecting

    I face a very queer problem. I have written a simple servlet to gather information from a static HTML form and I wish to write to a Database (DB) if the record doesn't exist already.

    In order to do so, I have the following snippet from my servlet, DataEntry.java

    Code:
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
        {
    ...
    See more | Go to post

  • p vs np
    started a topic STL's key_comp()
    in C

    STL's key_comp()

    I was going through the stl::key_comp() function and found it's implementation to be pretty straight forward when it came implementation on integers.

    For eg:
    Code:
    #include <iostream>
    #include <set>
    using namespace std;
    
    int main ()
    {
      set<int> myset;
      set<int>::key_compare mycomp;
      set<int>::iterator it;
      int i,highest;
    ...
    See more | Go to post

  • p vs np
    replied to Accessing a file through its path
    in Java
    Mea Culpa.

    I had something else in mind, which seems to have sorted itself out.

    Thank you.
    See more | Go to post

    Leave a comment:


  • p vs np
    started a topic Accessing a file through its path
    in Java

    Accessing a file through its path

    Hi.

    Quick thought.

    Is one able to access a file purely through its path, when using Java SE 6??

    This feature seems to be available in the Java 7 preview JDK in the package nio.file. But what about SE 6?
    See more | Go to post

  • p vs np
    replied to CardLayout Manager is giving some trouble
    in Java
    Silly me.
    I had not made cards , the variable in class CardLayoutSelf static.

    Thanks for the help :)
    See more | Go to post

    Leave a comment:


  • p vs np
    replied to CardLayout Manager is giving some trouble
    in Java
    Yes.
    I do realise the significance of the line number, and in my code, it corresponds to the statement:

    Code:
    CardLayout cl = (CardLayout)(c.cards.getLayout());
    in the actionPerformed () method.

    But I simply do not get as to why/how cl could be receiving a NULL value!?
    See more | Go to post

    Leave a comment:


  • p vs np
    started a topic CardLayout Manager is giving some trouble
    in Java

    CardLayout Manager is giving some trouble

    Hi.

    I have been trying to fiddle around with some layout managers, the CardLayout in particular. The idea I had was : I must be able to accept multiple panels on one frame, i.e, i must have the first panel with a navigation button labeled "Next", and on clicking it, i am expected to see another panel on the frame.

    In my sample code, i have three classes: CardLayoutSelf, Page0, Page1.

    The design is...
    See more | Go to post

  • p vs np
    replied to Client-Server connectivity through Java
    in Java
    Could you please point at the code which needs to be modified, with some more details provided.

    I am not very comfortable with the terminology and methods as this is the first time i am trying my hand at socket programming.
    See more | Go to post

    Leave a comment:


  • p vs np
    replied to Client-Server connectivity through Java
    in Java
    This part is solved i guess.
    There was a problem with the masking of the IPv6 addresses.

    The next problem i have encountered happens to be of a queer nature.
    I developed applets for the above code.

    Server
    Code:
    import java.awt.*;
        import java.awt.event.*;
        import java.applet.*;
        import java.io.*;
        import java.net.*;
     /*
         <applet code="client_button"
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...