Daily Archives

Articles indexed Thursday April 15 2010

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

  • Xforwarding in Ubuntu

    - by Dan
    I'm trying to get Xforwarding working in Ubuntu... On the server I have uncommented the following lines of /etc/ssh/sshd_config: X11Forwarding yes AllowTcpForwarding yes Now I try to ssh in, but I get the following error messages (and Xforwarding isn't working). $ssh -Y example.com /usr/bin/xauth: /home/dan/.Xauthority not writable, changes will be ignored $ssh -X example.com /usr/bin/xauth: error in locking authority file /home/dan/.Xauthority Any suggestions? Thanks

    Read the article

  • Installing Wordpress - constant PHP/MySQL extension appears missing

    - by Driss Zouak
    I've got Win2003 w/IIS6, PHP 5 and MySQL installed. I can confirm PHP is installed correctly because I have a testMe.php that runs properly. When I run the Wordpress setup, I get informed that Your PHP installation appears to be missing the MySQL extension which is required by WordPress. But in my PHP.ini in the DYNAMIC EXTENSIONS section I have extension=php_mysql.dll extension=php_mysqli.dll I verified that mysql.dll and libmysql.dll are both in my PHP directory. I copied my libmysql.dll to the C:\Windows\System32 directory. When I try to run the initial setup for WordPress, I get this answer. I've Googled setting this up, and everything comes down to the above. I'm missing something, but none of the instructions that I've found online seem to cover whatever that is.

    Read the article

  • How can I set the Regional Options in a Visual Basic 6.0 Application?

    - by jalcom
    I have a VB6's Application that is in production environment right now, this application is reading the pc's Regional Settings; but now, I need to set another Regional Settings for the application without change the pc's settings. How can I set the new Regional Settings globally with the lowest impact? Is there any configuration method (or something like that) for do it?

    Read the article

  • Class member functions instantiated by traits

    - by Jive Dadson
    I am reluctant to say I can't figure this out, but I can't figure this out. I've googled and searched Stack Overflow, and come up empty. The abstract, and possibly overly vague form of the question is, how can I use the traits-pattern to instantiate non-virtual member functions? The question came up while modernizing a set of multivariate function optimizers that I wrote more than 10 years ago. The optimizers all operate by selecting a straight-line path through the parameter space away from the current best point (the "update"), then finding a better point on that line (the "line search"), then testing for the "done" condition, and if not done, iterating. There are different methods for doing the update, the line-search, and conceivably for the done test, and other things. Mix and match. Different update formulae require different state-variable data. For example, the LMQN update requires a vector, and the BFGS update requires a matrix. If evaluating gradients is cheap, the line-search should do so. If not, it should use function evaluations only. Some methods require more accurate line-searches than others. Those are just some examples. The original version instantiates several of the combinations by means of virtual functions. Some traits are selected by setting mode bits that are tested at runtime. Yuck. It would be trivial to define the traits with #define's and the member functions with #ifdef's and macros. But that's so twenty years ago. It bugs me that I cannot figure out a whiz-bang modern way. If there were only one trait that varied, I could use the curiously recurring template pattern. But I see no way to extend that to arbitrary combinations of traits. I tried doing it using boost::enable_if, etc.. The specialized state information was easy. I managed to get the functions done, but only by resorting to non-friend external functions that have the this-pointer as a parameter. I never even figured out how to make the functions friends, much less member functions. The compiler (VC++ 2008) always complained that things didn't match. I would yell, "SFINAE, you moron!" but the moron is probably me. Perhaps tag-dispatch is the key. I haven't gotten very deeply into that. Surely it's possible, right? If so, what is best practice? UPDATE: Here's another try at explaining it. I want the user to be able to fill out an order (manifest) for a custom optimizer, something like ordering off of a Chinese menu - one from column A, one from column B, etc.. Waiter, from column A (updaters), I'll have the BFGS update with Cholesky-decompositon sauce. From column B (line-searchers), I'll have the cubic interpolation line-search with an eta of 0.4 and a rho of 1e-4, please. Etc... UPDATE: Okay, okay. Here's the playing-around that I've done. I offer it reluctantly, because I suspect it's a completely wrong-headed approach. It runs okay under vc++ 2008. #include <boost/utility.hpp> #include <boost/type_traits/integral_constant.hpp> namespace dj { struct CBFGS { void bar() {printf("CBFGS::bar %d\n", data);} CBFGS(): data(1234){} int data; }; template<class T> struct is_CBFGS: boost::false_type{}; template<> struct is_CBFGS<CBFGS>: boost::true_type{}; struct LMQN {LMQN(): data(54.321){} void bar() {printf("LMQN::bar %lf\n", data);} double data; }; template<class T> struct is_LMQN: boost::false_type{}; template<> struct is_LMQN<LMQN> : boost::true_type{}; struct default_optimizer_traits { typedef CBFGS update_type; }; template<class traits> class Optimizer; template<class traits> void foo(typename boost::enable_if<is_LMQN<typename traits::update_type>, Optimizer<traits> >::type& self) { printf(" LMQN %lf\n", self.data); } template<class traits> void foo(typename boost::enable_if<is_CBFGS<typename traits::update_type>, Optimizer<traits> >::type& self) { printf("CBFGS %d\n", self.data); } template<class traits = default_optimizer_traits> class Optimizer{ friend typename traits::update_type; //friend void dj::foo<traits>(typename Optimizer<traits> & self); // How? public: //void foo(void); // How??? void foo() { dj::foo<traits>(*this); } void bar() { data.bar(); } //protected: // How? typedef typename traits::update_type update_type; update_type data; }; } // namespace dj int main_() { dj::Optimizer<> opt; opt.foo(); opt.bar(); std::getchar(); return 0; }

    Read the article

  • How do you print a limited number of characters?

    - by Mike Pateras
    Sorry to put a post up about something so simple, but I don't see what I'm doing wrong here. char data[1024]; DWORD numRead; ReadFile(handle, data, 1024, &numRead, NULL); if (numRead > 0) printf(data, "%.5s"); My intention with the above is to read data from a file, and then only print out 5 characters. However, it prints out all 1024 characters, which is contrary to what I'm reading here. The goal, of course, is to do something like: printf(data, "%.*s", numRead); What am I doing wrong here?

    Read the article

  • How to manage state in REST

    - by user317050
    I guess this question will sound familiar, but I am yet another programmer baffled by REST. I have a traditional web application which goes from StateA to StateB and so on If the user goes to (url of) StateB, I want to make sure that he has visited StateA before. Traditionally, I'd do this using session state. Since session state is not allowed in REST, how do I achieve this?

    Read the article

  • Do variable references (alias) incure runtime costs in c++?

    - by cheshirekow
    Maybe this is a compiler specific thing. If so, how about for gcc (g++)? If you use a variable reference/alias like this: int x = 5; int& y = x; y += 10; Does it actually require more cycles than if we didn't use the reference. int x = 5; x += 10; In other words, does the machine code change, or does the "alias" happen only at the compiler level? This may seem like a dumb question, but I am curious. Especially in the case where maybe it would be convenient to temporarily rename some member variables just so that the math code is a little easier to read. Sure, we're not exactly talking about a bottleneck here... but it's something that I'm doing and so I'm just wondering if there is any 'actual' difference... or if it's only cosmetic.

    Read the article

  • Drupal clean urls on custom page GET request.

    - by calebthorne
    I have a drupal page (content type page) that should accept GET values using clean urls. I put the following code in the page body using the php code input format. <?php $uid = $_GET['uid']; $user = user_load($uid); print $user->name; ?> Now the following link http://www.example.com/mypath/?uid=5 results in user 5's name being displayed. Great. My question is: Can this be accomplished using clean urls such that going to http://www.example.com/mypath/5 has the same result? (Similar to using arguments in views)

    Read the article

  • Problem with InlineUIContainer

    - by paradisonoir
    I have an Windows.Documents.InlineUIContainerin a RichTextBox, and sometimes it's font size of alignment change when I hit key combination such as Ctrl+Space. I couldn't find any place to handle these events and block them somehow. I don't want to block it in the RichTextBox. I am more looking for a way to block it only on the InlineUIContainer.

    Read the article

  • How to bind arrays?

    - by Emily
    Say i have those 3 arrays : Product(milk,candy,chocolate) Colors(white,red,black) Rating(8,7,9) How to create a loop to bind those arrays so i get 3 variables in each loop : $product $color $rating So by example i will output like this: Milk is white and has a rating of 8/10 Candy is red and has a rating of 7/10 Chocolate is black and has a rating of 9/10 Thanks

    Read the article

  • Is there any way to do a WER "Request Additional Files" for the windows temp directory?

    - by Jason Mathison
    My company has had numerous crashes reported to windows error reporting due to what looks like an install problem. The logs for our installs are typically in the windows\temp directory. I would like to include the install log file as a "Request Additional Files" entry, however there doesn't seem to be any way to get to a subdirectory of the list of environmental Variables that are provided. The windows temp directory is not in the list of values that you can work from, so I am stuck. In general, I don't understand how it is possible to get at almost anything of use via the "Request Additional Files". For example, the %programfiles% directory shouldn't contain any useful files, they should be in a subdirectory for your product. What am I missing?

    Read the article

  • plone.app.blob or z3c.blobfile?

    - by askvictor
    I need a blob file field as part of a content type in plone. plone.app.blob's BlobField should provide this, but I can't find how to get a URL to download the file including the original filename (e.g. http://plone.site/plone/obj/orig-file-name.avi). Is there a way to do this using plone.app.blob? Alternately, there are a few pointers on the web pointing to plone.namedfile to do this. plone.namedfile seems to rely on z3c.blobfile. How does z3c.blobfile differ from plone.app.blob? Is one of these methods better than the other? vik

    Read the article

  • get a list of function names in a shell script

    - by n-alexander
    I have a Bourne Shell script that has several functions in it, and allows to be called in the following way: my.sh <func_name> <param1> <param2> Inside func_name() will be called with param1 and param2. I want to create a "help" function that would just list all available functions, even without parameters. The question: how do I get a list of all function names in a script from inside the script? I'd like to avoid having to parse it and look for function patterns. Too easy to get wrong. Thanks, Alex

    Read the article

  • jQuery / jEditable and jQuery UI Dialog. Re-populating table cell.

    - by solefald
    Hello, this is my first time using JS, so i really have no idea what i am doing. I have a table with data, and using jEditable to allow a user to edit the data and POST it to my php script. When user hits "Save", it opens jQuery UI with the data from php script and it seems to work fine, however, if the user hits Cancel or Esc to close the jQuery UI dialog, they and up back on the page, but the cell they tried to edit is now completely empty. How do i get the cell re-populated? Thank you! $(".editable_textarea").editable("/path/to/my/scrip.php", { indicator : "<img src='/images/indicator.gif'>", type : 'textarea', submitdata: { _method: "post", uri: "<?php echo $this->uri->segment(3); ?>" }, select : false, submit : 'Save', cancel : 'Cancel', tooltip : "Click to edit...", cssclass : "editable", onblur: "cancel", cssclass: "edit_destination", callback: function(value, settings) { $(this).dialog({ autoOpen: true, width: 400, modal: true, position: "center", resizable: false, draggable: false, title: "Pending Changes", buttons: { "Cancel": function() { $(this).dialog("close"); }, "Confirm Changes": function() { document.findSameDestination.submit(); } } }); $('form#findSameDestination').submit(function(){ $(this).dialog('open'); return false; }); $(this).editable("disable"); }, data: function(value, settings) { var retval = value.replace(/<br[\s\/]?>/gi, '\n'); retval = retval.replace(/(<([^>]+)>)/gi, ''); return retval; } });

    Read the article

  • Linux Kernel Packet Forwarding Performance

    - by Bob Somers
    I've been using a Linux box as a router for some time now. Nothing too fancy, just enabling forwarding in the kernel, turning on masquerading, and setting up iptables to poke a few holes in the firewall. Recently a friend of mine pointed out a performance problem. Single TCP connections seem to experience very poor performance. You have to open multiple parallel TCP connections to get decent speed. For example, I have a 10 Mbit internet connection. When I download a file from a known-fast source using something like the DownThemAll! extension for Firefox (which opens multiple parallel TCP connections) I can get it to max out my downstream bandwidth at around 1 MB/s. However, when I download the same file using the built-in download manager in Firefox (uses only a single TCP connection) it starts fast and the speed tanks until it tops out around 100 KB/s to 350 KB/s. I've checked the internal network and it doesn't seem to have any problems. Everything goes through a 100 Mbit switch. I've also run iperf both internally (from the router to my desktop) and externally (from my desktop to a Linux box I own out on the net) and haven't seen any problems. It tops out around 1 MB/s like it should. Speedtest.net also reports 10 Mbits speeds. The load on the Linux machine is around 0.00, 0.00, 0.00 all the time, and it's got plenty of free RAM. It's an older laptop with a Pentium M 1.6 GHz processor and 1 GB of RAM. The internal network is connected to the built in Intel NIC and the cable modem is connected to a Netgear FA511 32-bit PCMCIA network card. I think the problem is with the packet forwarding in the router, but I honestly am not sure where the problem could be. Is there anything that would substantially slow down a single TCP stream?

    Read the article

  • Saját kezuleg próbálja ki az Oracle elemzo-lekérdezo üzleti intelligencia csomagját

    - by Fekete Zoltán
    Április 19-én, hétfon délután rendezzük meg az Oracle Test Drive, Bi Hands On rendezvényt, ahol természetesen magyar nyelven próbálhatja ki az Oracle Business Intelligence Enterprise Edition csomagot. Ezen a kifejezetten végfelhasználóknak szóló rendezvényen az üzleti felhasználók probálhatják ki az Oracle BI csomagot egy vezetett példa kapcsán. Az interaktív irányítópultok (interactive dashboards) és az ad-hoc elemzo eszköz (Answers) lesz a fókuszban. Aki szeretne jelentkezni, küldjön számomra egy mail-t a jelentkezési szándékáról, s visszajelzek, maradt-e még hely a teremben. A leveleket a [email protected] e-mail címre várom.

    Read the article

  • Using git branches for variations of a project

    - by Trevor Hartman
    I'm using git's branching feature to manage 5 variations of a small website. There are 5 versions that will all be live in different subdirectories on production. My approach to checking out the various branches to their respective folders was to: mkdir foo && cd foo git init git remote add origin git@...:project.git git fetch origin foo:foo Where "foo" is a given branch name. This was fine, except for that it pulled my entire repo (designs, as3 source, etc...) into those branch folders instead of just the public www folder, which is the only thing I really want on production. Is there a cleaner way to handle this? Git can't clone subdirectories right?

    Read the article

  • jquery load links not clickable

    - by john morris
    ok i am loading a separate page with links in it, into a page named index.php. it loads fine, but when i click one of the links inside the loaded content, nothing happens. they dont act as links. but if i do a alert('hi'); after the load('page.html'); then it will work. any ideas on getting this to work without alerting something after it loads? oh also i cant use a callback, unless there is a way to update the get variable because the page loading, has a $_GET variable, and the links inside the loaded page are supposed to update the $_GET variable. anyways is there a way to make the links clickable after loading the page?

    Read the article

  • Migrating data from Plone to Liferay, or how could I retrieve information from Plone's Data.fs

    - by brandizzi
    Hello, all. I need to migrate data from a Plone-based portal to Liferay. Has anyone some idea on how to do it? Anyway, I am trying to retrieve data from Data.fs and store it in a representation easier to work, such as JSON. To do it, I need to know which objects I should get from Plone's Data.fs. I already got the Products.CMFPlone.Portal.PloneSite instance from the Data.fs, but I cannot get anything from it. I would like to get the PloneSite instance and do something like this: >>> import ZODB >>> from ZODB import FileStorage, DB >>> path = r"C:\Arquivos de programas\Plone\var\filestorage\Data.fs" >>> storage = FileStorage.FileStorage(path) >>> db = DB(storage) >>> conn = db.open() >>> root = conn.root() >>> app = root['Application'] >>> plone_site = app.getChildNodes()[13] # 13 would be index of PloneSite object >>> a = plone_site.get_articles() >>> for article in a: ... print "Title:", a.title ... print "Content:", a.content Title: <some title> Conent: <some content> Title: <some title> Conent: <some content> Of course, it did not need to be so straightforward. I just want some information about the structure of PloneSite and how to recover its data. Has anyone some idea? Thank you in advance!

    Read the article

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