Daily Archives

Articles indexed Saturday April 3 2010

Page 12/78 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • SQL SERVER – Difference Between GRANT and WITH GRANT

    - by pinaldave
    This was very interesting question recently asked me to during my session at TechMela Nepal. The question is what is the difference between GRANT and WITH GRANT when giving permissions to user. Let us first see syntax for the same. GRANT: USE master; GRANT VIEW ANY DATABASE TO username; GO WITH GRANT: USE master; GRANT VIEW ANY DATABASE TO username WITH GRANT OPTION; GO The difference between both of this option is very simple. In case of only GRANT – username can not grant the same permission to other users. In case, of the option of WITH GRANT – username will be able to give the permission it has received to other users. This is very basic definition of the subject. I would like to request my readers to come up with working script to prove this scenario. If can submit your script to me by email (pinal ‘at’ sqlauthority.com) or in comment field. Reference : Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Permissions

    Read the article

  • malloc and delete in C++, opinions

    - by Alexander
    In C++ using delete to free memory obtained with malloc() doesn't necessarily cause a program to blow up. Do you guys think a warning or perhaps even an assertion failure should be produced if delete is used to free memory obtained using malloc()?? Why do you think that Stroustrup did not had this feature on C++?

    Read the article

  • How to retrieve a binary file from .NET assembly?

    - by Rahul Soni
    I have an excel file that I want to embed in my C# assembly. I have changed the build action of the XLSX file to "Embedded Resource". During runtime, I have to retrieve this XLSX file from the assembly. Assembly assembly = Assembly.GetExecutingAssembly(); StreamReader sr = new StreamReader(assembly.GetManifestResourceStream("AssemblyName.Output.xlsx"), true); StreamWriter sw = new StreamWriter(strPath); sw.Write(sr.ReadToEnd()); sr.Dispose(); sw.Dispose(); System.Diagnostics.Process.Start(strPath); As expected, this fails for the XLSX file since it is a binary data. This could works well with a text file. I tried binary read/write, but I am not able to get the code running. Thoughts?

    Read the article

  • Sef-packed training kit practice tests

    - by Costa
    Hi I have a book called .Net framework 2.0 application development foundation, self-packed training kit by Tony Northup and Shawn wildermuth. the book CD contains practice tests, Can I rely on this CD to take the exam, or it will be just like the book itself, a wast of money? someone rely on it and success? I am not talking about memorizing or cheating the exam I am talking about studying and practice it. Also When I visit MS website they did not determine the number of questions, type of questions, or the time, someone have this info? Thanks

    Read the article

  • added div does not recognize jquery function

    - by zurna
    I pull categories of one section from a XML. Problem is, pulled categories need to recognize tab plugin but they do not recognize it. I am not sure if I made sense, please let me know if I didnt make any sense. I will try to explain it again. :) $.ajax({ dataType: "xml", url: "/FLPM/content/home/index.cs.asp?Process=ViewVCategories", success: function(xml) { $(xml).find('row').each(function(){ var id = $(this).attr('id'); var CategoryName = $(this).find('CategoryName').text(); $("<div class='tab fleft'><a href='#'>"+ CategoryName + "</a></div>").appendTo("#VCategories"); }); } }); $("div.row-title").tabs("div.panes > div", {effect: 'ajax'}, function(i) { // get the pane to be opened var pane = this.getPanes().eq(i); // load it with a page specified in the tab's href attribute pane.html('<img src="http://www.refinethetaste.com/html/cp/images/loading.gif" alt="Loading..." />') .load(this.getTabs().eq(i).attr("href")); }); pulled categories displayed here: <div class="row-title clear" id="VCategories"> categories xml <rows> - <row id="1"> <CategoryName>Nation</CategoryName> </row> - <row id="2"> <CategoryName>Politics</CategoryName> </row> - <row id="3"> <CategoryName>Health</CategoryName> </row> - <row id="4"> <CategoryName>Business</CategoryName> </row> - <row id="5"> <CategoryName>Culture</CategoryName> </row> </rows> </div>

    Read the article

  • Endian check in C

    - by webgenius
    Got this code snippet from some website: int num = 1; if(*(char *)&num == 1) { printf("\nLittle-Endian\n"); } else { printf("Big-Endian\n"); } Can anyone explain this step-by-step? &num - Adress of a (char *)&num - Type-cast address of a into a string *(char *)&num - Points to the first character of the string Am I missing anything here?

    Read the article

  • How to float a <div> echoed in the footer over a <div> located elsewhere (PHP/jQuery/HTML/CSS)

    - by PlasmaFlux
    Hello All! I'm embarking on a major project, but am stuck on a tiny issue at the very start. I'll try to be as concise as possible. I have a PHP script that will be echoing into the footer of the page (the last stuff before a bunch of s containing visible buttons and s containing hidden dialog boxes. The plan is to have the buttons float in the upper-right corner of corresponding s in the main content area of the page. i.e. - button-1 echoed into the footer will float in the corner of content-box-1, and will be tied to the hidden 'dialog-1'. I'll be using jQuery and jQuery UI Dialog throughout the page(s). I'm not sure if that's particularly relevant to this question, but thought it worth mentioning just in case. So my question, put simply, is how do I echo a Button 1 into the footer with PHP, but have it float in the upper-right corner (with maybe 5px margin) of Content 1 is full of content? A picture says a thousand words: As shown above, I want the little blue gear button things in the corner of content pieces, locked and loaded with hidden s containing dialog boxes. Again, the catch is that all buttons and hidden divs will be the very last items echoed into the page footer. I've found plenty of info on how to float divs on top of divs, but all the examples I saw showed the s in close proximity to each other in the page source; not with a hundred lines of source code between the two s I'm not sure if the solution is pure CSS, pure jQuery/jQueryUI or a combination of the two. Any advice will be much appreciated. Thanks!

    Read the article

  • How to change a UIBarButtonItem in a UINavigationBar

    - by pkulak
    I'm trying to set up a list of items that can be edited. I have a main view, with a UINavigationBar at the top and a UITableView directly under it. I'd like to have my "edit" button change to a "done" button on click, but I can't figure out how to do it. If I could do it in the code (not it interface builder), I could just replace it, but I can't even do that. I've seen some code using [self.navigationItem], but in my case self is a UIView. It also feels a bit odd to be using a UINavigationBar when I don't want navigation (this is one page only), but I want a toolbar with a title and and a button, so I don't think really have a choice.

    Read the article

  • Problem with Killing windows explorer ?

    - by Vivek Bernard
    I need to kill windows explorer's process (explorer.exe), for that it tried using System.Diagnostics.Process.Kill("Explorer.exe"); It works but the problem is that the explorer starts again, may be windows is doing that, anyway. When i kill explorer.exe with windows task manager, it doesn't come back, its stays killed I want to do whatever taskmanager is doing through my application.

    Read the article

  • Calling ASP.NET MVC Controller explicitly via AJAX

    - by effkay
    I know that I can use following piece of code to refresh a div: <%=Ajax.ActionLink( "Update", "Administration", new AjaxOptions { UpdateTargetId = "grid", LoadingElementId = "grid-wait" } ) %> But this creates a link; user will have to click on it to get the view refreshed. How can I make it automatic, i.e., like say if I want the grid to be refreshed after every five seconds?

    Read the article

  • Initialize a static member ( an array) in C++

    - by Jimmy zhang
    I intended to create a class which only have static members and static functions. One of the member variable is an array. Would it be possible to initialize it without using constructors? I am having lots of linking errors right now... Class A{ public: static char a[128]; static void do_something(); } How would you initialize a[128]? Why can't I initialize a[128] by directly specifying its value like in C? a[128={1,2,3,...};

    Read the article

  • Lilypond: Customize bar lines, recursively, automatically?

    - by ananth.p
    I'm working on Carnatic music scores that involve complex time signatures, that will require modified bar lines Pattern for barlines for: 8/4 beats: 1 2 3 4 (dashed bar here) 5, 6 (Dotted Bar) 7, 8 (double bar) Here's one bar of actual score g16( f) d8 ees( ees) d16( c d8) bes16[( d c bes \bar "dashed" a g]) a[( bes c] d[ c d]) \bar ":" g8( f16) ees8( d16 c d) \bar "||" Is there a way to automate these barlines?

    Read the article

  • CSS / jQuery Vertically and Horizontally Center DIV

    - by aherrick
    I'm trying to vertically and horizontally center this div even when there is content to scroll and the user is scrolling down the page. The following test works fine in IE, but in Firefox I get a weird flickering affect when hovering over the thumbnail image. Any thoughts? <html> <head> <title>aj</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { // img preview $('.img').hover(function() { if (!$('#overlay').length) { $('<div id="overlay"/>').css({ position: 'fixed', top: 0, left: 0, width: '100%', zIndex: 100, height: $(window).height() + 'px' }).appendTo('body'); $('<div id="item" />').css({ border: '7px solid #999', height: '500px', width: '500px', top: '50%', left: '50%', position: 'absolute', marginTop: '-250px', marginLeft: '-250px' }).append('<img src="' + $(this).attr('rel') + '" alt="img" />').appendTo('#overlay'); } }, function() { $('#overlay').remove(); }); }); </script> </head> <body> <img class="img" src="http://ajondeck.net/temp/paperboy_thumb.gif" rel="http://ajondeck.net/temp/paperboy.gif" alt="image" /> </body> </html>

    Read the article

  • Would anyone tell me how to fetch the media:thumb element's attribute from a json feed?

    - by ash
    I made a yahoo pipe that pulls up the atoms as json format; however, I can fetch and display all the elements in my html page except for the element's attribute. Would anyone tell me how to fetch the media:thumb element's attribute from a json feed? I am pasting the html page's code with javascript. If you save the html page and then view it in browser, you will see that all the necessary elements get output at html page except for the media:thumb as I cannot display the attribute of media:thumb when the feed is formatted as json. I am also pasting the some portion of the json feed so that you can have an idea what i am talking about. Please tell me how to retrieve attribute from media:thumb element of a json feed by using plain javascript but no server side code or javascript library. Thank you. function getFeed(feed){ var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = 'http://pipes.yahoo.com/pipes/pipe.run?_id=40616620df99780bceb3fe923cecd216&_render=json&_callback=piper'; document.getElementsByTagName("head")[0].appendChild(newScript); } function piper(feed){ var tmp=''; for (var i=0; i'; tmp+=feed.value.items[i].title+''; tmp+=feed.value.items[i].author.name+''; tmp+=feed.value.items[i].published+''; if (feed.value.items[i].description) { tmp+=feed.value.items[i].description+''; } tmp+='<hr>'; } document.getElementById('rssLayer').innerHTML=tmp; } </script> bchnbc .............................................................. Some portion of the json feed that gets generated by yahoo pipe .............................................................. piper({"count":2,"value":{"title":"myPipe","description":"Pipes Output","link":"http:\/\/pipes.yahoo.com\/pipes\/pipe.info?_id=f7f4175d493cf1171aecbd3268fea5ee","pubDate":"Fri, 02 Apr 2010 17:59:22 -0700","generator":"http:\/\/pipes.yahoo.com\/pipes\/","callback":"piper", "items": [{ "rights":"Attribution - Noncommercial - No Derivative Works", "link":"http:\/\/vodo.net\/mixtape1", "y:id":{"value":null,"permalink":"true"}, "content":{"content":"We're proud to be releasing this first VODO MIXTAPE. Actual tape might be a thing of the past, but before P2P, mixtapes were the most popular way of sharing popular culture the world had known -- and once called the 'most widely practiced American art form'. We want to resuscitate the spirit of the mixtape for this VODO MIXTAPE series: compilations of our favourite shorts, the weird, the wild and the wonky, all brought together in a temporary and uncomfortable company.","type":"text"}, "author": {"name":"Various"}, "description":"We're proud to be releasing this first VODO MIXTAPE. Actual tape might be a thing of the past, but before P2P, mixtapes were the most popular way of sharing popular culture the world had known -- and once called the 'most widely practiced American art form'. We want to resuscitate the spirit of the mixtape for this VODO MIXTAPE series: compilations of our favourite shorts, the weird, the wild and the wonky, all brought together in a temporary and uncomfortable company.", "media:thumbnail": { "url":"http:\/\/vodo.net\/\/thumbnails\/Mixtape1.jpg" }, "published":"2010-03-08-09:20:20 PM", "format": { "audio_bitrate":null, "width":"608", "xmlns":"http:\/\/xmlns.transmission.cc\/FileFormat", "channels":"2", "samplerate":"44100.0", "duration":"3092.36", "height":"352", "size":"733925376.0", "framerate":"25.0", "audio_codec":"mp3", "video_bitrate":"1898.0", "video_codec":"XVID", "pixel_aspect_ratio":"16:9" }, "y:title":"Mixtape #1: VODO's favourite short films", "title":"Mixtape #1: VODO's favourite short films", "id":null, "pubDate":"2010-03-08-09:20:20 PM", "y:published":{"hour":"3","timezone":"UTC","second":"0","month":"4","minute":"10","utime":"1270264200","day":"3","day_of_week":"6","year":"2010" }}, {"rights":"Attribution - Noncommercial - No Derivative Works","link":"http:\/\/vodo.net\/gilbert","y:id":{"value":"cd6584e06ea4ce7fcd34172f4bbd919e295f8680","permalink":"true"},"content":{"content":"A documentary short about Gilbert, the Beacon Hill \"town crier.\" For the last 9 years, since losing his job and becoming homeless, Gilbert has delivered the weather, sports, and breaking headlines from his spot on the Boston Common. Music (used with permission) in this piece is called \"Blue Bicycle\" by Dusseldorf-based pianist \/ composer Volker Bertelmann also known as Hauschka. Artistic Statement: This is the first in a series of profiles of people who I think are interesting, and who I see on almost a daily basis. I don't want to limit the series to people who live \"on the fringe,\" but it would be appropriate to say that most of the people I interview are eclectic, eccentric, and just a little bit unique. The art is in the viewing - but I hope to turn my lens on individuals that don't always color in the lines, whether they can help it or not.","type":"text"},"author":{"name":"Nathaniel Hansen"},"description":"A documentary short about Gilbert, the Beacon Hill \"town crier.\" For the last 9 years, since losing his job and becoming homeless, Gilbert has delivered the weather, sports, and breaking headlines from his spot on the Boston Common. Music (used with permission) in this piece is called \"Blue Bicycle\" by Dusseldorf-based pianist \/ composer Volker Bertelmann also known as Hauschka. Artistic Statement: This is the first in a series of profiles of people who I think are interesting, and who I see on almost a daily basis. I don't want to limit the series to people who live \"on the fringe,\" but it would be appropriate to say that most of the people I interview are eclectic, eccentric, and just a little bit unique. The art is in the viewing - but I hope to turn my lens on individuals that don't always color in the lines, whether they can help it or not.","media:thumbnail":{"url":"http:\/\/vodo.net\/\/thumbnails\/gilbert.jpeg"},"published":"2010-03-03-10:37:05 AM","format":{"audio_bitrate":null,"width":"624","xmlns":"http:\/\/xmlns.transmission.cc\/FileFormat","channels":"2","samplerate":null,"duration":"373.673","height":"352","size":"123321266.0","framerate":null,"audio_codec":"mp3","video_bitrate":null,"video_codec":"XVID","pixel_aspect_ratio":"16:9"},"y:title":"Gilbert","title":"Gilbert","id":"cd6584e06ea4ce7fcd34172f4bbd919e295f8680","pubDate":"2010-03-03-10:37:05 AM","y:published":{"hour":"3","timezone":"UTC","second":"0","month":"4","minute":"10","utime":"1270264200","day":"3","day_of_week":"6","year":"2010" }} ] }})

    Read the article

  • An important question on iPhone file writing

    - by Kyle
    I use the NSHomeDirectory() function to get the app's home folder, and write to the Documents directory within that. I'm curious, though, what happens when the user downloads an update for the app in the appstore? Will it all be deleted? When I delete the app on the device, then reinstall it, its wiped out. So, I'm curious to know what will happen with an update. I can't find this in the documentation at all. Thanks alot for reading. I really tried to find this asked somewhere else first, but couldn't. Hopefully this page will be informative to guys like me who are confused on the subject.

    Read the article

  • T4 Controller Template to trigger View Generation

    - by DrydenMaker
    I have been using some customized MVC templates that really improve my productivity. However, I would like to take it to the next level. I generate a controller template for each table in my app. The controller has Edit, List, Details, and Delete actions. What I would like to do, is at the same time trigger the generation of the views for those actions. Does anyone have a reference or have suggestions on how this can be done?

    Read the article

  • OpenSSL not listed under PHP modules but shows up in the configure command

    - by Lauren
    PHP 5.2.12 OS X 10.5.8 If I compile PHP from source with the following configure command ./configure --disable-all --with-openssl=shared,/opt/local it succeeds. However, after a make and make install, php -m does not list the openssl module. Based on what I've read, I think it may be due to multiple installs of the openssl library. Installing the latest version of openssl from source and trying to specify the path in the configure command, --with-openssl=/usr/local, always results in the following error: Undefined symbols: "_EVP_CIPHER_CTX_block_size", referenced from: _zif_openssl_seal in openssl.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 I've tried a few different variations on the path with no luck. Based on http://blog.yimingliu.com/2009/02/24/missing-library-symbols-while-compiling-php-528/, I've also tried editing the Makefile so that MH_BUNDLE_FLAGS comes later in the compilation line. After spending a good portion of the day on this issue, I'm at a loss. Any suggestions?

    Read the article

  • ASP .NET MVC; return HTML along with JavaScript

    - by effkay
    I have a partial view which renders a table. On page load, I am using JQuery to perform Zebra Stripping on it. Whenever ajax refreshes the table, DOM elements are updated, but since JQuery code to do the Zebra Stripping is not executed; table looks ugly. I have tried adding Javascript in my partial view if( Request.IsAjaxRequest() ) return PartialView( "AdministrationGrid", Users ); but javascript is not executed. I guess the only way to execute the Javascript as reply is to do: return JavaScript( "alert( '' )" ); Anyone with an idea how can I achieve this? I thought about JQuery Live, but it is used to bind itself to events.

    Read the article

  • Good, secure video chat program

    - by wag2639
    I'm looking for something similar to skype but basically just for me to video chat with my girlfriend. Skype has been kind of buggy lately with its recent iterations and doesn't seem to be progressing as much as when it was with its previous backers. Are there any good, secure video chat programs? Something that customizable and lets you choose framerate vs pixelation and is generally secure (I don't care if the NSA can tap it but no one else, especially over unencrypted wifi's). Open source is preferred but not required. Free or really really cheap is practically required. Also, since this is point to point, an i am a power user (and my gf as well), it can involve some manual setup to establish a point-to-point link. Any suggestions, Thanks.

    Read the article

  • references in C++

    - by Alexander
    Once I read in a statement that The language feature that "sealed the deal" to include references is operator overloading. Why are references needed to effectively support operator overloading?? Any good explanation?

    Read the article

  • How can I get the output of a command terminated by a alarm() call in Perl?

    - by rockyurock
    Case 1 If I run below command i.e iperf in UL only, then i am able to capture the o/p in txt file @output = readpipe("iperf.exe -u -c 127.0.0.1 -p 5001 -b 3600k -t 10 -i 1"); open FILE, ">Misplay_DL.txt" or die $!; print FILE @output; close FILE; Case 2 When I run iperf in DL mode , as we know server will start listening in cont. mode like below even after getting data from client (Here i am using server and client on LAN) @output = system("iperf.exe -u -s -p 5001 -i 1"); on server side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -s -p 5001 ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1896] local 192.168.5.101 port 5001 connected with 192.168.5.101 port 4878 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1896] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) command prompt does not appear , process is contd... on client side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -c 192.168.5.101 -p 5001 -b 3600k -t 2 -i 1 ------------------------------------------------------------ Client connecting to 192.168.5.101, UDP port 5001 Sending 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1880] local 192.168.5.101 port 4878 connected with 192.168.5.101 port 5001 [ ID] Interval Transfer Bandwidth [1880] 0.0- 1.0 sec 441 KBytes 3.61 Mbits/sec [1880] 1.0- 2.0 sec 439 KBytes 3.60 Mbits/sec [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec [1880] Server Report: [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) [1880] Sent 614 datagrams D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITY so with this as server is cont. listening and never terminates so can't take output of server side to a txt file as it is going to the next command itself to create a txt file so i adopted the alarm() function to terminate the server side (iperf.exe -u -s -p 5001) commands after it received all data from the client. could anybody suggest me the way.. Here is my code: #! /usr/bin/perl -w my $command = "iperf.exe -u -s -p 5001"; my @output; eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 20; #@output = `$command`; #my @output = readpipe("iperf.exe -u -s -p 5001"); #my @output = exec("iperf.exe -u -s -p 5001"); my @output = system("iperf.exe -u -s -p 5001"); alarm 0; }; if ($@) { warn "$command timed out.\n"; } else { print "$command successful. Output was:\n", @output; } open FILE, ">display.txt" or die $!; print FILE @output_1; close FILE; i know that with system command i cannot capture the o/p to a txt file but i tried with readpipe() and exec() calls also but in vain... could some one please take a look and let me know why the iperf.exe -u -s -p 5001 is not terminating even after the alarm call and to take the out put to a txt file

    Read the article

  • using JQuery and Prototype in the same page

    - by Don
    Hi, Several of my pages use both JQuery and Protoype. Since I upgraded to version 1.3 of JQuery this appears to be causing problems, because both libraries define a function named '$'. JQuery provides a function noConflict() which relinquishes control of $ to other libraries that may be using it. So it seems like I need to go through all my pages that look like this: <head> <script type="text/javascript" src="/obp/js/prototype.js"></script> <script type="text/javascript" src="/obp/js/jquery.js"></script> </head> and change them to look like this: <head> <script type="text/javascript" src="/obp/js/prototype.js"></script> <script type="text/javascript" src="/obp/js/jquery.js"></script> <script type="text/javascript"> jQuery.noConflict(); var $j = jQuery; </script> </head> I should then be able to use '$' for Prototype and '$j' (or 'jQuery') for JQuery. I'm not entirely happy about duplicating these 2 lines of code in every relevant page, and expect that at some point somebody is likely to forget to add them to a new page. I'd prefer to be able to do the following Create a file jquery-noconflict.js which "includes" jquery.js and the 2 lines of code shown above Import jquery-noconflict.js (instead of jquery.js) in all my JSP/HTML pages However, I'm not sure if it's possible to include one JS file in another, in the manner I've described? Of course an alternate solution is simply to add the 2 lines of code above to jquery.js directly, but if I do that I'll need to remember to do it every time I upgrade JQuery. Thanks in advance, Don

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >