Daily Archives

Articles indexed Saturday March 27 2010

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

  • fedora apache/nginx pylons

    - by microchasm
    I'm trying to wrap my head around Pylons and how it works. So far... it's been confusing... I'm using EC2 with Fedora8. Everything is working so far (i.e. I have Pylons/python et al installed and after creating a test app and running paster serve I can access the default page via my domain name). As the Pylons docs explain and as I understand, the built in paster serve server is not suited for a production environment. What I am not clear on, then, is what to do next... It seems like nginx is a good option, but I am more familiar with Apache (like .0002%). I plan on having virtualhosts (which nginx says can accomodate). However, I am totally unclear on how the big picture is supposed to work. In order to serve an app, does paster serve need to be running? Does then nginx/apache basically just act as a proxy to shuttle connections to the paster server? How do I start it so it doesn't terminate after closing the ssh connection? If running multiple apps, what do I set as the host/port in development.ini to differentiate the apps? Or if this is not the right way, how do I differentiate beween apps? I am more familiar with MySQL, but willing to negotiate PostgreSQL if it's a better fit. Is it? Is virtualenv a prerequisite to running multiple apps on the same machine? Thanks in advance for any tips.

    Read the article

  • Knowledge base web app -- need a demo mode

    - by Smandoli
    I was contracted to build an on-line knowledge base that searches and cross-references many thousands of replacement parts for a niche industry. My client furnishes this app to his customers on a subscription basis. It uses MySQL and PHP and it works great. I want to deploy it in "demo mode" to sell my skills. I want the user to see the functions, but I have to guard the data for my client. My first idea was to obfuscate the results. That's at cross-purposes with showing how well it searches. I'm considering a limit on how many searches you can perform, but that's awkward too as someone could visit every day and get more answers than we would prefer. Other posts I've found are about letting people interact with an app, but without the challenge of protecting a big knowledge base. Can you suggest an approach? (Note, I put the tag obfuscation, but not sure it applies because java code obfuscation seems to be unrelated.)

    Read the article

  • Exporting SQL Server Databases for offline use

    - by WedTM
    I have a desktop application (C# .NET 3.5) that uses a SQL server for it's database. I have had a request from the client, however, to make it possible to export the database as it stands, and be able to use it on a laptop without connectivity. They understand that updates to the parent server will not be reflected in these offline clients. Is there a way I can just save the DataSet's to a binary form and write them to a disk and send those files to the offline clients.

    Read the article

  • Is there anything RAD comparible to VCL?

    - by mawg
    After years in embedded programmking, I have to develop a windows app. I dug out my old C++ builder and Delphi. These are great and the latest version costs over $1k, so I won't be going there. What I prarticularly like is the VCL (visual component library) which let's me code my own components and share them with others, plus the thousands of existing 3rd party components. I noticed that there is now also a RAD PHP form Borland too. I realzie that MSVC, QT, NetBEans, etc are good enough IDEs for RAD, _BUT_ does anything offer the ease of the Borland products for developing additional components - and does anything else have thousands to choose from? PC based? Cross-platform is good. Browser based? Free is always good ;-) I don't particularly care about the programming language.

    Read the article

  • Why for only some actions must I call setTarget?

    - by Max Pierce
    For most actions, I just click and drag in InterfaceBuilder to "wire up" a call from some interface object to my code. For example, if I want to know when the user single-clicks a row in a table, I drag a connection from the table's action to my controller's action. But now let's consider the user double-clicking a row. If I want one of my actions to be called when this happens, I need to call not only -[NSTableView setDoubleAction] but also -[NSControl setTarget]. Why? To be clear, I am not asking why Interface Builder doesn't support setDoubleAction. All tools have limitations. I am trying to gain a greater understanding about how and why setTarget doesn't seem to be necessary unless and until I want setDoubleAction to work. Another way to ask this question would be: Why don't I need to do anything in Interface Builder to set the target of the table's (single-click) action?

    Read the article

  • Load image dynamically on Silverlight

    - by FelixMM
    I have a Silverlight app that has to load an image dynamically, depending on the image name. The approach that im taking right now is passing the image name by query string to the page and passing that as a param to the Silverlight objet tag This is the query string passed Response.Redirect("Build.aspx?img=" + this.PictureUploader.PostedFile.FileName; And I try to pass it to Silverlight like this: <object id="SilverlightObject" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="Silverlight/iMapsSL.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> <param name="image" value="<%# Request.QueryString["img"] %>" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/> </a> </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe> in the last param tag with name=image value= Requerst.QueryString I catch the image inside the Silverlight app like this private void Application_Startup(object sender, StartupEventArgs e) { string pictureName = ""; if (e.InitParams != null && e.InitParams.Count > 0) { pictureName = e.InitParams["image"]; this.RootVisual = new MainPage(pictureName); } else { this.RootVisual = new MainPage(); } } And when MainPage starts, I set the image source of the Image control like this this.Image.Source = new BitmapImage(new Uri(pictureName, UriKind.RelativeOrAbsolute)); But Silverlight loads without an image, any help someone?

    Read the article

  • What is Perl's equivalent to awk's /text/,/END/ ?

    - by kSiR
    I am looking to replace a nasty shell script that uses awk to trim down some HTML. The problem is I cannot find anything in Perl that does the aforementioned function awk '/<TABLE\ WIDTH\=\"100\%\" BORDER\=1\ CELLSPACING\=0><TR\ class\=\"tabhead\"><TH>State<\/TH>/,/END/' How can I do this in Perl? the expected output would be <TABLE WIDTH="100%" BORDER=1 CELLSPACING=0><TR class="tabhead"><TH>State</TH> The Perl flipflop operator gives me WAY more. (Everything between the asterisks is junk) *<h2>Browse Monitors (1 out of 497)</h2><br><font size="-1" style="font-weight:normal"> Use the <A HREF=/SiteScope/cgi/go.exe/SiteScope?page=monitorSummary&account=login15 >Monitor Description Report</a> to view current monitor configuration settings.</font>*<TABLE WIDTH="100%" BORDER=1 CELLSPACING=0><TR class="tabhead"><TH>State</TH>

    Read the article

  • Debian 5 server is randomly shutting down.

    - by revofreak
    My debian 5 vps is suffering from random shutdowns. I reinstalled it several times, the hosts moved me to a different physical box, check the install image and said everyone else also uses it and is fine. Heres the output from syslog Mar 27 00:19:19 noobintraining-1 -- MARK -- Mar 27 00:32:01 noobintraining-1 shutdown[18142]: shutting down for system halt Mar 27 00:32:06 noobintraining-1 init: Switching to runlevel: 0 Mar 27 00:32:06 noobintraining-1 xinetd[15907]: Exiting... Mar 27 00:32:07 noobintraining-1 named[15865]: received control channel command 'stop -p' Mar 27 00:32:07 noobintraining-1 named[15865]: shutting down: flushing changes Mar 27 00:32:07 noobintraining-1 named[15865]: stopping command channel on 127.0.0.1#953 Mar 27 00:32:07 noobintraining-1 named[15865]: stopping command channel on ::1#953 Mar 27 00:32:07 noobintraining-1 named[15865]: no longer listening on ::#53 Mar 27 00:32:07 noobintraining-1 named[15865]: no longer listening on 127.0.0.1#53 Mar 27 00:32:07 noobintraining-1 named[15865]: no longer listening on 89.238.172.132#53 Mar 27 00:32:07 noobintraining-1 named[15865]: exiting Mar 27 00:32:07 noobintraining-1 exiting on signal 15 Any help is most appreciated!

    Read the article

  • Protecting Content with AuthLogic

    - by Rob Wilkerson
    I know this sounds like a really, really simple use case and I'm hoping that it is, but I swear I've looked all over the place and haven't found any mention of any way - not even the best way - of doing this. I'm brand-spanking new to Ruby, Rails and everything surrounding either (which may explain a lot). The dummy app that I'm using as my learning tool requires authentication in order to do almost anything meaningful, so I chose to start by solving that problem. I've installed the AuthLogic gem and have it working nicely to the extent that is covered by the intro documentation and Railscast, but now that I can register, login and logout...I need to do something with it. As an example, I need to create a page where users can upload images. I'm planning to have an ImagesController with an upload action method, but I want that only accessible to logged in users. I suppose that in every restricted action I could add code to redirect if there's no current_user, but that seems really verbose. Is there a better way of doing this that allows me to define or identify restricted areas and handle the authentication check in one place?

    Read the article

  • Casting objects in C# (ASP.Net MVC)

    - by Mortanis
    I'm coming from a background in ColdFusion, and finally moving onto something modern, so please bear with me. I'm running into a problem casting objects. I have two database tables that I'm using as Models - Residential and Commercial. Both of them share the majority of their fields, though each has a few unique fields. I've created another class as a container that contains the sum of all property fields. Query the Residential and Commercial, stuff it into my container, cunningly called Property. This works fine. However, I'm having problems aliasing the fields from Residential/Commercial onto Property. It's quite easy to create a method for each property: fillPropertyByResidential(Residential source) and fillPropertyByCommercial(Commercial source), and alias the variables. That also works fine, but quite obviously will copy a bunch of code - all those fields that are shared between the two main Models. So, I'd like a generic fillPropertyBySource() that takes the object, and detects if it's Residential or Commercial, fills the particular fields of each respective type, then do all the fields in common. Except, I gather in C# that variables created inside an If are only in the scope of the if, so I'm not sure how to do this. public property fillPropertyBySource(object source) { property prop = new property(); if (source is Residential) { Residential o = (Residential)source; //Fill Residential only fields } else if (source is Commercial) { Commercial o = (Commercial)source; //Fill Commercial only fields } //Fill fields shared by both prop.price = (int)o.price; prop.bathrooms = (float)o.bathrooms; return prop; } "o" being a Commercial or Residential only exists within the scope of the if. How do I detect the original type of the source object and take action? Bear with me - the shift from ColdFusion into a modern language is pretty..... difficult. More so since I'm used to procedural code and MVC is a massive paradigm shift. Edit: I should include the error: The name 'o' does not exist in the current context For the aliases of price and bathrooms in the shared area.

    Read the article

  • How to document object-oriented MATLAB code?

    - by jjkparker
    I'm writing a sizable application using object-oriented MATLAB, and this has gotten me thinking about how to document the code. If this was C, I would use Doxygen. For Java, I'd use JavaDoc. Both have mostly agreed-upon standards for how class and method documentation should look and what it should contain. But what about MATLAB code? The most I've seen in TMW's own classes is a short sentence or two at the top of the class, and I can't find any topics devoted to documenting sizable MATLAB applications. So how do you document your MATLAB classes? Any particular style issues or additional tools?

    Read the article

  • Parsing a tweet to extract hashtags into an array in Python.

    - by Scott
    I am having a heck of a time taking the information in a tweet including hashtags, and pulling each hashtag into an array using Python. I am embarrassed to even put what I have been trying thus far. For example, "I love #stackoverflow because #people are very #helpful!" This should pull the 3 hashtags into an array.

    Read the article

  • Disable scrolling in webview?

    - by jakesankey
    Hi there, Until now I have been an iPhone developer only and now I have decided to give Android a whirl. Something I haven't been able to figure out on Android is how to programmatically prevent scrolling in a webview?? Something similar to iPhones prevention of the onTouchMove event would be great! Thanks in advance!

    Read the article

  • What is the worst programming mistake you have made?

    - by George Edison
    Most of us are not perfect. (Well, except Jon Skeet) Have you made a terrible mistake that you would like to share? The idea is that we could all learn from our mistakes and by collecting them together here, we can avoid some common ones and discover some no-so-common ones we may have overlooked. Oh, and this question is CW, of course. Edit: This question is different than http://stackoverflow.com/questions/1928002/what-is-the-worst-programming-mistake-you-have-ever-seen because we are sharing our own mistakes. Edit again: And this one http://stackoverflow.com/questions/130965/what-is-the-worst-code-youve-ever-written is different too - it asks for code. My question does not have that restriction!

    Read the article

  • How do I code a loop for my echo statement?

    - by ggg
    I get only one printed result in the foreach echo loop at the bottom of the page. <?php defined('_JEXEC') or die('Restricted access'); $db =& JFactory::getDBO(); $query0 = "SELECT * FROM `jos_ginfo` WHERE . . . LIMIT 30"; //echo $query0; $db->setQuery($query0); $ginfo = $db->loadObjectList(); //echo //$ginfo[0]; foreach($ginfo as $ginfo[$i]): {$i=0; $i++;} endforeach; echo $db->getErrorMsg(); if(empty($ginfo)){ echo "<center>No game found, try a different entry.</center>"; }else{ $pgndata = array ( $ginfo[$i]->Id); $i=0; foreach($pgndata as $ginfo[$i]->Id): //I am only getting one printed result! { echo "<a href='/index.php?option=com_publishpgn&tactical-game=".$ginfo[$i]->Id."&Itemid=78.html'>\n"; echo "".$ginfo[$i]->White." v. ".$ginfo[$i]->Black." (".$ginfo[$i]->Result.") ".$ginfo[$i]->EventDate." ECO:".$ginfo[$i]->ECO."</a><br>\n"; $i++; } endforeach; //echo "</div>"; } ?>

    Read the article

  • 3 Emerging SEO Trends

    Everyone knows that technology is always changing, always moving forward. Following the trends of the moment is vital for webmasters to keep their sites high on search engine rankings and ensure they are successful. Here are three search engine optimization (SEO) trends that webmasters and professionals should be aware of for this coming year.

    Read the article

  • VBA compare and sort strings with quirky characters

    - by Smandoli
    I am comparing text values from two DAO recordsets in MS Access. I sort on the text field, then go through both recordsets comparing the values from each. The sets are substantially different and while they're mostly alpha-numeric, spaces and symbols like hyphens and periods are very common. My program depends on predictable sorting and fool-proof comparing. But unfortunately, the sort will rank two values differently than the comparison function. StrComp is the obvious first choice: varResult = StrComp(Val_1, Val_2) RFA-300 14.9044 RFA300 14-2044 But for the two pairs above, StrComp returns a different value than one would expect based on the sort. Including vbTextCompare or vbBinaryCompare affects StrComp's result, but not so as to solve the problem. Note the values must always be compared as strings. Of course I make sure that "14-2044" and "14.9044" aren't evaluated as -2030 and ~15. That's not the cause of my problem. I learned API-based functions are more reliable for quirky texts, so I tried these: varResult = CompareString(LOCALE_SYSTEM_DEFAULT, _ SORT_STRINGSORT, strVal_2, -1, strVal_1, -1) varResult = CompareString(LOCALE_SYSTEM_DEFAULT, _ NORM_IGNOREWIDTH, strVal_2, -1, strVal_1, -1) The first one returns the opposite of StrComp. The second one returns the same as StrComp. But neither yields a result that is consistent with the sort order. (NORM_IGNOREWIDTH is probably not relevant, but I needed a place-holder substitute and it looked as good as any.) UPDATE: This is a complete rewrite of the original post, deleting all the info about why I really need this -- just take my word for it and enjoy the brevity.

    Read the article

  • XFBML fb:login_button only loading 20% of the time

    - by kalpaitch
    I have a fb:login-button that is working but the button only displays about 20% of the time I load the page. Have a look here to see what I mean, bearing in mind I have never had to refresh the page more than 20 times before I finally turns up. What am I doing wrong...( Head: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> Body: <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_GB" type="text/javascript"></script><script type="text/javascript">FB.init("sd89897sf98d9d9d9d8s98798798s7d");</script> <fb:login-button v='2' autologoutlink='true' size='medium' onlogin='window.location=\"/PHP/FBcheckLogin.php\";'>Connect with Facebook</fb:login-button>

    Read the article

  • passing hashes to a subroutine

    - by Vishalrix
    In one of my main( or primary) routines,I have two or more hashes. I want the subroutine foo() to recieve these possibly-multiple hashes as distinct hashes. Right now I have no preference if they go by value, or as references. I am struggling with this for the last many hours and would appreciate help, so that I dont have to leave perl for php! ( I am using mod_perl, or will be) Right now I have got some answer to my requirement, shown here From http://forums.gentoo.org/viewtopic-t-803720-start-0.html # sub: dump the hash values with the keys '1' and '3' sub dumpvals { foreach $h (@_) { print "1: $h->{1} 3: $h->{3}\n"; } } # initialize an array of anonymous hash references @arr = ({1,2,3,4}, {1,7,3,8}); # create a new hash and add the reference to the array $t{1} = 5; $t{3} = 6; push @arr, \%t; # call the sub dumpvals(@arr); I only want to extend it so that in dumpvals I could do something like this: foreach my %k ( keys @_[0]) { # use $k and @_[0], and others } The syntax is wrong, but I suppose you can tell that I am trying to get the keys of the first hash ( hash1 or h1), and iterate over them. How to do it in the latter code snippet above?

    Read the article

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