Search Results

Search found 369 results on 15 pages for 'mathias lin'.

Page 9/15 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to build march-0 for different architectures?

    - by Victor Lin
    I have some dylibs to load from python with ctypes. I can load libbass.dylib without problem, but I can't load the self-compiled libmp3lame.dylib. Here is the error I get. OSError: dlopen(libmp3lame.dylib, 6): no suitable image found. Did find: libmp3lame.dylib: mach-o, but wrong architecture Then, I inspect the file type of those libs. Here is the result of libbass.dylib: libbass.dylib: Mach-O universal binary with 2 architectures libbass.dylib (for architecture i386): Mach-O dynamically linked shared library i386 libbass.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc And here is the self-compiled one: libmp3lame.dylib: Mach-O 64-bit dynamically linked shared library x86_64 I did compile the lame library with the install instructions: ./configure make make install I'm new to mac system, here comes the problem: how to build the libmp3lame.dylib so that it supports different architecture I want? Thanks.

    Read the article

  • sqlcipher command line not working

    - by Min Lin
    I have a encrypted sqlite db and its key. (Which is generated by an android program). However, when I open the db in command line I can not read the db. The command line tool is installed by: brew install sqlcipher I open the database by: sqlcipher EnDB.db >pragma key="6b74fcd"; >select * from bizinfo; It keeps telling me "Error: file is encrypted or is not a database" However, if I open the database file with gui app sqlite database browser (which is a windows program and I run it in wine). It pops up a window for me to enter the key, with 6b74fcd as the key it successfully read the database. As I want to automatically process the db in the future, I can not depend on the GUI. Do you know why the command line is not working?

    Read the article

  • How to workaround Python "WindowsError messages are not properly encoded" problem?

    - by Victor Lin
    It's a trouble when Python raised a WindowsError, the encoding of message of the exception is always os-native-encoded. For example: import os os.remove('does_not_exist.file') Well, here we get an exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> WindowsError: [Error 2] ???????????: 'does_not_exist.file' As the language of my Windows7 is Traditional Chinese, the default error message I get is in big5 encoding (as know as CP950). >>> try: ... os.remove('abc.file') ... except WindowsError, value: ... print value.args ... (2, '\xa8t\xb2\xce\xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xc0\xc9\xae\xd7\xa1C') >>> As you see here, error message is not Unicode, then I will get another encoding exception when I try to print it out. Here is the issue, it can be found in Python issue list: http://bugs.python.org/issue1754 The question is, how to workaround this? How to get the native encoding of WindowsError? The version of Python I use is 2.6. Thanks.

    Read the article

  • ASP.NET custom server control: nested items

    - by Dylan Lin
    Hi, In the aspx code view, we can code like this: <asp:ListBox runat="server"> <asp:ListItem Text="Item1" /> <asp:ListItem Text="Item2" /> </asp:ListBox> However, the ListItem class is not a server control. How could we do that? Is there some attributes being consumed by the visual studio? Thanks:)

    Read the article

  • How to build mach-0 for different architectures?

    - by Victor Lin
    I have some dylibs to load from python with ctypes. I can load libbass.dylib without problem, but I can't load the self-compiled libmp3lame.dylib. Here is the error I get. OSError: dlopen(libmp3lame.dylib, 6): no suitable image found. Did find: libmp3lame.dylib: mach-o, but wrong architecture Then, I inspect the file type of those libs. Here is the result of libbass.dylib: libbass.dylib: Mach-O universal binary with 2 architectures libbass.dylib (for architecture i386): Mach-O dynamically linked shared library i386 libbass.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc And here is the self-compiled one: libmp3lame.dylib: Mach-O 64-bit dynamically linked shared library x86_64 I did compile the lame library with the install instructions: ./configure make make install I'm new to mac system, here comes the problem: how to build the libmp3lame.dylib so that it supports different architecture I want? Thanks.

    Read the article

  • In Ruby on Rails, why will story.votes return an empty Array object, but story.votes.create will act

    - by Jian Lin
    In Ruby on Rails, say a Story object can "has_many" Vote objects (a story is voted "hot" by many users). So when we do a s = Story.find(:first) s is a Story object, and say s.votes returns [] and s.votes.class returns Array So clearly, s.votes is an empty Array object. At this time, when s.votes.create is called, it actually invokes a method of the Vote class? How come an Array class object can invoke a Vote class method?

    Read the article

  • Does jQuery have a plugin to display a "message bar" like the Twitter "wrong password" bar at the to

    - by Jian Lin
    Twitter will pop down a message bar at the top of the screen say "Wrong password" and after 10 seconds, it will slide up and disappear. Chrome also shows "Do you want to save the password" message box using such a way. Does jQuery have a plug in to do that already? Does it also work in IE 6? Because usually, the display of relative to the viewport (using position: fixed) will not work on IE 6. thanks.

    Read the article

  • PHP cron script with twitter (problem with oauth)

    - by James Lin
    Hi guys, I am trying to write an php twitter script which will be run by crontab, what the script does is to get the tweets from a dedicated twitter account. I have looked at some of the php twitter oauth libraries, all of them seem to use redirect to a twitter page to get a token, then goes back to a callback link. In my case I don't want to have any user interaction at all. Could anyone please tell me what I should do? Regards James

    Read the article

  • In Ruby, how to implement 20 - point and point - 20 using coerce() ?

    - by Jian Lin
    In Ruby, the operation of point - 20 20 - point are to be implemented. But the following code: class Point attr_accessor :x, :y def initialize(x,y) @x, @y = x, y end def -(q) if (q.is_a? Fixnum) return Point.new(@x - q, @y - q) end Point.new(@x - q.x, @y - q.y) end def -@ Point.new(-@x, -@y) end def *(c) Point.new(@x * c, @y * c) end def coerce(something) [self, something] end end p = Point.new(100,100) q = Point.new(80,80) p (-p) p p - q p q - p p p * 3 p 5 * p p p - 30 p 30 - p Output: #<Point:0x2424e54 @x=-100, @y=-100> #<Point:0x2424dc8 @x=20, @y=20> #<Point:0x2424d3c @x=-20, @y=-20> #<Point:0x2424cc4 @x=300, @y=300> #<Point:0x2424c38 @x=500, @y=500> #<Point:0x2424bc0 @x=70, @y=70> #<Point:0x2424b20 @x=70, @y=70> 30 - p will actually be taken as p - 30 by the coerce function. Can it be made to work? I am actually surprise that the - method won't coerce the argument this way: class Fixnum def -(something) if (/* something is unknown class */) a, b = something.coerce(self) return -(a - b) # because we are doing a - b but we wanted b - a, so it is negated end end end that is, the function returns a negated version of a - b instead of just returning a - b.

    Read the article

  • Can a binary tree or tree be always represented in a Database as 1 table and self-referencing?

    - by Jian Lin
    I didn't feel this rule before, but it seems that a binary tree or any tree (each node can have many children but children cannot point back to any parent), then this data structure can be represented as 1 table in a database, with each row having an ID for itself and a parentID that points back to the parent node. That is in fact the classical Employee - Manager diagram: one boss can have many people under him... and each person can have n people under him, etc. This is a tree structure and is represented in database books as a common example as a single table Employee.

    Read the article

  • Can MySQL / SQL's short hand of "Using" be used without saying "Inner Join" ?

    - by Jian Lin
    The following 2 statements are to join using gifts.giftID = sentgifts.giftID: mysql> select * from gifts, sentgifts using (giftID); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using (giftID)' at line 1 and the second one: mysql> select * from gifts INNER JOIN sentgifts using (giftID); +--------+------------+----------------+---------------------+--------+------------+--------+------+---------------------+ | giftID | name | filename | effectiveTime | sentID | whenSent | fromID | toID | trytryWhen | +--------+------------+----------------+---------------------+--------+------------+--------+------+---------------------+ | 2 | teddy bear | bear.jpg | 2010-04-24 04:36:03 | 4 | 2010-04-24 | NULL | 111 | 2010-04-24 03:10:42 | | 6 | beer | beer_glass.png | 2010-04-24 05:18:12 | 5 | 2010-03-03 | 11 | 22 | 2010-03-03 00:00:00 | | 6 | beer | beer_glass.png | 2010-04-24 05:18:12 | 6 | 2010-04-24 | 11 | 222 | 2010-04-24 03:54:49 | | 6 | beer | beer_glass.png | 2010-04-24 05:18:12 | 7 | 2010-04-24 | 1 | 2 | 2010-04-24 03:58:45 | +--------+------------+----------------+---------------------+--------+------------+--------+------+---------------------+ 4 rows in set (0.00 sec) Can the first statement also use the "using" shorthand? It seems that when it is used then the word "Inner Join" must be specified... but the first statement is actually an inner join?

    Read the article

  • Is using Natural Join or Implicit column names not a good practice when writing SQL in a programming

    - by Jian Lin
    When we use Natural Join, we are joining the tables when both table have the same column names. But what if we write it in PHP and then the DBA add some more fields to both tables, then the Natural Join can break? The same goes for Insert, if we do a insert into gifts values (NULL, "chocolate", "choco.jpg", now()); then it will break the code as well as contaminating the table when the DBA adds some fields to the table (example as column 2 or 3). So it is always best to spell out the column names when the SQL statements are written inside a programming language and stored in a file in a big project.

    Read the article

  • Programmatically controlled virtual drive

    - by Robert Lin
    How would I go about creating a virtual drive with which I can programmatically and dynamically change the contents? For instance, program A starts running and creates a virtual drive. When program B looks in the drive, it sees an error log and starts reading/processing it. In the middle of all this program A gets a signal from somewhere and decides to add to the log. I want program B to be unaware of the change and just keep on going. Program B should continue reading as if nothing happened. Program A would just report a rediculously large file size for the log and then fill it in as appropriate. Program A would fill the log with tags if program B tries to read past the last entry. I know this is a weird request but there's really no other way to do this... I basically can't rewrite program B so I need to fool it. How do I do this in windows? How about OSX?

    Read the article

  • In Ruby, can the coerce() method know what operator it is that requires the help to coerce?

    - by Jian Lin
    In Ruby, it seems that a lot of coerce() help can be done by def coerce(something) [self, something] end that's is, when 3 + rational is needed, Fixnum 3 doesn't know how to handle adding a Rational, so it asks Rational#coerce for help by calling rational.coerce(3), and this coerce instance method will tell the caller: # I know how to handle rational + something, so I will return you the following: [self, something] # so that now you can invoke + on me, and I will deal with Fixnum to get an answer So what if most operators can use this method, but not when it is (a - b) != (b - a) situation? Can coerce() know which operator it is, and just handle those special cases, while just using the simple [self, something] to handle all the other cases where (a op b) == (b op a) ? (op is the operator).

    Read the article

  • Can Ruby on Rails handle AJAX Response by Static Javascript code? by using RJS?

    - by Jian Lin
    So it looks like on RoR, when Ajax (using form_remote_tag) returns a success code, Javascript is also returned to handle the visual effects. (this is the RJS mechanism) using Fiddler, I do see the following response: try { Element.update("vote_score", "Score 58"); $("vote_score").visualEffect("highlight"); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.update(\"vote_score\", \"Score 58\");\n$(\"vote_score\").visualEffect(\"highlight\");'); throw e } Will there be situation where the code is quite big (like 1 or 2k) that RJS can use some sort of static Javascript already loaded to handle the effect? Is there any other ways to use static Javascript already loaded with the page? Must it be just raw Javascript and use the Prototype's Ajax success response to call the static Javascript code, or can it be some Rails mechanism related to RJS?

    Read the article

  • Why single textarea mess all following xhtml?

    - by Victor Lin
    I encounter a problem in my web program. I got a textarea in my form, sometimes there is nothing in textarea, so genshi template engine just output it as <textarea xxxx /> and here comes the problem, all following tags are in the textarea. Why all browser can't handle single textarea correctly? If I write it as <textarea xxxx></textarea> and everything works fine. Why a single textarea messes following tags in xhtml?

    Read the article

  • How to implement a link that can get bonus for 5 times by different people on a Social Network?

    - by Jian Lin
    How can we generate a link that can be clicked on by 5 different people on a Social Network game, so that each of the five people can get a bonus? The link will be published as a "newsfeed" on the Social Network such as Facebook. The link shouldn't be easily "generated" by any people as a cheating method. Also, what database table(s) should be added to handle: 1) the bonus can be claimed up to 5 times 2) must be claimed by different people ?

    Read the article

  • Can GIT, Mercurial, SVN, or other version control tools work well when project tree has binary files

    - by Jian Lin
    Sometimes our project tree can have binary files, such as jpg, png, doc, xls, or pdf. Can GIT, Mercurial, SVN, or other tools do a good job when only part of a binary file is changed? For example, if the spec is written in .doc and it is part of the repository, then if it is 4MB, and edited 100 times but just for 1 or 2 lines, and checked in 100 times during the year, then it is 400MB. If it is 100 different .doc and .xls files, then it is 40GB... not a size that is easy to manage. I have tried GIT and Mercurial and see that they both seem to add a big size of data even when 1 line is changed in a .doc or .pdf. Is there other way inside of GIT or Mercurial or SVN that can do the job?

    Read the article

  • Why in Ruby, a || 1 will throw an error when `a` is undefined, but a = a || 1 will not?

    - by Jian Lin
    When a is undefined, then a || 1 will throw an error, but a = a || 1 will not. Isn't that a little bit inconsistent? irb(main):001:0> a NameError: undefined local variable or method `a' for main:Object from (irb):1 from c:/ruby/bin/irb:12:in `<main>' irb(main):002:0> a || 1 NameError: undefined local variable or method `a' for main:Object from (irb):2 from c:/ruby/bin/irb:12:in `<main>' irb(main):003:0> a = a || 1 => 1

    Read the article

  • Does Ruby on Rails "has_many" array provide data on a "need to know" basis?

    - by Jian Lin
    On Ruby on Rails, say, if the Actor model object is Tom Hanks, and the "has_many" fans is 20,000 Fan objects, then actor.fans gives an Array with 20,000 elements. Probably, the elements are not pre-populated with values? Otherwise, getting each Actor object from the DB can be extremely time consuming. So it is on a "need to know" basis? So does it pull data when I access actor.fans[500], and pull data when I access actor.fans[0]? If it jumps from each record to record, then it won't be able to optimize performance by doing sequential read, which can be faster on the hard disk because those records could be in the nearby sector / platter layer -- for example, if the program touches 2 random elements, then it will be faster just to read those 2 records, but what if it touches all elements in random order, then it may be faster just to read all records in a sequential way, and then process the random elements. But how will RoR know whether I am doing only a few random elements or all elements in random?

    Read the article

  • How to do a comet long pulling with ActionScript3?

    - by Victor Lin
    I want to load data from my web server, I want it be the AJAX/Comet way, my web-server long holds the request, response it until something happened. Thus, I wrote some as3 code like this: private function load(): void { var request:URLRequest = new URLRequest(url); var variables:URLVariables = new URLVariables(); variables.tick = this.tick; request.data = variables; urlLoader = new URLLoader(request); urlLoader.addEventListener(Event.COMPLETE, onComplete); urlLoader.addEventListener(IOErrorEvent.IO_ERROR , onIOError); log.info("Loading info from {0}", request.url); } It works, if the waiting time is short, but however, it failed with IOError 2032, seems the waiting time is out. Here is the problem, how can I do a long-polling with as3 and avoid the timeout error? Thanks.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15  | Next Page >