Daily Archives

Articles indexed Thursday April 15 2010

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

  • How to remove files and directories quickly

    - by None
    I am using a mac. When I use the "rm" command it can only remove files. The "rmdir" command only removes empty folders. If you have a directory with files and folders with files and folders in them and so on. Is there anyway to delete all the files and folders without all the strenuous command typing? Remember, I am using the mac bash shell from terminal, not Microsoft DOS or linux.

    Read the article

  • HTML Comment-out Add-In

    - by Velika
    Here is an old add in to quickly comment out HTML code. Maybe I am missing it, but it seems like there is a shortcut in VS2010 to scratch your tail with one click but commenting out HTML code is still awkward as hell. What's the easiest way to get a function like this working? Can I expect any add-ins that were written for older versions of VS to work in VS2010 w/o an upgrade?

    Read the article

  • Security implications of writing files using PHP

    - by susmits
    I'm currently trying to create a CMS using PHP, purely in the interest of education. I want the administrators to be able to create content, which will be parsed and saved on the server storage in pure HTML form to avoid the overhead that executing PHP script would incur. Unfortunately, I could only think of a few ways of doing so: Setting write permission on every directory where the CMS should want to write a file. This sounds like quite a bad idea. Setting write permissions on a single cached directory. A PHP script could then include or fopen/fread/echo the content from a file in the cached directory at request-time. This could perhaps be carried out in a Mediawiki-esque fashion: something like index.php?page=xyz could read and echo content from cached/xyz.html at runtime. However, I'll need to ensure the sanity of $_GET['page'] to prevent nasty variations like index.php?page=http://www.bad-site.org/malicious-script.js. I'm personally not too thrilled by the second idea, but the first one sounds very insecure. Could someone please suggest a good way of getting this done?

    Read the article

  • How to use CFUUID, can CFUUID be traced back to a unique individual. security/privacy

    - by Kevin
    Hi, i an new to iphone Dev and the concept of CFUUID, so thought i should ask, before i start implementing it. so the string returned by CFUUID is it really unique or can it be traced back to a unique individual. meaning lets say, i generate a CFUUID object and convert it to string(using the methods provided) , and then this info is used in my app or stored on a server database. and how unique is it, i mean is their a chance it can be similar to one generated on some other device. is it a good idea to use this info freely or are their some security/privacy aspects that i am not thinking about here. any help is greatly appreciated thanks

    Read the article

  • In .NET, Why Can I Access Private Members of a Class Instance within the Class?

    - by AMissico
    While cleaning some code today written by someone else, I changed the access modifier from Public to Private on a class variable/member/field. I expected a long list of compiler errors that I use to "refactor/rework/review" the code that used this variable. Imagine my surprise when I didn't get any errors. After reviewing, it turns out that another instance of the Class can access the private members of another instance declared within the Class. Totally unexcepted. Is this normal? I been coding in .NET since the beginning and never ran into this issue, nor read about it. I may have stumbled onto it before, but only "vaguely noticed" and move on. Can anyone explain this behavoir to me? I would like to know the "why" I can do this. Please explain, don't just tell me the rule. Am I doing something wrong? I found this behavior in both C# and VB.NET. The code seems to take advantage of the ability to access private variables. Sincerely, Totally Confused Class Jack Private _int As Integer End Class Class Foo Public Property Value() As Integer Get Return _int End Get Set(ByVal value As Integer) _int = value * 2 End Set End Property Private _int As Integer Private _foo As Foo Private _jack As Jack Private _fred As Fred Public Sub SetPrivate() _foo = New Foo _foo.Value = 4 'what you would expect to do because _int is private _foo._int = 3 'TOTALLY UNEXPECTED _jack = New Jack '_jack._int = 3 'expected compile error _fred = New Fred '_fred._int = 3 'expected compile error End Sub Private Class Fred Private _int As Integer End Class End Class

    Read the article

  • OCR for Devanagari (Hindi / Marathi / Sanskrit)

    - by Egon
    Does anybody have any idea about any recent work being done on optical character recognition for Indian scripts using modern Machine Learning techniques ? I know of some research being done at ISI, calcutta, but nothing new has come up in the last 3-4 years to the best of my knowledge, and OCR for Devanagari is sadly lacking!

    Read the article

  • How can I declare and initialize an array of pointers to a structure in C?

    - by worlds-apart89
    I have a small assignment in C. I am trying to create an array of pointers to a structure. My question is how can I initialize each pointer to NULL? Also, after I allocate memory for a member of the array, I can not assign values to the structure to which the array element points. #include <stdio.h> #include <stdlib.h> typedef struct list_node list_node_t; struct list_node { char *key; int value; list_node_t *next; }; int main() { list_node_t *ptr = (list_node_t*) malloc(sizeof(list_node_t)); ptr->key = "Hello There"; ptr->value = 1; ptr->next = NULL; // Above works fine // Below is erroneous list_node_t **array[10] = {NULL}; *array[0] = (list_node_t*) malloc(sizeof(list_node_t)); array[0]->key = "Hello world!"; //request for member ‘key’ in something not a structure or union array[0]->value = 22; //request for member ‘value’ in something not a structure or union array[0]->next = NULL; //request for member ‘next’ in something not a structure or union // Do something with the data at hand // Deallocate memory using function free return 0; }

    Read the article

  • Is it okay to implement reference counting through composition?

    - by Billy ONeal
    Most common re-usable reference counted objects use private inheritance to implement re-use. I'm not a huge fan of private inheritance, and I'm curious if this is an acceptable way of handling things: class ReferenceCounter { std::size_t * referenceCount; public: ReferenceCounter() : referenceCount(NULL) {}; ReferenceCounter(ReferenceCounter& other) : referenceCount(other.referenceCount) { if (!referenceCount) { referenceCount = new std::size_t(1); other.referenceCount = referenceCount; } else { ++(*referenceCount); } }; ReferenceCounter& operator=(const ReferenceCounter& other) { ReferenceCounter temp(other); swap(temp); return *this; }; void swap(ReferenceCounter& other) { std::swap(referenceCount, other.referenceCount); }; ~ReferenceCounter() { if (referenceCount) { --(*referenceCount); if (!*referenceCount) delete referenceCount; } }; operator bool() const { return referenceCount && (*referenceCount != 0); }; }; class SomeClientClass { HANDLE someHandleThingy; ReferenceCounter objectsStillActive; public: SomeClientClass() { //Construct handle thingy } ~SomeClientClass() { if (objectsStillActive) return; //Release resources }; }; or are there subtle problems with this I'm not seeing?

    Read the article

  • Exposed onsite vs IFD deployments for MS Dynamics CRM

    - by Greg McGuffey
    I'm working for the first time on a MS Dyanmics CRM 4.0 project. Our company has a high number of remote employees and even more remote consultants. As such it will be necessary to make the CRM solution available over the internet. As near as I can tell, I have three options: Have everyone use a VPN to access an intranet site (typical onsite deployment). However, we have found that VPNs are far from trouble free and cause many support issues. We avoid them like the plague. Use IFD to expose the CRM on the internet. I don't know much about this except that the URL will be different than the onsite URL, which could cause some headaches (see below). Expose the CRM site by opening the site to the internet, using SSL to encrypt traffic. We currently do this with our MS sharepoint sites. I'm not sure how secure this would be (one of the reasons for this question). I'd like to avoid using both the onsite intranet deployment and the IFD together for a couple of reasons. One of the requests for the solution is use email to notify users that they've been assigned a task, and include the URL to the task within the email. For this reason. If both deployments are used, then I'll need to include two URLs and the user would need to know which to use. Which leads to the second reason, the main users of the solution split time between being in the office and being remote. Thus they would need to access the solution two different ways, and know when to use which. Bad. So, what are the advantages/disadvantages of any of these methods? Any other options? Is there any issue using IFD from within the intranet? Security issues? Thanks!

    Read the article

  • Use regular expressions to match an ? but not a \?

    - by J.Milly
    I have a PHP regular expression that has been functioning fairly well to parse some odd legacy client templates until recently when we found an escaped question mark (\?) included in a template expression. I'm not strong enough with my regular expression-fu to wrap my feeble noodle around a negative look ahead or some techno-mumbo-jumbo so, tips or points in the right direction would be greatly appreciated. My PHP: preg_match_all("/\{\{IF (.*)\?(.*):(.*)\}\}/U", $template, $m, PREG_SET_ORDER);

    Read the article

  • Clear scr does not work

    - by idea_
    I haven't been able to use the "clear scr" command in a while, as I get the following error: root@server:~# clear The program 'clear' is currently not installed. You can install it by typing: apt-get install ncurses-bin bash: clear: command not found root@server:~# apt-get install ncurses-bin Reading package lists... Done Building dependency tree Reading state information... Done ncurses-bin is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I'm using Ubuntu Server 9.10. I did some development with the ncurses library a while ago, so I've no doubt broken something.

    Read the article

  • Oracle's Cloud Computing Events

    - by Peeyush Tugnawat
    Here is a useful link to Oracle full day events on Cloud Computing worldwide http://www.oracle.com/events/cloudcomputing/index.html   Other Oracle Cloud Computing Resources Oracle's Cloud Computing Products and Services Oracle's Cloud Computing Resource Center   Others My Previous Post about Cloud Computing

    Read the article

  • Customizing Number of Page Links Rendered With will_paginate?

    - by Moe
    I'm using the will_paginate gem for my Rails project and it's working beautifully. Unfortunately, on paginated result sets with a larger number of pages, the link section is too wide. Instead of: « Previous 1 2 … 5 6 7 8 9 10 11 12 13 … 18 19 Next » I would like to show: « Previous 1 2 … 5 6 7 8 9 … 18 19 Next » How can I reduce the number of page links being rendered? I looked at the will_paginate docs on github but couldn't find a solution. Thanks! Moe

    Read the article

  • ScrollView containing TextView does not scroll

    - by Dave Allison
    I have a textview displaying many individual words, each word is a link using Spans and setMovementMethod(LinkMovementMethod.getInstance()); The textview is wrapped by a ScrollView. However the ScrollView does not work as the links in the TextView are activated instead. Is there a way to combine a ScrollView and TextView so that both the scrolling and links in the text work?

    Read the article

  • Qt/C++ - confused about caller/callee, object ownership

    - by Isabel
    I am creating a GUI to manipulate a robot arm. The location of the arm can be described by 6 floats (describing the positions of the various arm joints. The interface consists of a QGraphicsView with a diagram of the arm (which can be clicked to change the arm position - adjusting the 6 floats). The interface also has 6 lineEdit boxes, to also adjust those values separately. When the graphics view is clicked, and when the line edit boxes are changed, I'd like the line edit boxes / graphics view to stay in synchronisation. This brings me to confusion about how to store the 6 floats, and trigger events when they're updated. My current idea is this: The robot arm's location should be represented by a class, RobotArmLocation. Objects of this class then have methods such as obj.ShoulderRotation() and obj.SetShoulderRotation(). The MainWindow has a single instance of RobotArmLocation. Next is the bit I'm more confused about, how to join everything up. I am thinking: The MainWindow has a ArmLocationChanged slot. This is signalled whenever the location object is changed. The diagram class will have a SetRobotArmLocation(RobotArmLocation &loc). When the diagram is changed, it's free to change the location object, and fire a signal to the ArmLocationChanged slot. Likewise, changing any of the text boxes will fire a signal to that ArmLocationChanged slot. The slot then has code to synchronise all the elements. This kind of seems like a mess to me, does anyone have any other suggestions? I've also thought of the following, does it have any merrit? The RobotArmLocation class has a ValueChanged slot, the diagram and textboxes can use that directly, and bypass the MainWindow directly (seems cleaner?) thanks for any wisdom!

    Read the article

  • WPF Window Style not working at runtime

    - by Christian Pena
    Hi, I created a WPF application in Visual Studio 2010 Express (C#) and added the text below to the Application.Resources in App.xaml. I see the style applied to the window in the designer, but when I run the application, the window background is white. Running in Windows XP on BootCamp on a MacBook Pro if that is a factor. Thanks in advance, Christian <Style TargetType="{x:Type Window}"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Offset="0" Color="WhiteSmoke" /> <GradientStop Offset="1" Color="Silver" /> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="Padding" Value="20" /> </Style>

    Read the article

  • Algorithm Analysis tool for java

    - by Mansoor
    I am looking for an algorithm analysis tool for java that can calculate Big 0 of a function. Ideal I would like to make it part of my build process, along side of my other code metrics tool. Even after searching on google I am unable to find any opensource of commercial tool. Any suggestion would be welcome Thanks

    Read the article

  • Outlook Marking Email as Junk Email

    - by robertabead
    I know. I sound like a spammer but these emails are completely legitimate email confirmations for people that have signed up for an account on this website we developed. These emails all make it through to various mail providers (gmail, yahoo, aol, hotmail/live) but they always get directed into the Outlook Junk Email folder. I am have tried using Zend Framework mail, PEAR Mail and phpMailer. All of those methods result in the same thing happening. This seemed to start happening after Microsoft released their update to the Outlook Junk Email filter in January of this year. Following is the code in question: include_once('Mail.php'); include_once('Mail/mime.php'); $hdrs = array( 'From' => "Membership <[email protected]>", 'Subject' => 'Test Email', 'Reply-To'=> "[email protected]", 'Message-ID'=> "<" . str_pad(rand(0,12345678),8,'0',STR_PAD_LEFT) . "@mail.example.com>", 'Date'=> date("D, j M Y H:i:s O",time()), 'To'=> '[email protected]' ); $params = array('host'=>'mail.example.com','auth'=>false,'localhost' => 'www.example.com','debug'=>false); $crlf = "\n"; $mime = new Mail_mime($crlf); $mime->setTXTBody("TEST"); $mime->setHTMLBody("<html>\n<body>\nTest\n</body>\n</html>"); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $mail =& Mail::factory('smtp',$params); $t=$mail->send('[email protected]', $hdrs, $body); As you can see we are using the PEAR Mail functionality in this test. This is the most basic test we could run and the above generated email gets dumped into the Outlook Junk Email folder. We have reverse DNS on the mail server and it matches the forward DNS, SPF and DKIM are set up and there is nothing "spammy" with the above content. Can anybody see something with the above code that could cause Outlook to mark it as Junk? Thanks!

    Read the article

  • UISplitViewController. Can we hide/show the master view?

    - by dugla
    I would like to use a UISplitViewController in a slightly different way then is common. Because my iPad app is fullscreen app I would like the ability to hide/show the master view when in landscape mode. Portrait view is not an issue since the master view transforms into a popover which can be hidden via the toolbar button. Is there a method on UISplitViewController that will nicely hide the master view and expand the detail view? Any insight would be most appreciated. Cheers. Thanks, Doug

    Read the article

  • Code folding for LaTeX in Emacs

    - by ShreevatsaR
    Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in LaTeX mode? For instance, I would like to move to the beginning of a long \begin{figure} block, hit a keystroke, and have the contents of that figure environment hidden from view. Similarly with \begin{proof} and so on, and ideally even with \subsections. Is this possible? I just tried hs-minor-mode, allout-mode, and outline-minor-mode, but most of them don't recognize LaTeX's environments, e.g. hs-minor-mode fails with "scan error: unbalanced parentheses". I would prefer not to have to enter explicit folding marks like {{{ as in folding-mode. [Ideally it would be great if the folding were persistent, but I see that that question doesn't have an accepted answer yet.]

    Read the article

  • PHP4: Send XML over HTTPS/POST via cURL?

    - by starmonkey
    I wrote a class/function to send xml over https via PHP4/cURL, just wondering if this is the correct approach, or if there's a better one. Note that PHP5 is not an option at present. /** * Send XML via http(s) post * * curl --header "Content-Type: text/xml" --data "<?xml version="1.0"?>...." http://www.foo.com/ * */ function sendXmlOverPost($url, $xml) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // For xml, change the content-type. curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml")); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // ask for results to be returned if(CurlHelper::checkHttpsURL($url)) { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); } // Send to remote and return data to caller. $result = curl_exec($ch); curl_close($ch); return $result; } cheers!

    Read the article

  • Nested form using accepts_nested_attributes_for with pre-population from another table

    - by mikeydelamonde
    I'm using Rails 2.3.5 and have a nested structure as follows: Lists has_many Items Items_Features has_many Features Items_Features has_many Items Items_Features has a text field to hold the value of the feature Then I have a nested form with partials to update and display this so that it updates Lists, Items and Items_Features What I want to do is generate input fields for each of the rows in features so that the user can fill in a value and it gets inserted/updated in items_features. I also want a label next to the box to display the feature name. It might look like this: List name: Cheeses Item1 name: Edam Feature, hardness: - fill in - <= this list of features from feature table Feature, smell: - fill in - How can I interrupt the nice and easy accepts_nested_attributes_for system to display this as I want?

    Read the article

  • Why is FxCop warning about an overflow (CA2233) in this C# code?

    - by matt
    I have the following function to get an int from a high-byte and a low-byte: public static int FromBytes(byte high, byte low) { return high * (byte.MaxValue + 1) + low; } When I analyze the assembly with FxCop, I get the following critical warning: CA2233: OperationsShouldNotOverflow Arithmetic operations should not be done without first validating the operands to prevent overflow. I can't see how this could possibly overflow, so I am just assuming FxCop is being overzealous. Am I missing something? And what steps could be taken to correct what I have (or at least make the FxCop warning go away!)?

    Read the article

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