Jump to content

figo2476

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

figo2476's Achievements

Member

Member (2/5)

0

Reputation

  1. $ldap_url = "ldaps://example.com"; $ldap_port = 636; $ldap_conn = ldap_connect($ldap_url, $ldap_port); echo "ldap_conn: $ldap_conn\n"; $base_dn = "ou=something,o=something"; $filter = "(&(something=*)(something=staff))"; $ldap_search_res = ldap_search($ldap_conn, $base_dn, $filter); ldap_close($ldap_conn); I run this on my ubuntu, but it says "cannot connect to ldap server". I have a perl script doing exactly the same thing, but it works. I suspect it may be this --> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560161 (The workaround doesn't work for me)
  2. One of my form allows user to enter foreign languages (e.g French). I use CKEditor (what you see what you get editor), so people can type whatever they want. For example, if I type "&", it will store it as "&" in the database. This applies to foreign languages as well. When I export data as CSV file, those "&" will display as "&" in Microsoft Excel, but not "&". (This happens to the French as well) I am not sure how to handle them.
  3. Hi, I have been given this question and would like to get some ideas. Any thought is appreciated. a)"RADIUS" is an abbreviation of "Remote Authentication Dial In User Service" b)"TCP/IP" is an abbreviation of "Transmission Control Protocol / Internet Protocol" c)"FedEx" is an abbreviation of "Federal Express" d)"Bigpost is an abbreviation of "Big Post" e)"Cisco" is an abbreviation of "San Francisco" f)"ragnat" is a (rather silly) abbreviation of "Teragen International" In the above list: a) and b) are simple abbreviations (acronyms). The abbreviation is formed by taking the first letter of each word in the list. c) and d) are complex abbreviations, they consist of one or more letters from the beginning of each word in the list. e) and f) are substring abbreviations, they may take any part of any word as long as the letters appear in the original presented order. I am able to match them, but it is still NOT able to tell it is simple, complex or substring abbreviations. (I wonder how) Here is the code in PHP: $abbr = strtolower($abbr); $longstr = strtolower($longstr); $pattern = implode('.*?', str_split($abbr)); $condi = preg_match("/$pattern/", $longstr); if($condi == true) { echo "Match!"; } else { echo "Doesn't match!"; }
  4. Hi: I have fairly simple question: * $xmltext = "http://services.digg.com/stories/topic/mods?count=1&appkey=http%3A%2F%2Fexample.com%2fapplication"; * $xml = new SimpleXMLElement($xmltext); If you paste the URL on browser, you will see the output of XML file (I guess it is generated). I guess I cannot use SimpleXMLElement in this way, since there is no such file. I wonder what is the correct to handle it.
  5. It seems I have great details in hand, but they may be ambiguous. I wonder am I supposed to use them. I guess the task is to test how I handle software requirement and client relationship. I am not very clear what is the purpose of the question.
  6. Hi: I am asked a software requirements question and would like to bring it to discussion. (The company's core business customize open source software to suite the client needs.) The client has an old flash + text + a few menus website. They need a much better website, since they change their business model. There are requirements. (I simplify them and brief here) [pre] * Content updates + extra menus. * New business model * News letter - display on the site or via email * Events listing * Users management * Register * Buy courses e.g. accounting course, software course * Manage users * Prospective employees upload resumes * Photo gallery (Senior management) [/pre] The question is what is my initial response? I initially think: * I will prepare use cases, site plan to present to the client. * Website mock up. * More?
  7. Hi: I am not very familiar with regular expression. e.g. (?[^:\s]++) From my understanding, e.g. whatever: will "whatever" matches ?, and ":" will match : (That is not correct, right? Because there is another ":" at the end) But if I ignore the "?:" at the beginning, I am able to understand. It just try to match "whatever:". Also I am not sure "++", why no "+" only?
  8. Hi: I have this question. Something like article:"The winter" will become key & value like article=>"The winter" Notice the ":". If it doesn't have ":", then it may be Example 1. I was thinking if I am able to replace the space inside the double quotes, then I will be able to explode the string with space, but how can I replace the spaces within the double quotes? I guess regular expression will be helpful.... Is there any hint, anyone? Example 1: Input - "You are" "the best" digg hello Output - array( "normal" => array("You are", "the best", "digg", "hello") ) Example 2: Input - song:"The best year" writer:jason Output - array("song"=>"The best year", "writer"=>"jason") Example 3: Input - article:"The winter" bruce lee Output - array( "article"=>"The winter", "normal"=>array("bruce", "lee") ) Example 4: Input - software:linux linux father title:"open source" Output - array( "software"=>linux, "title"=>"open source", "normal"=>array("linux", "father") )
  9. In php, it is able to do: $method_name = "save"; $object->$method_name; I wonder is there any way I can do a substitution like this in javascript.
  10. Reply to JADASDesigner: * Images are uploaded. * XML file is at xml/images.xml and the swf file is next to xml/ The relative path inside the .swf is set to xml/images.xml to load images. * Here is my guess: When using relative path in flash, the swf will depend on the decent url, which user accesses. So flash can figure the actual path by adding the decent url + relative path. e.g. http://domain/test/gallery/display.swf But if it is used in some php framework (e.g. phpcake), the relative path won't work, since it is wrong. e.g. http://domain/controler/action/display.swf
  11. Hi: I have a flash photo gallery. What it does is to load external xml, which contains locations of images. * It works well, when it is accessed via decent url e.g. http://domain/test/gallery/display.swf so /test, /gallery are folders in the server * But it is accessed via e.g. http://domain/controler/action (Model view controller pattern for example) The flash appears, but it cannot display images and it seems it can't find the xml file. I wonder do you guys have the same problem or is there any way to get around.
  12. Hi: I just download a free version of flash_page_flip from http://www.flashpageflip.com/ I set up a file structure like this, based on the package from the site: /book /book/index.php /book/js/ --> swfobject.js /book/swf/ --> Magazine.swf, Pages.swf /book/txt/Lang.txt /book/xml/Pages.xml How it works? I assume when it accesses from the this uri (http://www.finditreadit.com/afl/aflannualreport/aflannualreport2006/mode/book). It will loads Magazine.swf Magazine.swf then loads images as pages from the server to Pages.swf Why is it called dynamic uri? Because it is not based on file system in the server. It is a bit like model view controller used by rail. Access via dynamic uri http://www.finditreadit.com/afl/aflannualreport/aflannualreport2006/mode/book You will see a cycle there. That means the flash is still loading, but it never finish. Access via static uri (It is based on the paths of the server) http://www.finditreadit.com/test/all/aflannualreport/aflannualreport2006/book (I disable it, but it is tested.) It will work. My understanding: I assume when it access via static uri. The flash uses relative paths. That means I only need to specify parts of the file paths. While accessing dynamic uri, flash file must rely on full file path. So I assume Magazine.swf doesn't know where to find Pages.swf What about your thought?
  13. function my_md5($filename) { $temp_f = '/tmp/my_md5-'. rand(100, 999) .'.jpg'; $src_img = imagecreatefromjpeg($filename); imagejpeg($src_img, $temp_f); imagedestroy($src_img); $md5 = @md5_file($temp_f); @unlink($temp_f); return $md5; } I assume md5 will actually look into the content of a file and hash it. By doing this, write the file to a tmp folder, will increase the chance to have a random hash
  14. Hi: md5_file gives same hash of 2 different image jpg files. I assume: 1. One image is a copy of another, but it has different file names. Or 2. It will give the same hash for 2 different files, somehow. Does anyone has any idea why this happen?
  15. Wow.. thank you for everyone. Hmm.. Not sure why IE6, 7 cannot figure it out. FF and safari understand the difference of same name, but modified file.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.