Daily Archives

Articles indexed Sunday February 6 2011

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

  • PHP preg_replace() pattern, string sanitization.

    - by Otar
    I have a regex email pattern and would like to strip all but pattern-matched characters from the string, in a short I want to sanitize string... I'm not a regex guru, so what I'm missing in regex? <?php $pattern = "/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i"; $email = 'contact<>@domain.com'; // wrong email $sanitized_email = preg_replace($pattern, NULL, $email); echo $sanitized_email; // Should be [email protected] ?> Pattern taken from: http://fightingforalostcause.net/misc/2006/compare-email-regex.php (the very first one...)

    Read the article

  • Cannot eliminate canvas page in facebook app.

    - by hunterp
    Hello, I have set a canvas page, and now, my facebook app page goes to a horrible place: http://apps.facebook.com/hificorder/?ref=ts whereas it is supposed to go to: http://www.facebook.com/apps/application.php?id=123018831077733 So, set the canvas page to the latter link...right? WRONG....when you do so, it causes an error. Set the canvas page to nothing??? FB does not allow. What do I do??? FYI, when you search for "HiFiCorder" in the normal facebook search, the canvas page is what comes up...this is horrible, please help.

    Read the article

  • Centre of a circle that intersects two points

    - by Jason
    Given two points in a 2D plane, and a circle of radius r that intersects both of those points, what would be the formula to calculate the centre of that circle? I realise there would two places the circle can be positioned. I would want the circle whose centre is encountered first in a clockwise direction when sweeping the line that joins the two points around one of those points, starting from an arbitrary angle. I guess that is the next stage in my problem, after I find an answer for the first part. I'm hoping the whole calculation can be done without trigonometry for speed. I'm starting with integer coordinates and will end with integer coordinates, if that helps.

    Read the article

  • jQuery Upload Progress Plugin Not working in Chrome and Safari

    - by Conceited Code
    I am using the jquery.uploadprogress plugin to get the upload progress of a file from the NginxHttpUploadProgressModule. This is inside an iframe for a facebook application. It works in firefox, but it fails in chrome/safari. When I open the console I get this. Uncaught ReferenceError: progressFrame is not defined jquery.uploadprogress.js:80 Any idea how I would fix that? I would like to also send the file using AJAX when it is completed. How would I implement that? EDIT: I need this soon and it is important so I am going to put a 100 point bounty on this question. The first person to answer it will receive the 100 points. EDIT 2: Jake33 helped me solve the first problem. First person to leave a response with how to send the file with ajax too will receive the 100 points.

    Read the article

  • Hierarchy flattening of interfaces in WCF

    - by nmarun
    Alright, so say I have my service contract interface as below: 1: [ServiceContract] 2: public interface ILearnWcfService 3: { 4: [OperationContract(Name = "AddInt")] 5: int Add(int arg1, int arg2); 6: } Say I decided to add another interface with a similar add “feature”. 1: [ServiceContract] 2: public interface ILearnWcfServiceExtend : ILearnWcfService 3: { 4: [OperationContract(Name = "AddDouble")] 5: double Add(double arg1, double arg2); 6: } My class implementing the ILearnWcfServiceExtend ends up as: 1: public class LearnWcfService : ILearnWcfServiceExtend 2: { 3: public int Add(int arg1, int arg2) 4: { 5: return arg1 + arg2; 6: } 7:  8: public double Add(double arg1, double arg2) 9: { 10: return arg1 + arg2; 11: } 12: } Now when I consume this service and look at the proxy that gets generated, here’s what I see: 1: public interface ILearnWcfServiceExtend 2: { 3: [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILearnWcfService/AddInt", ReplyAction="http://tempuri.org/ILearnWcfService/AddIntResponse")] 4: int AddInt(int arg1, int arg2); 5: 6: [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILearnWcfServiceExtend/AddDouble", ReplyAction="http://tempuri.org/ILearnWcfServiceExtend/AddDoubleResponse")] 7: double AddDouble(double arg1, double arg2); 8: } Only the ILearnWcfServiceExtend gets ‘listed’ in the proxy class and not the (base interface) ILearnWcfService interface. But then to uniquely identify the operations that the service exposes, the Action and ReplyAction properties are set. So in the above example, the AddInt operation has the Action property set to ‘http://tempuri.org/ILearnWcfService/AddInt’ and the AddDouble operation has the Action property of ‘http://tempuri.org/ILearnWcfServiceExtend/AddDouble’. Similarly the ReplyAction properties are set corresponding to the namespace that they’re declared in. The ‘http://tempuri.org’ is chosen as the default namespace, since the Namespace property on the ServiceContract is not defined. The other thing is the service contract itself – the Add() method. You’ll see that in both interfaces, the method names are the same. As you might know, this is not allowed in WSDL-based environments, even though the arguments are of different types. This is allowed only if the Name attribute of the ServiceContract is set (as done above). This causes a change in the name of the service contract itself in the proxy class. See that their names are changed to AddInt / AddDouble respectively. Lesson learned: The interface hierarchy gets ‘flattened’ when the WCF service proxy class gets generated.

    Read the article

  • MySQL reserves too much RAM

    - by Buddy
    I have a cheap VPS with 128Mb RAM and 256Mb burst. MySQL starts and reserves about 110Mb, but uses not more than 20Mb of them. My VPS Control Panel shows, that I use 127Mb (I also running nginx and sphinx), I know, that it shows reserved RAM, but when I reach over 128Mb, my VPS reboots automatically every 4 hours. So I want to force MySQL to reserve less RAM. How can i do that? I did some tweaks with my.conf but it helped not so much. top output: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 15 0 2156 668 572 S 0.0 0.3 0:00.03 init 11311 root 15 0 11212 356 228 S 0.0 0.1 0:00.00 vzctl 11312 root 18 0 3712 1484 1248 S 0.0 0.6 0:00.01 bash 11347 root 18 0 2284 916 732 R 0.0 0.3 0:00.00 top 13978 root 17 -4 2248 552 344 S 0.0 0.2 0:00.00 udevd 14262 root 15 0 1812 564 472 S 0.0 0.2 0:00.03 syslogd 14293 sphinx 15 0 11816 1172 672 S 0.0 0.4 0:00.07 searchd 14305 root 25 0 7192 1036 636 S 0.0 0.4 0:00.00 sshd 14321 root 25 0 2832 836 668 S 0.0 0.3 0:00.00 xinetd 15389 root 18 0 3708 1300 1132 S 0.0 0.5 0:00.00 mysqld_safe 15441 mysql 15 0 113m 16m 4440 S 0.0 6.4 0:00.15 mysqld 15489 root 21 0 13056 1456 340 S 0.0 0.6 0:00.00 nginx 15490 nginx 18 0 13328 2388 992 S 0.0 0.9 0:00.06 nginx 15507 nginx 25 0 19520 5888 4244 S 0.0 2.2 0:00.00 php-cgi 15508 nginx 18 0 19636 4876 2748 S 0.0 1.9 0:00.12 php-cgi 15509 nginx 15 0 19668 4872 2716 S 0.0 1.9 0:00.11 php-cgi 15518 root 18 0 4492 1116 568 S 0.0 0.4 0:00.01 crond MySQL tuner: >> MySQLTuner 1.0.1 - Major Hayden <[email protected]> >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering Please enter your MySQL administrative login: root Please enter your MySQL administrative password: -------- General Statistics -------------------------------------------------- [--] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.0.77 [OK] Operating on 32-bit architecture with less than 2GB RAM -------- Storage Engine Statistics ------------------------------------------- [--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [--] Data in InnoDB tables: 1M (Tables: 1) [OK] Total fragmented tables: 0 -------- Performance Metrics ------------------------------------------------- [--] Up for: 38m 43s (37 q [0.016 qps], 20 conn, TX: 4M, RX: 3K) [--] Reads / Writes: 100% / 0% [--] Total buffers: 28.1M global + 832.0K per thread (100 max threads) [OK] Maximum possible memory usage: 109.4M (42% of installed RAM) [OK] Slow queries: 0% (0/37) [OK] Highest usage of available connections: 1% (1/100) [OK] Key buffer size / total MyISAM indexes: 128.0K/64.0K [OK] Query cache efficiency: 42.1% (8 cached / 19 selects) [OK] Query cache prunes per day: 0 [!!] Temporary tables created on disk: 27% (3 on disk / 11 total) [!!] Thread cache is disabled [OK] Table cache hit rate: 57% (8 open / 14 opened) [OK] Open file limit used: 1% (12/1K) [OK] Table locks acquired immediately: 100% (22 immediate / 22 locks) [!!] Connections aborted: 10% [OK] InnoDB data size / buffer pool: 1.5M/8.0M -------- Recommendations ----------------------------------------------------- General recommendations: MySQL started within last 24 hours - recommendations may be inaccurate Enable the slow query log to troubleshoot bad queries When making adjustments, make tmp_table_size/max_heap_table_size equal Reduce your SELECT DISTINCT queries without LIMIT clauses Set thread_cache_size to 4 as a starting value Your applications are not closing MySQL connections properly Variables to adjust: tmp_table_size (> 32M) max_heap_table_size (> 16M) thread_cache_size (start at 4) I think if I do what MySQLtuner says, MySQL will use more RAM.

    Read the article

  • Seizing naming master from child domain server

    - by meera
    when I am trying to seize the role from my child domain server the naming master I get the following error fsmo maintenance: seize naming master Attempting safe transfer of domain naming FSMO before seizure. ldap_modify_sW error 0x34(52 (Unavailable). Ldap extended error message is 000020AF: SvcErr: DSID-03210380, problem 5002 (UN AVAILABLE), data 8438 Win32 error returned is 0x20af(The requested FSMO operation failed. The current FSMO holder could not be contacted.) ) Depending on the error code this may indicate a connection, ldap, or role transfer error. Transfer of domain naming FSMO failed, proceeding with seizure ... Server "win-fb20ixk90mu" knows about 5 roles Schema - CN=NTDS Settings,CN=WIN-3918XHC5STU,CN=Servers,CN=Default-First-Site-Na me,CN=Sites,CN=Configuration,DC=HCL,DC=com Naming Master - CN=NTDS Settings,CN=WIN-FB20IXK90MU,CN=Servers,CN=Default-First- Site-Name,CN=Sites,CN=Configuration,DC=HCL,DC=com PDC - CN=NTDS Settings,CN=WIN-FB20IXK90MU,CN=Servers,CN=Default-First-Site-Name, CN=Sites,CN=Configuration,DC=HCL,DC=com RID - CN=NTDS Settings,CN=WIN-FB20IXK90MU,CN=Servers,CN=Default-First-Site-Name, CN=Sites,CN=Configuration,DC=HCL,DC=com Infrastructure - CN=NTDS Settings,CN=WIN-FB20IXK90MU,CN=Servers,CN=Default-First -Site-Name,CN=Sites,CN=Configuration,DC=HCL,DC=com

    Read the article

  • Can't start mysql server in xubuntu

    - by codeomnitrix
    Hey all i am using Xampp version 1.7.1 in xubuntu 10.10. I have installed it in /opt/lampp but problem is that whenever i try to start the server using sudo ./lampp start it shows: Starting XAMPP for Linux 1.7.1... XAMPP: Starting Apache with SSL (and PHP5)... XAMPP: Starting MySQL... Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignored Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignored XAMPP: Starting ProFTPD... XAMPP for Linux started. So what should i do?? Thanks in advance.

    Read the article

  • Problem with bash scripting

    - by eple
    Hi. I terrible with bash scripting, and need some help with the following: #!/bin/bash if [ -e Pretty* ];then ncftpput -R -DD -v -u xbmc -p xbmc 192.168.1.100 /home/xbmc/TV/Pretty_Little_Liars/ Pretty* else echo "No new folders" fi find -depth -type d -empty -exec rmdir {} \; Problem here is the ncftpput line.. if I just do a simple [ echo "working" ] instead, everything is OK, but when I try the ncftpput-line it just gives me [ line 5: [: too many arguments ] the ncftpput command alone works fine.. Any ideas?

    Read the article

  • MySQL for SQL Server DBAs

    - by SQL3D
    I've been tasked with taking over the administration of a MySQL installation (running on Red Hat Linux) that will become fairly critical to our business in the near future. I was wondering if anyone could recommend some resources in regards to administering MySQL for DBAs already experienced with other relational database (SQL Server and some Oracle in my case). Specifically I'm looking for information around disaster recovery as well as high availability to start with, but I do want to get well rounded with the entire system. Thanks in advance, Dan

    Read the article

  • Enabling quota and doing quotacheck on reboot

    - by nixnotwin
    I have setup quota for home directories on ubuntu 10.04 server. I followed these tutorials: 5 Steps to Setup User and Group Disk Quota and Disk Quota This code I used at fstab file: /dev/sda1 /home ext4 defaults,usrjquota=aquota.user,grpjquota=aquota.grp,jqfmt=vfsv0 1 1 I have doubts about whether following steps are necessary: Adding quotaon -a >/dev/null 2>&1 to /etc/rc.local and adding quotacheck -avug to /etc/cron.daily/quotacheck

    Read the article

  • svn post-commit not performing

    - by davin
    ive been sitting on this for about 7 hours, and ive aged close to 7 years... ahhh, server admin does that to me. i have svn wired through apache2 with webdav in the usual manner (basically like http://www.howtoforge.com/setting-up-subversion-with-webdav-post-commit-hook-and-multiple-sites-on-jaunty-jackalope-ubuntu-9.04). ive had endless problems with this (i didnt on my previous ubuntu server install, although this is ubuntu 10.10): this happened, and was fixed like in the post: http://stackoverflow.com/questions/2547400/how-do-you-fix-an-svn-409-conflict-error this looks like my issue, although its not my solution: http://serverfault.com/questions/135494/apache-svn-on-ubuntu-post-commit-hook-fails-silently-pre-commit-hook-permis my commit to svn works (finally). although the post-commit hook which is supposed to svn update the working copy of the repo on the server, doesn't work. the post-commit hook itself executes, and has sudo permissions (as in the setup url above. testing with whoami somelogfile.log or sudo whoami somelogfile.log shows www-data and root, respectively), although it wont perform the svn update (sudo svn update /var/www/gameServer /var/svn/gameServer.log). similar to the serverfault url above, when i perform the exact command it does update the working copy to the latest revision, just not through the post-commit hook. an age old question that is 90% of the time a permissions issue. but in pure frustration i chmod 777 lots of stuff not to mention the fact that www-data is in /etc/sudoer so it shouldnt even need that. im collapsing in front of the screen partly out of frustration and partly out of sleepiness. any direction would be appreciated.

    Read the article

  • Setting up Tornado with Nginx on Ubuntu 10.04 for production use

    - by DjangoRocks
    Hi all, I understand that there's an nginx configuration file at http://www.friendfeed.com But i don't really know how to set up Tornada for production use on Ubuntu 10.04 with Nginx. Here's my situation and assumptions: 1) Assuming my Tornado project is set up as such: project/ src/ static/ templates/ project.py And I have installed Tornado by downloading the repositary from Github and than sudo python setup.py install 2) I've installed Nginx and started it based on the instructions here : http://library.linode.com/web-servers/nginx/installation/ubuntu-10.04-lucid My questions are: Where does my nginx configuration file go ? Within the src/ folder? After configuring Nginx, how do I start my Tornado project?

    Read the article

  • How to effectively secure a dedicated server for intranet use?

    - by Mark
    I need to secure a dedicated server for intranet use, the server is managed so will have software based security, but what other security should be considered for enterprise level security? The intranet is a host for an ECM (Alfresco) managing and storing sensitive documents. As the information is sensitive we are trying to make it as secure as reasonably possible (requirement in UK law). We plan to encrypt the data on the database. It will be connected to via SSL encryption. Should we consider Hardware firewall, Private lan between the application server and database server?

    Read the article

  • Sql Server 2005 cluster - unable to rename to old server name

    - by Paul2020
    We have a sql 2005 cluster on W2K8 cluster. It is a named instance say SRV1\A. Then I built a new W2K8 (with a diff cluster service name) but the same service account. Then I installed a new sql 2005 cluster say SRV2\A. Now when I bring down the sql server resources on SRV1 and try to rename SRV2\A to SRV1\A through the cluster admin, I get the error the network name already exists. I have tried bringing an old cluster and installing a new cluster with the same name and it works. Why am I not able to rename the name? Any advice would very helpful.

    Read the article

  • DNS on Redhat - rdnc: no server specified and no default

    - by Syahmul Aziz
    Hi all. The error as shown in the 2 pictures below: The configurations for named.conf and the zones files as shown below: After applying "alveso" suggestion below. Now, I think there is no error but I still can't ping my own domain www.p0864868.com (10.0.0.1) nor can I do host or nslookup as shown on previous pictures. PLease assist. Thank you in advance. I also attached my the changes that I made to my named.conf as well as my resolve.conf configs as shown below: progress 2: turned on logging by typping "rndc queylog" The output as below when I pinged p0864868.com progress 3: changed permission of 10-0-0.zone and p086868.zone to 644 named:named Still can't ping www.p0864868.com or execute host command. It says something like network unreachable. I don't understand why it refer to I don't what address is that.

    Read the article

  • What are the right questions to ask when deciding whether to use Chef or Puppet?

    - by John Feminella
    I am about to start a new project which will, in part, require deploying many identical nodes of approximately three different classes: Data nodes, which will run sharded instances of MongoDB. Application nodes, which will run instances of a Ruby on Rails application and an older ASP.NET MVC application. Processing nodes, which will run jobs requested by the application nodes. ALl the nodes will run on instances of Ubuntu 10.04, though they will have different packages installed. I have some familiarity with Chef from previous projects, though I don't consider myself an expert. In an effort to do due diligence, I have been investigating alternative possibilities. We have a number of folks in-house who are long-time Puppet users, and they have encouraged me to take a look. I am having trouble evaluating both choices, though. Chef and Puppet share many of the same domain terminology -- packages, resources, attributes, and so on, and they have a common history that stems from taking different approaches to the same problem. So in some sense they are very similar. But much of the comparison information I've found, like this article, is a little outdated. If you were starting this project today, what questions would you ask yourself to decide whether you should use Chef or Puppet for configuration management? (Note: I don't want answer to the question "Should I use Chef or Puppet?")

    Read the article

  • Can a device (WAP or switch) be configured as an 802.1x supplicant?

    - by Allan Ross
    We are looking at implementing 802.1x on a wired/wireless network. What I am looking for is a device that can act as a supplicant and once authenticated on the network, is able to pass traffic from any downstream connected device. The point of doing this would be to allow a properly pre-configured device to be provided to a client user who could then connect any device on the downstream side of the device. We will be able to manage the aggregate traffic on the device without concern for what is connected on the far side. Am I dreaming; does every device out there support this and I just don't know it or is reality fall somewhere in the middle?

    Read the article

  • How to set _optimizer_search_limit and _optimizer_max_permutations in Oracle10g.

    - by user52856
    I am working on a product that must support both MSSQL and Oracle (10g and 11g). I have some very complex queries that seem to run without issue on MSSQL 2005/2008, but very, very slow with Oracle. The CPU on the oracle server skyrockets for long periods of time, and it seems like the optimizer may be trying to find the best execution plan for the very complex query. I did some Googling to figure out how to limit the amount of time the optimizer spends on this, and came up with _optimizer_search_limit and _optimizer_max_permutations. Both of these parameters are hidden in Oracle 10g, and setting them in init.ora doesn't seem to make any difference. How do I set these parameters in Oracle. Or am I just totally barking up the wrong tree with the assumption that the optimizer is spending several minutes finding an execution plan? Thanks.

    Read the article

  • Red Hat 5.4 slow processing

    - by yucefrizk
    I'm running Red Hat Linux 5.4 on HP DL580 server with 16 processors and 64 GB of RAM. I'm connecting to the server remotely through SSH. after entering the password, it takes time to return the command line, if I click ctrl+c during this time, I'll have the command line prompt but not the correct bash prompt (I have to run bash to pass to my correct prompt). I tried to install Apache on the server, ./configure took 4 hours to finish instead of 1 or two minutes, Oracle installation same behavior. Server Disks are mirrored using RAID controller. any idea what could be the reason of this slowness?

    Read the article

  • Multiple "setups" on windows 7

    - by Roberto
    I would like to create multiple setups on Windows, that is, when I'm working with my computer I have some programs opened, after that I would like to change the setup/user to the "gaming setup" where the previous setup would hibernate and the computer would have all the resources free for me to play. I could have opened multiple tabs on firefox on each setup and they would be there when I come back. I understand that windows' switch user would make the programs run when I'm with the other user and that's not what I want. So, is that possible?

    Read the article

  • Handle wiki from android phone

    - by cmbrnt
    I'm currently using Oddmuse wiki to document thing, both personal and work related. What I'd like to do is to find an android app along with a wiki engine which enables me to read and make changes to the wiki with my phone. Using only the browser is unintuitive and hard to use. Does anyone else do this? I'd rather use mediawiki or dokuwiki, but I don't knlw of any apps which can both display and let me log in to edit the wiki. Any tips would be great!

    Read the article

  • Information about a file or directory

    - by Tim
    In Linux, the information about a file or directory is stored in its inode. I was wondering what is the data structure for information about a file or directory in Windows 7? How to get the information about a file or directory in Linux and in Windows 7, in terminal and command line window? Is the owner of a file or directory always its creator? Will it be able to change? Is there a creation timestamp for a file in Linux and in Windows 7? How to get it? Thanks and regards!

    Read the article

  • PC3200 RAM in Older Computer?

    - by skaz
    Hello all, I am inheriting a Dell Dimension 8200, but it needs RAM to get up and running. I have PC3200 sticks lying around, but I am not sure how to go about figuring out if the RAM is compatible, as RAM has always confused me. Here is the Dell Dimension 8200 Tech Specs: http://support.dell.com/support/edocs/systems/dim8200/specs.htm For RAM, it says: Memory type PC800 (non-ECC) I don't know if that is just the kind that comes with it, and I can put in PC3200 (I think, if it worked, this would run at the lower rating? Is that true?), or if that means only PC800 is compatible. Any help would be appreciated.

    Read the article

  • Unable to use BootCamp to Install Windows 7 on my Macbook Pro

    - by Sheehan Alam
    I get the error: cannot complete the partitioning because some files cannot be moved. I have more than enough space (250GB harddrive, 150GB free) I have tried doing a full defrag with iDefrag I don't want to reformat my drive I have tried partitioning in safe mode I have repaired all Disk Permissions using Disk Utility Any suggestions? NOTE: I am installing Windows 7 64-bit I am trying to create a 32GB partition

    Read the article

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