Recent Forum Posts
From categories:
How to Extract table values
mansurmansur 1255253761|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Scaladbc

I am using scala lift . Also i using mysql to retrive the table value .

My doubt is ,

My query is —>val stmt4 = select ('id,'name) from('category) where 'name <>("'Contact'") and 'name <>("'Faq'")
printResults(db.executeStatement(stmt4.parse))

I want to display a id and name value .

def printResults(res: dbc2.result.Relation) {
for(val i <- res) {
for(val f <- i.fields) {
print("\t"+f.content.nativeValue)
}
println()
}
}

This code , f.content.nativeValue display value. i wnat how to extract id and name value.
send reply mail moc.liamg|5002ilarusnam#moc.liamg|5002ilarusnam

How to Extract table values by mansurmansur, 1255253761|%e %b %Y, %H:%M %Z|agohover
Help to compile DBC2
Santi (guest) 1252322395|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Scaladbc

Hi HRJ,
I am new to this word, scala and dbc.
I need bdc2 but dont know how to build with SBT package.
¿can you show me to configuration for do it?
Thanks very much

What about dbc2/dbc3 in Scala 2.8.
Will be included?
Where is the api doc for these libraries?
Thank very much

Help to compile DBC2 by Santi (guest), 1252322395|%e %b %Y, %H:%M %Z|agohover
Re: Why connection was closed?
hrjhrj 1249620919|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Scaladbc

I have added an update to the top of the page.

Please check out the other projects llisted there which are more likely to be stable.

Re: Why connection was closed? by hrjhrj, 1249620919|%e %b %Y, %H:%M %Z|agohover
Re: Why connection was closed?
Sailaja (guest) 1249538775|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Scaladbc

Hi,
I am also facing the same problem . I have searched for this on google no result. Is any solution for this problem….

Thanks in advance '
Sailaja.

Re: Why connection was closed? by Sailaja (guest), 1249538775|%e %b %Y, %H:%M %Z|agohover

You are indeed better off, sAgar, congratulations! (To be sure, the absolute numbers can't be compared, as it depends on the individual HDD's max rating for reloads).

Your reloads per hour are (33405 / 1184.0) = ~ 30

Mine are 343830 / 3409.0 = ~ 100

Aside, I don' t think this should be colored as a vista v/s linux game, because the HDD manufacturer's power management features would also matter. To compare OSes we would have to use the same h/w for benchmarking (and under similar work loads, if you woke up pedantic today :-) ).

Re: Vista wearing down the HD lesser(?) by hrjhrj, 1240568741|%e %b %Y, %H:%M %Z|agohover

For my LT, smartctl (Windoze version) reports, among others:

Start_Stop_Count: 979
Power_On_Hours: 1184
Power_Cycle_Count: 674
Power-Off_Retract_Count: 282
Load_Cycle_Count: 34405 (that's a tenth of the value you see for your box)

YMMV ofcourse, especially if you have a different power option or have customised the power options. I am on 'Power Saver' for my inspiron 1525.

Vista wearing down the HD lesser(?) by sAgar (guest), 1240551685|%e %b %Y, %H:%M %Z|agohover
hrjhrj 1240551373|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Laptop Hard disks are (gonna be) seriously broken

@sAgar
Hmm.. Vista's setting to turn it off after 5 mins of inactivity is not too bad.

Back of the envelope calculation, for worst case, is 100k reloads per year. Which means, even in the worst case, you might get about 6 years of HDD life.

But, that's only in software, check the actual hardware setting thus:
hdparm -I /dev/sda | grep "Advanced power management level"

smartctl indeed reads data off the disk controller (a SMART disk controller).

by hrjhrj, 1240551373|%e %b %Y, %H:%M %Z|agohover

Very interesting post. Looked around for expert opinions, but turns out the experts don't agree on anything, as usual.

I keep the power setting on my Dell (insprion 1525) Vista laptop to 'Power Saver' (which by default favours battery life over performance; yes yes, I know 'Vista Performance' is an oxymoron).

A quick check (via 'Control Panel' -> 'Power options' -> 'Change plan settings') indicates that the HDDs are turned off auto, after 5 minutes of inactivity when on battery and after 20 minutes when plugged in.

I'll scout for the equivalent of 'smartctl' for Vista and compare with your results. (If smartctl's results are not from the OS, but directly from the disk controller, I can boot my box into linux and run the same).

HDD turn off & power options in Vista by sAgar (guest), 1240550517|%e %b %Y, %H:%M %Z|agohover
Neat!
Khot (guest) 1238509142|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Fun With Inkscape

Really amazing how these assembled squares still manage to retain your features!

Neat! by Khot (guest), 1238509142|%e %b %Y, %H:%M %Z|agohover
regardless
hrjhrj 1235714138|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » First Light

You have no idea, on how many cold nights to how many semi-conscious people have I lied about constellations.

I think many have gone on to lead successful lives thinking that Astronomy is the science of imagination.

regardless by hrjhrj, 1235714138|%e %b %Y, %H:%M %Z|agohover
Thank me
Oneirodynic (guest) 1235624765|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » First Light

I had to listen to your lies about constellations while getting drunk on a very cold night in Yuksom. I think that night was your turning point and i was there to endure it.

Thank me by Oneirodynic (guest), 1235624765|%e %b %Y, %H:%M %Z|agohover
@Prashanth
hrjhrj 1235283462|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Web programming in Scala: Choosing a framework

I really didn't experiment much with Sweet, except for an initial glance. It definitely looked well documented and easy to pick up at that time.

I ended up creating my own simple framework, and have used it for two websites already. One of these days I will publish it as open-source. Watch this blog for updates.

@Prashanth by hrjhrj, 1235283462|%e %b %Y, %H:%M %Z|agohover

I have been trying to learn this lift framework and use it in my upcoming project. Thanks for introducing Sweet. Will have to look into it. Did you try it? What is your impression of it?

thanks for the Sweet framework by Prashanth Kokati (guest), 1235266246|%e %b %Y, %H:%M %Z|agohover
Re: Why connection was closed?
hrjhrj 1232965490|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Scaladbc

Hi rakuto,

I am not well versed with the scala DBC2 package. I just brought it to a state where it compiled. The run-time behaviour is a little difficult to understand.

Looking at the source code, it seems like a call to Vendor.closeConnection happens after every statement is executed. It's not clear to me how it is re-opened again.

I advise you ask on the scala mailing list for support.

Cheers,
HRJ

Re: Why connection was closed? by hrjhrj, 1232965490|%e %b %Y, %H:%M %Z|agohover
Why connection was closed?
rakuto (guest) 1232889830|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Scaladbc

Try to CRUD operation using dbc2 package, but couldn't execute queries because scala.dbc2.exception.ClosedException was thrown.
How do I execute some queries?

import scala.dbc2.exception._

import java.sql._
import java.net.URI
import scala.dbc2.Database
import scala.dbc2.ShortSyntax._
import scala.dbc2.statement.AnyValueDef._
import scala.dbc2.statement.Relation
import scala.dbc2.statement.Status
import scala.dbc2.vendor.MySQL

object Demo extends Application {
    def printResults(res: dbc2.result.Relation) {
        for(val i <- res) {
            for(val f <- i.fields) {
                print("\t" + f.content.sqlString) 
            } 
            println()
        } 
    }

    val vendor:scala.dbc2.Vendor = scala.dbc2.vendor.MySQL(new URI("jdbc:mysql://localhost:3306/scala_test"), "mysql", "mysql")
    var db = new Database(vendor)

    // crate test DB
    try {
        var stmt = create table 'people columns('id integer primary key, 'name character varying(255))
        db.executeStatement(stmt.parse)
        println("Success")
    } catch {
        case e:Exception => println("table `people` already created")
    }

    // truncate a table
    var stmt = delete from 'people
    db.executeStatement(stmt.parse)

    // insert data
    val people = List((1, "Martin Odersky"), (2, "Guid van Rossam"))
    people.foreach {
        person => 
            var stmt2 = insert into 'people columns('id, 'name) values((person._1, person._2))
            // XXX: Failed because scala.dbc2.exception.ClosedException exception was thrown
            db.executeStatement(stmt2.parse)
    }

    var stmt3 = select(*) from('people)
    printResults(db.executeStatement(stmt3.parse))
}

Best regards.

Why connection was closed? by rakuto (guest), 1232889830|%e %b %Y, %H:%M %Z|agohover
Khot (guest) 1230755269|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » 8.5" Newtonian Reflector

Pharaoh, I really love this "whys" page. Very informative!

by Khot (guest), 1230755269|%e %b %Y, %H:%M %Z|agohover
Khot (guest) 1229643598|%e %b %Y, %H:%M %Z|agohover
in discussion Hidden / Per page discussions » Moon, Venus, Geminids, Fireball - Observation report

Hey Pharaoh, thanks for the updates. Looks like you have made major progress with the scope [ & your beard ;) ] since I last saw you. Looking forward to hearing more interesting updates as you find your way through our majestic universe!

by Khot (guest), 1229643598|%e %b %Y, %H:%M %Z|agohover