Saturday, March 28, 2009
ImagineCup2009 Updates - Congrats DLSU
Embedded Development:
Currently, 1 PH team
- ADMU-UP: team-tations
Game Development:
Currently, 1 PH team
- ADMU: Banana
MashUp:
Currently 4 PH teams:
- DLSU: grace8fhex
- DLSU: Green Executioners
- DLSU: OneAdvocacy
- DLSU: Team Jet
Software Design:
Currently 2 PH teams:
- DLSU: I-TANIM
- DLSU: BUKLOD_DLSU
Robotics: Coming up (April 20)
DLSU Teams that joined: currently 4.
Congrats DLSU for filling up the PH slots. Hope the remaining 4 teams win.
Tuesday, March 3, 2009
Filipinos are Maids! (Sabi ng Singaporean kong Kaklase) Bull!
Singaporean Classmate: "Maids are FILIPINOS and INDONESIANS la"
Crowd: "ooohhhhhh"
Me:
Singaporean Seatmate: "Sorry for that, they're just insensitive"
bull!
To GMA: these things will keep on happening if our own government takes away everyone's opportunity to be respected.
P.S. In that tutorial class of 15, I was the only Filipino with another one from China.
Monday, October 27, 2008
SQL Case Problem - Solved with an Alternative Query
I have here 3 SELECT statements, 2 of which are under the main SELECT and are combined thru UNION.
To evaluate these 2 SELECT statements, the first one is for the debit while the other one is for the credit. You may notice that in the intended debit select, I added NULL AS CREDIT and in the credit select counterpart, I added NULL AS DEBIT. This is because the UNION syntax requires me to have the two SELECT statements return tables that are equivalent (Same column data types and order).
And the SQL Query:
SELECT ABS(debit) AS debit, ABS(credit) AS credit, title FROM
(
SELECT entry_account.balance AS debit, null AS credit, accounts.title, entry_account.entry_id
FROM (entry_account INNER JOIN accounts ON entry_account.account_id = accounts.id)
WHERE (accounts.normal_balance = 'D') AND (entry_account.balance >= 0) OR (accounts.normal_balance = 'C') AND (entry_account.balance < 0)
UNION
SELECT null AS debit, entry_account_1.balance AS credit, accounts_1.title, entry_account_1.entry_id
FROM (entry_account entry_account_1 INNER JOIN accounts accounts_1 ON entry_account_1.account_id = accounts_1.id)
WHERE (accounts_1.normal_balance = 'C') AND (entry_account_1.balance >= 0) OR (accounts_1.normal_balance = 'D') AND (entry_account_1.balance < 0)
) derivedtbl_1
WHERE (entry_id = ?)
sweet...
Saturday, October 25, 2008
SQL Case Problem
FROM ((entry_account INNER JOIN
accounts ON entry_account.account_id = accounts.id) INNER JOIN
entry ON entry_account.entry_id = entry.id)
WHERE (entry.id = ?)
Basically, the above code simply wants to put a value in the debit column if entry_account.balance is > 0 else NULL is appended. This is not exactly what my business logic is but I just have to make it simpler to actually get myself familiarized with the CASE syntax.
The problem is, it just doesn't work. I browsed a couple of code snippets and all of them don't give my an idea why my code is wrong.
Have to sleep now, I might just get the answer tomorrow.
Saturday, August 2, 2008
Problems with JSF – Help Guys?
Hello O&B. I'm experiencing a problem right now. Recently, I've been doing my distributed database machine problem and self-studying JSF at the same time. Now, the problem is this, the database part is not that hard but the JSF implementation quite made itself a stumbling block. And I couldn't just roll things back since I'm almost finished and I simply want to finish this project implementing the JSF framework (in all instances – I don't want to resort to the JSP style of iterating over the arrays and have the <tr> <td>s).
Currently, I simply want to have a table within a table, I couldn't find (or have not researched enough) info about nesting tables, so I think it would be a great help if you guys can give me a code, send me a tutorial link, or give me any articles or documents that can solve this problem.
The Dummy scenario (Just to simplify things):
I have A and B classes. A has an array of B. I also have a Request Bean C, which has an array of A.
I have an init method in my JSF Java file, which populates the Request Bean C from the Dao. (So this is already with the assumption that the whole thing is populated – just the view part is not working)
Here's the scenario (I'll simplify the tags –I'll just give their name):
<table>
<table row group; sourceData= C.As; sourceVar= currentRow>
<table column>
<static text; text = currentRow.value[<field name here other than the array B>]>
</table column>
<here>
</table row group>
</table>
==This is part is definitely not working – just a rough guess on how the JSF works, thought this worked.
What I did, in the <here>:
<table column>
<table>
<table row group; sourceData= currentRow.value[Bs]>
</table row group>
</table>
</table column>
You can prolly guess what I was trying to do. This just didn't work. What I wanted to achieve:
A[0]
A.B[0]
A.B[1]
…
A[1]
…
So there, I hope I've given enough info. Thanks in advance for the help(S).
Monday, June 9, 2008
Checking Out
Long time no commit. The last time I checked the project, I could almost say, "I am a stranger of my own country" – Amir from The Kite Runner. I'm wondering why there is currently an Option in the model, actions and services are somewhat jumbled, and so and so.
Recently, I came across an article where there is a code segment about Logger. Adding a log was done thru a static method call, so there was practically no instantiation of Log.
Frames are bad, well in my opinion. Most sites I visit don't have frames. They have internal frames but not the frame I used with the ftl. Also, in the freemarker documentation, there was an include syntax to link to an existing ftl code, thus frames are technically not needed.
This will prolly be my last blog for this term (3 months) in this blog site. I'm transferring to my other "DLSU Acad" blog (that is also listed in my blogger profile) for a while just so I could have a unified flow of thoughts.
Thursday, May 22, 2008
Near Finish
I'm so happy! Since yesterday, I've been asking God to enlighten me in initializing default values for the <@s.select> tag, whether multiple or not. Just now, I was able to give the roles default values whenever I edit the user. What I did was I have a List<Integer>, that is the container of the existing roleIds of the user, and put it to the value attribute of the select tag. It's quite simple, only that I've been experimenting with the wrong attributes. Many forums claim it's the property attribute, though it might have been right, there was no right example showing how it should be done. With the value attribute, I kind of experimented on it a bit and thank God, I was able to make it right.
*****
I was able to transfer the role identification to the User model. I added the isAdmin function in the User model, as how sir Butch suggested. And now, the loginAction is really much cleaner.
*****
I added 2 kinds of Login Interceptors: the one that simply assures that the user session is not null, and the other one that assures that the user session has an admin role. Jo mentioned (Anna said) Spring security. I wasn't able to experiment with this feature though.
*****
Another component is to be added: Exception. Just where should I put it? I have two kinds of exceptions, the one that we made to prevent duplicate values, and the Validation exception, the one Tina did. The validation exceptions weren't caught yet and I'm still finding the right spot for it. Also, the validation mechanism Tina implemented wasn't quite that easy to comprehend. I think it's not implemented as the usual interceptor. It doesn't have an interceptor reference, simply it has a mapping mechanism in the web.xml: patterns com.orangeandbronze.service.* so I think it maps itself automatically. Catching the exception is also another thing. Uhh, can you wait 'til I understand it (the validation impl)?
*****
Refactoring the bloodiest of them all: Book! I'm having a hard time right now understanding the literally messy code. What was I thinking that time? I couldn't effectively add the author – book mapping til I refactor this completely. Right now, I just migrated some unnecessary functions from the action to the service.