Daily Archives

Articles indexed Thursday May 27 2010

Page 2/122 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Inconsistent get_class_methods vs method_exists when using UTF8 characters in PHP code

    - by coma
    I have this class in a UTF-8 encoded file called EnUTF8.Class.php: class EnUTF8 { public function ñññ() { return 'ñññ()'; } } and in another UTF-8 encoded file: require_once('EnUTF8.Class.php'); require_once('OneBuggy.Class.php'); $utf8 = new EnUTF8(); //$buggy = new OneBuggy(); echo (method_exists($utf8, 'ñññ')) ? 'ñññ() exists!' : 'ñññ() does not exist...'; echo "\n\n----------------------------------\n\n" print_r(get_class_methods($utf8)); echo "\n----------------------------------\n\n" echo $utf8->ñññ(); that produces the expected result: ñññ() exists! ---------------------------------- Array ( [0] => ñññ ) ---------------------------------- ñññ() but if... require_once('EnUTF8.Class.php'); require_once('OneBuggy.Class.php'); $utf8 = new EnUTF8(); $buggy = new OneBuggy(); echo (method_exists($utf8, 'ñññ')) ? 'ñññ() exists!' : 'ñññ() does not exist...'; echo "\n\n----------------------------------\n\n" print_r(get_class_methods($utf8)); echo "\n----------------------------------\n\n" echo $utf8->ñññ(); then the weirdness appears!!!: ñññ() does not exist! ---------------------------------- Array ( [0] => ñññ ) ---------------------------------- Fatal error: Call to undefined method EnUTF8::ñññ() in /var/www/test.php on line 16 Well, the thing is that OneBuggy.Class.php is UTF-8 encoded too and shares absolutly nothing with EnUTF8.Class.php so... where is the bug? UPDATED: Well, after a long debugging time I found this in OneBuggy.Class.php constructor: setlocale (LC_ALL, "es_ES@euro", "es_ES", "esp"); so I did... //setlocale (LC_ALL, "es_ES@euro", "es_ES", "esp"); and now it works but why?.

    Read the article

  • Mac Safari randomly recreating cookie when I refresh my login screen. Very bizarre

    - by mcintyre321
    We have found an issue in our app where Safari on the Mac randomly recreates a login cookie from a logged off session. I have a fiddler archive with this behaviour here. Note that some stuff has been removed from this to make it easier to get, but nothing which sets a cookie or anything has been taken out - only repetitions of requests 3-8. I'll talk you through the running order Request 1: user logs out via call to /logout.aspx - Set-Cookie returned setting cookie expiry date to 1999 Requests 2-8: user refreshes login page sending calls to root or /res/en-US/s.js - no cookie is sent to server or received back, and access is denied. I have cut out a lot of requests of this nature from the log as they are boring Request 9: request for /res/en-US/s.js - Hv3 authentication cookie has mysteriously reappeared! Wat. There was NO set-cookie! WTFF! Request 10+ : now the cookie has reappeared, the site logs the user in AGAIN The cookie, when examined in Safari looks like <dict> <key>Created</key> <real>259603523.26834899</real> <key>Domain</key> <string>.mysite.dev</string> <key>Expires</key> <date>2010-03-24T16:05:22Z</date> <key>HttpOnly</key> <string>TRUE</string> <key>Name</key> <string>.Hv3</string> <key>Path</key> <string>/</string> </dict> One thing to note is that in Safari, the cookie domain is .mysite.dev not mysite.dev (which is the cookie domain specified in web.config) - however, given that access is denied in requests 2-8, it looks like the cookie has expired OK. If you look in the list of cookies in the browser during 2-8, the .Hv3 cookie is not there. Is this our bug or Safari's? What can I do to stop it happening?

    Read the article

  • Blogger issue with custom background images on Chrome and Safari

    - by hdx
    This is weird, the site in question is blog.andrebatista.info and it is a hosted at blogger.com. I'm trying to make the blogger template look the same as the one in my main website, www.andrebatista.info. For some reason if I go directly to the blog address Chrome and Safari fail to display all of my background images... all of them. However if I first go to www.andrebatista.info first and then go to the blog it renders just fine ?¿ The way I'm customizing it is by adding a link to my main site's stylesheet at the very end of the head tag on the blogger template. That stylesheet is displayed below: *{ margin:0; padding:0; border:0; } html,body { background:#064169 url(http://www.andrebatista.info/images/main_gradient_slice.jpg) repeat-x; font-family: Arial, "MS Trebuchet", sans-serif; font-size:18px; } #main_wrapper{ margin: 0 auto; width:1024px; } #header{ background: url(http://www.andrebatista.info/images/header.jpg); height:133px; border:none; margin:0; } #menu_wrapper{ background: url(http://www.andrebatista.info/images/menu.jpg); height:34px; overflow:hidden; } #menu_wrapper .menu_item{ color:white; float: left; border: 1 px solid red; height: 34px; padding-top:10px; text-align:center; width:100px; } #menu_wrapper .first{ padding-left:240px; float:left; width:100px; } #menu_wrapper .active,#menu_wrapper .menu_item:hover{ background-color:white; color:Teal; cursor: pointer; } #content_area_wrapper{ background: url(http://www.andrebatista.info/images/body_bg_slice.jpg) repeat-y; } #content_area{ min-height:524px; background: url(http://www.andrebatista.info/images/main_content_top.jpg) repeat-x; } #main_banner{ background: url(http://www.andrebatista.info/images/main_banner.jpg) no-repeat center center; width:662px; height:338px; margin: 0 auto; } #main_banner div{ color:white; padding-left:47px; padding-right:164px; padding-top:105px; } #text_area{ overflow:hidden; width:662px; margin:0 auto; padding:14px; } #contentList{ padding:0 20px 20px 20px; } #text_area .left{ width:50%; float:left; } #text_area .left{ width:50%; float:right; } #footer2{ background: url(http://www.andrebatista.info/images/footer.jpg); height:62px; } #footer{ background: url(http://www.andrebatista.info/images/footer.jpg); height:62px; } Any ideas on what I could be missing?

    Read the article

  • ASP.NET MVC PartialView generic ModelView

    - by Greg Ogle
    I have an ASP.NET MVC application which I want to dynamically pick the partial view and what data gets passed to it, while maintaining strong types. So, in the main form, I want a class that has a view model that contains a generically typed property which should contain the data for the partial view's view model. public class MainViewModel<T> { public T PartialViewsViewModel { get; set; } } In the User Control, I would like something like: Inherits="System.Web.Mvc.ViewUserControl<MainViewModel<ParticularViewModel>>" %> Though in my parent form, I must put Inherits="System.Web.Mvc.ViewPage<MainViewModel<ParticularViewModel>>" %> for it to work. Is there a way to work around this? The use case is to make the user control pluggable. I understand that I could inherit a base class, but that would put me back to having something like a dictionary instead of a typed view model.

    Read the article

  • Weird problem with PHP mail() under Linux.

    - by Vilx-
    This is the case when it "works on my machine". Except that my machine is Windows, and the target is some sort of Linux. The idea is that the mail() function puts a newline between the MIME-Version and Content-Type headers, thus breaking the whole thing. Here's the code, simpliefied as much as possible: <?php $HTMLPart = chunk_split(base64_encode('<html><body style="color: red">Test.</body></html>')); $PlaintextPart = chunk_split(base64_encode('>>> TEST <<<')); $Headers =<<<AKAM From: "My Test" <[email protected]> Reply-To: [email protected] MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="9-1410065408-1410065408=:27514" AKAM; $Body =<<<AKAM This is a multi-part message in MIME format. --9-1410065408-1410065408=:27514 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: base64 $PlaintextPart --9-1410065408-1410065408=:27514 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: base64 $HTMLPart --9-1410065408-1410065408=:27514-- AKAM; echo 'Try 3: '; echo mail('[email protected]', 'Testmail', $Body, $Headers) ? 'WIN' : 'FAIL'; ?>

    Read the article

  • Visual Studio 2008 - Why do my windows keep rearranging themselves?

    - by nailitdown
    Every so often (at least a couple of times a day), my VS2008 windows are rearranging themselves. Team/Solution/Server Explorer - They jump from the right sidebar down to the bottom, or suddenly become free-floating. Same with Errors/Pending Changes/etc. free-floating or suddenly gone, as if they've been closed. It is very strange behaviour. Has anyone else experienced it? Am I doing something silly that would account for this?

    Read the article

  • Weird behavior in referring to global variable. Is this a bug in javascript? Surely it isn't!

    - by Chandan .
    Consider the following piece of code. <html> <body> <script> var x = 5; //globally declared function showX() { alert("x="+x); //trying to display global value var x=10; //trying to create and initialize a local x } </script> <input type = "button" value="Show X" onclick="showX()"> </body> </html> The alert statement shows 'x=undefined'. And doesn't print the global value of x as expected. An equivalent java code would display 5! So, is it a bug? If not then how does one explain that behavior?

    Read the article

  • Make Mac OS X mouse acceleration more Windows-like

    - by TomA
    The mouse acceleration on Mac OS X is driving me nuts. It may work for touchpads but nothing beats the Windows' acceleration curves. Is there a way to modify the behaviour on OS X? I tried getting a Microsoft mouse driver for OS X but it didn't work since my mouse is not from Microsoft.

    Read the article

  • With MSDN and BizSpark, Cloud Computing is Closer than You Think

    Cloud computing offers significant advantages for businesses of all sizes, and it's easier to get started than you think. Microsoft makes Windows Azure compute time available for MSDN subscribers, as well as for software start-ups through the Microsoft BizSpark program. Learn why cloud computing is a good fit for you and how you can get started.

    Read the article

  • Android PCM Bytes

    - by Pintac
    Hi I am using the AudioRecord class to analize raw pcm bytes as it comes in the mic. So thats working nicely. Now i need convert the pcm bytes into decibel. I have a formula that takes sound presure in Pa into db. db = 20 * log10(Pa/ref Pa) So the question is the bytes i am getting from audiorecorder from the buffer what is it is it amplitude pascal sound pressure or what. I tried to putting the value into te formula but it comes back with very hight db so i do not think its right thanks

    Read the article

  • how to add column in SQL Query that incl. LEFT OUTER JOIN

    - by radbyx
    I have this Query: SELECT p.ProductName, dt.MaxTimeStamp, p.Responsible FROM Product p LEFT JOIN (SELECT ProductID, MAX(TimeStamp) AS MaxTimeStamp FROM StateLog WHERE State = 0 GROUP BY ProductID, Status) dt ON p.ProductID = dt.ProductID ORDER BY p.ProductName; It works like it should, but now I need to SELECT "State" out too. The tricky part is, that I only want the lastest "TimeStamp" where "State" was false. But now I also need the "State" for the lastest "TimeStamp". I tried this: SELECT p.ProductName, dt.State, dt.MaxTimeStamp, p.Responsible FROM Product p LEFT JOIN (SELECT ProductID, MAX(TimeStamp) AS MaxTimeStamp, State FROM StateLog WHERE State = 0 GROUP BY ProductID, Status) dt ON p.ProductID =dt.ProductID ORDER BY p.ProductName; But it didn't work, because it gave me the "State" for the lastest "TimeStamp". So I hope there is some clever heads out there that can help me. I'm guessing that this is either very simple or very hard to solve.

    Read the article

  • (Java) weird value of System.getProperty("os.version")

    - by Helpme
    hello fellow java developers, Im trying toget the System.getProperty("os.name") of my own machine. I am running a java application directly from the machine from within eclipse. My machine is "windows 7" the returned value is "windows vista" ! Seems wrong, very wrong. and yes I am sure that I am running the app on a windows 7 machine... Any ideas as to what is going on here?

    Read the article

  • unix utilities under Android

    - by Shapour
    I have a smartQ V5 device running Android ( 1.6, I think) Q: I can not do simple unix things (find, more, ... ) on this device. they are not there. Do I aomehow downlooad them? apt-get is not there either; is there an alternative?

    Read the article

  • summer experiment: GWT & python for a trading game- arch question

    - by sadhu_
    Hi, As a summer learning experiment, I'm thinking of coding up a web front end for a trading game i wrote in python, that generates share prices and random snippets of text. I am sort of struggling with how this should work on the back-end though. I'd rather have my GWT client page interact with the python share price generator, than to try and re-code it in java. I suppose i could use an sqlite db, and then use jdbc to pick up the prices, but i was wondering if there is a better way, for me to be able to poll some python script either from my client page, or from the serverside java code ? I found this python wrapper, but i'm not sure how i could use it though: http://code.google.com/apis/visualization/documentation/dev/gviz_api_lib.html Thanks.

    Read the article

  • Writing a Jeweler Rakefile that adds dependencies depending on RUBY_ENGINE (ruby or jruby)

    - by Matt Zukowski
    I have a Rakefile that includes this: Jeweler::Tasks.new do |gem| # ... gem.add_dependency('json') end The gemspec that this generates builds a gem that can't be installed on jruby because the 'json' gem is native. For jruby, this would have to be: Jeweler::Tasks.new do |gem| # ... gem.add_dependency('json-jruby') end How do I conditionally add the dependency for 'json-jruby' when RUBY_ENGINE == 'java'? It seems like my only option is to manually edit the gemspec file that jeweler generates to add the RUBY_ENGINE check. But I'd rather avoid this, since it kind of defeats the purpose of using jeweler in the first place. Any ideas?

    Read the article

  • NHibernate : recover session after connection lost

    - by Catalin DICU
    I'm using NHibernate with SQL Server 2005 in a WPF client application. If I manually stop the SQL Server service and then restart it the session doesn't automatically reconnect. So far I'm doing this witch seems to work : try { using (ITransaction transaction = this.Session.BeginTransaction()) { // some select here } }catch(Exception ex) { if(this.Session.Connection.State == ConnectionState.Closed) { try { this.Session.Connection.Open(); } catch (Exception) { } } } Is there a better way ?

    Read the article

  • Tool to diagonalize large matrices

    - by Xodarap
    I want to compute a diffusion kernel, which involves taking exp(b*A) where A is a large matrix. In order to play with values of b, I'd like to diagonalize A (so that exp(A) runs quickly). My matrix is about 25k x 25k, but is very sparse - only about 60k values are non-zero. Matlab's "eigs" function runs of out memory, as does octave's "eig" and R's "eigen." Is there a tool to find the decomposition of large, sparse matrices? Dunno if this is relevant, but A is an adjacency matrix, so it's symmetric, and it is full rank.

    Read the article

  • What is the best API in any language for Audio and MIDI music application development?

    - by noneme
    What, in your opinion, is the best API to utilize in developing an application that handles both realtime MIDI and audio input and output? This would be for an application that is used in the process of making music as opposed to playing audio or MIDI files. I'm aware that this may be a subjective question, but if you know of an API that is dominantly used for these purposes, please share it. I'm agnostic about which language the API is for, and I also don't care about portability. The real concern is for an API that is well documented, well designed (e.g. thought out and intuitive to developers using it), and actively maintained. OS portability would be nice, but it is second to having an API/Language that meets the previous requirements. Please note that the emphasis is not on API's for sound synthesis or for composing music with code. It is intended for the handling of sound file and MIDI data in a real-time context.

    Read the article

  • Passing a Variable into jQuery AJAX

    - by Scott
    I'm stuck in a rut. I hope some one can help. Basically, I am building an AJAX mobile web app with jQuery. I am able to parse a specific XML file just fine, but I want the option to parse other XML files based on the link they were clicked on and load them on the fly into the same DIV or UL. So: click on Link1, loads XML1 click on Link2, loads XML2 I would like to be able to do this all client side, so no PHP (or is that a bad idea?). This the jquery code I've been using: $(document).ready(function() { $("a.load_ajax").click(loadAjax()); function loadAjax() { var fileID = get('?lineID='); var dataID = "xml/" + fileID + ".xml" $.ajax({ type: "GET", url: dataID, dataType: "xml", success: parseXml }); function parseXml(xml) { $(xml).find("train").each(function() { $("ul#ajax-output").append('<li>' + $(this).find("time").text() + '</li>'); }); } } }); Its just not working at all. I have been passing the variable using GET in the url. So the link in the HTML goes to /?lineID=SBD_to_Union and it should load the XML file called SBD_to_Union.xml Making sense to anyone? I'd appreciate some help.

    Read the article

  • Maven doesn't compile target/hibernate3/generated-sources

    - by mmm
    Can someone tell me how to configure maven for it also to compile sources from the target/hibernate3/generated-sources directory? I have already read this and other posts but they don't seem to solve my problem (which indeed seems trivial). I have used the bottom-up approach hibernate configuration for cfg.xml, hbm.xml and POJO generation (i.e. auto-generated the complete hibernate configuration out of an existing database schema). I'm also only using standard maven and hibernate3-plugin directory layouts. Yet, when executing mvn compile in the command-line while my sources are in the src/main/java and the generated sources in /target/hibernate3/generated-sources only the ones from src/main/java get compiled and copied into target/classes. I wouldn't like to generate sources into src/main/java as I'd like mvn clean to clean them. I'd like to solve the problem using command-line, plugins and pom.xml only. Is there a way to configure maven-compiler-plugin to do so? Or is there another way? Regards and thanks for any help.

    Read the article

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