Search Results

Search found 5637 results on 226 pages for 'triple slash comments'.

Page 71/226 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • Open C: Directly with `FileStream` without `CreateFile` API

    - by DxCK
    I trying to open C: directly with FileStream without success: new FileStream("C:", FileMode.Open, FileAccess.Read, FileShare.ReadWrite); System.UnauthorizedAccessException was unhandled Message="Access to the path 'C:\' is denied." Source="mscorlib" StackTrace: in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) in System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) in ReadingMftNewTest.Program.Main(String[] args) in D:\CS\2008\ReadingMftNewTest\ReadingMftNewTest\Program.cs:line 76 Note that i openning "C:" but the error says "C:\", where did this slash came from? :\ Is there any chance to open C: without using the CreateFile API? I really don't want be depending on WIN32 API because this code should also run on Mono that dont support WIN32 API, but successfully openning devices with regular FileStream (Mono 1 Microsoft 0).

    Read the article

  • How to Post Javascript to a MySQL Database

    - by salientanimal
    Hi guys, I have created a form in HTLM and I m trying to post the information in the form to a MySQL database. My form make suse of a dynamic list selection that needs to be captured to the database. However when submtting the form I get the following error Error: Unknown column 'coulmn_name' in 'field list'. Here is my HTML CODE for the form <td height="94"><p align="justify">CALL TRACKER - ADMIN</p></td> Customer Name : E-Mail Address : </tr> <tr> <td width="29%" align="right" valign="middle"><strong>Case Number :</strong></td> <td> <input type="text" name="case_number" width="70%" align="left" valign="middle"> </td> </tr> <tr> <td width="29%" align="right" valign="middle"><strong>MSISDN :</strong></td> <td> <input type="text" name="msisdn" width="70%" align="left" valign="middle"> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Route Cause :</strong></td> <td width="71%" align="left" valign="middle"> <select name="route_cause" id="category" onChange="javascript: listboxchange1(this.options[this.selectedIndex].value);"> <!-- <select name="route_cause" id="route_cause"> --> <option value="">Select the Call Reason</option> <option value="Billing Admin">Billing Admin</option> <option value="Customer Care">Customer Care</option> <option value="Insurance">Insurance</option> <option value="Repairs">Repairs</option> <option value="SIM Swap">SIM Swap</option> <option value="UTI">UTI</option> </select> </td> </tr> <tr> <td align="right" valign="middle"> <strong>Call Type/Indexed To :</strong></td> <td align="left" valign="middle"> <script type="text/javascript" language="javascript" name="calltype_indexedto"> <!-- document.write('<select name="subcategory1" onChange="javascript: listboxchange2(this.options[this.selectedIndex].value);"><option value=""></option></select>') --> </script> </td> </tr> <tr> <td align="right" valign="middle"> <strong>Type/TAT :</strong></td> <td align="left" valign="middle"> <script type="text/javascript" language="javascript" name="type_tat"> <!-- document.write('<select name="subcategory2" onChange="javascript: listboxchange3(this.options[this.selectedIndex].value);"><option value=""></option></select>') --> </script> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Escalated To :</strong></td> <td width="71%" align="left" valign="middle"> <select name="escalatedto" id="escalated_to"> <option value="">Select the Escalation</option> <option value="Billing Ops">Billing Ops</option> <option value="Resolvers">Resolvers</option> <option value="Finance">Finance</option> <option value="Ressolver">Ressolver</option> <option value="Nudebt">Nudebt</option> <option value="Transunion">Transunion</option> <option value="N/A">N/A</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Requested By :</strong></td> <td width="71%" align="left" valign="middle"> <select name="requestedby" id="requested_by"> <option value="">UTI Requested By</option> <option value="Billing">Billing</option> <option value="Customer Service">Customer Service</option> <option value="Insurance">Insurance</option> <option value="Management">Management</option> <option value="Repairs">Repairs</option> <option value="Retail Support">Retail Support</option> <option value="Retentions">Retentions</option> <option value="SIM Swap">SIM Swap</option> <option value="WOW">WOW</option> <option value="N/A">N/A</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Province :</strong></td> <td width="71%" align="left" valign="middle"> <select name="province" id="province"> <option value="">Select the Province</option> <option value="Eastern Cape">Eastern Cape</option> <option value="Gauteng">Gauteng</option> <option value="Kwa-Zulu Natal">Kwa-Zulu Natal</option> <option value="Limpopo">Limpopo</option> <option value="Mpumalanga">Mpumalanga</option> <option value="North West">North West</option> <option value="Northern Cape">Northern Cape</option> <option value="Polokwane">Polokwane</option> <option value="Western Cape">Western Cape</option> <option value="Other">Other</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"><strong>Comments :</strong></td> <td> <textarea rows ="5" cols="30" name="comments"> </textarea> </td> </tr> <tr> <td> <p> <input type="reset" value="Reset Form"><input type="Submit" value="Submit"> Here is my PHP CODE to write to the Database <?php $con = mysql_connect("hostname" ,"mysqusername" ,"mysqlpassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $con); $sql="INSERT INTO customer_services_tracker (customer_name ,customer_email_address ,case_number ,msisdn ,route_cause ,calltype_indexedto ,type_tat ,escalatedto ,requestedby ,province ,comments ) VALUES ('$_POST[customer_name]' ,'$_POST[customer_email_address]' ,'$_POST[case_number]' ,'$_POST[msisdn]' ,'$_POST[route_cause]' ,'$_POST[calltype_indexedto]' ,'$_POST[type_tat]' ,'$_POST[escalatedto]' ,'$_POST[requestedby]' ,'$_POST[province]' ,'$_POST[comments]')"; $CatName = $rowCat["Name"]; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?>

    Read the article

  • Like posts over Facebook graph api

    - by Sima
    HI! I have little problem with facebook PHP SDK..I want to like a post, or something else via facebook PHP SDK..I am doing this code, I think it should be right, but  apparently it's not working..The given error code is, the PHP SDK dont know this kind of POST request(the generated link is definitely alright). What I have seen on Facebook Developers page is about the same..There is an example of Curl command, and I the PHP SDK is doing this requests over Curl (propably). $this->getFacebook()->api("/"+$id+"/likes", 'post'); This is what I am using in my code and it's not working(Facebook API Exception unsupported post request). Maybe, I have bad syntax in my code, but, for example, when I want to post a status to my Profile, it's working..Another cause which confused me, was when I tried to fetch these data over Graph api(on the documentation page is written, I should use address like graph.facebook.com/POST_ID/likes)... You can comment on or like a post by posting to https://graph.facebook.com/POST_ID/comments and https://graph.facebook.com/POST_ID/likes,respectively: curl -F 'access_token=...' \ https://graph.facebook.com/313449204401/likes <=this is from facebook documentation And all these requests or commands(liking ones, comments have I not yet tried) are putting me back a JSON array which contents any already existing likes, but my like is nowhere. Does anyone know what to do?How to like a post from PHP..There are other SKDs like FQL, but I haven't any knowlegde with it, so I like rather to use the standard PHP SDK(but if is there some possibility how to call for example FQL from PHP SDK, here I am:)) Please help..

    Read the article

  • What keying option does the keychain use?

    - by Rudiger
    I have read into the keychain and have found that it uses Triple DES. What I can't find is what keying option it uses. I am guessing / hoping that its keying option 1 where all 3 passwords are unique but if thats the case I can only think of two passwords it can use (user password and App ID that comes from your dev cert) so where is the third coming from? Is it a key private to Apple? If its keying option 2 (first and third key are the same) it might not be secure enough for our company to rely on. Although that might sound paranoid I have to justify to our security department that it is secure enough.

    Read the article

  • UITableViewCells loaded from NIB always nil

    - by Jason B
    I'm trying to create a simple form using a UITableViewController as documented in the Apple Developer Documentation here: http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html What I'm trying to do is located in the section entitled: "The Technique for Static Row Content" I've created a couple of UITableViewCells and added them to my nib, but when I try and access them to add them to the UITableView (in the cellForRowAtIndexPath method) they are always null. It's like they are not being properly loaded from the nib. I've double/triple/quadruple checked my code to make sure I'm doing it exactly as detailed in the docs, but no luck. Is there something obvious I'm missing here? Thanks

    Read the article

  • curl not returning content length header

    - by Michael P. Shipley
    Trying to get image file size using curl but content length header is not returned: $url ="http://www.collegefashion.net/wp-content/plugins/feed-comments-number/image.php?1263"; $fp = curl_init(); curl_setopt($fp, CURLOPT_NOBODY, true); curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); curl_setopt($fp, CURLOPT_FAILONERROR,1); curl_setopt($fp, CURLOPT_REFERER,''); curl_setopt($fp, CURLOPT_URL, $url); curl_setopt($fp, CURLOPT_HEADER,1); curl_setopt($fp, CURLOPT_USERAGENT,'Mozilla/5.0'); $body = curl_exec($fp); var_dump($body): HTTP/1.1 200 OK Date: Sun, 02 May 2010 02:50:20 GMT Server: Apache/2.0.63 (CentOS) X-Powered-By: W3 Total Cache/0.8.5.2 X-Pingback: http://www.collegefashion.net/xmlrpc.php Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT Content-Type: image/png It works via ssh though: curl -i http://www.collegefashion.net/wp-content/plugins/feed-comments-number/image.php?1263 HTTP/1.1 200 OK Date: Sun, 02 May 2010 03:38:43 GMT Server: Apache/2.0.63 (CentOS) X-Powered-By: W3 Total Cache/0.8.5.2 X-Pingback: http://www.collegefashion.net/xmlrpc.php Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT Content-Length: 347 Content-Type: image/png

    Read the article

  • IE8 claims my page has an error, firefox doesn't, and I can't find any error. Help!

    - by Bears will eat you
    This is something of a follow-up question to my question here. You can find the HTML source in a text file here. When I load that page in IE8, I get the "Done, but with errors on page." message in my status bar. The detail view shows Expected identifier sms Line: 147 Code: 0 Char: 67 and I see absolutely no problems anywhere near there. In IE8, the page is still behaving erratically w/r/t the randomly losing focus as mentioned in my other question. When I load the same exact page in Firefox (using Firebug) the console shows no errors and the page works perfectly. Any thoughts on what's going on here? This is driving me nuts and making me want to give up on even trying to write an IE friendly page. Edit: Thanks for all the comments! This page is written as a JSP, so I edit in Eclipse. I found an Eclipse warning about the onblur event for the username field. I switched it from onblur="alert(document.activeElement + ' class:' + document.activeElement.class)" to onblur="alert(document.activeElement)" and that made the bizarre IE page error vanish. I had been trying to give more info (namely, its CSS class) about specifically which element is stealing focus - to my own detriment, apparently, since Javascript was interpreting the '.class' part in the Java(script) sense. And, no, the page doesn't validate. But the errors were mostly/all ones that just didn't make sense, such as Line 14, Column 41: Attribute "LANGUAGE" is not a valid attribute. Did you mean "language"? to which I say, WTF?! But I'm still stuck trying to figure out why, as I enter text in the username & password fields, focus randomly switches to a div (working on figuring out which div currently). Edit 2: It's the div between the two "global nav" comments, at the very top of the body. Still no idea why it's happening, though.

    Read the article

  • Highlighting correctly in an emacs major mode

    - by Paul Nathan
    Hi, I am developing an emacs major mode for a language (aka mydsl). However, using the techniques on xahlee's site doesn't seem to be working for some reason (possibly older emacs dialect..) The key issues I am fighting with are (1) highlighting comments is not working and (2), the use of regexp-opt lines is not working. I've reviewed the GNU manual and looked over cc-mode and elisp mode... those are significantly more complicated than I need. ;;;Standard # to newline comment ;;;Eventually should also have %% to %% multiline block comments (defun mydsl-comment-dwim (arg) "comment or uncomment" (interactive "*P") (require 'newcomment) (let ((deactivate-mark nil) (comment-start "#") (comment-end "") comment-dwim arg))) (defvar mydsl-events '("reservedword1" "reservedword2")) (defvar mydsl-keywords '("other-keyword" "another-keyword")) ;;Highlight various elements (setq mydsl-hilite '( ; stuff between " ("\"\\.\\*\\?" . font-lock-string-face) ; : , ; { } => @ $ = are all special elements (":\\|,\\|;\\|{\\|}\\|=>\\|@\\|$\\|=" . font-lock-keyword-face) ( ,(regexp-opt mydsl-keywords 'words) . font-lock-builtin-face) ( ,(regexp-opt mydsl-events 'words) . font-lock-constant-face) )) (defvar mydsl-tab-width nil "Width of a tab for MYDSL mode") (define-derived-mode mydsl-mode fundamental-mode "MYDSL mode is a major mode for editing MYDSL files" ;Recommended by manual (kill-all-local-variables) (setq mode-name "MYDSL script") (setq font-lock-defaults '((mydsl-hilite))) (if (null mydsl-tab-width) (setq tab-width mydsl-tab-width) (setq tab-width default-tab-width) ) ;Comment definitions (define-key mydsl-mode-map [remap comment-dwim] 'mydsl-comment-dwim) (modify-syntax-entry ?# "< b" mydsl-mode-syntax-table) (modify-syntax-entry ?\n "> b" mydsl-mode-syntax-table) ;;A gnu-correct program will have some sort of hook call here. ) (provide 'mydsl-mode)

    Read the article

  • Lightbox scrolling issue with IE7 & 8

    - by BlazeK
    The lightbox that i am using works great with all browsers except for IE. In IE, its giving me triple scrolls. http://obliqueinteractive.com/demo/monster/ CSS code for the iframe: #wrap { float:left; width:800px; height:500px; overflow-x: hidden; overflow-y: scroll; } #content-wrap { float:left; width:700px; padding-left:50px; } Why is IE adding additional scrolls to the lightbox window? any suggestions?

    Read the article

  • How can I search for numbers in a varchar column

    - by dave
    I've got a simple nvarchar(25) column in an SQL database table. Most of the time, this field should contain alphanumeric text. However, due to operator error, there are many instances where it contains only a number. Can I do a simple search in SQL to identify these cases? That is, determine which rows in the table contain only digits in this column. As an extension, could I also search for those column values which contain only digits and a space and/or slash. In other languages (eg. Perl, Java) a regular expression would resolve this quickly and easily. But I haven't been able to find the equivalent in SQL.

    Read the article

  • Orphan Char appearing when using Sifr3 in Navigation (Wordpress)

    - by missmonkee
    Hi there, I am having an issue implementing Sifr3 on this particular site and it's driving me nuts. Hoping someone will be able to help me: http://client.missmonkee.com/agency-mobile LOGIN: client-login cl1entpassw0rd Here at the top right you can see the navigation to the site, in FF3 Win 7 / FF & Safari MAC some menu items show 1 char on a seperate line to the rest of the menu item. It looks as if there is a width on the li or something but I'm 100% sure there isnt and the rest of the menu items are OK and display fine. Something in relation to this might help answer this problem, is that Sifr3 does does not work AT ALL in IE7 WIN. I've checked previous answers to this, being the trailing comma issue but I've triple checked and I do not have any trailing commas. Can anyone help on this pls? Thanks in advance

    Read the article

  • Installing CakePHP on Windows with Apache

    - by GeoSQL
    Hi, I'm trying to install CakePHP on my Windows XP machine running Apache 2.2. I have installed the Cake folder in my doc root. I've read the installation instructions that say to include this line in the httpd.conf file; <Directory /path/to/cake> Does anyone know how to translate that into Windows? I currently have the following in my conf file: <Directory "C:/Apache/Apache2.2/htdocs/cakeapp/"> Whenever I uncomment this line it crashes Apache. I've tried switching the slashes to "\" and I tried taking the slash off the end. Any advice? Thanks

    Read the article

  • Is there a way to validates_presence_of only one time? (to skip that validation once the user's been

    - by GoodGets
    So, I'd like for a user to see an error message if he submits a comment and the :name is blank (typical error message, don't need help with that). However, I'd then like to allow the user to skip that validation once he's been notified that "we like all comments to have a name." So, he submits the comment once, sees the notification, then can submit the form again unchanged if he really doesn't want to add a name, and the validates_presences_of :name is skipped. But, I'm not sure how to go about doing this. I thought about checking to see where the request is coming from, but after a create, errors are handed off to the "new" action, which is the same as actual "new" comments. I then thought about checking to see if flash[errors] were present, but that won't work because there are other validations a comment has to pass. Finally, I thought about trying a validates_presences_of :name, :unless = :notified but wasn't sure how to define notified. I honestly hate asking such an open ended question, but wasn't sure where to get started. So, is there a way to just check a certain validation once?

    Read the article

  • Controlling Movie Clips from the main time line instead of using their individual time lines?

    - by Jess
    I have a Flash website template (four pages) that I made using AS 3.0 and Flash CS4. It is for an assignment involving movie clips. Currently on the main time line there is only one frame, and three layers: actions/menu/content. The actionscript on the main time line is simply: content_mc.stop (); There is a movie clip on the stage called “Content” that contains the content for each of the pages. Inside of that there is a “Menu” movie clip that contains and controls all of the navigation buttons. The actionscript for the Menu movie clip is: function homeBtnPress (event:MouseEvent):void{ //comments here //comments here MovieClip(parent).content_mc.gotoAndStop("home"); } function aboutBtnPress (event:MouseEvent): void{ MovieClip(parent).content_mc.gotoAndStop ("about"); } function servicesBtnPress (event:MouseEvent): void{ MovieClip (parent).content_mc.gotoAndStop ("services"); } function contactBtnPress (event:MouseEvent): void{ MovieClip (parent).content_mc.gotoAndStop ("contact"); } function portfolioBtnPress (event:MouseEvent): void{ MovieClip (parent).content_mc.gotoAndStop ("portfolio"); } home.addEventListener(MouseEvent.CLICK, homeBtnPress); about.addEventListener(MouseEvent.CLICK, aboutBtnPress); services.addEventListener(MouseEvent.CLICK, servicesBtnPress); contact.addEventListener(MouseEvent.CLICK, contactBtnPress); portfolio.addEventListener(MouseEvent.CLICK, portfolioBtnPress); So everything works fine, but my instructor wants me to control the menu/content from the main time line by using the target path tool. What exactly would I target – just the “menu” and “content” movie clips, and what code would I use? Sorry if I'm not explaining very well, I'm pretty confused. Here is the feedback from my instructor: “While we learned how to control the main timeline and the timeline of another movie clip from within a movie clip, this is not the most intuitive way to script and makes for difficult debugging. So you will need to explore how to target your buttons inside of your menu movie clip and the frames within the content movie clip from the main timeline. “ Thanks so much in advance!

    Read the article

  • mod_rewrite rule to work with get method

    - by Davi
    I'm using this rule: RewriteRule ^(.*)$ public/$1 [L] and in public folder I use: $url = $_GET['url']; when I try to acess something on url using slash or it works fine and I get: /cities/display/45 => Array ( [0] => cities [1] => display [2] => 45) But when I try to submit a form, i'm not able to acces the data: /cities/?field1=value1&field2=value2 => Array ( [0] => cities) How can I solve this? I need a rule that also gets form's submited values Thanks

    Read the article

  • How can one close html tags in vim quickly

    - by wds
    It's been a while since I've had to do any html-like code in vim, but recently I came across this again. Say I'm doing a simple bit of a html page: <html><head><title>This is a title</title></head></html> How do I write those closing tags for title, head and html down quickly? I feel like I'm missing some really simple way here that does not involve me going through writing them all down one by one. Of course I can use ^P to autocomplete the individual tag names but what gets me on my laptop keyboard is actually getting the brackets and slash right.

    Read the article

  • Can somone help fix up my simple regex query, please?

    - by Pure.Krome
    Hi folks, yep - another noob regex query, which I can't seem to get. I'm trying to get all matches for the string foo.mydomain.com/ or foo.mydomain.com:1234/ or foo.mydomain.com:<random port>/ but any other paths do not match, ie. foo.mydomain.com/bar or foo.mydomain.com/bar/pewpew I tried to use: foo.mydomain.com(.*)/$ ( starts with anything, then foo.mydomain.com, then any thing after that .. until a slash. then end. (this search query is anchored to the end of the line). but that doesn't work. It doesn't match when i pass in foo.mydomain.com:1234 but it correct says foo.mydomain.com/bar/pewpew is not a match (as expected). any ideas?

    Read the article

  • In App Purchase no valid Product IDs

    - by david
    I'm trying to get In App Purchase with my existing iPad App working. I'm stuck retrieving the Product Information from App Store: - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response The SKProductsResponse only contains invalid Product IDs. I tried every potential solution I found here or on the net: my App ID has In App enabled I generated a new provisioning profile and installed it on my device I restarted the device my App ID is the same as in my Info.plist (it's in the Store since weeks) I added In App Purchases for the App with "cleared for sale" checked I added Screenshots to my In App Purchases I tried different naming schemes for the Product ID I made triple checked that I pass the correct Product ID to the SKProductsRequest I'm passing a NSSet to the SKProductsRequest instead of a MutableSet I updated my App with the upcoming version containing in App purchase and submitted it for Review I approved one of my In App Purchases, just to see if that helps I waited more than 24 hours All of these actions brought me nothing but invalid Product IDs. I hope someone can point me into the right direction, because I'm running out of ideas.

    Read the article

  • Passing params in rails... Breakthrough in understanding params, aka, the "aha" moment

    - by Brian McDonough
    I have a simple has_many belongs_to relationship and I want to include the parent object for the view of the belongs_to model and I have had some success, but I want it to work better. class Submission < ActiveRecord::Base belongs_to :user belongs_to :contest end class Contest < ActiveRecord::Base belongs_to :user has_many :submissions, :dependent => :destroy end In the case that works, I pass contest_id to submissions by placing it in the url: <%= link_to 'Submit Contest Entry', new_submission_path(:contest_id => @contest.id), :class => 'btn btn-primary btn-large mleft10' %> So that, combined with a hidden_field: <%= f.hidden_field :contest_id %> And a find_contest method in the controller (called with a before_filter): def find_contest #the next line is giving the error (line 76) @contest = Contest.find(params[:submission][:contest_id]) end Makes it work for submissions/new, but how do I add a find to the controller that just works across more than that one page, like if I want to access in show and index. Right now, I get an error: Started GET "/submissions?contest_id=5" for 127.0.0.1 at 2012-12-01 16:01:45 -0800 Processing by SubmissionsController#index as HTML Parameters: {"contest_id"=>"5"} User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY users.created_at DESC LIMIT 1 Completed 500 Internal Server Error in 37ms NoMethodError (undefined method `[]' for nil:NilClass): app/controllers/submissions_controller.rb:76:in `find_contest' [edited] Adding show action for submissions: before_filter :find_contest, :except => [:index, :show, :edit, :update, :destroy] def find_contest @contest = Contest.find(params[:submission][:contest_id]) end def show contest_id = @submission.contest_id @submission = @commentable = Submission.find(params[:id]) @comments = @commentable.comments.order(:created_at).reverse respond_to do |format| format.html # show.html.erb format.json { render :json => @submission } end end

    Read the article

  • Getting the ranking of a photo in SQL

    - by Jake Petroules
    I have the following tables: Photos [ PhotoID, CategoryID, ... ] PK [ PhotoID ] Categories [ CategoryID, ... ] PK [ CategoryID ] Votes [ PhotoID, UserID, ... ] PK [ PhotoID, UserID ] A photo belongs to one category. A category may contain many photos. A user may vote once on any photo. A photo can be voted for by many users. I want to select the ranks of a photo (by counting how many votes it has) both overall and within the scope of the category that photo belongs to. The count of SELECT * FROM Votes WHERE PhotoID = @PhotoID being the number of votes a photo has. I want the resulting table to have generated columns for overall rank, and rank within category, so that I may order the results by either. So for example, the resulting table from the query should look like: PhotoID VoteCount RankOverall RankInCategory 1 48 1 7 3 45 2 5 19 33 3 1 2 17 4 3 7 9 5 5 ... ...you get the idea. How can I achieve this? So far I've got the following query to retrieve the vote counts, but I need to generate the ranks as well: SELECT PhotoID, UserID, CategoryID, DateUploaded, (SELECT COUNT(CommentID) AS Expr1 FROM dbo.Comments WHERE (PhotoID = dbo.Photos.PhotoID)) AS CommentCount, (SELECT COUNT(PhotoID) AS Expr1 FROM dbo.PhotoVotes WHERE (PhotoID = dbo.Photos.PhotoID)) AS VoteCount, Comments FROM dbo.Photos

    Read the article

  • Comment out a python code block

    - by gbarry
    Is there any mechanism to comment out large blocks of Python code? Right now the only ways I can see of commenting out code are to either start every line with a #, or to enclose the code in """ (triple quotes), except that actually makes it show up in various doc tools. Edit--After reading the answers (and referring to the "duplicate"), I have concluded the correct answer is "No". One person said so, and the rest lectured us about editors. Not a bad thing, but I feel it's important to put the answer at the top.

    Read the article

  • Zip up groups of webpages for viewing in the browser

    - by Arlen Beiler
    I think there should be a standard for saving and viewing bunches of webpages as a website. For instance, say I have a whole bunch of pages, such as I get from the WordPress plugin "Really Static" (which saves the entire site), and I have all the links start with a slash (to make linking to supporting files easier). Now, I can't really use those links if I am reading it from the file system. If there would be a standard where we could zip up files, give them a unique extension (like "hzip" for html zip), and open the file with any browser, which would display it as though the root of that file were the root of the pages. "file://examplefile.hzip/" The links would then all work. This would really help sharing and copying groups of webpages. Is this a good idea? A bad one? What do you think?

    Read the article

  • proc_open() path problem

    - by fadib
    Hi, i'm using linux and php 5.2.12 i have problem with executing proc_open if i use proc_open('php script.php', $descriptorspec, $pipes); it will show me error sh: /php: No such file or directory if i use proc_open('/usr/bin/php script.php', $descriptorspec, $pipes); or proc_open('php script.php', $descriptorspec, $pipes, '/usr/bin/'); it still show me same error. i have no idea why it always append slash in front of command. any help please? thanks!

    Read the article

  • htaccess Redirect - First Segment to PHP File, Second Segment as Parameter

    - by Steve
    My htaccess redirect knowledge is somewhat weak, so I was hoping to get some help here. I currently have the following redirect, which works well: # remove trailing slash RewriteRule ^(.*)/$ /$1 [L,R=301] # redirect to clean URL RewriteCond /%{REQUEST_FILENAME}.php -f RewriteRule ^([a-zA-Z0-9_-\s]+)$ /$1.php This takes a URL like www.mysite.com/about to www.mysite.com/about.php Now I would like to keep this behavior, but add parameters (if applicable), as such: www.mysite.com/about = www.mysite.com/about.php www.mysite.com/gallery/1 = www.mysite.com/gallery.php?id=1 If possible, I might like to expand this system to 2 or more parameters, as such: www.mysite.com/gallery/1/2 = www.mysite.com/gallery.php?id=1&section=2 So the pattern would be: First URL segment redirects to a PHP file (Optionally) the second segment gets added as the id parameter (Optionally) the third segment gets added as the section parameter

    Read the article

  • slashes in url variables

    - by namtax
    Hi there I have set up my coldfusion application to have dynamic urls on the page, such as www.musicExplained/index.cfm/artist/:VariableName However my variable names will sometimes contain slashes, such as www.musicExplained/index.cfm/artist/GZA/Genius This is causing a problem, because my application presumes that the slash in the variable name represents a different section of the website, the artists albums. So the URL will fail. I am wondering if there is anyway to prevent this from happening? Do I need to use a function that replaces slashes in the variable names with another character? Thanks

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >