[#401849] If statement — Masoud Ahmadi <lists@...>

Will anyone be able to point out what I am doing wrong.

15 messages 2012/12/02

[#401987] Trying to get "translator" to work — JD KF <lists@...>

So, basically, I'm trying to get the below code to work properly for

12 messages 2012/12/06

[#402012] Need help to select some listbox item in different listbox together — Jonathan Masato <lists@...>

Hello,

10 messages 2012/12/07

[#402045] if n belongs to set a and m belongs to set b repeat some steps, How? — "zubair a." <lists@...>

We can do so in java and similar languages like:

11 messages 2012/12/08

[#402078] Time.new(2001, 12, 3).to_i returns wrong value — Robert Buck <lists@...>

I am doing something that not many do, I am writing a database driver

9 messages 2012/12/09

[#402145] How I can create/extract a variable/hash into the current binding in Ruby? — Ramon de C Valle <rcvalle@...>

Hi,

12 messages 2012/12/12

[#402205] Wondering About Flatiron School — "Kevin Y." <lists@...>

Hi everyone!,

35 messages 2012/12/15
[#402207] Re: Wondering About Flatiron School — Chad Perrin <code@...> 2012/12/15

On Sat, Dec 15, 2012 at 11:51:08AM +0900, Kevin Y. wrote:

[#402214] Ruby quick reference arranged in ASCII sequence? — Old Grantonian <lists@...>

As a ruby beginner, I would be grateful for any links to a ruby

17 messages 2012/12/15

[#402226] print - and strip text between tags using Nokogiri — Paul Mena <lists@...>

I'm a Ruby Newbie trying to write a program to process thousands of HTML

13 messages 2012/12/15

[#402332] Perl to Ruby: regex captures to assignment. — "Derrick B." <lists@...>

Hello all,

37 messages 2012/12/19
[#402342] Re: Perl to Ruby: regex captures to assignment. — "Derrick B." <lists@...> 2012/12/20

First of all, thanks for the fast responses!

[#402352] Re: Perl to Ruby: regex captures to assignment. — Robert Klemme <shortcutter@...> 2012/12/20

On Thu, Dec 20, 2012 at 1:38 AM, Derrick B. <lists@ruby-forum.com> wrote:

[#402357] Re: Perl to Ruby: regex captures to assignment. — "Derrick B." <lists@...> 2012/12/20

Robert Klemme wrote in post #1089733:

[#402359] trying to strip characters from a line — Paul Mena <lists@...>

I'm reading a table from a MySQL database and then processing it row by

18 messages 2012/12/20

[#402394] simple division: -9 / 5 = -2 what? — "Derrick B." <lists@...>

$ irb

13 messages 2012/12/22

[#402412] POLS and string-handling — Paul Magnussen <lists@...>

Hi,

14 messages 2012/12/22

[#402460] "Open" dialog of Windows — "Damián M. González" <lists@...>

Hi guys, been researching about pop up the "open" file dialog of

11 messages 2012/12/24

[#402466] How do I install Ruby on my Ubuntu 12.10 partition. — Kaye Ng <lists@...>

I already have Ruby installed on my Windows 7 partition.

23 messages 2012/12/25

[#402510] Ruby Association Certified Ruby Programmer — Sean Westfall <lists@...>

How well respected is this certification in the industry: Ruby

27 messages 2012/12/27
[#402528] Re: Ruby Association Certified Ruby Programmer — Peter Hickman <peterhickman386@...> 2012/12/27

On 27 December 2012 01:28, Sean Westfall <lists@ruby-forum.com> wrote:

[#402555] numeric? — Brandon Weaver <keystonelemur@...>

I've found a bit of an annoyance trying to find out if a number is numeric

20 messages 2012/12/27

[#402580] Ruby Koans regarding Hashes. — "Derrick B." <lists@...>

I am trying to understand this, so let me know how I do. :) I know

18 messages 2012/12/28

[#402609] can't open new ruby program under "new" context menu — "Lee V." <lists@...>

I'm stuck on the new version at trying to do something very simple.

10 messages 2012/12/28

[#402642] require "test/unit" — "Mattias A." <lists@...>

Hi,

17 messages 2012/12/29
[#402667] Re: require "test/unit" — "Mattias A." <lists@...> 2012/12/31

Hi Dami=C3=A1n M. Gonz=C3=A1lez!

[#402747] Re: require "test/unit" — "Derrick B." <lists@...> 2013/01/04

Mattias A. wrote in post #1090700:

[#402749] Re: require "test/unit" — sto.mar@... 2013/01/04

Am 04.01.2013 19:48, schrieb Derrick B.:

Re: Database query

From: Panagiotis Atmatzidis <atma@...>
Date: 2012-12-13 18:19:26 UTC
List: ruby-talk #402180
Hello,


On 13 =CE=94=CE=B5=CE=BA 2012, at 17:56 , cristian cristian =
<lists@ruby-forum.com> wrote:

> Thank you for the help!
> Panagiotis I will look into datamapper but now Im stuck with this
> problem... :)

Datamapper will help you solve this problem (and other syntax problems) =
as it uses hashes widely and it's syntax is much more 'rubyish'.

However, the code 7stud guru posted is working perfectly. Take a look =
here
=
--------------------------------------------------------------------------=
-------------------------------------
=E2=9E=9C  archive git:(master) =E2=9C=97 sqlite3 hellenic_words.db=20
SQLite version 3.7.14.1 2012-10-04 19:37:12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
hellenic_words_databases
sqlite> select * from hellenic_words_databases;
=
1|=CE=BA=CE=B1=CE=BB=CE=B7=CE=BC=CE=AD=CF=81=CE=B1|feea7f066965d3a9f1f19e6=
7a4fcc5d81f313210|2012-12-11T15:27:27+01:00||||||
=
2|=CE=B1=CE=BB=CE=AE=CE=B8=CE=B5=CE=B9=CE=B1|8f01e8dbc7dc7c64ae80daa6558dc=
ad679f48e3d|2012-12-11T15:27:27+01:00||||||
=
3|=CE=B1=CE=B3=CE=AC=CF=80=CE=B7|187adbb275e4e1df0caf32087f0dc0957fc1474b|=
2012-12-11T15:27:27+01:00||||||
=
4|=CE=95=CE=BB=CE=BB=CE=AC=CE=B4=CE=B1|d2e38adc17e42d109fdb946f564e70aa84f=
994d7|2012-12-11T15:27:27+01:00||||||
=
5|=CF=83=CF=84=CF=81=CE=BF=CF=86=CE=AE|0c3dbbf9303a42c0b678db7d59ff1c5aa53=
b8a12|2012-12-11T15:27:27+01:00||||||
=
6|=CE=B1=CE=BD=CE=B1=CF=80=CE=BF=CE=B4=CE=B9=CE=AC|e22383f69bf6a0330090577=
39a52bc16f87d4f2d|2012-12-11T15:27:27+01:00||||||
=
7|=CF=84=CE=B9=CE=BC=CF=8C=CE=BD=CE=B9|b79aafd3f543ebefba9430d8e0d0033ed50=
72a89|2012-12-11T15:27:27+01:00||||||
=
8|=CE=B1=CE=B4=CE=B5=CE=BB=CF=86=CE=AE|24897aaa317b0dec6bb01d3abcbf17048cb=
8b6e3|2012-12-11T15:27:27+01:00||||||
=
9|=CF=80=CE=BF=CF=84=CE=B1=CE=BC=CF=8C=CF=82|95ae1fed2b86c551911e78f107f38=
b777c777d9a|2012-12-11T15:27:27+01:00||||||
=
10|=CE=BA=CE=B1=CE=BD=CE=AC=CF=84=CE=B1|cf951867e94cf8474e5ccd700966b2c603=
d9ebf4|2012-12-11T15:27:27+01:00||||||
=
11|=CF=86=CE=B1=CF=83=CE=BF=CE=BB=CE=AC=CE=B4=CE=B1|e5ea942c97d8c0f2c9a37c=
d0f1a271beeedb5a98|2012-12-11T15:27:27+01:00||||||
=
12|=CF=80=CE=B1=CE=B9=CF=87=CE=BD=CE=AF=CE=B4=CE=B9|d752a274657538e752e6ee=
edbd34a1359ac11d8d|2012-12-11T15:27:27+01:00||||||
=
13|=CF=80=CE=B1=CF=80=CE=BF=CF=8D=CF=84=CF=83=CE=B9|2eaea11ab23d6ac0a7497f=
978887f4f6330c1fce|2012-12-11T15:27:27+01:00||||||
=
14|=CF=80=CE=B1=CE=BD=CF=84=CF=8C=CF=86=CE=BB=CE=B1|e68e9ad399ddce4572fd7a=
7ed33962dda842b231|2012-12-11T15:27:27+01:00||||||
=
15|=CE=BA=CE=BF=CE=BC=CE=BF=CE=B4=CE=AF=CE=BD=CE=BF|dafd4a50b1ff983cd1cfff=
7160320c64af3ee7fe|2012-12-11T15:27:27+01:00||||||
=
16|=CE=B4=CE=AF=CF=83=CE=BA=CE=BF=CF=82|5a3a80cc90756999bab5b81775311be2e0=
96e873|2012-12-11T15:27:27+01:00||||||
=
17|=CE=BA=CE=BF=CF=85=CF=84=CE=AF|ff7f9d9b16a51770a31863f9296cb903af97d0e9=
|2012-12-11T15:27:27+01:00||||||
sqlite> .quit
=E2=9E=9C  archive git:(master) =E2=9C=97 ruby sample.rb=20
word =3D> =CE=BA=CE=B1=CE=BB=CE=B7=CE=BC=CE=AD=CF=81=CE=B1
sha1 =3D> feea7f066965d3a9f1f19e67a4fcc5d81f313210
0 =3D> =CE=BA=CE=B1=CE=BB=CE=B7=CE=BC=CE=AD=CF=81=CE=B1
1 =3D> feea7f066965d3a9f1f19e67a4fcc5d81f313210
********************
word =3D> =CE=B1=CE=BB=CE=AE=CE=B8=CE=B5=CE=B9=CE=B1
sha1 =3D> 8f01e8dbc7dc7c64ae80daa6558dcad679f48e3d
0 =3D> =CE=B1=CE=BB=CE=AE=CE=B8=CE=B5=CE=B9=CE=B1
1 =3D> 8f01e8dbc7dc7c64ae80daa6558dcad679f48e3d
********************
word =3D> =CE=B1=CE=B3=CE=AC=CF=80=CE=B7
sha1 =3D> 187adbb275e4e1df0caf32087f0dc0957fc1474b
0 =3D> =CE=B1=CE=B3=CE=AC=CF=80=CE=B7
1 =3D> 187adbb275e4e1df0caf32087f0dc0957fc1474b
********************
[...]
=E2=9E=9C  archive git:(master) =E2=9C=97 cat sample.rb=20
#!/usr/bin/env ruby
# encoding: UTF-8

require 'sqlite3'
db =3D SQLite3::Database.open('hellenic_words.db')

db.results_as_hash =3D true
result_set =3D db.execute( "SELECT word,sha1 FROM =
hellenic_words_databases" )

result_set.each do |row|
	row.each { |key, value| puts "#{key} =3D> #{value}" }
	puts '*' * 20
end
=
--------------------------------------------------------------------------=
-------------------------------------

So you're obviously doing something wrong :-)

> This always puts 'Nothing' even though I know I have a Key=3D=3D7 in =
the
> table. I miss something... Any suggestions?
>=20
> result_set =3D db.execute( "SELECT Key,Url FROM Sites" )
>=20
> result_set.each do |row|
>  row.each do |key, value|
>    if key=3D=3D'7'
>      puts "#{key} =3D> #{value}"
>    else
>      puts "Nothing"
>    end
>    puts '*' * 20
>  end
> end
>=20
>=20
> Br
> cristian
>=20
> --=20
> Posted via http://www.ruby-forum.com/.
>=20

Have a nice day!


Panagiotis (atmosx) Atmatzidis

email:	atma@convalesco.org
URL:	http://www.convalesco.org
GnuPG ID: 0xE736C6A0
gpg --keyserver x-hkp://pgp.mit.edu --recv-keys 0xE736C6A0
--
The wise man said: "Never argue with an idiot. They bring you down to =
their level and beat you with experience."



In This Thread