Java: Array Methods
A few useful array methods in Java:
ArrayMethods.java
A few useful array methods in Java:
ArrayMethods.java
Using quick sort algorithm, this software reads a text file with integers and returns a new text file containing all integers ordered.
Keep in mind that these files were used in class while learning Java. Sometimes they were written under very short deadline, that is, it might not be the most efficient way to write a code, but I hope it helps you as an example.
Feel free to use it.
It uses 3 files: Main.java, Order.java, and Sorter.java
(more…)
/* 1044s.scss */
/* Config */
$num-cols: 12;
$row-width: 1140px;
$container-lateral-padding: 20px;
$col-margin-right: 3.8%;
$col-unit: (100% + $col-margin-right) / $num-cols;
[..]
.container {
padding-left: $container-lateral-padding;
padding-right: $container-lateral-padding;
}
.row {
width: 100%;
max-width: $row-width;
margin: 0 auto;
overflow: hidden;
}
.col{
margin-right: $col-margin-right;
float: left;
}
@for $i from 1 through $num-cols {
.col-#{$i} { @extend .col;
width: $col-unit * $i - $col-margin-right; }
}
.col-#{$num-cols} {
margin-right: 0px;
}
.last {
margin-right: 0px;
}
img, object, embed {
max-width: 100%;
}
Have you ever tried to save a website in your computer so you could see it later offline? What about saving an offline copy of a wordpress theme and then later you can use it on your own website?
Most of the web browsers have features where you can save a website, but sometimes it just doesn’t work as expected. The reason is that the browser “save as…” option doesn’t download the whole website, it just download the page you asked for keeping all the links, css and javascript import as online reference. That way you are not able to see the exactly same page you saved if you’re offline.
For those smart users who use Linux you can use WGET to download anything including websites. GNU’s wget command line program for downloading is very popular, and not without reason. While you can use it simply to retrieve a single file from a server, it is much more powerful than that and offers many more features.
One of the more advanced features in wget is the mirror feature. This allows you to create a complete local copy of a website, including any stylesheets, supporting images and other support files. All the (internal) links will be followed and downloaded as well (and their resources), until you have a complete copy of the site on your local machine.
Let’s try it:
$ wget -mk http://www.example.com/
Where -m means mirror and -k is to convert all the links and references to your local address.
Now if you want to make a backup of something, or download your favourite website for viewing when you’re offline, you can do so with wget’s mirror feature. If you are on your Linux, you can always check the manual for more options. Just type in the terminal:
$ man wget
Hi Folks,
Veetle just released a beta version of the new veetle for linux. No more need to change the settings. It works like a charm for me. Give a try and Let me know! That is a copy of the veetle developers post:
Hey Linux users – help us pre-test a new release for Linux! We put the old release on a diet, and it’s down to about 8MB in size, includes better support for PulseAudio (you should no longer need to uninstall pulse to get audio synced up properly in linux) and works out of the box on my 64-bit Ubuntu. It will still show up as version 0.9.17 (we’ve got some added fixes we’d like to push out before applying the coveted 0.9.18 moniker) but you can get it in either of your favorite formats from:
http://veetle.com/download.php/veetle-0 … install.sh
http://veetle.com/download.php/veetle-0.9.17plus.tgz
If you do install it, let us know how it’s working out for you! I’m calling this one “0.9.17+”.
[Caveat: This is an experimental release! Not for the weak of heart! Don't install it unless you feel comfortable rolling up your sleeves and tinkering with your Linux box - or at the very least, wait until others confirm that it doesn't horribly break the website...]
Link: http://s1.veetle.com/forums/viewtopic.php?f=7&t=2312#p8845
it is caused by the vlc included with the veetle in the .veetle_vlc folder (thanks forevertheuni). Somewhat it leads to an audio delay in lucid systems, probably due to an output driver problem (I have encountered similar delay problems while this vlc was playing audio files when alsa, or pulse was selected as output driver). But oss driver worked for me.
Anyway, let’s begin fixing it!
1) Firstly browse to the .veetle_vlc folder located in your home folder using nautilus (or your favourite file browser).
2) Rename the “vlc” file into something else. I have renamed it as “vlcori” which is the short for vlc original but you are free to give it any name at all.
3) Create a new document called vlc by right-clicking on the nautilus window, selecting “Create Document” and clicking “Empty File”
4) Now double click the vlc file you have created. The file be opened with gedit (or your default file editor).
5) Type (or copy-paste) the following code inside the file:
#! /bin/sh
exec ~/.veetle_vlc/vlcori --aout oss "$@"
6) If you renamed your original vlc file as something different than vlcori, make sure you have changed the code above according to the name you gave.
7) Save the file, close gedit,
Right click the vlc file you have created, click “Properties”, then “Permissions” tab, make sure “Allow executing file as program” is selected, if not click the checkbox beside it, and finally click “Apply”
9) Close nautilus, enjoy veetle.
UPDATE:
On Ubuntu Maverick for some reason, on my tests, this solution doesn’t work. An alternative way to fix it, in case the first doesn’t work is:
On step five, instead
#! /bin/sh
exec ~/.veetle_vlc/vlcori --aout oss "$@"
Replace it for:
#! /bin/sh
exec ~/.veetle_vlc/vlcori --alsadev 0 "$@"
when you use your poor Oracle connected application, after some time of activity you get “ORA-12519, TNS:no appropriate service handler found”, and you don’t get any more connection from the db, with SQLExceptions instead. The quick way to solve, is to restart the listener. Not bad uh, for a “proven industry database”, isn’t that?
Googling around I found that this is a bug on how OracleXE monitors processes, and issuing the following command at SQL command line will fix it (after restarting the listener):
ALTER SYSTEM SET PROCESSES=150 SCOPE=SPFILE;
Worked for me. This saved me to install Oracle Enterprise on my laptop.
Musician: Hey Apple, I just had to accept a new license agreement for your iTunes platform.
Apple: So what? You have been really reading through it?
Musician: It says that I have to use GarageBand if I want to see any music I produce on iTunes.
Apple: Correct.
Musician: Well but I do not like GarageBand. I would like to use Ableton Live.
Apple: Sorry but you are not allowed to use that.
Musician: But it is suited very well for electronic music.
Apple: Use GarageBand then. It is a magical and amazing product!
Musician: Okay fair enough, but what if I would like to play the piano? An instrument I have practiced since more than eight years. I think I am creating better music on a piano than with GarageBand.
Apple: Then you invested your time in the wrong instrument.
Musician: Okay. What about the Audiotool? Can I use it?
Apple: That application does not even run on our devices. Those developers are lazy.
Musician: Errr, okay. So if I use GarageBand I can do what I want?
Apple: No. If you use the F-word in a song for example it won’t be distributed via iTunes.
Musician: You are kidding. Why?
Apple: Because we think that it is not appropriate.
Musician: That must be a joke.
Apple: Not at all. Your child could listen to that song — think about it.
Musician: Well, I think I know best what’s good for my child. Besides, would some parental control system not help here?
Apple: Next question please.
Musician: Okay, assume I use GarageBand and that my content is “appropriate”. Can I be sure it will make it to the iTunes store?
Apple: First we will check it.
Musician: How long will that take?
Apple: Up to two months.
Musician: Are you serious?
Apple: Yes. There is plenty of music being created and we want to filter only whats best for our users.
Musician: And you think you can decide that?
Apple: Sure.
Musician: Okay, let me sum this up quickly: I have to use GarageBand to create any music for iTunes. It has to be “appropriate” and then you let me wait for quite some time to tell me whether you like it or not?
Apple: Now you make it sound like as if we were evil. Google is evil. We are the good guys! And look, the new iPad. Isn’t it beautiful?
Musician: Oh, yeah. I really want that overpriced product. Where can I buy it?
Apple: In our certified Apple retail stores.
Musician: And you will not pull me over this time like you did with the iPhone when you dropped the price dramatically two weeks after its release?
Apple: No. Not exactly. We will release an iPad with a webcam soon. And we will charge $200 extra for that.
[...]
Sounds strange doesn’t it? Thank god this was just a fictional interview and will never become reality.
When installing Eclipse on Ubuntu and trying to use the Tomcat provided on the Ubuntu repositories for some weird reason Eclipse can’t find the tomcat or when it finds it doesn’t work. Looking for some solutions on Internet, most of the places say to do not install tomcat from the repositories when the intention is to use Eclipse. Their advice is to download and compile manually the Tomcat.
But there’s an easy solution, and the great thing is that the Tomcat from the Ubuntu repositories can be kept without the need to compile anything.
sudo apt-get install tomcat6 cd /usr/share/tomcat6 sudo ln -s /var/lib/tomcat6/conf conf sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy sudo ln -s /var/log/tomcat6 log sudo chmod -R 777 /usr/share/tomcat6/conf
Tired of typing password every time you need to mount a partition? Here is the solution, it’s easy and very useful!!
link to the tutorial: http://www.webupd8.org/2009/11/deactivate-password-request-for.html