2012-09-07
Some thoughts on my philosophy concerning forums
Yeah, this is the editorial section. Gotta go there some times.
There are far too many forum "gurus" and trolls who have an absolutely TERRIBLE attitude and it shows in the way that they "answer" forum inquiries. You all know what I am talking about. Short smart ass replies that say something like, "if you read the documentation...insert annoying tone and useless high level jargon, indecipherable to anyone who doesn't ALREADY know the answer to the posed question bla bla stop bothering me...". Yes, we all now that guy. Lots of those guys.
Here is a simple parallel metaphor to explain my philosophy on documentation and the attitude everyone should have if they participate in any capacity in forums:
You can only ever see a movie, for the first time, once. That is why the director has groups come in and view the movie before he puts it out, so that he can get a perspective on how it actually plays to fresh minds, as opposed to the inevitably warped version that will reach his mind after being filtered through all of his knowledge of what he wants the film to be and of what he already has seen countless times while editing. For film directors, this struggle to make something fresh and digestible, even though it is many years old to themselves, is right in front of them at all times. It is obvious. Once you know everything it is difficult to understand what is the needed amount of information to keep the viewer in touch with the narrative of the story and, for instance, what is going on in the heads of the characters at any given moment. Is this amount enough? Or am I making assumptions based on my overall knowledge of the complete character including aspects that have not yet been revealed. A GOOD director is constantly worried about making sure that his message is getting across right now to people BRAND NEW to his story. Not so much for programmers and IT guys. What do they care about noobs? Noobs should study more, right?
I disagree. Study is what you do AFTER you are presented with a concept, in order to make it stick in your mind. It is still the job of the teacher, or the documentation, to present that concept clearly and unmistakably and taking into account all the common pitfalls. There is plenty enough gold to be had after the student has been lead to the mine, provided with a pick, and taught how to use it. Uh oh mixed metaphor!
It is wise to always remember that what appears easy to you, may have been easy for you simply because you got lucky enough to come at it from an advantageous angle, or because you had a good teacher, or because you got lucky and did it right the first time, while others may be struggling with shaking off terribly explained paradigms from the last intolerant asshole forum guru that gave them bad "advice" by giving them incomplete information. If you get lost on the way to going somewhere every time you go there and all of the directions you ask for are wrong, then it is likely you will not remember exactly how to get back there the next time you try again. Too many confusing memories.
So, if you are a forum guru, your abrupt, short, impatient answers may actually be helping to create more confusion, instead of helping, and guess what, it will come back to haunt you in the form of more "stupid" questions. Yup, there is a good chance that you, or some other cocky, incomplete answer giver in a related thread, are the entire reason why this questioner is so stumped to begin with. So just answer the stupid questions already. Frankly, I see more stupid answers than stupid questions. You cannot assume that someone is lazy just because they ask a question. Sometimes frustration and overload make simple, basic concepts slip through the cracks. Sometimes, dealing with a steady stream of flippant asshole forum "gurus" will just plain unbalance the chemical balance in one's brain! However, from the answer side, if you KNOW the answer and you just flip a tidbit at them without clearly explaining, then you are truly giving a stupid answer. If you are picturing yourself as Mr. Miyagi, and think that you are somehow imparting wisdom by being mysterious, then you are, again, an idiot. You are not in an intense training montage from a Hong Kong kung-fu movie, you are answering a technical question in a forum specifically dedicated to that discipline.
Smart answers give clear concise information. You knew that when you answered questions in school, right? So what is the problem? Real people not good enough for your A-game answers? It baffles me. Posting something like "I think it is clearly spelled out in the documentation", is a waste of every one's time. It is the equivalent of answering a school test question with "that is defined quite well in the dictionary". Imagine actually putting that on a test. You would obviously get an "F" for that answer. I am giving you an "F" right now for your incomplete, and/or smug, answer in the forums. Put up or shut up.
The future belongs to the noobs! They can be your allies, or your enemies. You decide. If you don't believe that it is safe to assume that anyone who is asking a question is trying to learn, then you should not be answering questions in a forum. Go code by yourself in the dark and play some more WoW.
Cheers!
ultramanjones
2012-09-06
Property Animation in QML
It has been a long time since I put up a post, I'll try to post more often. I'm posting up some code I wrote to make a button pulse after clicked and then quit pulsing when clicked again. Simple, but it contains some important examples of syntax and implementation. I hope somebody finds it useful.Start up QtCreator and select File/New File or Project.../Applications/QtQuick Application (Built-in Elements). Enter a name and then select only Desktop. Will it work on the other platforms? Probably, but I haven't tested it on any but Desktop, so that is why I'm suggesting you do the same. Just copy and paste this code over the main.qml and it should run.
import QtQuick 1.0
Rectangle {
width: 400
height: 400
Rectangle {
id: applyButton
width: 100
height: 30
border.color: "#4f78a2"
border.width: 2
radius: 5
smooth: true
anchors.centerIn: parent
color: "#BFEFFF"
opacity: 1.0
Text {
id:textItem
anchors.centerIn: parent
font.pointSize: 12
font.family: "Helvetica"
color: "#337777"
styleColor: "#ffffff"
style: Text.Raised
text: "Apply"
}
PropertyAnimation {
id: changeToColor1;
target: applyButton;
properties: "color";
to: "#ffff00";
duration: 1000
}
PropertyAnimation {
id: changeToColor2;
target: applyButton;
properties: "color";
to: "#BFEFFF";
duration: 1000
}
NumberAnimation {
id: toFullOpacity
target: applyButton
properties: "opacity"
to: 1
duration: 250
exclude: border
}
SequentialAnimation {
id: sequentialOpacity
running: false
NumberAnimation {
id: animateOpacity
target: applyButton
properties: "opacity"
from: .2
to: 1
duration: 700
easing {type: Easing.InOutQuad; }
exclude: border
}
NumberAnimation {
id: animateOpacity2
target: applyButton
properties: "opacity"
to: .2
from: 1
duration: 700
easing {type: Easing.InOutQuad;}
exclude: border
}
loops: Animation.Infinite
}
MouseArea {
id: applyButtonMA
anchors.fill: parent
//hoverEnabled: true
onClicked: {
if (sequentialOpacity.running == true)
{
sequentialOpacity.stop()
toFullOpacity.start()
changeToColor2.start()
}
else
{
changeToColor1.start()
sequentialOpacity.start()
}
}
}
}
}

When you click the button the first time, it will turn to yellow and start to pulse ( the opacity will cycle from 1.0 to 0.1 and back again over and over ).
When you click it again, it will return to it's initial state as a light blue button.
I really love how you just put an id on an item and then you can refer to it later by that id. Like:
sequentialOpacity.stop()
It's quick object notation. Since sequentialOpacity (my name) is an instance of SequentialAnimation I can use dot notation to access any of SequentialAnimation's functions.
QML is not exactly the "plain english" language that it appears to be. Even the syntax can get a bit wonky at times and leave me scratching my head as to WHY is this element in this syntax, while all the rest are written a different way. For example, take this bit of code from above:
NumberAnimation {
id: animateOpacity2
target: applyButton
properties: "opacity"
to: .2
from: 1
duration: 700
easing {type: Easing.InOutQuad;}
exclude: border
}
Apparently "easing" is an object? All the other properties use the colon notation, but then easing pops in using the syntax of an entire object. It could have been written like this:
NumberAnimation {
id: animateOpacity2
target: applyButton
properties: "opacity"
to: .2
from: 1
duration: 700
easing {
type: Easing.InOutQuad;
}
exclude: border
}
Thinking of easing as a property had me coding with the wrong syntax for a while, and the error messages are not always specific enough to lead to proper correction. Eventually I ran into just one example on the inter-webs with the proper syntax and I fixed it, but it took some digging and sleuthing, and this sort of thing is a serious waste of valuable time. "exclude: border" does not work either, by the way. I have no idea why. And QtCreator rejected entirely "exclude: border.color". Gave up on that one.
Anyway, play with this and see if it helps you understand QML a little better. Let me know if you have any suggestions or questions. I've been working with QML for a couple of months now, and I've learned how to do a few things. If you are learning this powerful language ( and possibly Qt alongside of it as well ) then you have probably found that documentation of some of the simplest things is hard to find. I'm one who believes that documentation needs to include comprehensive examples, definitions and references to relative terms if it dares call itself documentation. As "extensive" as the Qt and QML documentation is, it lacks terribly in explanations, clarifications of concepts, and easy to read specific examples. IF you already know what you are doing, then it is an adequate reference, but even then I often run into dead ends.
Here are some more of my thoughts on that whole situation...
Thanks for reading.
CHEERS! ultramanjones
2012-08-09
Qt Open Source Platform sold/moved to Digia
As per this article at PCMag.com, Nokia has just sold Qt to Digia.
I consider this to be great news. I was a bit worried that Qt might die or flounder along with Nokia, considering that Nokia has completely lost their minds. Perhaps more accurately, they have been taken over by a questionable leader, to say the least. I'll not get into the politics.
I'm hopeful that this will lead to a quick release of Qt 5.0, a full realization of QML tools and standards, and full support for Android (and possibly MeeGo, that would be dreamy!).
So glad to hear that the core team will be kept together.
Great news!
I LIKE it!
I consider this to be great news. I was a bit worried that Qt might die or flounder along with Nokia, considering that Nokia has completely lost their minds. Perhaps more accurately, they have been taken over by a questionable leader, to say the least. I'll not get into the politics.
I'm hopeful that this will lead to a quick release of Qt 5.0, a full realization of QML tools and standards, and full support for Android (and possibly MeeGo, that would be dreamy!).
So glad to hear that the core team will be kept together.
Great news!
I LIKE it!
2012-08-03
Operator Malfunction
When I was a kid, my bro and I used to always get on my Dad's Commodore 64 and try to program ( or just play games ). I remember that sometimes we would run out of the "office" and get Dad, who was most likely watching TV or reading in the living room, and we'd say things like, "Dad! We can't get this stupid thing to work, it keeps hanging up and just not working!", or some similar desperate, oblivious plea.
He would "hrrrumph" as he got up from the floor and start following us back to the computer, whereupon I would hear him say, "Ah... it's probably just operator malfunction."
The first couple times I didn't ask what he meant, because I liked to think that I was smart and I would just figure it out when he showed us what was wrong anyway.
Then one time he said the phrase again, and I realized that I had no idea what he was talking about so I said, "What do you mean by 'operator malfunction'? What's the operator?"
My brain rapidly shuffled through images of circuit boards, transistors and all manner of mysterious electrical components trying to figure it out.
He poked me in the forehead, holding his finger there, then pushing away as he said,"YOU operate the computer, right?" I watched him slowly smile as he watched the me grasp the concept and then he laughed that belly chuckle, "heh ha!", as I scowled and twisted my face at the idea that it could possibly be my fault.
"Ahhh...", I said, reluctantly, but smiling as we sat down to figure out the problem.
Sometimes, after that, he would hold his finger up in the air like Einstein and proclaim, "Operator Malfunction!"
To this day, I find that the vast majority of my computing problems are due to "operator malfunction".
Miss you Dad.
He would "hrrrumph" as he got up from the floor and start following us back to the computer, whereupon I would hear him say, "Ah... it's probably just operator malfunction."
The first couple times I didn't ask what he meant, because I liked to think that I was smart and I would just figure it out when he showed us what was wrong anyway.
Then one time he said the phrase again, and I realized that I had no idea what he was talking about so I said, "What do you mean by 'operator malfunction'? What's the operator?"
My brain rapidly shuffled through images of circuit boards, transistors and all manner of mysterious electrical components trying to figure it out.
He poked me in the forehead, holding his finger there, then pushing away as he said,"YOU operate the computer, right?" I watched him slowly smile as he watched the me grasp the concept and then he laughed that belly chuckle, "heh ha!", as I scowled and twisted my face at the idea that it could possibly be my fault.
"Ahhh...", I said, reluctantly, but smiling as we sat down to figure out the problem.
Sometimes, after that, he would hold his finger up in the air like Einstein and proclaim, "Operator Malfunction!"
To this day, I find that the vast majority of my computing problems are due to "operator malfunction".
Miss you Dad.
2012-07-13
QTreeView in QtQuick/QML Implementation
Okay, so in my last post I posted a duplicate of my question over on the Qt Dev Forums. Thankfully someone answered quickly and I was able to implement a solution. Mind you, it still has all sorts of kinks and functions that need to be fixed or realized, but it's a start. Considering how much time I spent trying to get this to work, I figured that this is one of those things that I really want to share with the community, so before I delve in deep, I thought I'd stop for a second and post the code to my test application.
All this app does is show a QTreeView using QML. Essentially, it is a boiled down plugin for QML. The QTreeView class is derived from QWidget. The QDeclarativeView where my QML "lives" only accepts elements that are derived from QGraphicsObject. To solve this problem I have wrapped the QTreeView in a QGraphicsProxyWidget.
It sounds complicated, but it really isn't. Without ever having seen it done however, it was quite difficult to discover, especially for the nooborn like me. Answers are much simpler to find once you know what questions to ask. IMHO it is important to always remember this fact lest we start to labor under the misconception that we are actually intelligent beings or that we ourselves are awesome because we know so muich. What follows are the terrible diseases that go by many names including "noobphobia", "lorditoverallsia", "assholiosis", and "I-have-forgotten-plain-english-but-I-think-that-using-technical-terms-makes-me-look-smart-so-no-one-knows-what-I-am-saying-blindness". Just take a look around the forums and through the comments all over the web and you will see that these diseases are spreading like that virus that causes people to turn into flesh eating zombies in the movies. I think I'd prefer the zombies....
Anyway, here is the code. Enjoy. If you have any questions, I'll try to answer, but I'm a noob too, so no promises peeps!
I am using Qt Creator 5.0 Based on Qt 4.8.1 (64 bit) according to Help/About Qt Creator...
This quick test app was created by going to File/New File or Project.../Applications/Qt Quick Application (Built-in Elements). Named the project QTreeTest. I chose only "Desktop" as my target.
The files I am going to share are:
QTreeTest.pro
testtron.h
treeview.h
testtron.cpp
main.cpp
main.qml
TreeView.qml
I tried to post the code directly to Blogger and it got all wonky of course, so here is a link to a Google Docs folder instead. Enjoy!
LINK TO ALL THE FILES
NOTE: In order to assign the "treeView" a "hide" state I had to nest it within another rectangle and assign the hide state to the id of that rectangle. The TreeView will reject direct state assignments.
I sure hope this helps somebody. I'm going to come back and clean this up a bit on Monday. Right now, it is almost 6:00 PM and it is FRIDAY! Woo hoo! I am outta here! Cheers!
All this app does is show a QTreeView using QML. Essentially, it is a boiled down plugin for QML. The QTreeView class is derived from QWidget. The QDeclarativeView where my QML "lives" only accepts elements that are derived from QGraphicsObject. To solve this problem I have wrapped the QTreeView in a QGraphicsProxyWidget.
It sounds complicated, but it really isn't. Without ever having seen it done however, it was quite difficult to discover, especially for the nooborn like me. Answers are much simpler to find once you know what questions to ask. IMHO it is important to always remember this fact lest we start to labor under the misconception that we are actually intelligent beings or that we ourselves are awesome because we know so muich. What follows are the terrible diseases that go by many names including "noobphobia", "lorditoverallsia", "assholiosis", and "I-have-forgotten-plain-english-but-I-think-that-using-technical-terms-makes-me-look-smart-so-no-one-knows-what-I-am-saying-blindness". Just take a look around the forums and through the comments all over the web and you will see that these diseases are spreading like that virus that causes people to turn into flesh eating zombies in the movies. I think I'd prefer the zombies....
Anyway, here is the code. Enjoy. If you have any questions, I'll try to answer, but I'm a noob too, so no promises peeps!
I am using Qt Creator 5.0 Based on Qt 4.8.1 (64 bit) according to Help/About Qt Creator...
This quick test app was created by going to File/New File or Project.../Applications/Qt Quick Application (Built-in Elements). Named the project QTreeTest. I chose only "Desktop" as my target.
The files I am going to share are:
QTreeTest.pro
testtron.h
treeview.h
testtron.cpp
main.cpp
main.qml
TreeView.qml
I tried to post the code directly to Blogger and it got all wonky of course, so here is a link to a Google Docs folder instead. Enjoy!
LINK TO ALL THE FILES
NOTE: In order to assign the "treeView" a "hide" state I had to nest it within another rectangle and assign the hide state to the id of that rectangle. The TreeView will reject direct state assignments.
I sure hope this helps somebody. I'm going to come back and clean this up a bit on Monday. Right now, it is almost 6:00 PM and it is FRIDAY! Woo hoo! I am outta here! Cheers!
2012-07-12
QTreeView in QML question (posted to Qt Developer Network too)
UPDATE: See my later post here for the answer(s) to this question. Or at least a start.
Hello everybody. Help! I'm trying to incorporate a Model/View into an application using QTreeView, QFileSystemModel and qmlRegisterType to create the QTreeView plugin.
If my main.qml looks like this:
import QtQuick 1.1
import TreeView_Plugin 1.0
TreeView {
id: myTreeView
allColumnsShowFocus: true
}
I get a QTreeView displayed looking like this:
However, when my main.qml looks like this:
import QtQuick 1.1
import TreeView_Plugin 1.0
Rectangle {
id:myRect
width: 400
height: 400
TreeView {
id: myTreeView
allColumnsShowFocus: true
}
}
All I get is this...
I am not able to insert the "TreeView" into the rest of my QML and I can't figure out why.
If I try to add a property change to x, y, width or height, for example:
I get error: Invalid property assignment: "x" is a read-only property
Of course I will post plenty more code if someone thinks they might be able to help.
If I try to add a property change to x, y, width or height, for example:
TreeView {
id: myTreeView
x: 15
y: 15
allColumnsShowFocus: true
}
I get error: Invalid property assignment: "x" is a read-only property
Of course I will post plenty more code if someone thinks they might be able to help.
The application already uses a QDeclarativeView with an OpenGL backend like so:
QGLWidget *glWidget = new QGLWidget(this); setViewport(glWidget);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
There is of course a bit more code involving setting the FileSystemModel, etc, but I don't believe it is relevant. I am really quite baffled here. Obviously, I need the QTreeView to show within the rest of my QML or there really is no point.
If anyone could point me to a way to do this, I would very much appreciate it. I'm pretty new to Qt and I readily admit that I sometimes have no idea what is going on "under the hood", especially when it comes to the whole MOC file paradigm.
Whatever way I can get this done is fine with me. I really thought the plugin (qmlRegisterType) method was the way to go, because I'm using it to create an OpenGL window for animations in a separate part of the app, but, as you can see, it ain't working.
Thanks for your help!
------------------------------------
UPDATE 2012-07-13:
I received an answer in the Qt Dev Forums. Here's a link.
This looks promising, because I was already thinking I would probably have to wrap the class/object in another object in order to get QDeclarativeView to accept it.
What I did not see until after I posted this yesterday, is that QtCreator is producing a warning when I run the first example above (the one WITH the QTreeView displayed). I don't have it in front of me but it was something along the lines of QDeclarativeView only supports objects derived from QGraphicsObject. QTreeWidget is NOT a QGraphicsObject, it is derived from QWidget.
I'll let you know what I get working.
I know it's a bit odd posting a question like this, but now you can see the sort of process I go through on a daily basis in the world of programming. The eternally nooborn, learning never ends. (did I just coin a word?)
------------------------------------
UPDATE 2012-07-13:
I received an answer in the Qt Dev Forums. Here's a link.
This looks promising, because I was already thinking I would probably have to wrap the class/object in another object in order to get QDeclarativeView to accept it.
What I did not see until after I posted this yesterday, is that QtCreator is producing a warning when I run the first example above (the one WITH the QTreeView displayed). I don't have it in front of me but it was something along the lines of QDeclarativeView only supports objects derived from QGraphicsObject. QTreeWidget is NOT a QGraphicsObject, it is derived from QWidget.
I'll let you know what I get working.
I know it's a bit odd posting a question like this, but now you can see the sort of process I go through on a daily basis in the world of programming. The eternally nooborn, learning never ends. (did I just coin a word?)
2012-05-29
QtCreator error: No GL capable X visuals available Fedora 16 Linux
So you are trying to run the example applications in Qt Creator to see if you have installed correctly and you get:
No GL capable X visuals available.
Well, if you are running Fedora 16 with an nVidia graphics card then this link might just help you fix that problem. The methods described here have only been tested on a Fedora 16 system running Qt Creator 2.5 installed on Qt SDK 1.2.1 and with an nVidia GeForce GT 240 graphics card. So try at your own risk, because changing your graphics drivers obviously could cause major problems (i.e. you won't be able to see anything!!)
http://www.if-not-true-then-false.com/2011/fedora-16-nvidia-drivers-install-guide-disable-nouveau-driver/
Many thanks to if-not-true-then-false!
Uh oh! So you did that and it STILL gives you the error. Well then try this guy's advice. It worked for me.
http://www.opengl.org/discussion_boards/showthread.php/176711-QGLWidget-under-new-OS-configuration-throws-error
Just look on the left panel of Qt Creator. Just below the "Debug" bug icon, there is a sideways folder thing called Projects. Click on it. At the top you will see a funny looking widget that looks like this:
Make sure you have "Run" clicked. (I know, right? Why do they make it like solving some kind of hieroglyphic puzzle in an Indiana Jones movie? I mean who is looking for a thing that looks like that for switching pages?) Anyway...
After you make sure you are looking at the Run Settings page. Scan down and find "Run Environment". Look over to the right and click on "Details", if it isn't open already, and then scan the list until you find:
LD_LIBRARY_PATH
Click on it and then click on the "Unset" button on the right.
That should do it. Now go back to the "Welcome" screen of Qt Creator 2.5 and select "Examples" and run one of them. Works for me.
No warranties or promises here. Good luck.
Cheers!
UPDATE: While this did work for the 2dpainting example, I ran into a new problem. When I tried to open an existing project (of mine) and run it. I actually copied this project over from another work station. I copied the entire project folder and placed it in my working directory.
The first problem was that I got this error:
Failed to start program. Path or permissions wrong?
I fixed this by selecting Build>Rebuild project...
Now it tried to run, but then it went back to the error:
QGLTempContext: No GL capable X visuals available.
So I picked up my computer and threw it out the window and... No wait that was just a daydream.
I went BACK into the Projects>Run Settings (as described above) and found that the LD_LIBRARY_PATH was set again. I unset it and now it works. My project was "Set as Active Project" when I did this. To set any project as "active" just right click on it and click the first selection. Does this mean that I will have to do this for every project? Not sure yet. We shall see......
Install QtCreator 2.5 Linux Fedora from the binary (.bin) download
What I am describing here is kind of noob stuff, but then that's what I do : kick ass for the noobs every day.
You will need to have already installed the Software Development Kit before you do this. Currently, on May 29, 2012, the latest version of the Qt SDK is 1.2.1. You can get the installer here. For my installation I used the Linux 64 bit Offline Installer. This will also install QtCreator 2.3.1 as part of the whole package. Now, since they haven't (yet) released an SDK that includes QtCreator 2.5, you can just grab the binary here and install it yourself.
Download it, it should be about 98mb so it will depend on your connection speed how long it takes.
Open the folder where you downloaded it.
Right click on it. It should look like this: qt-creator-linux-x86_64-opensource-2.5.0.bin
Select properties.
Select the permissions tab.
Check the box for "Allow executing file as program."
Now I would just say, "Now double-click on it", but that didn't work for me. It gave me some error:
Could not display "/home/ultrajones/Downloads/q...x-x86_64-opensource-2.5.0.bin"
The file is of an unknown type
No it isn't.
So open a terminal and CD to the directory where you downloaded it. Most likely this is the Downloads folder in your Home directory. When you open a terminal you will already be in the Home directory, so just type:
cd Downloads
And you will be there.
Type:
ls
You will see a list of all the files and folders in that directory.
Somewhere on the list you should see:
qt-creator-linux-x86_64-opensource-2.5.0.bin
Here's a nice trick. Now type:
./qt-
and hit the tab key. The terminal should fill out the rest of the name for you, since it is the only thing in the folder with a name starting with "qt-". Oooh magic. By the way, the dot ( . ) stands for current directory and the slash ( / ) just tells the terminal to execute the following file. Now just hit enter and the installer should fire up.
If it didn't, don't blame me. I do this for free!
Cheers!
2012-05-27
YouTube is blue!
All my other visual media are fine, but YouTube is blue!
Or I should say, it WAS blue. I figured out how to fix it. At least temporarily. Thanks to this link:
Another thumbs down for Flash.
2012-05-26
Create a file listing all files in directory Linux
This is really simple stuff, but, since I never had a formal Linux class, I never knew!
To create a .txt file listing all the files in a directory simply enter:
I wanted to create a text file that listed all of the MP3's in my Home/Music directory. Good thing I was using Linux, because this incredibly simple task is impossible without installing software in Windows. It is really quite powerful for getting things done!
All I had to do was. Open a terminal. CD to the Music directory and enter:
mp3list.txt is just a name I made up on the spot. The file did not yet exist, but it does now!
Another neat little trick I learned is to create an alphabetized version of a file. This should only be done with simple files like .txt or .dat. You see I had been compiling a list of songs that I wanted to add to a compilation I am going to burn for someone, and they were not in any sort of order. I wanted the list to be alphabetical for readability purposes.
That's it! It creates the my_mix_AZ.txt file on the fly. Just be very careful with this. If you designate the second file the same as the first it will erase everything. I found out the hard way. Luckily I had another copy laying around in my messy folders.
Now I can take the two files and diff them using Meld, or just eyeball them side by side to find differences so much easier now that I have alphabetical versions.
To create a .txt file listing all the files in a directory simply enter:
ls > anyfilenameyouwant.txtI wanted to create a text file that listed all of the MP3's in my Home/Music directory. Good thing I was using Linux, because this incredibly simple task is impossible without installing software in Windows. It is really quite powerful for getting things done!
All I had to do was. Open a terminal. CD to the Music directory and enter:
ls *.mp3 > mp3list.txtmp3list.txt is just a name I made up on the spot. The file did not yet exist, but it does now!
Another neat little trick I learned is to create an alphabetized version of a file. This should only be done with simple files like .txt or .dat. You see I had been compiling a list of songs that I wanted to add to a compilation I am going to burn for someone, and they were not in any sort of order. I wanted the list to be alphabetical for readability purposes.
cat my_mix.txt |sort -d my_mix_AZ.txtThat's it! It creates the my_mix_AZ.txt file on the fly. Just be very careful with this. If you designate the second file the same as the first it will erase everything. I found out the hard way. Luckily I had another copy laying around in my messy folders.
Now I can take the two files and diff them using Meld, or just eyeball them side by side to find differences so much easier now that I have alphabetical versions.
Subscribe to:
Posts (Atom)




