view · edit · sidebar · attach · print · history

20130814-update-davaz-com-tag-generikacc-layout

<< | Index | >>


Summary

  • Fix bug about tags in davaz.com
  • Update layout, style, label position in settings view (generikacc.app)

Commits / Patches

davaz.com
generikacc.app

Index / Status


Debug davaz.com tags

Checked update in my VM.

@update_artobject has expected update_hash

["", "thefamily", "inspiration"] #=> tags
"INSERT INTO tags SET name='family'ON DUPLICATE KEY UPDATE name='family'"
0 #=> id
"INSERT INTO tags SET name='inspiration'ON DUPLICATE KEY UPDATE name='inspiration'"
0 #=> id

Its name is not UNIQUE ?

mysql> show fields from tags;
+--------+-----------------+------+-----+---------+----------------+
| Field  | Type            | Null | Key | Default | Extra          |
+--------+-----------------+------+-----+---------+----------------+
| tag_id | int(6) unsigned | NO   | PRI | NULL    | auto_increment |
| name   | varchar(100)    | NO   | UNI |         |                |
+--------+-----------------+------+-----+---------+----------------+
2 rows in set (0.01 sec)

And there is no 0 tag_id in tags_artobjects.

mysql> select * from tags_artobjects order by tag_id desc limit 5;
+--------+--------------+
| tag_id | artobject_id |
+--------+--------------+
|     12 |         1247 |
|     12 |         1246 |
|     12 |         1245 |
|     12 |         1244 |
|     12 |         1243 |
+--------+--------------+
5 rows in set (0.00 sec)

ON DUPLICATE KEY UPDATE

SQL in davaz.com expects wrong affetction (or old bug of MySQL ?)

mysql> INSERT INTO tags SET name = 'inspiration' ON DUPLICATE KEY UPDATE name = 'inspiration';
Query OK, 0 rows affected (0.01 sec)

# But Maybe, above SQL in davaz.com expects like this (this does not work, got- warning)
mysql> INSERT INTO tags SET name = 'inspiration' ON DUPLICATE KEY UPDATE name = 'inspiration' + '';
Query OK, 2 rows affected, 1 warning (0.01 sec)

mysql> show warnings\g
+---------+------+-------------------------------------------------+
| Level   | Code | Message                                         |
+---------+------+-------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'inspiration' |
+---------+------+-------------------------------------------------+
1 row in set (0.00 sec)

Then tried following SQLs.

# same result
my-ql> INSERT INTO tags (name) values('inspiration') ON DUPLICATE KEY UPDATE name=values(name);
mysql> INSERT INTO tags (name) values('inspiration') ON DUPLICATE KEY UPDATE name = 'inspiration';

# this increments tag_id...
mysql> REPLACE INTO tags (tag_id, name) values(11, 'inspiration');

link

Finaly

I could got a solution

mysql> INSERT INTO tags (name) values('inspiration') ON DUPLICATE KEY UPDATE tag_id = LAST_INSERT_ID(tag_id), name=name;
Query OK, 0 rows affected (0.00 sec)

mysql> select last_insert_id();
+------------------+
| last_insert_id() |
+------------------+
|               11 |
+------------------+
1 row in set (0.00 sec)

mysql> INSERT INTO tags (name) values('test') ON DUPLICATE KEY UPDATE tag_id = LAST_INSERT_ID(tag_id), name=name;
Query OK, 0 rows affected (0.00 sec)

mysql> select last_insert_id();
+------------------+
| last_insert_id() |
+------------------+
|               15 |
+------------------+

link

commit

Note for linked library

Maybe, if there is no linked QuartzCore, following error is caused.

ARC Semantic Issue
Receiver type 'CALayer' for instance message is a forward declaration
No known instance method for selector 'setCornerRadius:'

QuartzCore

commit

Update generikacc settings and webview layout

Fix label position and frame size of views in cell, tableview.

commit

Note about grouped table view default UI

apple default value

Plain
fontName: Helvetica-Bold
pointSize: 18.000000
textColor: UIDeviceWhiteColorSpace 1 1
shadowColor: UIDeviceWhiteColorSpace 0 0.44
shadowOffset: CGSize 0 1

Grouped
fontName: Helvetica-Bold
pointSize: 17.000000
textColor: UIDeviceRGBColorSpace 0.298039 0.337255 0.423529 1
shadowColor: UIDeviceWhiteColorSpace 1 1
shadowOffset: CGSize 0 1

link

detect iPad

UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
commit
view · edit · sidebar · attach · print · history
Page last modified on August 14, 2013, at 12:45 PM