Daily Archives

Articles indexed Sunday March 21 2010

Page 23/85 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • CakePHP - Controller url

    - by teepusink
    Hi, I just setup CakePHP on my local machine. When I do http://dev.local/categories/index, that works. However, http://dev.local/categories does not work. How do I make sure that http://dev.local/categories will give the same content as http://dev.local/categories/index? Thanks, Tee

    Read the article

  • Should a "script" tag be allowed to remove itself?

    - by Nischal
    We've been having a discussion at our workplace on this with some for and some against the behavior. Wanted to hear views from you guys : <html> <body> <div> Test! <script> document.body.removeChild(document.getElementsByTagName('div')[0]); </script> </div> </body> </html> Should the above script work and do what it's supposed to do? First, let's see what's happening here : I have a javascript that's inside the <div> element. This javascript will delete the child node within body which happens to hold the div inside which the script itself exists. Now, the above script works fine in Firefox, Opera and IE8. But IE6 and IE7 give an alert saying they cannot open the page. Let's not debate on how IE should have handled this (they've accepted it as a bug and hence fixed it in IE8). The point here is since the 'SCRIPT' tag itself is a part of DOM, should it be allowed to do something like this? Should it even exist after such an operation? Edit: Firefox, Opera, IE9 etc. do not remove the 'script' tag if I run the above code. But, document.getElementsByTagName('script').length returns 0! To understand what I mean, add alert(document.getElementsByTagName('script').length); before and after document.body.removeChild(document.getElementsByTagName('div')[0]); in the code above.

    Read the article

  • How can I only allow certain filetypes on upload in php?

    - by Chris
    I'm making a page where the user upload a file. I want an if statement to create an $error variable if the file type is anything other jpg, gif, and pdf. Here's my code: $file_type = $_FILES['foreign_character_upload']['type']; //returns the mimetype if(/*$file_type is anything other than jpg, gif, or pdf*/) { $error_message = 'Only jpg, gif, and pdf files are allowed.'; $error = 'yes'; } I'm having difficulty structuring the if statement. How would I say that?

    Read the article

  • Jquery $.post and PHP - Prevent the ability to use script outside of main website.

    - by Tim
    I have a PHP script setup using Jquery $.post which would return a response or do an action within the targeted .php file within $.post. Eg. My page has a form where you type in your Name. Once you hit the submit form button, $.post is called and sends the entered Name field value into "mywebsite.xyz/folder/ajaxscript.php" If a user was to visit "mywebsite.xyz/folder/ajaxscript.php" directly and somehow POST the data to the script, the script would return a response / do an action, based on the submitted POST data. The problem is, I don't want others to be able to periodically "call" an action or request a response from my website without using the website directly. Theoretically, right now you could determine what Name values my website allows without even visiting it, or you could call an action without going through the website, by simply visiting "mywebsite.xyz/folder/ajaxscript.php" So, what measures can I take to prevent this from happening? So far my idea is to ensure that it is a $_POST and not a $_GET - so they cannot manually enter it into the browser, but they could still post data to the script... Another measure is to apply a session key that expires, and is only valid for X amount of visits until they revisit the website. ~ Or, just have a daily "code" that changes and they'd need to grab this code from the website each day to keep their direct access to the script working (eg. I pass the daily "code" into each post request. I then check that code matches in the ajax php script.) However, even with these meaures, they will STILL have access to the scripts so long as they know how to POST the data, and also get the new code each day. Also, having a daily code requirement will cause issues when visiting the site at midnight (12:00am) as the code will change and the script will break for someone who is on the website trying to call the script, with the invalid code being passed still. I have attempted using .htaccess however using: order allow,deny deny from all Prevents legitimate access, and I'd have to add an exception so the website's IP is allowed to access it.. which is a hassle to update I think. Although, if it's the only legitimate solution I guess I'll have to. If I need to be more clear please let me know.

    Read the article

  • Resolving DNS queries for two disconnected, private, networks

    - by Mikeage
    I'm trying to setup two PCs (one Windows, one Linux, but my understanding is that this problem is more DNS and less OS) as follows: Home network: 192.168.1.0/24 VPN (via OpenVPN server not within the home network): 192.168.2.0/24 . I would like a PC on both networks to be able to access three different types of site: Internet addresses Addresses on the home network Addresses on the vpn However, I'm not sure how/which DNS servers to use. If I prioritize my home DNS server, I can resolve (1) and (2), but not (3). If I prioritize my VPN DNS server, I can't resolve addresses of type (2). Of course, looking up addresses via nslookup and explicitly setting the correct server works, so I know my local DNS servers are OK. Is there any way I can set up my PCs to fallback on the second DNS server if there is no response? Alternatively, is there any way I can tell different queries to go to different servers [maybe by setting up different subdomains; foo.local.something vs. bar.vpn.something]? Thanks

    Read the article

  • How can I increase the size of a Windows 2003 NTFS partition?

    - by waszkiewicz
    Hi everybody! I have a very important server running Windows Server 2003 and my System partition is becoming too small, it's slowing down the machine. I have already tried all the cleaning stuff and transferring some "unimportant softs" on the "Saves" partition but it didn't help much at all. Is there a way to re-partition my hard-drive that will work on a 2003 Server, that's not too expensive and that could be used without turning the machine off. If there is no other way, then I'll have to reinstall the OS, but it will have to wait for the weekend. Thanks for your suggestions.

    Read the article

  • Torrent download (µTorrent and FlashGet) suddenly got limited speed!

    - by el
    Both µTorrent and FlashGet are being throttled and I don't know why or how. I use both and they usually report a download speed of 70kbps for torrent speed. FlashGet would report a speed of 70kbps yet actually download at another speed which is about the same as the actual which is a consisten 70kbps. Now, all of a sudden, my torrent downloads are only up to 20kbps. FlashGet still shows a reading of 70kbps, maybe even 80kbps. But, the average actual speed of download is really only 20kbps. I am using Windows 7 on my laptop and no matter where the internet is coming it's the same thing. I have no idea what could be limiting my download rates.

    Read the article

  • Web GUI for editing INI files

    - by Tom
    I am looking for a Unix based application or framework that would allow me to view/edit ini files on a remote system in a Html GUI via Apache (or similar). Searching for ini/config/GUI solutions via search engines returns a lot a false positives. Any recommendations?

    Read the article

  • programming language implemented in pure python

    - by iamgopal
    hi, i am creating ( researching possibility of ) a highly customizable python client and would like to allow users to actually edit the code in another language to customize the running of program. ( analogous to browser which itself coded in c/c++ and run another language html/js ). so my question is , is there any programming language implemented in pure python which i can see as a reference ( or use directly ? ) -- i need simple language ( simple statements and ifs can do )

    Read the article

  • Help to chouse NoSQL database for project

    - by potapuff
    There is a table: doc_id(integer)-value(integer) Approximate 100k doc_id and 27?? rows. Majority query on this table - searching documents similar to current document: select 10 documents with maximum of (count common to current document value)/(count ov values in document). Nowadays we use PostgreSQL. Table weight (with index) ~1,5 GB. Average query time ~0.5s. Should I transfer all this to NoSQL base, if so, what?

    Read the article

  • Thumbnails from HTML pages created and used automatically in web application

    - by Jesper Rønn-Jensen
    I am working on a Ruby on Rails app that visualizes product trees. The tree is built of nodes an everything is rendered in HTML/CSS3. Some of the products make several hundred SQL queries as the tree builds up (up to 800 queries on the biggest tree). I'd like to have small thumbnails of each tree to present it on an index page. So rendering each tree once again and modifying CSS to make a tiny representation is an option. But i think it's probably easier to generate thumbnails, crop, cache, and show these on the index page. Any ideas on how to do this? Any links/articles/blog posts that could help me?

    Read the article

  • How do I use Notepad++ (or other) with msysgit?

    - by PHLAK
    How do I use Notepad++ (or any other editor besides vim) with msysgit? I tried all of the following to no avail: git config --global core.editor C:\Program Files\Notepad++\notepad++.exe git config --global core.editor "C:\Program Files\Notepad++\notepad++.exe" git config --global core.editor C:/Program Files/Notepad++/notepad++.exe git config --global core.editor C:\\Program Files\\Notepad++\\notepad++.exe

    Read the article

  • Download rates of torrents through µTorrent and FlashGet are suddenly limited

    - by el
    Both µTorrent and FlashGet are being throttled and I don't know why or how. I use both and they usually report a download speed of 70kbps for torrent speed. FlashGet would report a speed of 70kbps yet actually download at another speed which is about the same as the actual which is a consisten 70kbps. Now, all of a sudden, my torrent downloads are only up to 20kbps. FlashGet still shows a reading of 70kbps, maybe even 80kbps. But, the average actual speed of download is really only 20kbps. I am using Windows 7 on my laptop and no matter where the internet is coming it's the same thing. I have no idea what could be limiting my download rates.

    Read the article

  • How to control allowed HTML tags in WMD Editor?

    - by Toto
    I am trying to some-how set the valid HTML tags and attributes users would be able to use in WMD Editor in my site. For example, I want to forbid the user to directly set the font size, color, typeface and so on, which is trivial to do with the default settings typing something like: <span style="font-size: 45px; color:#FF0000">Some intrusive text here</span>. I think the way to implement this is through the "wmd_options", but I have not found any documentation or reference regarding this, giving the fact that the 'Options demo' seems to be the only public documentation and it does not show how should I do what I have described above. I've send this same question to [email protected] but didn't get any reply. As stackoverflow uses this editor someone reading this or maybe Jeff knows the answer ;) Thanks in advance!

    Read the article

  • Login failed when a web service tries to communicate with SharePoint 2007

    - by tata9999
    Hi, I created a very simple webservice in ASP.NET 2.0 to query a list in SharePoint 2007 like this: namespace WebService1 { /// <summary> /// Summary description for Service1 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public string ShowSPMyList() { string username = this.User.Identity.Name; return GetList(); } private string GetList() { string resutl = ""; SPSite siteCollection = new SPSite("http://localhost:89"); using (SPWeb web = siteCollection.OpenWeb()) { SPList mylist = web.Lists["MySPList"]; SPQuery query = new SPQuery(); query.Query = "<Where><Eq><FieldRef Name=\"AssignedTo\"/><Value Type=\"Text\">Ramprasad</Value></Eq></Where>"; SPListItemCollection items = mylist.GetItems(query); foreach (SPListItem item in items) { resutl = resutl + SPEncode.HtmlEncode(item["Title"].ToString()); } } return resutl; } } } This web service runs well when tested using the built-in server of Visual Studio 2008. The username indicates exactly my domain account (domain\myusername). However when I create a virtual folder to host and launch this web service (still located in the same machine with SP2007), I got the following error when invoking ShowSPMyList() method, at the line to execute OpenWeb(). These are the details of the error: System.Data.SqlClient.SqlException: Cannot open database "WSS_Content_8887ac57951146a290ca134778ddc3f8" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Does anyone have any idea why this error happens? Why does the web service run fine inside Visual Studio 2008, but not when running stand-alone? I checked and in both cases, the username variable has the same value (domain\myusername). Thank you very much.

    Read the article

  • SubSonic error: db.tables with a ~ in the name result in a "Character is not valid" error

    - by Steven
    I renamed a database table and added a ~ character to the table name (my way of notifying it is a backup of something). After generating the SubSonic files, my Visual Studio gives a "Character not valid" error on file "AllStructs.vb" When looking into this file the following line of code was generated; Public Shared ReadOnly DbTable1~old As String = "dbtable1~old". I assume this character has to be filtered out of the db.table names when generating the SubSonic names?

    Read the article

  • iphone - compiler conditional on header

    - by Mike
    I have a project that generates applications for two targets. One of the targets has to include one additional delegate protocol that should not be present on the other one. So, I have created a macro on Xcode and declared the header like this: #ifdef TARGET_1 @interface myViewController : UIViewController <UIScrollViewDelegate, UIPopoverControllerDelegate> #endif #ifdef TARGET_2 @interface myViewController : UIViewController <UIScrollViewDelegate> #endif { .... bla bla.... } The problem is that Xcode is not liking this "double" declaration of @interface and is giving me all sort of problems. How to solve that? thanks for any help.

    Read the article

  • Best practise question

    - by sid_com
    Hello! With version would you prefer? #!/usr/bin/env perl use warnings; use strict; use 5.010; my $p = 7; # 33 my $prompt = ' : '; my $key = 'very important text'; my $value = 'Hello, World!'; my $length = length $key . $prompt; $p -= $length; Option 1: $key = $key . ' ' x $p . $prompt; Option 2: if ( $p > 0 ) { $key = $key . ' ' x $p . $prompt; } else { $key = $key . $prompt; } say "$key$value"

    Read the article

  • Are there any tools to help the user to design a State Machine to be consumed by my application?

    - by kolrie
    When reading this question I remembered there was something I have been researching for a while now and I though Stackoverflow could be of help. I have created a framework that handles applications as state machines. Currently all the state business logic and transactions are handled via Java code. I was looking for some UI implementation that would allow the user to draw the state machines and transactions and generate a file that can later on be consumed by my framework to "run" the workflow according to one or more defined state machines. Ideally I would like to use an open standard like SCXML. The goal as the UI would be to have something like this plugin IBM have for Rational Software Architect: Do you know any editor, plugin or library that would have something similar or at least serve as a good starting point?

    Read the article

  • Drupal Query builder

    - by Rimian
    I quite often use Drupal's Views Module to build SQL that I paste into my code. It understands the Drupal database schema quite well. Is there a module that would give me this functionality or can I factor this out of Views?

    Read the article

  • How to implement Object Databases in Asp.net MVC

    - by amexn
    I started my project in Asp.net MVC(c#) & SQL Server 2005.I want to implement Object Databases in my project. While searched in google i found "MongoDb" & db4o I didn't have enough knowledge in Object Databases & which one best suited for SQL Server 2005. Please suggest a good example/reference regarding Object Databases implementation in Asp.net MVC application

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >