67 Archived Topics
Remove Filter The last time a major change happened, i remember in a community chat few people (including me) were saying that the new changes looked a bit girly :P That won't work this time though. This is so totally different from vintage Daniweb. Also, i see some stuff probably not working … | |
My Program is about Directed Graphs. It reads a list of edges like : `25 589` , and puts 589 into the adjacency list (a linked list) of 25. My input file has about 5 Million such `v w` edges, with about 800K nodes/vertices, for each of which there will … | |
The below post is just something i thought of contributing here for young( or old ) members starting out in C. In (effectively) 3 lines of code , i hope to give an intro about pointer arithmetic and how endian-ness in windows affects the output. #include<stdio.h> int main(void){ int a … | |
chrome , firefox.. these are great browsers , and even if i write utter crappy html code, it still makes sense out of it , and tries to display it the way a proper code would have made it display. thats great stuff unless i want to know/see the errors … | |
My assignment says : Write a program to perform following stack operations : Create a stack with item code and quantity Itemcode Quantity 111 450 112 0 113 487 114 101 115 500 116 0 117 359 and then Delete the items having quantity zero and update the stack. My … ![]() | |
If we have something in a `div` block , how come it can flow out of the `div` block as if nothing's even there ? For example , here : <!DOCTYPE html> <html> <head> <link type="text/css" rel="stylesheet" href="box.css"/> <title>Result</title> </head> <body> <div> <p>one</p> <p>two</p> <p>one</p> <p>two</p> <p>one</p> <p>two</p> </div> </body> … | |
I saw a tutorial from a site where it showed the use of `ArrayBlockingQueue` as a thread-safe concurrent data-structure . Just for learning purposes , i tried to build something similar using synchronized and wait-notify methods in java. I'm hoping someone could guide me to some improvements and point out … | |
Remember High-school maths ? there was this greek letter Sigma ( if i remember correctly ) , followed by an algebraic function like `f(n)` , where `n = a to b` would be short-formed as `a` below the `sigma` , and `b` sitting on top of it. I want to … | |
I think i have understood the basic locks , synchronized statements and methods etc etc . I would like to actually program something that used all this. Something that is prone to breaking if one is not careful , also would love if there is swing involved ( i read … | |
I'm a bit confused about the use of "for" in the above statement.( i read the line from the [oracle tutorials](http://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html) ) I suppose a thread has its run() method , inside which there is some code. That code might call a method **of** an object... and by this point … | |
I like watching stuff like google tech-talks , josh bloch seminars/talks etc for Java. Can somebody provide something similar in nature for C# ? | |
 booted from a flash drive to go into the live cd mode , there , as soon as i double clicked a flash video , the screen went all jumbled up , and my pc hanged up. later i tried to check it in oracle virtual box , … | |
[Version 1](http://www.daniweb.com/software-development/java/threads/462737/generic-resizing-circular-array-.-do-i-need-to-implement-iterable-) had quite a few problems that i didnt think about. A lot of them were pointed out in the replies. I tried to correct them as best as i could to make this code. However , I'm having some doubts regarding what to do while implementing the Collection … | |
Since the underlying data-structure used here is an array , which is itself iterable via `for-each()` , i'm wondering how much benefit implementing `Iterable` will provide here. I would appreciate if someone could review my code and suggest any further improvements. **Code:** import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; class ResizingCircularArray<E> … | |
i had previously worked with the GNS3 and cisco packet tracer console as a part of college lab work. It involved setting up and simulating LAN and VLAN topologies. Iv seen people in the CS dept , as part of their course , simulate various TCP/IP functions using C and … | |
Have been studying [Reservoir sampling](http://en.wikipedia.org/wiki/Reservoir_sampling) for a couple of days , What I'v tried here is to draw a uniformly random sample of size 3 from a bigger data (the English alphabet) via reservoir sampling. Below is what i'v come up with. if anyone could review my code and offer … | |
writting this : N = args[1].split("\\s+").length; with commandline argument like : `echo "A B C D E F G H I" | java Subset 3` , will this consume similar memory as would have been the case if i parsed the `"A B C D E F G H I"` … | |
probably doing something fundamentally wrong , but im used to the luxury of java's `System.currentTimeMillis()` or `System.nanoTime()` unfortunately. i have a code that i posted before for a different problem (couldnt compile properly in pelles C) , but now , although its compiling well and good , my clock outputs … ![]() | |
whats even more is that if i create any new file in the "src" folder of the project , it doesnt create any new bin folder to place the class file. i dont know where the class files are of the compiled source code . only when i manually `javac … | |
while trying to compare times between two different ways of determing whether a number is odd/even without using modulo, i thought of using `long long int`s which my codeblocks compiler aint supports . and so i installed pelles c.( supports c99/c11 which inturn supports long long stuff.. ) and im … | |
for a basic ascii checker code of less than 10 lines , i want to print out stuff immediately , instead of after a newline. i understand that stdout is a bufferedstream , and so it will by default wait for a '\n'. i was looking at [this](http://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newline-is-in-the-format-strin) page for … | |
im trying to do this : alter table project_info change column number proj_id int not null auto_increment, add primary key (proj_id); but mysql tells iv got an error. any help with whats wrong here ? i followed this from head first sql book (page 210 if anyone's interested ) . | |
im on win 8. neither can i find the bin folder as i could on my xp machine , nor do i get any command line. googleing didnt help much either. either i got some really hard to understand mysql doc page , with no specific answer to my problem … | |
my `display()` method is public and looks to be defined , however eclipse says that its not defined. this is a code for an amortized time resizing circular array. can someone help me out here ? also , please do point out if you see something else wrong with the … | |
[This](http://docs.oracle.com/javase/tutorial/essential/concurrency/deadlock.html) is the example i was looking at. The docs say that trying to access the bowBack() method is creating the deadlock , but im new to threads , and i really dont understand why this is happening. In need of some guidance here... | |
1st of all , let me mention my hardware : **HP G6 laptop with win8** : amd a4 4300M, radeon graphics : 512 MB 7420G + 1GB 7670M , 4 gb 1600 Mhz ram. **4 yr old Desktop running xp sp2** : amd athlon x2 250 , inbuilt graphics : … | |
doing this works : contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); textArea = new JTextArea(); scrollPane = new JScrollPane(textArea); contentPane.add(scrollPane,BorderLayout.CENTER); setContentPane(contentPane); however this doesnt : contentPane = new JPanel(); textArea = new JTextArea(); scrollPane = new JScrollPane(textArea); contentPane.add(scrollPane,BorderLayout.CENTER); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, … | |
my string (str2) = "aaaabbaacc" i wanted to parse out the two a groups. some trials had worked according to plan , while a few , are giving me outcomes i dont understand. im hoping the members could help me out :) problematic regexp 1 : `console.log(str2.match(/a+(a+(?=c))/).toString());` this gives "aa … | |
[this](http://docs.oracle.com/javase/tutorial/uiswing/examples/components/TextComponentDemoProject/src/components/TextComponentDemo.java) is the code i was looking at.Its about how to use JTextPane and related swing text Components along with actions and keymaps. my question is that in this part textPane = new JTextPane(); textPane.setCaretPosition(0); textPane.setMargin(new Insets(5, 5, 5, 5)); StyledDocument styledDoc = textPane.getStyledDocument(); if (styledDoc instanceof AbstractDocument) { doc … | |
i saw the docs for both .. but found the terms a bit hard to get. i was hoping to get some simple answers here. thanks for your time :) | |
can the members suggest some books/links that takes advantage of what i already know about oop (the basics , from java) and utilises it to make learning C# a faster process? perhaps i should have posted this on the C# forums , felt i should keep it here as my … | |
one of my good friends wrote [this](http://developertimes.wordpress.com/) blog here. he asked me for an opinion , however , i havent used linux much... only used centOS for about a semester in college for a networking course. i was hoping the members here could give some opinions about the blog. thanks … | |
i started html from the book head first html n css , and just in the second chapter , they're talking about having your own website and that it would help out in learning html. i dont really know anything about this, can anyone suggest if having my own website … | |
this is the problem code : import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.io.IOException; public class Prepared { public static void main(String[] args) { try { readerHelper r = readerHelper.GET_INSTANCE; System.out.print("enter username: "); String user = r.is().readLine(); System.out.print("enter password: "); String pass = r.is().readLine(); Connection con … | |
the following is taken from joshua bloch's effective java. pg 82: public class InstrumentedHashSet<E> extends HashSet<E> { // The number of attempted element insertions private int addCount = 0; public InstrumentedHashSet() { } public InstrumentedHashSet(int initCap, float loadFactor) { super(initCap, loadFactor); } @Override public boolean add(E e) { addCount++; return … | |
my host is XP sp2 , and virtual box guest is XP SP3. i want to access the guest from the host. I read and felt that a host-only network is what i want.( ill be using it to use database loaded on guest from the host). i googled it … | |
i basically need mySQL for learning JDBC connections. will be thankful to any information regarding this matter. didnt find anything concrete on the net... | |
hi everyone :) im trying to open this project , but when i double click it , vs2010 opens with error on the forms. double clicking the forms shows that the file doesnt exist at the particular directory , even when its visibly there. its probably a trivial thing , … | |
i was thinking of downloading some database software that would help me learn sql. so far i have only *read* sql , ie havent done any practical sort of thing. i made a post earlier in this forum , where i was told that sql server express will be a … | |
hi everyone :) im hoping to learn a healthy amount of vb10/12 by the end of the month. mainly to improve my cv and get a better shot at jobs. originally wanted to learn vb6 for a college project , but after a post in daniweb , my ideas are … | |
hi everyone :) i want to learn vb6 , but i dont know where to start. I have a college project related to creating banking software where vb6 is being used as the frontend. i have around 1 month to get my vb6 skills up , as the project has … | |
from today morning , my keyboard just cant keep up. i type a few words , and then it starts displaying the first letters! quite a trouble this ! i tried google-ing about keyboard becoming slow , but the few forum threads i found suggested a format, but thats not … | |
can anyone help me understand this code part ? this is about binary minimum heap , ie root has the lowest key.. the part of the code im trying to understand checks whether the subtree ( of a certain minHeap pq[1..N] ), rooted at k is also a min heap … | |
i wrote a code to implement some basics of priority queue , but apparantly its not giving desired output. the code is implemented using binary heap as its data structure. i tried tinkering here and there , nut no luck... i want to display a given number of max or … | |
i want to sort a list of two dimensional points based on their polar angles with respect to a particular point. this will a part of a bigger code to find collinear objects from a set of points. the method i thought of for doing this is is: 1. create … | |
i have to create a queue where the dequeue operations will be random. that is , a random location will be chosen, and deleted after returning the data stored at that location. i was going through the two underlying datastructures that im allowed to use **:** linked list , and … | |
in an assingment, i have to implement a deque ( double ended queue ). the underlying datastructure is allowed to be arrays or linkedlist. only that im not allowed to use any prebuilt java api that does the above. (like the java.util.LinkedList api) implementing the above using doubly linked list … | |
forgive my ignorance, there must be a really simple answer to this, but im unaware of it, also, tried google-ing for it, but didnt know what to look for exactly, and didnt get much good answers either. my question is, since 2^32 is around 4Gb, so max usable RAM on … | |
code for : Percolation using Weighted Quick Union Find Algorithm. this is a homework assignment. iv made the code do what its supposed to do, and it works perfectly. The only problem im facing now is to model the code structure according to the given API. when i try to … | |
im learning some algorithms , and trying to come up with a version for Quick find using union find. the algorithm works like : 1. get user input for size of the array (the array holds the data on which quickfind will work) 2. create and initialize the array based … |
The End.