tag:blogger.com,1999:blog-49587142582266746332024-03-13T08:31:32.967-07:00fortytwoUnknownnoreply@blogger.comBlogger21125tag:blogger.com,1999:blog-4958714258226674633.post-69394975449281463882022-03-31T01:52:00.001-07:002022-04-01T05:18:13.618-07:00Using opOSSum with ScanCode Output - How to Convert ScanCode Output JSON to Opossum JSON<p style="text-align: justify;">
<span style="font-family: georgia;"> opOSSum is a nice Open Source compliance tool which can be found on
<a href="https://github.com/opossum-tool/OpossumUI" target="_blank">GitHub</a>. ScanCode is another nice Open Source compliance tool which can be found
on
<a href="https://github.com/nexB/scancode-toolkit" target="_blank">GitHub</a>, too. While the latter provides extensive code scanning functionality, the
former can create comprehensive reports and visualize scan results. One just
has to figure out how to get opOSSum to read ScanCode output. </span>
</p>
<p style="text-align: justify;">
<span style="font-family: georgia;">This is not really an issue, but - as far as I can tell - has not yet been
documented anywhere on the internet. opOSSum does read ScanCode json output,
but it reqires some transformation beforehand. Good news: opOSSum also
provides the tool to perform said transformation. </span>
</p>
<p style="text-align: justify;">
<span style="font-family: georgia;">As usual, this is more of a step-by-step-guide for noobs such as myself for
future reference, but I figured maybe this can be of use for the community
as well. </span>
</p>
<h2 style="text-align: left;">
<span style="font-family: georgia;">Prerequisites: </span>
</h2>
<h3 style="text-align: left;">
<span style="font-family: georgia;">1. Get ScanCode </span>
</h3>
<p style="text-align: justify;">
<span style="font-family: georgia;">Just get it from
<a href="https://github.com/nexB/scancode-toolkit/releases">https://github.com/nexB/scancode-toolkit/releases</a>, I chose scancode-toolkit-XX.X.X_sources.tar.xz, and unpack it</span>
</p>
<h3 style="text-align: left;">
<span style="font-family: georgia;">2. Get opOSSum<br /></span>
</h3>
<p style="text-align: justify;">
<span style="font-family: georgia;">Download recent version from
<a href="https://github.com/opossum-tool/OpossumUI/releases/">https://github.com/opossum-tool/OpossumUI/releases/</a>
- if you're on linux like me, choose OpossumUI-for-linux.AppImage. If
this is your first time using the AppImage format (it was for me) note
that in order to use the file you need to make it executable (right
click, properties, permissions, allow executing file as program). </span><br />
</p>
<h3 style="text-align: left;">
<span style="font-family: georgia;">3. Get opOSSum tool to transform json<br /></span>
</h3>
<p style="text-align: justify;">
<span style="font-family: georgia;">As I mentioned before we need to transform ScanCode output JSON to
opOSSum JSON. Thererfore, head over to
<a href="https://github.com/opossum-tool/opossum.lib.hs">https://github.com/opossum-tool/opossum.lib.hs</a>
and download the sources. </span>
</p>
<p style="text-align: justify;">
<span style="font-family: georgia;">Now at some point - I don't quite remember when - either scanning or
transforming failed because zlib was missing. So just to make sure you
don't run into these troubles, check if it does exist on your
system:</span>
</p>
<p style="text-align: left;">
<span style="font-family: courier;">Bash: <span> </span>whereis zlib</span>
</p>
<p style="text-align: justify;">
<span style="font-family: georgia;">If no results (i.e. zlib locations) show up, get zlib. For ubuntu, zlib
can be installed through your package manager, the package is
zlib1g-dev. </span><br />
</p>
<h3 style="text-align: left;">
<span style="font-family: georgia;">4. Scan the code with ScanCode</span>
</h3>
<p style="text-align: justify;"><span style="font-family: georgia;">Assuming you came here for a reason, you probably already know what you
want to scan. If you're just trying out things, just use one of the
downloads above. </span>
</p>
<p style="text-align: justify;">
<span style="font-family: georgia;">To produce a ScanCode.json, use the following command: </span>
</p>
<p style="text-align: left;">
<span style="font-family: courier;">Bash:<span> </span>/path/to/ScanCode/scancode -clpieu
--json-pp /path/to/output.json /path/to/codeyouwanttoscan/</span>
</p>
<p style="text-align: justify;">
<span style="font-family: georgia;">What's clpieu? These are the options scanning the input for copyright,
licenses, packages, other info, emails and URLs. Other info includes size,
type, date, programming language, hashes etc. (see
<a href="https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html">https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html</a>) </span>
<br />
</p>
<h3 style="text-align: left;">
<span style="font-family: georgia;">5. Convert to opOSSum-json</span>
</h3>
<p style="text-align: left;">
<span style="font-family: georgia;"><span style="font-family: courier;">Bash:
<span> </span>/path/to/oppossum-lib-hs/opossum-lib-exe.sh --scancode
/path/to/output.json > /path/to/output_converted.json</span> </span>
</p>
<p style="text-align: left;">
<span style="font-family: georgia;">where output.json is the file from step 4</span>
</p>
<h3 style="text-align: left;">
<span style="font-family: georgia;">6. Use output in opOSSum</span>
</h3>
<p style="text-align: justify;">
<span style="font-family: georgia;">Run file from step 2 (e.g. by just double-clicking), open
output_converted.json - done. </span>
</p>
<p style="text-align: justify;">
<span style="font-family: georgia;">From here on, consider visiting the
<a href="https://github.com/opossum-tool/OpossumUI/blob/main/USER_GUIDE.md" target="_blank">opOSSum user guide</a>.
</span><br />
</p>
<p style="text-align: left;">
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-fareast-language:EN-US;}
</style>
<![endif]-->
</p>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-84818660603323024622019-01-22T23:11:00.000-08:002019-01-22T23:14:36.765-08:00SiteOrigin / PageBuilder and Wordpress: Copy PagesI recently found myself in need of being able to copy a PageBuilder Wordpress page to another site in my Wordpress site network (happens in multilanguage networks...). Normally I would simply expect to switch to "code view", copy code, create new page in other site, paste code. Unfortunately, PageBuilder does not provide a "code view". Here's how I still managed to not have to recreate the layout in the new site myself:<br />
<br />
Prerequisites: You need SQL access (PHPmyAdmin or whatever floats your boat)<br />
Note: I am still working on Wordpress <span id="wp-version">4.7.12, not tested on any more recent versions. </span> <br />
<br />
1) Save and close original page.<br />
2) Switch to destination network site<br />
3) Create page (name it), leave it empty, close it.<br />
4) Open your mySQL administration console.<br />
5) Find table wp_posts (prefix might be different depending on your setup)<br />
6) Browse to your original post entry. There might be several versions if you use versioning, go to the most recent one (duh). Open / edit entry.<br />
7) Copy contents (contents of post_content).<br />
8) Find your wp_post table for the destination site (probably different prefix if in same database).<br />
9) Find the page you created as destination page in step 3.<br />
10) If there are multiple versions, delete all revisions. <br />
11) Open / edit, paste what you copied into post_content. Make note of post id. Save.<br />
<br />
12) Go to wp_postmeta (of destination site). Browse to entries related to post id. Check if there is a "_edit_lock" entry on your post. Delete that. (I simply deleted all entries belonging to that ID, after all there is not much to loose if you just created the post).<br />
13) Go back to Wordpress. Open destination page.<br />
14) Switch to PageBuilder view, it will ask you if you want to copy the contents to PageBuilder. Accept that.<br />
15) et voilà, that should have worked.<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-22888585798159877492018-11-12T03:55:00.000-08:002018-11-12T06:05:57.104-08:003 Years later: Purchasing Music on Ujomusic with Ether<div style="text-align: justify;">
So I was researching Copyright and Blockchain topics and came across this Medium article: <a href="https://medium.com/hatching-amazing/part-1-how-my-ssn-prevented-me-from-buying-music-on-the-blockchain-and-why-blockchain-for-music-a85eaeaca7ad">https://medium.com/hatching-amazing/part-1-how-my-ssn-prevented-me-from-buying-music-on-the-blockchain-and-why-blockchain-for-music-a85eaeaca7ad</a>. In January 2016, the authors attempted to download Imogen Heap's song from the UjoMusic platform, which allows users to buy and download songs paying with Ether. Imogen Heap started exploring music on the blockchain just before that, as described <a href="https://www.digitalmusicnews.com/2015/10/05/im-imogen-heap-and-this-is-why-im-releasing-my-music-on-blockchain/" target="_blank">in this article</a>. In June 2017, Imogen Heap <a href="https://hbr.org/2017/06/blockchain-could-help-musicians-make-money-again" target="_blank">published an article on HBR</a> on that matter, delving into Ujomusic as well. Since the Medium article is almost 3 years old, and there has been a lot of development in the blockchain area, I gave it another go. Here is what I experienced:<br />
<br />
<b>First of all, at the beginning of all this, I did not own any Ether</b>. The entire experience probably is another thing if you already own some (you can basically skip to step 24 if you already have MetaMask installed). <br />
<br />
For starters, I went over to <a href="https://ujomusic.com/" target="_blank">ujomusic.com</a> to just get to know the platform a little. They address creators and listeners, providing means for music creators to sign up and register their songs on the Ethereum blockchain and allowing music lovers to browse songs and artists. In order to show you just how long the process was, I'll provide a step-by-step of what I did.<br />
<br />
1) I went to ujomusic.com.<br />
2) Clicked "Discover".<br />
3) Clicked on any song (note that I could NOT find a search box, thus I just randomly clicked on some songs and hit play (yes, you can listen to them online without buying them. Also, I did not find Imogen Heap in the list of artists. Later on, I learned that Imogen Heap released her song on the Alpha version of ujomusic. Let's talk about this later)).<br />
4) Ok, let's just get this one song. There is a button below the track saying "Use Web3 to buy". Whatever that means, I'll just click on it.<br />
5) I got redirected to a page explaining how to install a Chrome plugin called "MetaMask" (note that until that point I was using Firefox...). <br />
6) Read the article, copied the URL, switched to Chrome.<br />
7) Inserted the URL into Chrome and followed the instructions to install the MetaMask extension in Chrome - pretty straightforward.<br />
8) After the installation successfully finished, a tiny fox icon appeared in my Chrome toolbar (which I find hilarious on a random note since I just switched to Chrome from fireFOX after all).<br />
9) Out of sheer curiosity I clicked on that icon, and a pop-up opened suggesting the install of a new version. What? Whatever. Just do it. <br />
10) A new tab opened, guiding me through the MetaMask signup process. I am to create a password and accept Terms of Use, Privacy Notice and a Phishing Warning. Uuuuh sounds very promising. <br />
11) For password recovery I got a backup phrase (that was a first to me, I got a number of words in a certain order, had to write them down and for confimation put them in the right order).<br />
12) That's all for the MetaMask account creation. Now the fun began: Depositing Ether into that account.</div>
<div style="text-align: justify;">
<br />
13) After redirection to a different page, I get three options to do the deposit: <br />
a) from existing funds [I don't have any]<br />
b) buy on Coinbase [what's that?]<br />
c) deposit with ShapeShift [apparently that allows you to use a different crypto currency. Don't have any]<br />
14) That leaves me with b) - Coinbase. Clicked on that option, got redirected to a Coinbase page with a dialog window and no means of navigation or information.<br />
15) Specify amount (in Euro, might be due to my locales, I am sitting in Germany). I went for 3 €, had to enter my e-mail address and full name and agree to T&C and Privacy Policies. If that's all that would have been easy. Well it's not.<br />
16) I then had to confirm my e-mail address by entering a code that was sent to that address<br />
17) Next, the dialogue wanted me to add a phone number, which I couldn't skip. For the sake of science, OK. Did it. Got a code sent to my phone, had to enter that into the dialogue. <br />
18) Done? No. Next is ID verification. Seriously? Whyyy? </div>
<div style="text-align: justify;">
<br />
19) At that point I started exploring other options. I had heard about the possibility to obtain Ether through mining. Thus I started putting some minutes into researching mining options. Pretty soon I learned that my 2014 laptop would not be able to provide sufficient mining power to get to any reasonable result. Duh. Researching Coinbase, I learned that it apparently is not meant for use in Germany (I read that on some comments on the internet, not in the T&C, because who reads them, anyways). I decided to ignore that comment for now, and returned to the ID verification process.</div>
<div style="text-align: justify;">
<br />
20) They wanted some kind of picture ID, so I just selected a random student ID just out of curiosity, which, of course, didn't work. Instead, I got hung up on that veryfication screen which I could not abort or go back from. I reloaded the page, it asked my for my phone number and sent me another code via text message. Upon entering that code I was redirected back to where I last stopped the process (at first, this process confused me, but it kept doing that whenever I got thrown off track which turned out to be quite convenient).<br />
21) I tried my driver's licence next. Didn't work. Then I started wondering if they were accepting German IDs at all, and started googling. Apparently, a lot of people seemed to have succeeded. Also, it appears that Coinbase is a legitimate currency exchange which a lot of people seemed to trust in. I took a leap of faith and uploaded pictures of my real ID. (note that I do not feel good about it at all...but curiosity won. Again.)<br />
22) Then they started asking questions like what will I be using the Ether for (online purchases, trades, ...), what's my source of income, last 4 digits of my SSN as well as address information. They know basically everything about me now. Now that I am writing this down I feel even more weird about having done that 3 days ago.<br />
23) Using my VISA card, I finally managed to succeed with my Ether purchase. The amount I purchased immediately showed up in my newly created Coinbase account and instantly thereafter transferred to MetaMask.</div>
<div style="text-align: justify;">
<br />
24) Now I felt like meeting the basic conditions to be a Ujomusic user. So I headed back over to the music platform, selected a song. It says it's free. What? The button beneath the "this record is free" line still says "Use Web3 to buy". Clicking it still redirects to the MetaMask install guide. Did I do something wrong? Clicking on that fox icon in my Chrome toolbar shows that the Ether ended up in my MetaMask account alright. <br />
25) Reload the page. Behold! A MetaMask notification popup asks me to connect with Coinbase. Connect I do. <br />
26) "Use Web3 to buy" now says "sign up to purchase". Hm. Okay. I click that button.<br />
27) I get redirected to a Ujomusic signup page (or is it?) and at the same time another MetaMask notification pops up asking me to "sign" (I guess sign the transaction with Ujomusic). I click "sign". No further signup required, I do not need to provide any information to Ujomusic.<br />
28) Another redirect back to the song page now shows the button saying "buy release" (remember, above that button it says it's free)<br />
29) Click that button. Let's do this. We're almost there! <br />
30) A MetaMask notification details the transaction information. The song is free alright, but I have to pay gas of course, which amounts to 0.33 $ (which seems quite a lot to me, but then again, the network is growing, isn't it). I can still decline or confirm. I confirm. <br />
31) The page now shows a download button, also mentioning that I could always come back and download again. I then get a Windows notification (!) that the transaction was confirmed, and at the same time the music file is downloaded in a zip file. <br />
32) It is an .mp3 file and it does play. Mission accomplished!<br />
<br />
Conclusion 1: Compared to what was tried in 2016 I cannot quite say if using MetaMask and Coinbase is easier than the Kraken solution back in the days, since the authors stopped when they were asked to upload their documents. The process to obtain a song once you already own Ether appears to be a lot more straightforward than the 7 step process that was described in the Ujomusic Alpha guide. No more manually entering addresses, everything is handled through MetaMask. <br />
<br />
But now, to the test! Does this work for Imogen Heap's song on the Alpha Version of Ujomusic, too? The front page of ujomusic.com features a link to learn more about Imogen Heap's song, and redirects to <a href="http://www.alpha.ujomusic.com/" target="_blank">http://www.alpha.ujomusic.com/</a> which leads to <a href="https://imogen2.surge.sh/#/imogen_heap/tiny_human/tiny_human" target="_blank">https://imogen2.surge.sh/#/imogen_heap/tiny_human/tiny_human</a>. This looks a lot more like the project Imogen Heap described: The song is shown in the center of the page, with lines going out from it naming contributing parties such as Junge Deutsche Philharmonie, a Mastering Engineer, the Brass Ensemble etc. offering detailed information about all artists who contributed to that song. The page has a detailed credits section, also the "stems" of the song (unfortunately they won't play, but it was supposed to be the drums, violins, bass, brass, etc. sections of the song which you could listen to), the lyrics, information about what inspired her to do the song and - las but not least - licensing. Now for the disappointing part: "Purchasing is disabled for now". At least the play button at the center of the page lets me listen to a snippet of the song. <br />
<br />
<b>So, let's just try with another song from the Ujomusic beta: Selecting a song, I click "buy release". MetaMask notification opens, giving me info about the transaction, gas is a lot less now by the way (only .16 $), and I decide to buy it. Confirm. Download link clicked, downloading, done. That's easy. </b><br />
<br />
Conclusion 2: I would love to see Imogen Heap's initial idea of a world music database (<a href="http://myceliaformusic.org/">http://myceliaformusic.org/</a>) combined with what Ujomusic now does: Easy music purchases and downloads, while getting lots of background information on the song. I am also still missing a search option in Ujomusic, and downloading a track will give me no information about how I could use that song (i.e. licensing info is missing). There is no blog indicating that Ujomusic plans to move forward, but since the beta is working quite nicely I am not yet ready to give up hopes. What I still don't get though (might be due to my lack of financial background knowledge) is why it has to be so difficult to buy Ether. Why can't I just buy Ether using PayPal or my Visa Card like anything else online without having to provide all my personal information? Wasn't the purpose of Ethereum to also allow anonymous acting on the internet? But then again, do we want that? Thinking about this, not using proper ID verification processes of course also empowers abusive use of anonymous purchasing options. For now, it's "buy hardware to mine or pay with your data [or fetch some on the dark web]". Let's see what the future holds.</div>
Polarishttp://www.blogger.com/profile/08535232759862031946noreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-71328734499669919932016-09-05T12:09:00.000-07:002016-09-05T12:09:13.695-07:00Clone SSD to larger SSD, and how to fix Windows 10 afterwards...Once in a while, one needs new challenges. Or one simply buys a new SSD drive because she likes the idea of more hard drive space. Big mistake?<br />
<br />
As you might have already guessed, I recently acquired a Crucial 750GB SSD drive to upgrade my Lenovo u430 touch machine. The plan was to "simply clone the old SSD to the new SSD", so I got myself a "SSD to USB adapter" and connected the empty drive to my machine. There are various tools out there which claim to be able to clone the drives, but none of them worked for me. Booting into (USB-)Ubuntu, I opened up GParted and noticed that my old SSD already had 8 partitions, some of which could not be read properly...<br />
<br />
Long story short, I ended up formatting the new SSD into a GPT (not MBR!) drive, created the same partitions (just allocated a bit more space to the main ones) and, after chatting with a friend, who mentioned the "DD"-command to me (learn something new everyday, right?) cloned all partitions from old drive to new drive, partition by partition, like <span style="font-family: "Courier New", Courier, monospace;">sudo dd if=sda1 of=sdc1. </span><br />
<br />
<span style="font-family: inherit;">Worked like a charm (at least that's what I tought). I switched drives and fired up the machine - only to run into a BSOD. First it said something like winload.efi was missing, but didn't allow me to enter recovery, later on I was getting the dreaded BDC files missing or corrupted message. </span><br />
<br />
<span style="font-family: inherit;">I figured out I could use the original SSD to get into recovery, but that didn't help much, so I'll just skip over the next 24 hours. By then, I also had issues on the old SSD - I couldn't use the bootrec command any more to fix the MBR / Boot sectors. That's when I (accidentally?) disconnected the new drive while working in recovery - and voila, seems like bootrec has issues with two drives (probably with similar volumes). I managed to fix the original SSD like this:</span><br />
<br />
<span style="font-family: inherit;"><span style="font-family: "Courier New", Courier, monospace;">bootrec /fixmbr</span></span><br />
<span style="font-family: inherit;"><span style="font-family: "Courier New", Courier, monospace;">bootrec /fixboot</span></span><br />
<span style="font-family: inherit;"><span style="font-family: "Courier New", Courier, monospace;">bootrec /scanos</span></span><br />
<span style="font-family: inherit;"><span style="font-family: "Courier New", Courier, monospace;">bootrec /rebuildbcd</span></span><br />
<br />
<span style="font-family: inherit;">Since I figured that I won't be able to use the old SSD's recovery console to fix the new one, I finally created a recovery / installation disk (I didn't have any disk / USB media holding a Win 10 installation, so I googled the Microsoft Windows Media Creation Tool and used it to create a recovery DVD). </span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Now the bootrec /fixmbr, bootrec /fixboot and bootrec/scanos worked, but I couldn't manage /rebuildbcd to complete successfully (it couldn't access the drive somehow, claiming it couldn't find the required system device). I tried it all, bcdboot, diskpart, renaming drives, chkdsk, you name it.</span><br />
<br />
<span style="font-family: inherit;">Some more googling, and someone mentioned somewhere that it could help to boot the installation media dvd (U)EFI version instead of the (legacy) CD-Drive. I gave it a try and voilà - bootrec /rebuildbcd finished without any complaints. Reboot, done. If only someone had told me earlier to use this damn disk, would have saved like a week of work, aggression and frustration... :-D </span><br />
<span style="font-family: inherit;"><span style="font-family: "Courier New", Courier, monospace;"><span style="font-family: inherit;"> </span> </span> </span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-45428360171916609372016-07-16T12:55:00.001-07:002016-07-16T12:56:41.726-07:00How to reanimate dead Leonovo u430 touchSo I opened up my Lenovo Ideapad 430 touch today because I wanted to check whether my new SSD drive would fit in. When I reassembled it to transfer the data, I connected it to power and nothing happened. Not even the A/C light came on.<br />
<br />
Since I didn't screw back all the screws, I opened it up again and put everything back into place (suspecting it was something to do with anti static precautions, but what do I know of physics...)<br />
<br />
Well, it didn't help, and I got kind of freaked out. I googled and found nothing, except a fairly old entry about ThinkPads mentioning the Power Button.<br />
<br />
Out of some kind of weird thought I pressed the Power Button for like 15 seconds - and a light came on. Pressed it again, and the machine came alive. [I'll spell the Power Button with Caps from now on since it is the HOLY Power Button obviously.]<br />
<br />
Tech guys will most likely laugh at me now, but since I read nothing about this (and since I'm really glad I don't have to get a new Laptop or go ask some guys for help) I decided to share. Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-9737416633245471682016-02-05T06:03:00.000-08:002016-02-05T06:03:24.391-08:00Eureka! Intel N 7260 Issue Appears To Be SolvedFor a while now I've been having annoying trouble with my wireless adapter (Intel N 7260 - yes, I know it is known to cause trouble...). Not only did it not connect properly, it broke the wifi and the internet connection of the router in a way that no other device in the network could access the internet any more.<br />
<br />
I might just have discovered another possible cause: And guess what, Windows took me there. I know, right? So, this is what I did (I am on Win 10 right now):<br />
<br />
- It did not connect properly, as usual (for me this only happens when at home, where I am using a Speedport W 504V router) - so I ran Windows "troubleshooting" (right-click on the wifi icon in the task bar to get there)<br />
- It told me that there was an issue with a network protocol missing on my machine (which is rather ridiculous)<br />
- BUT at the bottom of the window it offered me a link to detailed information about the issue, which took me to a quite detailed troubleshooting report<br />
- This report lists all kinds of information about the device, known networks and available networks, and at the very bottom something very interesing was laid out to me, which confirmed my suspicions: My wireless adapter is not compatible with the router (access point). Go figure. Well, anyways, not like it was configured. Turns out that Windows 10 has quite detailed energy management settings, which seem not to be compatible with all network access points.<br />
<br />
To solve the issue: Right-Click the battery icon in your task bar, open energy management. Go to your active energy management mode and click "change settings" and click on "change advanced settings". Go to your wireless device, and check if both battery and a/c-mode are set to medium.<br />
<br />
The theory has yet to be confirmed after an extended testing period, but for now, it works!<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-44719426512901296342015-01-29T22:31:00.001-08:002015-01-29T22:33:11.429-08:00Galaxy S5 Lollipop Update IssueDisclaimer: getting anything wrong with flashing might brick your device - this is not a manual. I am not responsible for any damage to your phone or data... <br />
<br />
-- <br />
<br />
So I finally checked the software update availability on my Samsung Galaxy S5, and guess what - the Android 5.0 update was available. Finally. I cleared up some space on my phone (it claims that it needs 3 GB of free space for the installation) and started the update. It is a big image (1.4 GB), so it takes a while to download, then the phone shuts down, restarts, and starts to install. I started wondering when the installation process started at 25%, went down to 1, up to 20, 30% and then - "error". Phone restarts, everything OK except for the fact that I still have KitKat on my phone.<br />
<br />
Tried again. Same result. Tried again. Same result. Googled it. No results. Nobody seemed to run into that same error. There was indeed an error message after the phone restarted successfully - "Try it again, try Kies or go to a service center" (I paraphrased). Service center? Nope, no time, plus I got the phone in Germany and I wont be in Germany for quite some time. <br />
<br />
So I tried Kies. Downloaded the software, started the firmware upgrade - download interrupted at some point. Tried again. Tried again. Tried again - it started the installation process on the phone, finally. But it stopped at about 80%, complaining about the size of the image.<br />
<br />
Again, no real help on Google. I read something about that you could run into trouble if you made modifications to the ROM - my phone is NOT (yet) rooted, everything as I got it, I updated everything there was to update.<br />
<br />
Kies suggested an emergency recovery. I tried that. It stopped at like 80%, leaving me with a phone I couldn't even get into recovery mode. Kies suggested emergency initialization - meaning that all data would be lost. Nah, I wasn't that desperate yet - download mode was still working! <br />
<br />
After some thinking I decided to flash that thing myself. I got Odin and the current firmware (I decided to go for 5.0 right away) from <a href="http://www.sammobile.com/" rel="nofollow" target="_blank">SamMobile</a> (I checked the exact version of my phone under the battery pack and selected "Germany" as a country), unzipped the file, and started flashing. Some minutes later the installation completed, the apps were updated and my phone back to business. No loss of data.<br />
<br />
Thank you, Samsung, for nothing. The only reason I could think of that might have caused this issue is the regional differences. I am using the phone with a foreign SIM card, in a foreign country - probably a wrong ROM was selected by the general Samsung update process. Somewhat embarrassing...<br />
<br />
-- <br />
<br />
TL, DR:<br />
If you run into update issues with your Galaxy S5, consider flashing with Odin right away. Might save you some time and energy. Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-539444620951808972014-05-17T14:40:00.003-07:002014-05-17T14:40:55.131-07:00Pi Access Point with RTL9182CU-AdapterWell, I tried a long time and this is mainly a note to myself:<br />
<br />
go here first: http://blog.sip2serve.com/post/38010690418/raspberry-pi-access-point-using-rtl8192cu <br />
<br />
then go here: https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/install-software<br />
<br />
you do not need to fix the Invalid Argument error, just apply the WPA-Supplicant fix from here: http://forums.adafruit.com/viewtopic.php?f=19&t=47716&start=15Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-49957164358852357902013-09-06T03:21:00.000-07:002014-02-16T13:48:36.048-08:00Something about LaTeX...<div style="text-align: justify;">
Currently I am writing a paper in LaTeX, using Eclipse as an editor and jura as the document type. The paper is restricted to 20 pages, and both the page format and the tracking, as well as the line spacing, are defined and cannot be played with.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I spent some time fiddling with the jura files to get more space, and I came across some interesting possibilities (at least I think they are). As I found nothing on them on the internet I thought I'd share it with you, even though this might be very specific to the _old_ jura package<b> which still had the alphanum.sty file</b> (just found out that there is a newer version of the jura package which even has comments, the alphanum.sty is included in the jura file - you can obtain it <a href="http://www.ctan.org/pkg/jura" target="_blank">here</a> - the regular jura package is part of the texlive and miktex distributions).<br />
<br />
As a result of my research, I found out how to achieve so called runin headings:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><i>old:</i></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><b>A.I.1.b. This heading likes to stay in the text</b></span><br />
<span style="font-family: "Courier New",Courier,monospace;">and this is the content. It used to start only in the next line.</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><br /><i>new:</i></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><b>A.I.1.b. This heading likes to stay in the text </b>and this is the content, starting right after the heading. </span><i> </i> <br />
<br />
One might ask why one might want to use it like this when there is a way to skip the text of the heading and just use the numbers. But sometimes, papers tend to get complicated, especially when you are forced to take out free lines - it just gets messy. So, a little structure can be created by including heading texts. This is what I think :-D</div>
<br />
- Accessing the critical files, alphanum.sty and jura.cls, in the first place<br />
- Editing the short heading format (toc* and sub*)<br />
- Adjusting the space before and after the headings. <br />
- Getting the text to be in line with the long heading<br />
<br />
<br />
<h3>
Accessing the files</h3>
<div style="text-align: justify;">
For all of the other tasks we'll need to edit the alphanum.sty file. Find out where your alphanum.sty file is located by checking out your LaTeX log file, it should point you to the correct directory.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This goes for all of you: Create a backup of the file. Open it with your normal user through your
file browser, copy the contents to a new editor window, save it
somewhere. </div>
<br />
<h4>
... on Linux:</h4>
<div style="text-align: justify;">
Using texlive on Ubuntu 12.04, you'll probably find it in something like /usr/local/texlive/2012/texmf-dist/tex/latex/jura/alphanum.sty. Remember, to edit it you'll need sudo, your normal user will be able to view it, but cannot edit it.</div>
<br />
For GUI users: If you don't know how to handle this -<br />
<br />
Open the file in an editor with sudo rights. To do this...<br />
<ol><ol>
<li>Press<i><b><span style="font-family: "Courier New",Courier,monospace;"> ctrl+alt+t</span></b></i> - a terminal window should open</li>
<li>Type <span style="font-family: "Courier New",Courier,monospace;">sudo gedit</span> <i><span style="font-family: "Courier New",Courier,monospace;"><path to your file></span></i> and hit <b>enter </b><br />(you could use any other editor as well) </li>
<li>You'll be asked to enter your password. Type in your password, don't be confused - you won't see any characters or asterisks while typing. Hit <b>enter</b></li>
<li>A new text editor window will open. Do not close the terminal. </li>
</ol>
</ol>
<h4>
... on Mac:</h4>
<div style="text-align: justify;">
I won't explain this in detail, if you want to know, just leave a comment. It is similar to Linux, probably a different editor. I simply used <b>vi</b> to edit the file.Thus, in a terminal window, enter <span style="font-family: "Courier New",Courier,monospace;">sudo <i>vi </i></span><i><span style="font-family: "Courier New",Courier,monospace;"><path to your file><span style="font-family: inherit;"> </span></span></i><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: inherit;">and enter your password.</span></span></div>
<br />
<h4>
<b><span style="font-weight: normal;"><b><span style="font-family: inherit;">... on Windows: </span></b></span></b></h4>
<div style="text-align: justify;">
<span style="font-weight: normal;"><span style="font-family: inherit;">Open the command line as an administrator user. To do this, search for <b>cmd </b>and either hit </span></span><b><span style="font-weight: normal;"><span style="font-family: "Courier New",Courier,monospace;"><b><span style="font-family: inherit;"> </span></b></span></span><i><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: inherit;"></span>ctrl+shift+enter </span></i></b><span style="font-family: inherit;">or perform a right click on the menu entry and select "Run as administrator". Confirm the request to run it as an admin. </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">I am not very used to using the Windows cmd, but this worked for me - just enter the path to your file. In my case, this was <span style="font-family: "Courier New",Courier,monospace;">C:\Program Files\MiKTeX 2.9\tex\latex\jura\alphanum.sty</span>. You can use tab to autocomplete the path. Once you entered the path, just hit enter. Windows should open the default editor. </span></div>
<br />
<h3>
<span style="font-family: inherit;">Editing the short heading format (toc*{} and sub*{})</span></h3>
<div style="text-align: justify;">
<span style="font-family: inherit;">The jura package provides a short heading format, which will only display the heading number in the main matter, the full heading will be in the table of contents. I found this pretty convenient as it saves a lot of characters. But by default, the numbers are pure text, and I wanted them to at least be bold, so that they can be spotted easily. To achieve this I added \textbf or \bfseries to every heading in my first paper, because I did not know how to edit all of the entries at once. </span></div>
<br />
<span style="font-family: inherit;">But now we found our config files - <span style="font-family: "Courier New",Courier,monospace;">alphanum.sty</span>! This is where all the magic happens. So, open the file as explained above, and look for a line that says <span style="font-family: "Courier New",Courier,monospace;">\newcommand*{\J@ShortToc}[1]{\stepcounter{lvl\alph{tiefe}}\J@Number.</span> <span style="font-family: inherit;">To get a bold faced heading number for the short format, just add \textbf{} around the number - the line should now look like this: </span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: inherit;"><span style="font-family: "Courier New",Courier,monospace;">\newcommand*{\J@ShortToc}[1]{\stepcounter{lvl\alph{tiefe}}<span style="color: red;"><b>\textbf{</b></span>\J@Number<span style="color: red;"><b>}</b></span> </span> </span></span><br />
<br />
Save and enjoy.<br />
<br />
<h3>
Adjusting the space before and after the long headings</h3>
<div style="text-align: justify;">
By default, long headings leave quite some space before and after them. Not good for papers with a page restriction... But this can be fixed. Open the <span style="font-family: "Courier New",Courier,monospace;">alphanum.sty</span> again and look for this block of code:</div>
<div style="text-align: justify;">
<span style="font-family: "Courier New",Courier,monospace;"></span></div>
<br />
<span style="font-family: "Courier New",Courier,monospace;">\newcommand*{\J@LongToc}[2][]{%<br />\@startsection{lvl\alph{tiefe}}{\value{tiefe}}{0pt}<br />{\ifnum\value{tiefe}=1 -4ex plus-1,5ex minus-0,ex\else<br />-2,7ex plus-0,8ex minus-0,2ex\fi}<br />{\ifnum\value{tiefe}>7 -1em plus-0,5em\relax\else<br />0,6ex plus0,3ex minus0,1ex\fi}</span><br />
<br />
"Tiefe" refers to the level of the heading, thus<span style="font-family: "Courier New",Courier,monospace;"> tiefe = 1</span> means the first heading level. <span style="font-family: "Courier New",Courier,monospace;">Tiefe > 7</span> means all heading levels higher than seven. <span style="font-family: "Courier New",Courier,monospace;">-4ex</span> or <span style="font-family: "Courier New",Courier,monospace;">-2,7ex</span> seems to be the space before the heading. Set it to zero if you like - just play around with the numbers until your file looks as you please. <br />
<br />
<br />
<h3>
"Inline" or "runin" headings</h3>
<div style="text-align: justify;">
In my current paper, I decided not to use the short heading because I did not want to put in any blank lines between the paragraphs, thus the text would not look very structured. I am using the long headings now. But the long headings have a linebreak by default - so the text after the heading will start in a new line. What an aweful waste... Just find the above mentioned paragraph again and have a look at my changes - I adjusted this paragraph (i. e. played with the numbers):</div>
<br />
<span style="font-family: "Courier New",Courier,monospace;">\newcommand*{\J@LongToc}[2][]{%<br />\@startsection{lvl\alph{tiefe}}{\value{tiefe}}{0pt}</span><br />
<span style="font-family: "Courier New",Courier,monospace;">{\ifnum\value{tiefe}=1 -4ex plus-1,5ex minus-0,ex\else<span style="color: red;">-0,7ex plus-0,5em minus-0,2ex\relax</span>\fi}<br />{\ifnum\value{tiefe}>7 -1em plus-0,5em\relax\else -1em plus-0,5em<span style="color: red;">\relax</span>\fi}</span><br />
<br />
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you feel like now it looks too tight, note that there are ways to insert space between headings you want to make look special - try <span style="font-family: "Courier New",Courier,monospace;">\medskip</span> or <span style="font-family: "Courier New",Courier,monospace;">\smallskip</span> in your .tex file (insert it before the heading).</div>
<div style="text-align: justify;">
Again, if you have any questions, just leave a comment. Hope this helped at least some of you. </div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-69763669948004862632013-03-26T08:52:00.000-07:002013-03-26T08:52:36.384-07:00Joomla! 2.5 / Apache: File Downloads, docx etc.I let my users upload files and link to them in their articles. As I want to force them to download the files directly (and don't want them to view it in the browser), I am using a file called download.php which I include in the URLs.<br />
<br />
Thus, instead of "<span style="font-family: "Courier New",Courier,monospace;">/myfolder/myfiles/myfile.pdf</span>" the <span style="font-family: "Courier New",Courier,monospace;">href</span> attribute of the link will be like "<span style="font-family: "Courier New",Courier,monospace;">download.php?filename=/myfolder/myfiles/myfile.pdf</span>".<br />
<br />
In download.php I declare headers and do some things about the filename. It was always working fine for pdf or doc files, but there seemed to be something wrong with the "new" file formats of Office (docx, ppsx etc.) - if a user clicked on that file, it would be downloaded, but could not be opened (the message said something like "cannot read file"). A comparison of the original file and the downloaded file showed no difference except for one character which was not even visible. Fun fact: OpenOffice could open the file without any problems... Lots of pages suggested to check the MIME type configuration of apache in /etc/mime.types, but the docx formats were already there.<br />
<br />
I did a lot of research and came across a post on <a href="http://php.net/manual/de/function.header.php">http://php.net/manual/de/function.header.php</a> by <a class="name" href="http://www.php.net/manual/de/function.header.php#88038"><strong class="user"><em>eonrglez at gmail dot com.</em></strong></a><br />
<strong class="user"><em><br /></em></strong>
<span class="user">I included all the header information suggested in this post (except for the file size), from Pragma to Content-Transfer-Encoding, and voilà - it works. </span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-49255639172518517842013-03-21T08:05:00.002-07:002013-03-21T08:06:17.221-07:00Joomla! 2.5: Finally - A Soulution For Applying Changes (Front End Editing)This is about (front end) creating / editing an article.<br />
<br />
I have been looking for a way to save (apply changes) in Joomla's front end for a really long time. What I needed was just a button which would let me save changes without redirecting somewhere else... <br />
<br />
Recently I came across <a href="http://forum.codejoomla.com/open-source/joomla/front-end-apply-button-3212.html" target="_blank">this page</a>.<br />
<br />
I applied all suggested changes to my page, and it works! On the downside you need to edit Joomla core files, and the changes made to them will probably be lost after the next update... Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-31975643115033110202013-03-19T10:27:00.000-07:002013-03-19T11:04:37.293-07:00Joomla! 2.5: Another LDAP (?) IssueThis one was really driving me crazy. Really.<br />
<br />
But we can't blame LDAP for that, at least I don't think so...<br />
<br />
<br />
We have a LDAP authentication set up which is working really well. Except when a user enters a wrong password - then he just gets a blank page. The same is the case for articles with a user restriction (user need to be logged in to view the article) - again, just a blank page.<br />
<br />
Turns out the blank page is not as blank as it seems - the source is there, including a nice error message. And a line somewhere in the head saying<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;">html{display:none;}</span><br />
<br />
<span style="font-family: inherit;">A lot of research took me to <a href="http://forum.codejoomla.com/open-source/joomla/blank-admin-login-after-jupgrade-j15-gt-j17-urgent--6242.html" target="_blank">this page</a>, and I decided to try the following, out of some instinct:</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><i>"Comment out line 823 (or thereabouts) in:<br />libraries> joomla > html > html> behavior.php<br />$document->addStyleDeclaration('html { display:none }');<br />To comment out, just add 2 slashes "//" in front of the line."</i></span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Works like a charm. I am afraid the change will be undone by the next Joomla update, but I'll try to report a bug. In the meantime I hope this helps. Happy coding!</span><br />
<br />
<span style="font-family: inherit;">edit: Someone reported a bug on a similar problem, seems like version 2.5.9 will not have this line any more. See <a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=29705" target="_blank">here</a>. </span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-75696069380041368102013-02-20T03:25:00.000-08:002013-02-20T09:42:22.842-08:00Recover Joomla PhpMyAdmin MySQL DatabaseThis morning I found myself confronted with a new problem:<br />
<br />
Our server crashed, we had to set it up again - from scratch. Fortunately, we did have some backups - the Joomla! files, and the mysql folder (on Linux: /var/lib/mysql).<br />
<br />
(We are using a Linux server with mysql and phpmyadmin.)<br />
<br />
I then tried to recover our database. What I thought: Just copy the contents from the database backup folder (mysql/joomla) to the mysql folder on the server and everything should be fine. That was what they said on the internet, too. Turns out there were only .frm files in that folder, no .myd etc. Turns out that .frm only contains the table structure. But where is my data?<br />
<br />
Everything's not lost.<br />
<br />
I found a huge file in the mysql backup folder, called ibdata1.<br />
<br />
So what you need to do now is (instructions are for Linux):<br />
<br />
- Stop your mysql service<br />
<span style="font-family: "Courier New",Courier,monospace;"> sudo stop mysql</span><br />
- Copy that ibdata1 file to the /var/lib/mysql folder (consider making a backup of the existing ibdata1 file) <br />
<span style="font-family: "Courier New",Courier,monospace;"> cd /var/lib/mysql</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> sudo mv ibdata1 ibdata1backup</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> sudo cp <backupfolder>/ibdata1 /var/lib/mysql</span><br />
- check that permissions are set to mysql as owner and group<br />
- restart mysql service<br />
<span style="font-family: "Courier New",Courier,monospace;"> sudo start mysql</span><br />
<span style="font-family: inherit;">- if you set up any new passwords, check that Joomla! has the correct password in its <span style="font-family: "Courier New",Courier,monospace;">configuration.php</span> file for mysql.</span><br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-81344887767435121992012-11-25T02:53:00.001-08:002012-11-25T02:55:10.659-08:00Joomla! 2.5: Multiple views, one modelHere goes MVC again: I was a bit confused that every time I created a second or third view for a component, I had to create a separate model for it. Did not make sense to me - I had the necessary algorithms in the model for the first view, did I really need to do copy & paste? I hate it! Redundancy, redundancy, redundancy.<br />
<br />
That case occurred in my current project - I created user profiles and needed an "edit" view. The data is the same, but I need to have the data in editable text fields instead of fixed labels, and maybe some other buttons here and there... <br />
<br />
Well, some time later I realized that I just did not quite understand what Joomla! acutally means by "view". And that there is something called "layout".<br />
<br />
Long story short: If you have a model that provides all necessary information and you just want to have a different presentation of it, just add a new .php file to your <span style="font-family: "Courier New",Courier,monospace;">views/<yourviewname>/tmpl</span> folder - let's call it "layout2". Layout2.php has acces to all data default.php can access - they use the same model. If you want to use it on your site, just add &layout=layout2 to your URL (it would then be something like <span style="font-family: "Courier New",Courier,monospace;">index.php&option=com_yourcomponent&view=yourview&layout=layout2</span>...).Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4958714258226674633.post-87355460594041453422012-11-17T07:26:00.000-08:002012-11-17T07:27:42.840-08:00Joomla! 2.5: Table sorting / The MVC problem.Well, I feel kind of embarrassed that I need to write about this topic... I always thought I kind of understood MVC architecture. But this one drove me nuts:<br />
<br />
I am working on a custom article management system for my front end users. I know that there might be (for sure) extensions to accomplish this, but you know how it is... you want to do it yourself. Everything worked out fine, until I got to the point of sorting the article table (alphabetically, chronologically etc.). This, too, could be done with extensions or existing jquery / other techniques. Could be. <br />
<br />
Well, I decided to do it with the traditional Javascript / Ajax / PHP approach. Jacvascript function triggers AJAX request, AJAX request goes to controller, controller queries the database and creates an array that can be handled by the view. <br />
<br />
So far so good. But how do I get the view to reload without refreshing the entire page (which would obviously loose the sort order)? I made it as far as updating the model, but I couldn't manage an update of the view - yes, it reloaded, but the array with the data for the table seemed to be empty, even though I set it. I was about to do copy and paste... but I am very reluctant to redundancy.<br />
<br />
Eventually, my controller calls a custom view method and passes the array (without using the model), then the controller calls a custom display method. And voilà, it works. <br />
<br />
The code: <br />
<br />
controller.php<br />
...<br />
<span style="font-family: "Courier New", Courier, monospace;"> $db->setQuery($query);<br /> $result = $db->loadObjectList();</span><br />
<span style="font-family: "Courier New", Courier, monospace;"> $view = $this->getView(<i><viewname></i>, 'html');<br /> $view->setMyArticles($result);<br /> $view->mydisplay();</span><br />
<br />
If your view class name is "MyviewViewSpecialname", then <i>viewname</i> would be "specialname" (lowercase). This is important if you have multiple views.<br />
<br />
view.html.php<br />
<span style="font-family: "Courier New",Courier,monospace;"> // Overwriting JView display method<br /> function display($tpl = null) <br /> {<br /> // Assign data to the view<br /> $this->msg = $this->get('Msg');<br /><br /> $this->myarticles = $this->get('MyArticles');<br /> <br /> // Check for errors.<br /> if (count($errors = $this->get('Errors'))) <br /> {<br /><br /> JError::raiseError(500, implode('<br />', $errors));<br /> return false;<br /> }<br /> // Display the view<br /> parent::display($tpl);<br /> }</span><br />
<span style="font-family: "Courier New", Courier, monospace;"> public function mydisplay($tpl = null){<br /> parent::display($tpl);<br /> }<br /> public function setMyArticles($array){<br /> $this->myarticles = $array;<br /> }</span><br />
<br />
<span style="font-family: inherit;">This is it! This cost me about 20 hours to figure it out... Hope it can help you, too!</span><br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-63611885655351096512012-10-16T15:10:00.002-07:002012-10-16T15:10:58.404-07:00Creating a Joomla! Module PositionI know how it works. At least I did, once... I tend to forget, thus I'll write it down once and for all.<br />
<br />
<h3>
Step 1: Adding the position to the correct xml file</h3>
Go to your template's root folder (usually <span style="font-family: "Courier New",Courier,monospace;"><Joomla-Root>/templates/<your-template></span>) and open <span style="font-family: "Courier New",Courier,monospace;">templateDetails.xml</span> in a text editor. Scroll down 'til you find <span style="font-family: "Courier New",Courier,monospace;"><position></span>-tags. At the end of the row of position tags, add another one (just clone the last tag and increase the number by 1). Save.<br />
<br />
<div align="center">
<table><tbody>
<tr><td><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-41nvCjVTjdk/UH3T9n7L5nI/AAAAAAAAAi4/uQUfagHBOzg/s1600/positions1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="200" src="http://2.bp.blogspot.com/-41nvCjVTjdk/UH3T9n7L5nI/AAAAAAAAAi4/uQUfagHBOzg/s200/positions1.png" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">before</td></tr>
</tbody></table>
</td><td><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-3vN-XYEaBrg/UH3T_BNl3CI/AAAAAAAAAjA/Z03_LHVg0xs/s1600/positions2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="200" src="http://3.bp.blogspot.com/-3vN-XYEaBrg/UH3T_BNl3CI/AAAAAAAAAjA/Z03_LHVg0xs/s200/positions2.png" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">after</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
</div>
<br />
<h3>
Step 2: Check if what you just did worked</h3>
Go to your Joomla! backend. Open Extensions > Module Manager. Select a module (open the module item by clicking on it). Click "Select Position". Does the position you just created appear in the table? Good!<br />
<br />
<br />
<h3>
Step 3: Name your position (optional)</h3>
Now you can give your position a name. The name is what appears in brackets in the position table. Go to the <span style="font-family: "Courier New",Courier,monospace;"><Joomla-Root>/administrator/language/<your-language></span> folder. Open file <span style="font-family: "Courier New",Courier,monospace;"><your-language>.com_modules.ini</span> (for <span style="font-family: "Courier New",Courier,monospace;">example en-GB.com_modules.ini</span>) in a text editor. Look for a line that reads '<span style="font-family: "Courier New",Courier,monospace;">COM_MODULES_POSITION_POSITION-18="Position 18"</span>' (where 18 would be the number of your new position -1) and add a line for your new position (i. e. '<span style="font-family: "Courier New",Courier,monospace;">COM_MODULES_POSITION_POSITION-19="Position 19"</span>'). Save. (By the way: you can specify whatever you want to be the name of your position. It doesn't have to be "Position -<NumberOfPosition>")<br />
<h3>
<br /></h3>
<h3>
Step 4: Insert the position in index.php</h3>
All that's missing is the tag that specifies where your position should be included. Go to your template's root folder (usually <span style="font-family: "Courier New",Courier,monospace;"><Joomla-Root>/templates/<your template></span>) and open index.php in a text editor. Go to the position where you want to include the position and insert a tag similar to this one:<br />
<span style="font-family: "Courier New",Courier,monospace;"><jdoc:include type="modules" name="position-19" /> </span><br />
Replace "position-19" with the correct information you entered in the xml file (this is NOT the name you specified in the language file!).<br />
<h3>
<br /></h3>
<h3>
Step 5: Assigning a module to the position</h3>
Well, you should know how this works. Just open Extensions > Module Manager in your Joomla! backend, open a module, click "select position" and select your new very special own position. Reload your page to see if everything worked (clearing your cache might be necessary).<br />
<br />
<br />
Let me know if you had any problems with this!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-41095033860084940682012-10-13T02:24:00.001-07:002012-10-13T02:26:01.105-07:00"Fehlerhafter Code"One day I tried to log in to my Joomla 1.7.1 frontend area as a member of the site. I entered the correct contact information, but on clicking "Log In" I just got a white screen with the message "Fehlerhafter Code". Google only wanted me to update the page (which needs to be done sometime, I know...) - so that was not very helpful.<br />
<br />
Suddenly I remembered that I had changed the language settings of my page some time ago - it was German before, and I changed it to English. So far, so good, but I apparently forgot to set the default language for the frontend - I removed the German language pack so that only English was left. But I did not click on the "default" star icon (needs to be yellow).<br />
<br />
Go to "Extensions" - "Language Manager" - select the tab "Installed - Site" and make sure you have a default language selected. <br />
<br />
When I returned back to the frontend, I cleared the cache and everything worked fine again...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-61912960457173299372012-08-12T06:19:00.000-07:002012-08-12T06:19:17.713-07:00Win 7 / App Data Folders EmptySome time ago, I observed something strange happening to my laptop: all of my menu entries in my start menu (and "all programs" menu) vanished, the task bar icons changed into a "unknown file type" icon, and nothing but Firefox was working any more. My personal files didn't seem to be affected, except for the folder "App Data". It still had all of its folders, but they were left empty.<br />
<br />
I could literally watch the menu items disappear. I could do nothing against it.<br />
<br />
A virus? A bug? I have no clue.<br />
<br />
Very nice: all of my emails were gone, too. Of course. Including all of my vacation plans, confirmation emails etc.<br />
<br />
A very good friend of mine pointed to a free tool called "<a href="http://www.shadowexplorer.com/" rel="nofollow" target="_blank">Shadow Explorer</a>". I learned that Windows 7 creates "<a href="http://en.wikipedia.org/wiki/Shadow_Copy" rel="nofollow" target="_blank">Shadow Copies</a>" of nearly everything on the computer. This tool enables you to see these copies (up to about 2 or 3 weeks in the past) and recover the files.<br />
<br />
I was able to recover most of my missing app data files, including mail etc..<br />
<br />
<br />
Good Luck!<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-81606414108337583332012-07-06T13:42:00.000-07:002012-07-06T14:32:10.591-07:00Joomla / Eclipse: Use Eclipse to edit filesEven though I could use any Editor or Notepad, after some days of Joomla! I was yearning for some syntax highlighting and maybe even automatic code completion... I did some Java programming in the past, and I am really used to the Eclipse IDE.<a href="http://www.eclipse.org/downloads/packages/eclipse-ide-javascript-web-developers/indigosr2" rel="nofollow"> Eclipse IDE for JavaScript Web Developers</a> seemed to be a good deal for what I was up to do, so I gave it a try.<br />
<br />
I feel kind of stupid even posting about this, but upon starting up Eclipse, I started to wonder how I would do that - being that Eclipse works with projects, and I didn't want to put all of my components into an Eclipse workspace, and I didn't want to put up a subversioning system.<br />
<br />
Turns out it is quite simple: Right-click somewhere in the package explorer, select 'New', 'Project...'. In the dialog, open the folder 'General' and select 'Project'. Click 'Next'. For the name, I usually put the com_componentname / mod_modulename, as in my file system. But I don't think it matters. Then uncheck the box 'Use default location' and click 'Browse...'. Select your component folder and click 'Finish'. Voila!<br />
<br />
Nothing is copied or messed with, you are working on the files in your file system.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-33052382979366792412012-07-06T12:42:00.000-07:002012-07-06T13:04:11.974-07:00Joomla! 2.5: Component as ArticleCan you put a component on a page together with other articles? Like, for example, to have a component and a blog layout on the "Home" page?<br />
<br />
Yes, you can! There are some nice extensions that allow for this. I used the "Plugin Include Component" plugin, which is available on <a href="http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/embed-a-include/8741?qh=YToxNTp7aTowO3M6NzoiaW5jbHVkZSI7aToxO3M6ODoiaW5jbHVkZWQiO2k6MjtzOjg6ImluY2x1ZGVzIjtpOjM7czo5OiJpbmNsdWRpbmciO2k6NDtzOjk6ImluY2x1ZGVkcyI7aTo1O3M6ODoiaW5jbHVkZXIiO2k6NjtzOjk6IidpbmNsdWRlJyI7aTo3O3M6ODoiJ2luY2x1ZGUiO2k6ODtzOjk6ImNvbXBvbmVudCI7aTo5O3M6MTA6ImNvbXBvbmVudHMiO2k6MTA7czoxMToiY29tcG9uZW50J3MiO2k6MTE7czoxMDoiY29tcG9uZW50JyI7aToxMjtzOjk6ImNvbXBvbmFudCI7aToxMztzOjExOiJjb21wb25lbnRzJyI7aToxNDtzOjE3OiJpbmNsdWRlIGNvbXBvbmVudCI7fQ%3D%3D" rel="nofollow">extensions.joomla.org</a>. With this plugin, you simply create an article that contains a special tag, indicating the component to include. <br />
<br />
Just like this:<br />
<br />
Install the plugin and put the following code in whatever article you need it in (substitute 'componentName' and 'viewname' for your component's and view's name...).<br />
<br />
<div style="font-family: "Courier New",Courier,monospace;">
<span class="xml-text">{component url='index.php?option=com_<i>componentName</i></span><span class="xml-entity">&view=<i>viewname</i>'}</span></div>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4958714258226674633.post-67696704606480889832012-07-06T10:42:00.000-07:002012-07-06T13:04:25.296-07:00Joomla! 2.5: Menu ItemsSome time ago, I started to create my own components. Everything was working fine, but there was one thing that bugged me (even though it is not really necessary... it just looked strange):<br />
<br />
When I create a link to my component, I always ended up with something like this in my menu manager:
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-TXsX6-5xm7I/T_cSllOJHbI/AAAAAAAAAN4/7kJszt-ETKY/s1600/trainingmaterial.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="31" src="http://1.bp.blogspot.com/-TXsX6-5xm7I/T_cSllOJHbI/AAAAAAAAAN4/7kJszt-ETKY/s400/trainingmaterial.bmp" width="400" /></a></div>
<br />
Similar thing for the menu item type:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-IN9IYGj6kLQ/T_cTWThM4KI/AAAAAAAAAOE/Nr9qR7q_jNw/s1600/trainingmaterial2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="61" src="http://4.bp.blogspot.com/-IN9IYGj6kLQ/T_cTWThM4KI/AAAAAAAAAOE/Nr9qR7q_jNw/s320/trainingmaterial2.bmp" width="320" /></a></div>
<br />
I felt like I somehow missed something, but the tutorials did not say anything about it. After playing around for a little while, I found out that the solution actually is pretty simple: The site > views > <i>viewname</i> > tmpl > default.xml file specifies these texts. Joomla! will look for these keys in the language files. Thus, you just need to add some entries to the language files and voila - everything looks nice and clean, just like this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-4RA5brgD58o/T_cU6Pv1YJI/AAAAAAAAAOU/v1licQK344o/s1600/trainingmaterial_correct.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="16" src="http://2.bp.blogspot.com/-4RA5brgD58o/T_cU6Pv1YJI/AAAAAAAAAOU/v1licQK344o/s320/trainingmaterial_correct.bmp" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-k_-ZOssuKgI/T_cU_nSQrnI/AAAAAAAAAOc/BjpZKaOr7ag/s1600/trainingmaterial2_correct.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="56" src="http://2.bp.blogspot.com/-k_-ZOssuKgI/T_cU_nSQrnI/AAAAAAAAAOc/BjpZKaOr7ag/s320/trainingmaterial2_correct.bmp" width="320" /></a></div>
<br />
Step-By-Step:<br />
<br />
Let's assume you already created the default.xml file with contents similar to these:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><?xml version="1.0" encoding="utf-8"?></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><metadata></span><br />
<span style="font-family: "Courier New",Courier,monospace;"> <layout title="COM_TRAININGMATERIAL_TRAININGMATERIAL"></span><br />
<span style="font-family: "Courier New",Courier,monospace;"> <message>COM_TRAININGMATERIAL_TRAININGMATERIAL</message></span><br />
<span style="font-family: "Courier New",Courier,monospace;"> </layout></span><br />
<span style="font-family: "Courier New",Courier,monospace;"> </span><br />
<span style="font-family: "Courier New",Courier,monospace;"></metadata></span><br />
<br />
Now have a look into your filesystem - open the "joomla" folder. There are two "language" folders - one for the front-end, one for the back-end - you will find this one in the "administrator" folder. As the menu manager is a part of the back-end, we are looking for the administrator/language folder.<br />
<br />
This folder contains folders for the installed languages - for example "en-GB". Open your standard language folder. Here you will find lots of .ini and .sys.ini files. Now go on and create your own .sys.ini file - for example "en-GB.com_trainingmaterial.sys.ini". Open it with your favorite text editor.<br />
<br />
I copied the contents from another language file and didn't delete the comments at the top - now my language file looks like that:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">; Joomla! Project</span><br />
<span style="font-family: "Courier New",Courier,monospace;">; Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.</span><br />
<span style="font-family: "Courier New",Courier,monospace;">; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php</span><br />
<span style="font-family: "Courier New",Courier,monospace;">; Note : All ini files need to be saved as UTF-8 - No BOM</span><br />
<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">COM_TRAININGMATERIAL="Training Material"</span><br />
<span style="font-family: "Courier New",Courier,monospace;">COM_TRAININGMATERIAL_MANAGEMENT_VIEW_DEFAULT_TITLE="Management"</span><br />
<span style="font-family: "Courier New",Courier,monospace;">COM_TRAININGMATERIAL_TRAININGMATERIAL_VIEW_DEFAULT_TITLE="Frontend"</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">COM_TRAININGMATERIAL_TRAININGMATERIAL="Frontend"</span><br />
<span style="font-family: "Courier New",Courier,monospace;">COM_TRAININGMATERIAL_MANAGEMENT="Backend / Management"</span><br />
<br />
The first three entries are the ones for the menu manager. Note the "VIEW_DEFAULT_TITLE" part - even though it is not in your default.xml, it needs to go into the language file. Joomla! will put it all together.<br />
<br />
The other entries are for the menu item type manager. Try it!<br />
<br />
Any questions, comments? Feel free to comment on this post!Unknownnoreply@blogger.com2