Search Results

Search found 323 results on 13 pages for 'jian lin'.

Page 7/13 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13  | 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

  • 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

  • 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

  • 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

  • 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

  • How to get real-time status notification with Facebook SDK via listener

    - by Mathias Lin
    I'm using Twitter4j and the Android Facebook SDK to fetch status messages. With Twitter4J I get real-time notifications whenever a new status has been added to the stream via StatusListener (Twitter4J). In the Facebook SDK I cannot find a similar way, I can only fetch entire streams over and over again in a fixed time interval using RequestListener (Facebook SDK) as far as I see it. Is there any way to get notified of new statuses in realtime with the Facebook SDK in a similar way as with Twitter4J? (Found a similar but unanswered question here: Facebook real-time updated application wall)

    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

  • Google groups not finding discussion thread but regular google search does?

    - by Mathias Lin
    I'm having a problem with google groups and finding my own discussion threads. I go to the google group (in my case Android developer group) web view and try to search for my thread by entering the extact title of my thread. But it doesn't appear in the search results. On the other hand, when I search for the same title in the regular google web search, I get the thread right on top of the result list. I thought it might take a while until the groups index all new threads, but still after a few days, it still wouldn't show up. Sample: My thread is here: http://groups.google.com/group/android-developers/browse_thread/thread/0ab41d5056a25ce7 Doing a search for it in Google groups (will give one result, but not mine): http://groups.google.com/group/android-developers/search?group=android-developers&q=Strange+behaviour+with+mediaplayer+and+seekTo&qt_g=Search+this+group Search in Google web search (shows my thread as first result): http://www.google.de/search?sourceid=chrome&ie=UTF-8&q=Strange+behaviour+with+mediaplayer+and+seekTo

    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 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Why is the ( ) mandatory in the SQL statement select * from gifts INNER JOIN sentgifts using (giftID

    - by Jian Lin
    Why is the ( ) mandatory in the SQL statement select * from gifts INNER JOIN sentgifts using (giftID); ? The ( ) usually is for specifying grouping of something. But in this case, are we supposed to be able to use 2 or more field names... in the example above, it can be all clear that it is 1 field, is it just that the parser is not made to bypass the ( ) when it is all clear? (such as in the language Ruby).

    Read the article

  • It seems like the safest way to think of an Inner Join is to think of it as a Cross Join and then sa

    - by Jian Lin
    It seems like the safest way to think of an Inner Join is to think of it as a Cross Join and then satisfying some condition(s)? Because the equi-join can be obvious, but the non-equi-join can be a bit confusing. But if we always use the Cross Join, and then filter out the ones satisfying the condition, then we get the resulting table. In other words, we can always analyze it by using the first record on the left table, and then go through every single records on the right, and then repeat that for 2nd record on the left, and for the 3rd, 4th, ... etc. So in our mind, we can analyze it using this way, and it is like O(n^2), although what happens in the DBMS maybe that it is a lot faster (when an index is present). Is there another good way to think of it besides this method?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13  | Next Page >