Re: [Pharo-users] Polygons in woden
Hi, sorry for the late response. Thanks a lot for the hints. Though I didn't explain me well enough for what concern the shades. What I actually meant is how light gets reflected from the object. If I build a cube with: addCubeWithWidth I get a nicely dark effect on the walls of the object when the light is not pointing to it and a shiny effect when the light is pointing towards to it. While if I build a object on my own with addQl the walls are not considering the light at all and I don't get that effect anymore. Does anyone know how to solve this? Moreover do you think it is possible to use some how GLPolygon to draw arbitrary polygons since woden is based on Open GL? Cheers, Nicolas. On Nov 9, 2014, at 11:12 PM, Ronie Salgado ronies...@gmail.commailto:ronies...@gmail.com wrote: Hi Nicola, Sorry for not answering before. I have to improve my mail filters. As for the shadows, currently only the spotlights can cast shadows. I have yet to implement shadow mapping for directional lights. As for point light, I won't be implementing them in the near future, because they are very expensive. Currently you can simulate a point light casting shadows by using 6 spotlights with different orientations but in the same point. Also, you have to use deferred shading if you need shadows (WDFPSSimpleExample8 #initializeSceneRenderer) As for the polygons, Woden cannot render arbitrary polygons. Only points, lines, triangles and quads because that is what the graphics cards support. For an arbitrary polygon, you have to perform some kind of triangulation. If the polygon is convex, this is trivial, but if the polygon is concave this is hard (the algorithm missing is a Restricted Delaunay Triangulation). For drawing a convex polygon, you have to do something like this: positions := Some Collection .. builder newTrianglesScope. Add the positions. positions do: [:i | builder addP: ]. Add the indices 3 to: positions size do: [:i | builder addI1: 1 i2: i - 1 i3: i ]. What this code does is to generate a triangle fan ( http://en.wikipedia.org/wiki/Triangle_fan ) which is a simple way to triangulate a convex polygon. I think that I should add a method to the geometry builder. Greetings, Ronie 2014-10-28 11:33 GMT-03:00 Nicolas Lusa nicolas.l...@usi.chmailto:nicolas.l...@usi.ch: Hi everyone, I am working on some 3d representation and I am trying to draw 3D polygons with woden. I actually manage to make the walls but I still have to implement top and bottom parts which are not so simple since the shape can be really different from case to case. How I am actually doing it is with: WDGeometryBuilder adding vertices with addP: N: C: TC: messages and with addQuadI1: i2: i3: i4: Furthermore I have some issues with the shadows which actually don't appear. You can see a current polygon created with the code that I made in the attached image. (also notice the shadows are missing as well as the bottom and top part of the polygon). [cid:E6905B6F-F5CA-447D-A42D-BA1604AC7F5A@mobile.usilu.netmailto:cid%3ae6905b6f-f5ca-447d-a42d-ba1604ac7...@mobile.usilu.net] Now my question is: is there already something that makes those polygons or does anyone have any hint on how to make the top part with woden? Thannks in advance. Cheers, Nicolas
Re: [Pharo-users] MultiByteFileStream problem
Hi José, On 17 Nov 2014, at 02:06, José Comesaña jose.comes...@gmail.com wrote: There is an annoying error in MultiByteFileStream, reading back when you have a unicode character. It is also the cause of some FileOut errors. Your can reproduce it this way: testString := 'abcdé'. filename := 'test.txt'. filename asFileReference ensureDelete. filename asFileReference writeStreamDo: [ :stream | stream nextPutAll: testString ]. f := 'test.txt' asFileReference readStream. f setToEnd. f skip: -1. f peek. Any ideas how to solve it? Avoiding reading back is not an option ;). Maybe making skip to go back one more byte to check if there is a unicode character around?. Thanks a lot. This is a known problem/issue/limitation of MultiByteFileStream and the TextConverters. The more modern/logical ZnCharacterEncoders can do this reliably (provided the underlying stream can itself move backwards and the current position is between whole characters). 'test.txt' asFileReference readStreamDo: [ :in | in binary; setToEnd. ZnUTF8Encoder new backOnStream: in; nextFromStream: in ] IMHO, the ability to move backwards and to play with positions without restrictions on streams only makes sense with in-memory streams, not with file or network streams. It plays badly with buffering too. I know this doesn't solve your issue but I hope it gives you a better idea of the situation. Where exactly do you have this issue ? Sven
Re: [Pharo-users] MultiByteFileStream problem
Thank you Sven. I an trying to read a vry long log file, and extract the last 5 messages for the user to see them. Reading the whole file from the beginning is too expensive. So maybe I could try reading backwards from the end using binary mode and look for a lf... I have to think about it a little bit, and study your proposal, of course. 2014-11-17 9:26 GMT+01:00 Sven Van Caekenberghe s...@stfx.eu: Hi José, On 17 Nov 2014, at 02:06, José Comesaña jose.comes...@gmail.com wrote: There is an annoying error in MultiByteFileStream, reading back when you have a unicode character. It is also the cause of some FileOut errors. Your can reproduce it this way: testString := 'abcdé'. filename := 'test.txt'. filename asFileReference ensureDelete. filename asFileReference writeStreamDo: [ :stream | stream nextPutAll: testString ]. f := 'test.txt' asFileReference readStream. f setToEnd. f skip: -1. f peek. Any ideas how to solve it? Avoiding reading back is not an option ;). Maybe making skip to go back one more byte to check if there is a unicode character around?. Thanks a lot. This is a known problem/issue/limitation of MultiByteFileStream and the TextConverters. The more modern/logical ZnCharacterEncoders can do this reliably (provided the underlying stream can itself move backwards and the current position is between whole characters). 'test.txt' asFileReference readStreamDo: [ :in | in binary; setToEnd. ZnUTF8Encoder new backOnStream: in; nextFromStream: in ] IMHO, the ability to move backwards and to play with positions without restrictions on streams only makes sense with in-memory streams, not with file or network streams. It plays badly with buffering too. I know this doesn't solve your issue but I hope it gives you a better idea of the situation. Where exactly do you have this issue ? Sven
Re: [Pharo-users] pharo consultants
Norbert wrote: I forgot how people can add themselves. I remember a smalltalk snippet that one can send around to update the list. That doesn't run automatically. There are already some updates waiting. Stephan The script looks like: PharoConsultant new name: ’Stephan Eggermont'; location: 'Den Bosch, The Netherlands'; email: 'step...@legacycode.nl'; website: 'http://www.legacycode.nl'; languages: 'Dutch (native), English, German'; industryExperienceSince: 1994; smalltalkExperienceSince: 2005; pharoExperienceSince: 2008; areasOfExpertise: 'Legacy Code Refactoring Migrations, Small Business Applications, Improving Software Development'; yourself
Re: [Pharo-users] pharo consultants
OK, I will redo that page - please send updates. On 17 Nov 2014, at 10:24, Stephan Eggermont step...@stack.nl wrote: Norbert wrote: I forgot how people can add themselves. I remember a smalltalk snippet that one can send around to update the list. That doesn't run automatically. There are already some updates waiting. Stephan The script looks like: PharoConsultant new name: ’Stephan Eggermont'; location: 'Den Bosch, The Netherlands'; email: 'step...@legacycode.nl'; website: 'http://www.legacycode.nl'; languages: 'Dutch (native), English, German'; industryExperienceSince: 1994; smalltalkExperienceSince: 2005; pharoExperienceSince: 2008; areasOfExpertise: 'Legacy Code Refactoring Migrations, Small Business Applications, Improving Software Development'; yourself
Re: [Pharo-users] running out of memory while processing a 220MB csv file with NeoCSVReader - tips?
Open package contents on your vm, open Contents, take a look at the info.plist keySqueakMaxHeapSize/key integer541065216/integer That value needs to be increased to be able to use more than ~512 MB. Alain wrote: Let say it's your current requirement, and you want to do it like that, a trick that may help you : during personal experiments about loading data in memory and statistics from databases, I found that most often 70 to 80 % of real data is the same. It is easy to confirm if this is the case in your data: just zip the csv file. Reasonably structured relational database output often reduces to 10% of size. With explicitly denormalized data I've seen 99% reduction. In addition, DateAndTime has a rather wasteful representation for your purpose. Just reduce to one SmallInt, or with Pharo4, use slots to get a more compact record representation. Stephan
Re: [Pharo-users] Opentalk or remoting libraries
Thank you, My need is on a local network from machine to machine, in real time is possible, so no security involved. I would have preferred something more performant than web services or XMLRPC, since both serialization and XML serialization are slow. Annick Le 13 nov. 2014 à 20:17, Sven Van Caekenberghe s...@stfx.eu a écrit : Nice. It is of course also important to note the security risks involved: the client can execute absolutely anything. One partial solution is to bind the server only to the localhost. On 13 Nov 2014, at 19:17, Alain Rastoul alf.mmm@gmail.com wrote: Hi, CORBA main focus is about interoperability between systems, languages (don't know about opentalk). If you want smalltalk only remote execution, you can very easily do your own on Pharo with Zinc http components and Fuel serializer: a small server that reads smalltalk blocks, evaluates them and return the result (see below an example of server and client). I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are equivalents ones or you could do the same. Beware that Fuel builds a graph of the objects touched by the object it serializes (the block) and serialize them along the way, that may be a problem if you have references to other big objects of your image. = RPC server start Zn server in background ZnServer startDefaultOn: 1701. ZnServer default delegate: (ZnWebSocketDelegate handler: ([ :webSocket | [ [ | serializedRequest request response serializedResponse | serializedRequest := webSocket readMessage. request := FLMaterializer materializeFromByteArray: serializedRequest. execute block and it's value to response byte array response := [ request value ] on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex messageText ]. serializedResponse := FLSerializer serializeToByteArray: response . webSocket sendMessage: serializedResponse . ] repeat. ] on: ConnectionClosed, ConnectionTimedOut do: [ self crLog: 'Ignoring connection or timeout' ] ]) ). = to stop the server ZnServer stopDefault . = RPC CLIENT Client call to server: calculate factorial 100 on the other side | webSocket | webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'. [ | request serializedRequest serializedResponse response | request := [ 100 factorial ] . the request is the block to evaluate serializedRequest := FLSerializer serializeToByteArray: request . serialize the block webSocket sendMessage: serializedRequest . send it serializedResponse := webSocket readMessage . read response response := FLMaterializer materializeFromByteArray: serializedResponse. deserialize to object Transcript show: response asString ; cr ] on: ConnectionClosed do: [ self crLog: 'Ignoring connection close, done' ] regards, Alain Le 12/11/2014 18:17, Annick Fron a écrit : Hi, Are there some libraries in pharo to do remote calls like in Opentalk or Corba ? Annick
Re: [Pharo-users] Opentalk or remoting libraries
Using fuel should be way faster than plain textual serialization. A direct copy of memory would be theoretically faster but you would need to manage references anyway so it is not clear what can be gained. Norbert Am 17.11.2014 um 11:05 schrieb Annick Fron l...@afceurope.com: Thank you, My need is on a local network from machine to machine, in real time is possible, so no security involved. I would have preferred something more performant than web services or XMLRPC, since both serialization and XML serialization are slow. Annick Le 13 nov. 2014 à 20:17, Sven Van Caekenberghe s...@stfx.eu a écrit : Nice. It is of course also important to note the security risks involved: the client can execute absolutely anything. One partial solution is to bind the server only to the localhost. On 13 Nov 2014, at 19:17, Alain Rastoul alf.mmm@gmail.com wrote: Hi, CORBA main focus is about interoperability between systems, languages (don't know about opentalk). If you want smalltalk only remote execution, you can very easily do your own on Pharo with Zinc http components and Fuel serializer: a small server that reads smalltalk blocks, evaluates them and return the result (see below an example of server and client). I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are equivalents ones or you could do the same. Beware that Fuel builds a graph of the objects touched by the object it serializes (the block) and serialize them along the way, that may be a problem if you have references to other big objects of your image. = RPC server start Zn server in background ZnServer startDefaultOn: 1701. ZnServer default delegate: (ZnWebSocketDelegate handler: ([ :webSocket | [ [ | serializedRequest request response serializedResponse | serializedRequest := webSocket readMessage. request := FLMaterializer materializeFromByteArray: serializedRequest. execute block and it's value to response byte array response := [ request value ] on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex messageText ]. serializedResponse := FLSerializer serializeToByteArray: response . webSocket sendMessage: serializedResponse . ] repeat. ] on: ConnectionClosed, ConnectionTimedOut do: [ self crLog: 'Ignoring connection or timeout' ] ]) ). = to stop the server ZnServer stopDefault . = RPC CLIENT Client call to server: calculate factorial 100 on the other side | webSocket | webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'. [ | request serializedRequest serializedResponse response | request := [ 100 factorial ] . the request is the block to evaluate serializedRequest := FLSerializer serializeToByteArray: request . serialize the block webSocket sendMessage: serializedRequest . send it serializedResponse := webSocket readMessage . read response response := FLMaterializer materializeFromByteArray: serializedResponse. deserialize to object Transcript show: response asString ; cr ] on: ConnectionClosed do: [ self crLog: 'Ignoring connection close, done' ] regards, Alain Le 12/11/2014 18:17, Annick Fron a écrit : Hi, Are there some libraries in pharo to do remote calls like in Opentalk or Corba ? Annick
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
It looks like eveything is there. This configuration looks almost identical to my 32os machine. root@brads-linux-laptop:/usr/lib# ldd libopendbx.so.1.2.0 linux-gate.so.1 = (0xf76df000) libdl.so.2 = /lib/i386-linux-gnu/libdl.so.2 (0xf76b8000) libc.so.6 = /lib/i386-linux-gnu/libc.so.6 (0xf7508000) /lib/ld-linux.so.2 (0xf76e) root@brads-linux-laptop:/usr/lib# - Brad Selfridge -- View this message in context: http://forum.world.st/function-unavailable-when-calling-OpenDBXDriver-for-MySQL-tp4790564p4790636.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
Hi Brad, You don't tell us if your MySQL is 32 bit? Stephan
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
Ill have to check Brad Selfridge 913-269-2385 On Nov 17, 2014, at 9:41 AM, Stephan Eggermont [via Smalltalk] ml-node+s1294792n4790646...@n4.nabble.com wrote: Hi Brad, You don't tell us if your MySQL is 32 bit? Stephan If you reply to this email, your message will be added to the discussion below: http://forum.world.st/function-unavailable-when-calling-OpenDBXDriver-for-MySQL-tp4790564p4790646.html To unsubscribe from 'function unavailable' when calling OpenDBXDriver for MySQL, click here. NAML - Brad Selfridge -- View this message in context: http://forum.world.st/function-unavailable-when-calling-OpenDBXDriver-for-MySQL-tp4790564p4790648.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
My database is 64 bit on my 64bit Ubuntu machine. However, on my 32bit Ubuntu 14.04 machine, I have a 64 debian VM running that has a 64bit MySQL running which I can access just fine from 32bit host machine running Pharo. - Brad Selfridge -- View this message in context: http://forum.world.st/function-unavailable-when-calling-OpenDBXDriver-for-MySQL-tp4790564p4790694.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
Hello Brad, On 2014-11-17 17:34, bsselfri...@gmail.com wrote: My database is 64 bit on my 64bit Ubuntu machine. However, on my 32bit Ubuntu 14.04 machine, I have a 64 debian VM running that has a 64bit MySQL running which I can access just fine from 32bit host machine running Pharo. I would guess that the 32 Bit MySQL client libraries are not installed. Please check if you have libmysqlclient:i386 and libopendbx:i386 (or what the proper name is, I'm not on an ubuntu machine right now) installed. dpkg -l | grep mysql | awk ' { print $2 } ' dpkg -l | grep dbx | awk ' { print $2 } '
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
The libmysqlclient18:amd64 looks suspicious. brad@brads-linux-laptop:~$ sudo dpkg -l | grep mysql | awk ' { print $2 } ' libdbd-mysql-perl libmysqlclient18:amd64 libmysqlclient18:i386 libmysqlcppconn7 libopendbx1-mysql libqt4-sql-mysql:i386 mysql-client mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5 mysql-utilities mysql-workbench mysql-workbench-data python-mysql.connector brad@brads-linux-laptop:~$ brad@brads-linux-laptop:~$ sudo dpkg -l | grep dbx | awk ' { print $2 } ' libopendbx1 libopendbx1-mysql brad@brads-linux-laptop:~$ - Brad Selfridge -- View this message in context: http://forum.world.st/function-unavailable-when-calling-OpenDBXDriver-for-MySQL-tp4790564p4790702.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
Hello Brad, as far as I can tell, you have the 32 bit mysql client libraries installed (don't worry, the 64 and 32 bit version can coexist) - but I am not sure about opendbx. Please try sudo apt-get install libopendbx1:i386 libopendbx1-mysql:i386 Best regards, Markus
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
On 11/17/2014 11:37 AM, Markus Fritsche wrote: sudo apt-get install libopendbx1:i386 libopendbx1-mysql:i386 brad@brads-linux-laptop:~$ sudo apt-get install libopendbx1:i386 libopendbx1-mysql:i386 [sudo] password for brad: Reading package lists... Done Building dependency tree Reading state information... Done libopendbx1:i386 is already the newest version. libopendbx1:i386 set to manually installed. libopendbx1-mysql:i386 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. brad@brads-linux-laptop:~$
Re: [Pharo-users] Opentalk or remoting libraries
For a machine to machine connection, there will be no direct memory reference but under the hood some socket connection with a tcp server and client, and some marshalling of arguments that is to say some serialization. I'm not sure it would be really faster than websocket and Fuel, because it will be a generic api that have to be able to deal with complex cases. I don't see xml and webservice here ? Le 17/11/2014 11:05, Annick Fron a écrit : Thank you, My need is on a local network from machine to machine, in real time is possible, so no security involved. I would have preferred something more performant than web services or XMLRPC, since both serialization and XML serialization are slow. Annick Le 13 nov. 2014 à 20:17, Sven Van Caekenberghe s...@stfx.eu a écrit : Nice. It is of course also important to note the security risks involved: the client can execute absolutely anything. One partial solution is to bind the server only to the localhost. On 13 Nov 2014, at 19:17, Alain Rastoul alf.mmm@gmail.com wrote: Hi, CORBA main focus is about interoperability between systems, languages (don't know about opentalk). If you want smalltalk only remote execution, you can very easily do your own on Pharo with Zinc http components and Fuel serializer: a small server that reads smalltalk blocks, evaluates them and return the result (see below an example of server and client). I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are equivalents ones or you could do the same. Beware that Fuel builds a graph of the objects touched by the object it serializes (the block) and serialize them along the way, that may be a problem if you have references to other big objects of your image. = RPC server start Zn server in background ZnServer startDefaultOn: 1701. ZnServer default delegate: (ZnWebSocketDelegate handler: ([ :webSocket | [ [ | serializedRequest request response serializedResponse | serializedRequest := webSocket readMessage. request := FLMaterializer materializeFromByteArray: serializedRequest. execute block and it's value to response byte array response := [ request value ] on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex messageText ]. serializedResponse := FLSerializer serializeToByteArray: response . webSocket sendMessage: serializedResponse . ] repeat. ] on: ConnectionClosed, ConnectionTimedOut do: [ self crLog: 'Ignoring connection or timeout' ] ]) ). = to stop the server ZnServer stopDefault . = RPC CLIENT Client call to server: calculate factorial 100 on the other side | webSocket | webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'. [ | request serializedRequest serializedResponse response | request := [ 100 factorial ] . the request is the block to evaluate serializedRequest := FLSerializer serializeToByteArray: request . serialize the block webSocket sendMessage: serializedRequest . send it serializedResponse := webSocket readMessage . read response response := FLMaterializer materializeFromByteArray: serializedResponse. deserialize to object Transcript show: response asString ; cr ] on: ConnectionClosed do: [ self crLog: 'Ignoring connection close, done' ] regards, Alain Le 12/11/2014 18:17, Annick Fron a écrit : Hi, Are there some libraries in pharo to do remote calls like in Opentalk or Corba ? Annick
Re: [Pharo-users] running out of memory while processing a 220MB csv file with NeoCSVReader - tips?
you are saying that zip ratio is somewhat related to normalized data, interesting view, and certainly true :) And right, this somewhat normalize all fields, a technique used in specialized columnstore databases (monetdb and others), often BI databases with id representing values (that were my experiments). About DateTimes, I think this is not different than with other values, using a pointer to an interned value should be equivalent to using an int, as it would be a 32 bits pointer, and with this approach, using compact records should not make a big difference too if there is not a lot of different values. The key I mentioned here is that in real life, this normalizing ratio is very high for almost every kind of data and that's what puzzles me (not the technique). Regards, Alain Le 17/11/2014 10:47, Stephan Eggermont a écrit : Open package contents on your vm, open Contents, take a look at the info.plist keySqueakMaxHeapSize/key integer541065216/integer That value needs to be increased to be able to use more than ~512 MB. Alain wrote: Let say it's your current requirement, and you want to do it like that, a trick that may help you : during personal experiments about loading data in memory and statistics from databases, I found that most often 70 to 80 % of real data is the same. It is easy to confirm if this is the case in your data: just zip the csv file. Reasonably structured relational database output often reduces to 10% of size. With explicitly denormalized data I've seen 99% reduction. In addition, DateAndTime has a rather wasteful representation for your purpose. Just reduce to one SmallInt, or with Pharo4, use slots to get a more compact record representation. Stephan
Re: [Pharo-users] running out of memory while processing a 220MB csv file with NeoCSVReader - tips?
our referential world is very restricted, whatever area we are talking about Le 17/11/2014 21:04, Alain Rastoul a écrit : you are saying that zip ratio is somewhat related to normalized data, interesting view, and certainly true :) And right, this somewhat normalize all fields, a technique used in specialized columnstore databases (monetdb and others), often BI databases with id representing values (that were my experiments). About DateTimes, I think this is not different than with other values, using a pointer to an interned value should be equivalent to using an int, as it would be a 32 bits pointer, and with this approach, using compact records should not make a big difference too if there is not a lot of different values. The key I mentioned here is that in real life, this normalizing ratio is very high for almost every kind of data and that's what puzzles me (not the technique). Regards, Alain Le 17/11/2014 10:47, Stephan Eggermont a écrit : Open package contents on your vm, open Contents, take a look at the info.plist keySqueakMaxHeapSize/key integer541065216/integer That value needs to be increased to be able to use more than ~512 MB. Alain wrote: Let say it's your current requirement, and you want to do it like that, a trick that may help you : during personal experiments about loading data in memory and statistics from databases, I found that most often 70 to 80 % of real data is the same. It is easy to confirm if this is the case in your data: just zip the csv file. Reasonably structured relational database output often reduces to 10% of size. With explicitly denormalized data I've seen 99% reduction. In addition, DateAndTime has a rather wasteful representation for your purpose. Just reduce to one SmallInt, or with Pharo4, use slots to get a more compact record representation. Stephan
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
Hi, So as far as I can see, you have all dependencies... I remember that I had to reinitialize the OpenDBX libraries to change the adaptor to the native library calls (from FFI to NBPharoOpenDBX or similar). Unfortuanetly, I don't have the image at hand.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
How would one re-initialize OpenDBX libraries? Brad Selfridge 913-269-2385 On Nov 17, 2014, at 3:35 PM, Markus Fritsche mfrits...@reauktion.de wrote: Hi, So as far as I can see, you have all dependencies... I remember that I had to reinitialize the OpenDBX libraries to change the adaptor to the native library calls (from FFI to NBPharoOpenDBX or similar). Unfortuanetly, I don't have the image at hand.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
I think it's (Smalltalk at: #NBPharoOpenDBX) installAsCurrent. Brad Selfridge 913-269-2385 On Nov 17, 2014, at 3:35 PM, Markus Fritsche mfrits...@reauktion.de wrote: Hi, So as far as I can see, you have all dependencies... I remember that I had to reinitialize the OpenDBX libraries to change the adaptor to the native library calls (from FFI to NBPharoOpenDBX or similar). Unfortuanetly, I don't have the image at hand.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
On 2014-11-17 23:14, Brad wrote: I think it's (Smalltalk at: #NBPharoOpenDBX) installAsCurrent. That sounds familiar. But since I didn't read a hooray, I guess that didn't do the trick either? Off for some sleep
Re: [Pharo-users] Citizen example for manipulating a bibtex file
Hi Sven, Sorry for my late response. The constructive comments on the list and yours in particular are very valuable to my. I was finishing some details, so only until now I have the time to implement your suggestions. The new code for custom keys on bibtex files from pharo is published at [1] (by the grace of Doru's easy publishing of playgrounds on your stfx server) [1] http://ws.stfx.eu/3CEKQQQ3NL2E By the way the article I'm writing is about a tool for open, citizen, garage research and science developed in Pharo. It is published at [2] and was stored nicely using STON[3] and is superb. To test the tool, the article was wrote on it. [2] http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/Es/Articulos/Libertadores/bootstrapping-objeto-investigacion.pdf [3] http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/Es/Articulos/Libertadores/bootstrapping-objeto-investigacion.ston [4] http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/Es/Articulos/Libertadores/bootstrapping-objeto-investigacion.markdown The only thing I would add to STON would be an option to support line breaks so long character sequences can be broken to make the format DVCS friendly (git, fossil, etc) and support collaboration and changes tracking. At this moment, because of the long lines in STON, the files are treated as binaries by fossil :-/. Thanks for STON and your lessons, Offray El 22/10/14 a las #4, Sven Van Caekenberghe escribió: On 22 Oct 2014, at 18:42, Offray Vladimir Luna Cárdenas off...@riseup.net wrote: Hi, Thanks again. I have a small script, using Citezen which does the trick. I can explore and modify the BibTeX File from the playground with this: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | bibFile bibliography bibStream bibOutputer | bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio') children detect: [:each | each basename endsWith: 'bib' ]). bibliography := CZBibParser parse: bibFile contents. bibStream := '' writeStream. 1 to: (bibliography size) do: [:index | (((bibliography entries at: index) fields at: 2) key = 'shorttitle') ifTrue: [ (bibliography entries at: index) key: ((bibliography entries at: index) fields at: 2) value]. bibOutputer := CZBibtexOutputer new. bibStream nextPutAll: (bibOutputer entryToBibtexString: (bibliography entries at: index)); cr.]. bibliography. bibFile writeStreamDo: [:stream | stream nextPutAll: bibStream contents withUnixLineEndings ]. bibStream contents. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Some constructive comments about your code (smaller is always better, especially for interactive snippets): - you can change the #detect: to [ :each | each extension = #bib ] - you can iterate directly over the entries with #do: as in bibliography entries do: [ :each | .. ] which saves you the #at: index - there are handy unary shortcuts for accessing elements, like #first, #second and so on (up to #ninth) which also save you parenthesis - you can also construct strings using the idiom String streamContents: [ :bibStream | .. ] Sorry, these jumped to me when I saw your code, I hope you don't mind ;-) I will put some functionality inspired by this on my prototype this weekend. Cheers, Offray On 10/21/2014 01:20 AM, stepharo wrote: Check in the tools there is a bib writer. Stef On 21/10/14 03:33, Offray Vladimir Luna Cárdenas wrote: Thanks Stef and Damien, I have this small script as a proof of concept: === | bibFile bibliography | bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio') children detect: [:each | each basename endsWith: 'bib' ]) contents. bibliography := CZBibParser parse: bibFile. 1 to: (bibliography size) do: [:index | (((bibliography entries at: index) fields at: 2) key = 'shorttitle') ifTrue: [ (bibliography entries at: index) key: ((bibliography entries at: index) fields at: 2) value ]]. bibliography. === Now I want to write back the corrected file to the .bib ... just having problems finding which message does the job. I'll keep searching. Cheers, Offray On 10/16/2014 06:40 AM, Damien Cassou wrote: from Damien Pollet: You will need to load the .bib file from zotero (read the file however you like, then pass the stream to the CZ parser). You'll get a CZBibSet (I don't recall the name exactly) which represents the contents of the file. A Set is composed of entries, each of which has a key and a set of fields. Finally, fields accept a few different kinds of values. Your processing is just iterating a set then setting the key of each entry (or possibly removing and re-adding the entry, I don't recall if it's implemented like a dictionary or more like a list). On Mon, Oct 13, 2014 at 2:57 AM, Offray Vladimir Luna Cárdenas off...@riseup.net mailto:off...@riseup.net