Daily Archives

Articles indexed Tuesday May 4 2010

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

  • How to add http:// if it's not exists in the URL?

    - by David
    Hi, How to add http:// to the url if there isn't a http:// or https:// or ftp:// ? Example: addhttp("www.google.com"); // http://www.google.com addhttp("google.com"); // http://google.com addhttp("ftp://google.com"); // ftp://google.com addhttp("https://google.com"); // https://google.com addhttp("http://google.com"); // http://google.com

    Read the article

  • Format all elements of a list

    - by Curious2learn
    I want to print a list of numbers, but I want to format each member of the list before it is printed. For example, theList=[1.343465432, 7.423334343, 6.967997797, 4.5522577] I want the following output printed given the above list as an input: [1.34, 7.42, 6.97, 4.55] For any one member of the list, I know I can format it by using, print "%.2f" % member Is there a command/function that can do this for the whole list. I can write one, but was wondering if one already exists. Thanks.

    Read the article

  • Test run errors with MSTest in VS2010

    - by Tomas Lycken
    When I run my Unit Tests, all tests pass, but instead of "Test run succeeded" or whatever the success message is, I get "Test run error" in the little bar that tells me how many of my tests pass, even though all my tests passed. When i click the text, I'm taken to a page that tells me the following two things happened: Warning: conflict during test run deployment: deployment item '[...]\Booking.Web.dll' directly or indirectly referenced by the test container [...]\Booking.Web.Tests.dll cannot be deployed to 'Booking.Web.dll' because otherwise the file '[...]\Booking.Web.dll' would override deployment item '[...]\Booking.Web.dll' directly or indirectly referenced by '[...]\Booking.Web.Tests.dll' Error: Cannot initialize the ASP.NET project 'Booking.Web' Exception was thrown: The website could not be configured correctly; getting ASP.NET proccess information failed. Requesting 'http://localhost:54131/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error. I don't understand half of what it's complaining about. How do I get rid of these errors? (And for reference: Booking.Web is an ASP.NET MVC 2 project, Booking.Web.Tests is a Test project, [...] is the full local path to the projects in my environment, in most of the cases above to the /bin/debug/ folder inside the Booking.Web project)

    Read the article

  • Splitting android application in to two 'branches', free and paid.

    - by Alxandr
    I've developed an android-application that I'dd like to put up on the marketplace. However, I want to split it into two separate applications, one free (with ads), and one paid (logically without ads). How would I go about doing that? I'm not wondering about adding ads (I've alreaddy managed that), but how to take one existing android-application (eclipse-project) and split it into two without having to create a new project and just copy-paste every file one by one (or in batch for that matter). Is that possible? Btw, I use GIT for SCM, so I've made two separate branches, one master and one free, but I need to set some cind of config-value that makes shure that the market separates them as two different applications. Also, when a user 'upgrades', is it possible to copy the db from the free app to the paid one?

    Read the article

  • Populate a combo box with one data tabel and save the choice in another.

    - by Scott Chamberlain
    I have two data tables in a data set for example lets say Servers: | Server | Ip | Users: | Username | Password | Server | and there is a foreign key on users that points to servers. How do I make a combo box that list all of the servers. Then how do I make the selected server in that combo box be saved in the data set in the Server column of the users table. EDIT -- I havent tested it yet but is this the right way? this.bsServers.DataMember = "Servers"; this.bsServers.DataSource = this.dataSet; this.bsUsers.DataMember = "FK_Users_Servers"; this.bsUsers.DataSource = this.bsServers; this.serverComboBox.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.bsUsers, "Server", true)); this.serverComboBox.DataSource = this.bsServers; this.serverComboBox.DisplayMember = "Server"; this.serverComboBox.ValueMember = "Server";

    Read the article

  • Is Objective C fast enough for DSP/audio programming

    - by morgancodes
    I've been making some progress with audio programming for iPhone. Now I'm doing some performance tuning, trying to see if I can squeeze more out of this little machine. Running Shark, I see that a significant part of my cpu power (16%) is getting eaten up by objc_msgSend. I understand I can speed this up somewhat by storing pointers to functions (IMP) rather than calling them using [object message] notation. But if I'm going to go through all this trouble, I wonder if I might just be better off using C++. Any thoughts on this?

    Read the article

  • WCF Windows Service Monitor and process emails

    - by acadia
    Hello, I need your suggestions in solving this issue. Here is the requirement. We have a Microsoft Exchange server and we have a service email account [email protected]. We have scanners all owner the company when a user scans a document and email is sent to [email protected] as attachment. Now I need to write a Windows service which needs to monitor that email account and whenever an email is received, read the attachement and store it in the database. My question is, is it possible to do something of this sort? Any suggestions greatly appreciated. Thanks

    Read the article

  • own .NET platform hosting

    - by netmajor
    Hey, What should I do to host on my own pc .NET web application(ASP.NET, Silverlight) with support Sql Server and services(RIA, WCF) ? What should I install and configure so others can see my webs in the internet ? It's some administration API which I can install on pc and by which I can upload my app like in professional hosting? That for help ;)

    Read the article

  • PHP unable to load dynamic library... but it is loaded. WTF?

    - by Josh
    I have a CentOS 5.4 server with Apache 2.2.3, mod_fastcgi and PHP 5.2.11. Everything is working great, server is a production server and I've had no complaints. When I was looking in PHP's error log to diagnose a problem with a specific page, I saw the following periodically repeated over and over: [03-May-2010 19:54:12] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: undefined symbol: php_rfc1867_callback in Unknown on line 0 [03-May-2010 19:54:12] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0 [03-May-2010 19:54:12] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: undefined symbol: php_rfc1867_callback in Unknown on line 0 [03-May-2010 19:54:12] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0 I am very confused because APC is loaded, I can see it in the output of phpinfo(). And by the look of these error messages nothing should be working at all. Yet sites seem to be running fine. How can I track down the source of this error?

    Read the article

  • Best free (or cheap) ASP.NET based CMS for a club/association?

    - by marc_s
    I've been looking for a simple, intuitive ASP.NET based CMS to handle my club/association site. It should be based on ASP.NET so I can add some extra specific pages offer a membership system, e.g. I want to be able to define members which can e.g. comment posts, while anonymous users can only read (no active participation) have features like news, forums, blogs, picture gallery be simple and easy to use I've been looking at GraffitiCMS: so far my favorite, but it has no forum, and no membership system, and no future, it seems - no development whatsoever in over a year :-( Sitefinity: had extreme trouble even getting it installed, and when it's finally up and running, I find it overly complicated and not intuitive at all Umbraco: same problem - hard to install, hard to get up and running, the intro videos on their site are only available to paying subscribers (what's up with that deal???)..... DotNetNuke: seems like a major overkill Community Server: seems like a major overkill - and seems to be more and more commercial, only Any others I've missed that I should have definitely looked at ??

    Read the article

  • Why is C++0x's `noexcept` checked dynamically?

    - by rlbond
    I am curious about the rationale behind noexcept in the C++0x FCD. throw(X) was depreciated, but noexcept seems to do the same thing. Is there a reason that noexcept isn't checked at compile time? It seems that it would be better if these functions were checked statically that they only called throwing functions within a try block.

    Read the article

  • Using windows command line from Pascal

    - by Jordan
    I'm trying to use some windows command line tools from within a short Pascal program. To make it easier, I'm writing a function called DoShell which takes a command line string as an argument and returns a record type called ShellResult, with one field for the process's exitcode and one field for the process's output text. I'm having major problems with some standard library functions not working as expected. The DOS Exec() function is not actually carrying out the command i pass to it. The Reset() procedure gives me a runtime error RunError(2) unless i set the compiler mode {I-}. In that case i get no runtime error, but the Readln() functions that i use on that file afterwards don't actually read anything, and furthermore the Writeln() functions used after that point in the code execution do nothing as well. Here's the source code of my program so far. I'm using Lazarus 0.9.28.2 beta, with Free Pascal Compiler 2.24 program project1; {$mode objfpc}{$H+} uses Classes, SysUtils, StrUtils, Dos { you can add units after this }; {$IFDEF WINDOWS}{$R project1.rc}{$ENDIF} type ShellResult = record output : AnsiString; exitcode : Integer; end; function DoShell(command: AnsiString): ShellResult; var exitcode: Integer; output: AnsiString; exepath: AnsiString; exeargs: AnsiString; splitat: Integer; F: Text; readbuffer: AnsiString; begin //Initialize variables exitcode := 0; output := ''; exepath := ''; exeargs := ''; splitat := 0; readbuffer := ''; Result.exitcode := 0; Result.output := ''; //Split command for processing splitat := NPos(' ', command, 1); exepath := Copy(command, 1, Pred(splitat)); exeargs := Copy(command, Succ(splitat), Length(command)); //Run command and put output in temporary file Exec(FExpand(exepath), exeargs + ' __output'); exitcode := DosExitCode(); //Get output from file Assign(F, '__output'); Reset(F); Repeat Readln(F, readbuffer); output := output + readbuffer; readbuffer := ''; Until Eof(F); //Set Result Result.exitcode := exitcode; Result.output := output; end; var I : AnsiString; R : ShellResult; begin Writeln('Enter a command line to run.'); Readln(I); R := DoShell(I); Writeln('Command Exit Code:'); Writeln(R.exitcode); Writeln('Command Output:'); Writeln(R.output); end.

    Read the article

  • Works in firefox but not IE8

    - by creocare
    This is working fine in firefox but only closes the first page and then breaks in IE8. Firebug in IE8 says that x.item(o) is null. I can't figure out why this works in firefox but not IE. Thanks for any help. pager(x=document.getElementsByName("pg1")); function pager( x ) { var curr = document.getElementById('showing'); $(curr).fadeOut('fast'); curr.id = 'hide'; $(x).fadeIn('slow'); x.item(0).id ='showing'; }

    Read the article

  • auto Focus (Hit Enter) Javascript function is working good in IE7 but not working in IE8

    - by James123
    Hi, I used a javascript FocusChange() in my aspx page. I have couple of controls and I need Hit enter key need to move next control based on tab index. It is working good in IE7 but not working in IE8... Please help me on this.. Thanks for your help in advance. The java script is given below. function FocusChange() { if (window.event.keyCode == 13) { var formLength = document.form1.length; // Get number of elements in the form var src = window.event.srcElement; // Gets the field having focus var currentTabIndex = src.getAttribute('tabindex'); // Gets its tabindex // scroll through all form elements and set focus in field having next tabindex for (var i = 0; i < formLength; i++) { if (document.form1.elements[i].getAttribute('tabindex') == currentTabIndex + 1) { for (var j = i; j <= formLength; j++) { if (document.form1.elements[j].disabled == false) { document.form1.elements[j].focus(); event.returnValue = false; event.cancel = true; return; } } } } } }

    Read the article

  • Java Compare Two Lists

    - by agazerboy
    Hi All, Thanks for stoping to help me :) I have a question, may be for some of you, it will be a basic question :) I have two lists ( not java lists, you can say two columns) For example **List 1** **Lists 2** milan hafil dingo iga elpha binga hafil mike meat dingo iga neeta.peeta What I want ! I want that it returns me that how many elements are same. For this example it should be 3 and it should return me similar values of both list and different values too. Should I use hashmap if yes then what method to get my result? Please help P.S: It is not a school assignment :) So if you just guide me it will be enough

    Read the article

  • Rails route dependent on current user

    - by Lowgain
    I'd like to create a rails route for editing a user's profile. Instead of having to use /users/:id/edit, I'd like to have a url like /edit_profile Is it possible to create a dynamic route that turns /edit_profile into /users/{user's id}/edit, or should I do thing in a controller or?

    Read the article

  • Get all Javascript Variables?

    - by Matrym
    Is there a way for javascript to detect all assigned variables? For example, if one js file creates a bunch of vars (globally scoped), can a subsequent file get all the vars without knowing what they're named and which might exist? Thanks in advance :)

    Read the article

  • Deleting a user > need to also delete their project, and then activities for that project? (PHP, MyS

    - by Jamie
    Hi guys, Really stuck with this... basically my system has 4 tables; users, projects, user_projects and activities. The user table has a usertype field which defines whether or not they are admin or user (by an integer)... An admin can create a project, create an acitivity for the project and assign a user (limited access user) an activity. Therefore, this setup means that an admin is never directly associated with an activity (instead a project). When my head admin user deletes an admin, I need all projects and activities (for their projects) to be deleted also. My delete script for a user is simple so far and works, but I'm having trouble on how to gain the projectID in order to know which activities to remove (associated with the projects which are about to be deleted): $userid = $_GET['userid']; $query = "DELETE FROM users WHERE userid=".$userid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); $query = "DELETE FROM projects WHERE userid=".$userid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); $query = "DELETE FROM userprojects WHERE userid=".$userid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); $query = "DELETE FROM activities WHERE projectid=".$projectid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); Now the first three queries execute fine, obviously because the userid is being retrieved successfully. However the 4th and final query I know is wrong, because there is no projectid to be gained from anywhere, however I put it there to help understand what I am trying to get!! :D Im guessing that i would need something like 'WHERE projectid=' then something to gather the removed projects from the userid which can be related to the activities for that project(s)!! Its a simple concept but I'm having trouble...please excuse any bad code as I am learning also. Thanks for any help!

    Read the article

  • Getting JRuby to work in RubyMine

    - by John Baker
    I setup the proper SDK because all my ruby code will compile but RubyMine complains that it can't find the any of my java classes? Is this a flaw or is there a way to get it to recognizewhere the classes are? Here is my code, I have underlined all the things its complaining about require 'java' include_class 'java.awt.event.ActionListener' include_class 'javax.swing.JButton' include_class 'javax.swing.JFrame' class ClickAction include ActionListener def action_performed(event) puts "Button got clicked." end end Is there a way around this because I'd love to buy RubyMine if it's able to inform me of what Java classes and methods I can pick from. Thanks

    Read the article

  • Embedded file system and sqlite

    - by Jeff Lamb
    I'm working on an embedded project that has no file system, and our kludge of a database has ballooned in functionality. It's now so inefficient, we can't stand it any longer. I'm trying to figure out if there's built-in support for a flat file system in SQLite. I've dug around http://sqlite.org for a while now, but haven't found anything specifically covering it. Has anyone found a supported implementation written in C? It seems like such a straightforward request, but I can't find anything written about it. We have plenty of memory available. In a perfect world, I'd like to just set aside a large portion of it, pass the FS a pointer, then let the FS/SQLite library just use what it wants.

    Read the article

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