Search Results

Search found 23 results on 1 pages for 'newsid'.

Page 1/1 | 1 

  • Replacement for NewSID when working with Windows 7?

    - by sbussinger
    Has anyone got a lead on a replacement for the old SysInternals NewSID utility that will work for Windows 7? I found out the hard way that NewSID will totally hose a Win7 setup (BSOD on reboot). Apparently the same problem occurs for Server 2008 R2. They've officially announced that NewSID will be retired in November, possibly because of this issue. I'm aware of SYSPREP, but it's not a clean replacement in my case so I was hoping that there was another utility similar to NewSID that worked with Win7. Reworking our system to use SYSPREP will be ugly and slower as well. Any thoughts on another alternative? Thanks!

    Read the article

  • Conditional row count in linq to nhibernate doesn't work

    - by Lucasus
    I want to translate following simple sql query into Linq to NHibernate: SELECT NewsId ,sum(n.UserHits) as 'HitsNumber' ,sum(CASE WHEN n.UserHits > 0 THEN 1 ELSE 0 END) as 'VisitorsNumber' FROM UserNews n GROUP BY n.NewsId My simplified UserNews class: public class AktualnosciUzytkownik { public virtual int UserNewsId { get; set; } public virtual int UserHits { get; set; } public virtual User User { get; set; } // UserId key in db table public virtual News News { get; set; } // NewsId key in db table } I've written following linq query: var hitsPerNews = (from n in Session.Query<UserNews>() group n by n.News.NewsId into g select new { NewsId = g.Key, HitsNumber = g.Sum(x => x.UserHits), VisitorsNumber = g.Count(x => x.UserHits > 0) }).ToList(); But generated sql just ignores my x => x.UserHits > 0 statement and makes unnecessary 'left outer join': SELECT news1_.NewsId AS col_0_0_, CAST(SUM(news0_.UserHits) AS INT) AS col_1_0_, CAST(COUNT(*) AS INT) AS col_2_0_ FROM UserNews news0_ LEFT OUTER JOIN News news1_ ON news0_.NewsId=news1_.NewsId GROUP BY news1_.NewsId How Can I fix or workaround this issue? Maybe this can be done better with QueryOver syntax?

    Read the article

  • why cant I more than two values from 3 different tables in one query

    - by zurna
    This is strange. In the news details page, I want to take a few different values from different tables with one query. However, for some strange reason, I only get two values back. So the outcome is like: <rows> <row id="4"> <FullName>Efe Tuncel</FullName> <CategoryName/> <Title>Runway Report</Title> <ShortDesc/> <Desc></Desc> <Date/> </row> </rows> If I disable fullname, then I get shortdesc but not others. Same things happens with others. NewsID = Request.QueryString("NEWSID") SQL = "SELECT N.NewsID, N.MembersID, N.CategoriesID, N.ImagesID, N.NewsTitle, N.NewsShortDesc, N.NewsDesc, N.NewsActive, N.NewsDateEntered, C.CategoriesID, C.CategoriesName, M.MembersID, M.MembersFullName" SQL = SQL & " FROM News N, Categories C, Members M" SQL = SQL & " WHERE N.NewsID = "& NewsID &" AND N.NewsActive = 1 AND N.MembersID = M.MembersID AND N.CategoriesID = C.CategoriesID" Set objViewNews = objConn.Execute(SQL) With Response .Write "<?xml version='1.0' encoding='windows-1254' ?>" .Write "<rows>" End With With Response .Write "<row id='"& objViewNews("NewsID") &"'>" .Write "<FullName>"& objViewNews("MembersFullName") &"</FullName>" .Write "<CategoryName>"& objViewNews("CategoriesName") &"</CategoryName>" .Write "<Title>"& objViewNews("NewsTitle") &"</Title>" .Write "<ShortDesc>"& objViewNews("NewsShortDesc") &"</ShortDesc>" .Write "<Desc><![CDATA["& objViewNews("NewsDesc") &"]]></Desc>" .Write "<Date>"& objViewNews("NewsDateEntered") &"</Date>" .Write "</row>" End With With Response .Write "</rows>" End With objViewNews.Close Set objViewNews = Nothing

    Read the article

  • Passing a JavaScript variable to a helper method

    - by Brendan Vogt
    I am using ASP.NET MVC 3 and the YUI library. I created my own helper method to redirect to an edit view by passing in the item's ID from the Model as such: window.location = '@Url.RouteUrl(Url.NewsEdit(@Model.NewsId))'; Now I am busy populating my YUI data table and would like to call my helper method like above, not sure if it is possible because I get the item's ID by JavaScript like: var formatActionLinks = function (oCell, oRecord, oColumn, oData) { var newsId = oRecord.getData('NewsId'); oCell.innerHTML = '<a href="/News/Edit/' + newsId + '">Edit</a>'; };

    Read the article

  • Skipping one item in the column

    - by zurna
    I created a simple news website. I store both videos and images in IMAGES table. Videos added have videos and images added have images stored in a column called ImagesType. Images and Videos attached to a news is stored in ImagesID column of the NEWS table. My problem occurs when I need to display the first image of a news. i.e. IMAGES table: ImagesID ImagesLgURL ImagesType 1 /FLPM/media/videos/0H7T9C0F.flv videos 2 /FLPM/media/images/8R5D7M8O.jpg images 3 /FLPM/media/images/0E7Q9Z0C.jpg images NEWS table NewsID ImagesID NewsTitle 1 1;2; Street Chic: Paris ERROR 2 3; Paris Runway NO ERROR The following code give me an error with the 2nd news item because the first ImageID stored in the list is not an image but a video. I need to figure out a way to skip the video item and display the next image. I hope I made sense. SQL = "SELECT NEWSID, CATEGORIESID, IMAGESID, NEWSTITLE, NEWSSHORTDESC, NEWSACTIVE, NEWSDATEENTERED" SQL = SQL & " FROM NEWS N" SQL = SQL & " WHERE NEWSACTIVE = 1" SQL = SQL & " ORDER BY NEWSDATEENTERED DESC" Set objNews = objConn.Execute(SQL) Do While intLooper1 <= 3 And Not objNews.EOF IMAGES = Split(Left(objNews("IMAGESID"),Len(objNews("IMAGESID"))-1), ";") SQL = "SELECT ImagesID, ImagesName, ImagesLgURL, ImagesSmURL, ImagesType" SQL = SQL & " FROM IMAGES I" SQL = SQL & " WHERE ImagesID = " & IMAGES(0) & " AND ImagesType = 'images'" Set objLgImage = objConn.Execute(SQL) <div> <a href="?Section=news&SubSection=redirect&NEWSID=<%=objNews("NEWSID")%>"> <img src="<%=objLgImage("ImagesLgURL")%>" alt="<%=objLgImage("ImagesName")%>" /> </a> </div> <% objLgImage.Close Set objLgImage = Nothing intLooper1 = intLooper1 + 1 objNews.MoveNext Loop %>

    Read the article

  • How convert sql query to linq-to-sql

    - by name1ess0ne
    I have Sql query: SELECT News.NewsId, News.Subject, Cm.Cnt FROM dbo.News LEFT JOIN (SELECT Comments.OwnerId, COUNT(Comments.OwnerId) as Cnt FROM Comments WHERE Comments.CommentType = 'News' Group By Comments.OwnerId) Cm ON Cm.OwnerId = News.NewsId But I want linq-to-sql query, how I can convert this to linq?

    Read the article

  • Why Solr admin query page interprets UTF-8 as ISO-8859-1

    - by Scott Chu
    I deploy a war to my Tomcat 6.0.35 on Win7 64bit and when I use full-interface query page (I mean form.jsp) in Solr Admin to query 2 Chinese character (say it's C1C2) , the debug info shows: <lst name="debug"> <str name="rawquerystring">æ°è</str> <str name="querystring">æ°è</str> <str name="parsedquery">NEWSID:æ°è</str> <str name="parsedquery_toString">NEWSID:æ°è</str> ... You can see C1C2 becomes æ°è. I deploy same war file to Tomcat on Linux or on another Win7 64bit of my colleagues' computer, the encoding acts well. Does anyone know why and how can I avoid this problem? Thanks in advance!

    Read the article

  • How to write a file that called from a database on a page?

    - by Mehmet Kaleli
    Hi. I have a "news" page that belongs to a company. All news have a header, detail and html page and they come from database. So i have to print those html pages in a repeater on my "news.aspx". But i couldnt write dynamically. How can i do it or is there anyway else? <asp:Repeater ID="news" runat="server" OnItemDataBound="news_OnItemDataBound"> <ItemTemplate> <asp:HiddenField ID="newsid" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"newsid") %>' /> <tr> <td class="haberler-sayfasi-habermetni" style="width:580px;padding-bottom:30px;"> <h1 class="haberler-sayfasi-haberbasligi" style="background-image:url(images/haber-ikon.jpg); background-repeat:no-repeat;padding-left:25px;"> <%#DataBinder.Eval(Container.DataItem,"newsheader") %>/h1> <br /> <%#DataBinder.Eval(Container.DataItem,"newsspot") %> <br /><br /> <% **Response.WriteFile('dynamical filename with path');** %> </td> </tr> </ItemTemplate> </asp:Repeater>

    Read the article

  • for loop with count from array, limit output? PHP

    - by Philip
    print '<div id="wrap">'; print "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">"; for($i=0; $i<count($news_comments); $i++) { print ' <tr> <td width="30%"><strong>'.$news_comments[$i]['comment_by'].'</strong></td> <td width="70%">'.$news_comments[$i]['comment_date'].'</td> </tr> <tr> <td></td> <td>'.$news_comments[$i]['comment'].'</td> </tr> '; } print '</table></div>'; $news_comments is a 3 diemensional array from mysqli_fetch_assoc returned from a function elsewhere, for some reason my for loop returns the total of the array sets such as [0][2] etc until it reaches the max amount from the counted $news_comments var which is a return function of LIMIT 10. my problem is if I add any text/html/icons inside the for loop it prints it in this case 11 times even though only array sets 1 and 2 have data inside them. How do I get around this? My function query is as follows: function news_comments() { require_once '../data/queries.php'; // get newsID from the url $urlID = $_GET['news_id']; // run our query for newsID information $news_comments = selectQuery('*', 'news_comments', 'WHERE news_id='.$urlID.'', 'ORDER BY comment_date', 'DESC', '10'); // requires 6 params // check query for results if(!$news_comments) { // loop error session and initiate var foreach($_SESSION['errors'] as $error=>$err) { print htmlentities($err) . 'for News Comments, be the first to leave a comment!'; } } else { print '<div id="wrap">'; print "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">"; for($i=0; $i<count($news_comments); $i++) { print ' <tr> <td width="30%"><strong>'.$news_comments[$i]['comment_by'].'</strong></td> <td width="70%">'.$news_comments[$i]['comment_date'].'</td> </tr> <tr> <td></td> <td>'.$news_comments[$i]['comment'].'</td> </tr> '; } print '</table></div>'; } }// End function Any help is greatly appreciated.

    Read the article

  • How to set offset in GORM when using createCriteria?

    - by firnnauriel
    I'm just wondering if it's possible for 'createCriteria' to specify the paginateParams (i.e. offset) similar to dynamic finder (findAll, etc.) Note that this code is not working since 'offset' is not documented in http://www.grails.org/doc/1.2.1/ref/Domain%20Classes/createCriteria.html def c = SnbrItemActDistance.createCriteria() def results = c.list { eq('iid', newsId) ge('distance', cap) maxResults(count) offset(offset) order('distance', 'desc') }

    Read the article

  • Why date comparison in sql is not working. Please help

    - by Shantanu Gupta
    I am trying to fetch some records from table but when i use OR instead of AND it returns me few records but not in other case. dates given exactly are present in table. What mistake i am doing ? select newsid,title,detail,hotnews from view_newsmaster where datefrom>=CONVERT(datetime, '4-22-2010',111) AND dateto<=CONVERT(datetime, '4-22-2010',111)

    Read the article

  • appending multiple groups with values from xml

    - by zurna
    In my xml file comments are listed as <Comments> <CommentID id="1"> <CommentBy>efet</CommentBy> <CommentDesc> Who cares!!! My boyfriend thinks the same with me. tell your friends. </CommentDesc> </CommentID> <CommentID id="2"> <CommentBy>tetto</CommentBy> <CommentDesc> xyz.... </CommentDesc> </CommentID> </Comments> I need to append them inside the ul of the div id="nw-comments". <div id="nw-comments" class="article-page"> <h3>Member Comments</h3> <ul> <li class="top-level"> <ul class="comment-options right"> <li> <a id="reply_1272195" class="reply" href="javascript:void(0);" name="anchor_1272195">Reply</a> </li> <li class="last"> <a id="report_1272195" class="report" href="javascript:void(0);">Report Abuse</a> </li> </ul> <h6>Posted By: [CommentBy] @ [CommentDateEntered]</h6> <div class="post-content"> <p>[CommentDesc]</p> </div> </li> </ul> </div> I tried to do it with the following code but I keep getting errors. $(document).ready(function(){ $.ajax({ dataType: "xml", url: "/FLPM/content/news/news.cs.asp?Process=ViewNews&NEWSID=<%=Request.QueryString("NEWSID")%>", success: function(xml) { $(xml).find('row').each(function(){ var id = $(this).attr('id'); var FullName = $(this).find('FullName').text(); var CommentBy = $(this).find('CommentBy').text(); var CommentDateEntered = $(this).find('CommentDateEntered').text(); var CommentDesc = $(this).find('CommentDesc').text(); $("#nw-comments ul").append("<h6>Posted By: " + CommentBy + " @ " + CommentDateEntered + "</h6><div class=""post-content""><p>" + CommentDesc + "</p></div>"); }); } });

    Read the article

  • Listing most commented news

    - by zurna
    I have two tables in my database. Comments CommentsID MembersID CommentsBy CommentsBy CommentsDesc CommentsActive CommentsDateEntered NewsI News NewsID MembersID CategoriesID ImagesID ImagesID NewsTitle NewsTitle NewsShortDesc NewsDesc NewsActive I need to take top 5 commented news (active comments and active news) and list their titles using one query. I hope I made sense. But I am really confused here. Any suggestion appreciated.

    Read the article

  • Query data using LINQ to SQL and Entity Framework with foreign key? (Help me please)

    - by The Wind
    Hello! There is a problem I need help with your query on the data using LINQ to SQL and Entity Framework (I'm using Visual Studio 2010). My picure here: http://img.tamtay.vn/files/photo2/2010/5/28/10/962/4bff3a3b_1093f58f_untitled-1.gif I have three tables: tbl NewsDetails tblNewsCategories tblNewsInCategories (See screen 1 in my picture) Now, I want to retrieve records in the tblNewsDetails table, with condition: CategoryId=1, as the following results: (See screen 2 in my picture) But NewsID and CategoryId in tblNewsInCategories table is two foreign key, I do not see them and I do not know how to use them in your code. My code has errors: (See screen 3 in my picture) Please help me. Thanks! (I am a new member, should not have the right to insert images)

    Read the article

  • sql and pooled connection error

    - by user319075
    Dear all, Kindly look at the following code as this sample code gives an error when i hosted it on Hostexcellence , but locally it runs perfect, and the error is as the following: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached SqlDataSource1.SelectCommand = "Select Top (3) * from News Order by NewsID Desc"; SqlDataSource1.DataSourceMode = SqlDataSourceMode.DataReader; SqlDataReader r_News = (SqlDataReader)SqlDataSource1.Select(DataSourceSelectArguments.Empty); DataGrid_News.DataSource = r_News; r_News.Close(); DataGrid_News.DataBind(); So What's wrong with that code ??

    Read the article

  • Processing a property in linq to sql

    - by Mostafa
    Hi It's my first LINQ TO SQL Project , So definitely my question could be naive . Till now I used to create new property in Business Object beside of every DateTime Property , That's because i need to do some processing in my DateTime property and show it in special string format for binding to UI Controls .Like : private DateTime _insertDate; /// /// I have "InertDate" field in my Table on Database /// public DateTime InsertDate { get { return _insertDate; } set { _insertDate = value; } } // Because i need to do some processing I create a readonly string property that pass InsertDate to Utility method and return special string Date public string PInsertDate { get { return Utility.ToSpecialDate(_insertDate); } } My question is I don't know how to do it in LINQ . I did like follow but i get run time error. ToosDataContext db = new ToosDataContext(); var newslist = from p in db.News select new {p.NewsId,p.Title,tarikh =MD.Utility.ToSpecialDate( p.ReleaseDate)}; GridView1.DataSource = newslist; GridView1.DataBind();

    Read the article

  • Convert search from SQL Server to MySQL

    - by HAJJAJ
    hi, everyone. i need to convert this one from SQL Server into MySQL IF IsNull(@SearchText, '') <> '' BEGIN SET @SearchText = '%' + @SearchText + '%' SELECT NewsID,DeptID,DeptName,Title,Details ,NewsDate,img FROM @tbSearchtextTb WHERE IsNull(Title,'')+IsNull(Details,'') LIKE @SearchText END this code will search fro my search word in this columns: Title, Details. i tried to convert this line but i had lots of errors: these are my unsuccessful attempts IF ISNULL(SearchText,'') <> '' THEN SELECT CatID,CatTitle,CatDescription,CatTitleAr,CatDescriptionAr,PictureID,Published,DisplayOrder,CreatedOn FROM tmp WHERE CatTitle + CatDescription + CatTitleAr + CatDescriptionAr LIKE $SearchText; and this one IF $SearchText IS NOT NULL THEN SELECT CatID,CatTitle,CatDescription,CatTitleAr,CatDescriptionAr,PictureID,Published,DisplayOrder,CreatedOn FROM tmp WHERE ISNULL(CatTitle,'') +ISNULL(CatDescription ,'') +ISNULL(CatTitleAr ,'') +ISNULL(CatDescriptionAr,'') LIKE $SearchText; and many many other ways but i could not find any. so if you know please let me know, thanks and best regards.

    Read the article

  • UIWebView appears null when calling fro a method

    - by Alexidze
    I have a major problem when trying to access a UIWebView that was created during ViewDidLoad, the UIWebView appears null here is how i declare the property @property (nonatomic, retain) UIWebView *detailsView; the implementation @implementation iPadMainViewController @synthesize detailsView; - (void)viewDidLoad { [super viewDidLoad]; detailsView = [[UIWebView alloc] initWithFrame:CGRectMake(500, 0, 512, 768)]; [self.view addSubView:detailsView]; } When accessing from - (void)loadDetailedContent:(NSString *)s { NSLog(@"%@", detailsView); } I get NULL, is it a normal behavior or am i doing something wrong? here is the touchesBegan that is being called, from the views subclass that is being touched, -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { iPadMainViewController *mycontroller = [[iPadMainViewController alloc] init]; self.delegate = mycontroller; [self.delegate loadDetailedContent:NewsId]; }

    Read the article

  • How does KMS (Windows Server 2008 R2) differentiate clients?

    - by Joe Taylor
    I have recently installed a KMS Server in our domain and deployed 75 new Windows 7 machines using an image I made using Acronis True Image. There are 2 variations of this image rolled out currently. When I go to activate the machines it returns that the KMS count is not sufficient. On the server with a slmgr /dlv it shows: Key Management Service is enabled on this machine. Current count: 2 Listening on Port: 1688 DNS publishing enabled KMS Priority: Normal KMS cumulative requests received from clients: 366 Failed requests received: 2 Requests with License status unlicensed: 0 Requests with License status licensed: 0 Requests with License status Initial Grace period: 1 Requests with License statusLicense expired or hardware out of tolerance: 0 Requests with License status Non genuine grace period: 0 Requests with License status Notification: 363 Is it to do with the fact that I've used the same image for all the PC's? If so how do I get round this. Would changing the SID help? OK knowing I've been thick whats the best way to rectify the situation. Can I sysprep the machines to OOBE on each individual machine? Or would NewSID work?

    Read the article

  • Linq to Entities custom ordering via position mapping table

    - by Bigfellahull
    Hi, I have a news table and I would like to implement custom ordering. I have done this before via a positional mapping table which has newsIds and a position. I then LEFT OUTER JOIN the position table ON news.newsId = position.itemId with a select case statement CASE WHEN [position] IS NULL THEN 9999 ELSE [position] END and order by position asc, articleDate desc. Now I am trying to do the same with Linq to Entities. I have set up my tables with a PK, FK relationship so that my News object has an Entity Collection of positions. Now comes the bit I can't work out. How to implement the LEFT OUTER JOIN. I have so far: var query = SelectMany (n => n.Positions, (n, s) => new { n, s }) .OrderBy(x => x.s.position) .ThenByDescending(x => x.n.articleDate) .Select(x => x.n); This kinda works. However this uses a INNER JOIN so not what I am after. I had another idea: ret = ret.OrderBy(n => n.ShufflePositions.Select(s => s.position)); However I get the error DbSortClause expressions must have a type that is order comparable. I also tried ret = ret.GroupJoin(tse.ShufflePositions, n => n.id, s => s.itemId, (n, s) => new { n, s }) .OrderBy(x => x.s.Select(z => z.position)) .ThenByDescending(x => x.n.articleDate) .Select(x => x.n); but I get the same error! If anyone can help me out, it would be much appreciated!

    Read the article

  • Clustering for Mere Mortals (Pt 3)

    - by Geoff N. Hiten
    The Controller Now we get to the meat of the matter.  You want a virtual cluster, the first thing you have to do is create your own portable domain.  Start with a plain vanilla install of Windows 2003 R2 Standard on a semi-default VM. (1 GB RAM, 2 cores, 2 NICs, 128GB dynamically expanding VHD file).  I chose this because it had the smallest disk and memory footprint of any current supported Microsoft Server product.  I created the VM with a single dynamically expanding VHD, one fixed 16 GB VHD, and two NICs.  One NIC is connected to the outside world and the other one is part of an internal-only network.  The first NIC is set up as a DHCP client.  We will get to the other one later. I actually tried this with Windows 2008 R2, but it failed miserably.  Not sure whether it was 2008 R2 or the fact I tried to use cloned VMs in the cluster.  Clustering is one place where NewSID would really come in handy.  Too bad Microsoft bought and buried it. Load and Patch the OS (hence the need for the outside connection).This is a good time to go get dinner.  Maybe a movie too.  There are close to a hundred patches that need to be downloaded and applied.  Avoiding that mess was why I put so much time into trying to get the 2008 R2 version working.  Maybe next time.  Don’t forget to add the extensions for VMLite (or whatever virtualization product you prefer). Set a fixed IP address on the internal-only NIC.  Do not give it a gateway.  Put the same IP address for the NIC and for the DNS Server.  This IP should be in a range that is never available on your public network.  You will need all the addresses in the range available.  See the previous post for the exact settings I used. I chose 10.97.230.1 as the server.  The rest of the 10.97.230 range is what I will use later.  For the curious, those numbers are based on elements of my home address.  Not truly random, but good enough for this project. Do not bridge the network connections.  I never allowed the cluster nodes direct access to any public network. Format the fixed VHD and leave it alone for now. Promote the VM to a Domain Controller.  If you have never done this, don’t worry.  The only meaningful decision is what to call the new domain.  I prefer a bogus name that does not correspond to a real Top-Level Domain (TLD).  .com, .biz., .net, .org  are all TLDs that we know and love.  I chose .test as the TLD since it is descriptive AND it does not exist in the real world.  The domain is called MicroAD.  This gives me MicroAD.Test as my domain. During the promotion process, you will be prompted to install DNS as part of the Domain creation process.  You want to accept this option.  The installer will automatically assign this DNS server as the authoritative owner of the MicroAD.test DNS domain (not to be confused with the MicroAD.test Active Directory domain.) For the rest of the DCPROMO process, just accept the defaults. Now let’s make our IP address management easy.  Add the DHCP Role to the server.  Add the server (10.97.230.1 in this case) as the default gateway to assign to DHCP clients.  Here is where you have to be VERY careful and bind it ONLY to the Internal NIC.  Trust me, your network admin will NOT like an extra DHCP server “helping” out on her network.  Go ahead and create a range of 10-20 IP Addresses in your scope.  You might find other uses for a pocket domain controller <cough> Mirroring </cough> than just for building a cluster.  And Clustering in SQL 2008 and Windows 2008 R2 fully supports DHCP addresses. Now we have three of the five key roles ready.  Two more to go. Next comes file sharing.  Since your cluster node VMs will not have access to any outside, you have to have some way to get files into these VMs.  I simply go to the root of C: and create a “Shared” folder.  I then share it out and grant full control to “Everyone” to both the share and to the underlying NTFS folder.   This will be immensely useful for Service Packs, demo databases, and any other software that isn’t packaged as an ISO that we can mount to the VM. Finally we need to create a block-level multi-connect storage device.  The kind folks at Starwinds Software (http://www.starwindsoftware.com/) graciously gave me a non-expiring demo license for expressly this purpose.  Their iSCSI SAN software lets you create an iSCSI target from nearly any storage medium.  Refreshingly, their product does exactly what they say it does.  Thanks. Remember that 16 GB VHD file?  That is where we are going to carve into our LUNs.  I created an iSCSI folder off the root, just so I can keep everything organized.  I then carved 5 ea. 2 GB iSCSI targets from that folder.  I chose a fixed VHD for performance.  I tried this earlier with a dynamically expanding VHD, but too many layers of abstraction and sparseness combined to make it unusable even for a demo.  Stick with a fixed VHD so there is a one-to-one mapping between abstract and physical storage.  If you read the previous post, you know what I named these iSCSI LUNs and why.  Yes, I do have some left over space.  Always leave yourself room for future growth or options. This gets us up to where we can actually build the nodes and install SQL.  As with most clusters, the real work happens long before the individual nodes get installed and configured.  At least it does if you want the cluster to be a true high-availability platform.

    Read the article

  • Clustering for Mere Mortals (Pt3)

    - by Geoff N. Hiten
    The Controller Now we get to the meat of the matter.  You want a virtual cluster, the first thing you have to do is create your own portable domain.  IStart with a plain vanilla install of Windows 2003 R2 Standard on a semi-default VM. (1 GB RAM, 2 cores, 2 NICs, 128GB dynamically expanding VHD file).  I chose this because it had the smallest disk and memory footprint of any current supported Microsoft Server product.  I created the VM with a single dynamically expanding VHD, one fixed 16 GB VHD, and two NICs.  One NIC is connected to the outside world and the other one is part of an internal-only network.  The first NIC is set up as a DHCP client.  We will get to the other one later. I actually tried this with Windows 2008 R2, but it failed miserably.  Not sure whether it was 2008 R2 or the fact I tried to use cloned VMs in the cluster.  Clustering is one place where NewSID would really come in handy.  Too bad Microsoft bought and buried it. Load and Patch the OS (hence the need for the outside connection).This is a good time to go get dinner.  Maybe a movie too.  There are close to a hundred patches that need to be downloaded and applied.  Avoiding that mess was why I put so much time into trying to get the 2008 R2 version working.  Maybe next time.  Don’t forget to add the extensions for VMLite (or whatever virtualization product you prefer). Set a fixed IP address on the internal-only NIC.  Do not give it a gateway.  Put the same IP address for the NIC and for the DNS Server.  This IP should be in a range that is never available on your public network.  You will need all the addresses in the range available.  See the previous post for the exact settings I used. I chose 10.97.230.1 as the server.  The rest of the 10.97.230 range is what I will use later.  For the curious, those numbers are based on elements of my home address.  Not truly random, but good enough for this project. Do not bridge the network connections.  I never allowed the cluster nodes direct access to any public network. Format the fixed VHD and leave it alone for now. Promote the VM to a Domain Controller.  If you have never done this, don’t worry.  The only meaningful decision is what to call the new domain.  I prefer a bogus name that does not correspond to a real Top-Level Domain (TLD).  .com, .biz., .net, .org  are all TLDs that we know and love.  I chose .test as the TLD since it is descriptive AND it does not exist in the real world.  The domain is called MicroAD.  This gives me MicroAD.Test as my domain. During the promotion process, you will be prompted to install DNS as part of the Domain creation process.  You want to accept this option.  The installer will automatically assign this DNS server as the authoritative owner of the MicroAD.test DNS domain (not to be confused with the MicroAD.test Active Directory domain.) For the rest of the DCPROMO process, just accept the defaults. Now let’s make our IP address management easy.  Add the DHCP Role to the server.  Add the server (10.97.230.1 in this case) as the default gateway to assign to DHCP clients.  Here is where you have to be VERY careful and bind it ONLY to the Internal NIC.  Trust me, your network admin will NOT like an extra DHCP server “helping” out on her network.  Go ahead and create a range of 10-20 IP Addresses in your scope.  You might find other uses for a pocket domain controller <cough> Mirroring </cough> than just for building a cluster.  And Clustering in SQL 2008 and Windows 2008 R2 fully supports DHCP addresses. Now we have three of the five key roles ready.  Two more to go. Next comes file sharing.  Since your cluster node VMs will not have access to any outside, you have to have some way to get files into these VMs.  I simply go to the root of C: and create a “Shared” folder.  I then share it out and grant full control to “Everyone” to both the share and to the underlying NTFS folder.   This will be immensely useful for Service Packs, demo databases, and any other software that isn’t packaged as an ISO that we can mount to the VM. Finally we need to create a block-level multi-connect storage device.  The kind folks at Starwinds Software (http://www.starwindsoftware.com/) graciously gave me a non-expiring demo license for expressly this purpose.  Their iSCSI SAN software lets you create an iSCSI target from nearly any storage medium.  Refreshingly, their product does exactly what they say it does.  Thanks. Remember that 16 GB VHD file?  That is where we are going to carve into our LUNs.  I created an iSCSI folder off the root, just so I can keep everything organized.  I then carved 5 ea. 2 GB iSCSI targets from that folder.  I chose a fixed VHD for performance.  I tried this earlier with a dynamically expanding VHD, but too many layers of abstraction and sparseness combined to make it unusable even for a demo.  Stick with a fixed VHD so there is a one-to-one mapping between abstract and physical storage.  If you read the previous post, you know what I named these iSCSI LUNs and why.  Yes, I do have some left over space.  Always leave yourself room for future growth or options. This gets us up to where we can actually build the nodes and install SQL.  As with most clusters, the real work happens long before the individual nodes get installed and configured.  At least it does if you want the cluster to be a true high-availability platform.

    Read the article

  • iphone Dev - activity indicator with NSThread not working on Nav controller table view

    - by Frames84
    I really can't get this to work, basically when my JSON feeds loads I want the indicator to show, then hide when it's stopped. It loads top level menu items 1st "Publishing, Broadcasting, Marketing Services", then when Broadcasting is selected it loads a feed using the JSON framework hosted on Google. Round this load I call startIndicator and stopIndicator using the NSThread. Have I missed something? @implementation GeneralNewsTableViewController @synthesize dataList; @synthesize generalNewsDetailViewController; @synthesize atLevel; -(void) startIndicator { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc ] init ]; [(UIActivityIndicatorView *)[self navigationItem].rightBarButtonItem.customView startAnimating]; [pool release]; } -(void) stopIndicator { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc ] init ]; [(UIActivityIndicatorView *)[self navigationItem].rightBarButtonItem.customView stopAnimating]; [pool release]; } - (void)viewDidLoad { NSMutableArray *checker = self.dataList; if(checker == nil) { self.title = NSLocalizedString(@"General1",@"General News"); NSMutableArray *array = [[NSArray alloc] initWithObjects:@"Publishing", @"Broadcasting",@"Marketing Services",nil]; self.dataList = [array retain]; self.atLevel = @"level1"; [array release]; } UIActivityIndicatorView * activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; //set the initial property [activityIndicator stopAnimating]; [activityIndicator hidesWhenStopped]; //Create an instance of Bar button item with custome view which is of activity indicator UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithCustomView:activityIndicator]; //Set the bar button the navigation bar [self navigationItem].rightBarButtonItem = barButton; //Memory clean up [activityIndicator release]; [barButton release]; [super viewDidLoad]; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *level = self.atLevel; if([level isEqualToString:@"level2"]) { return 70.0f; } else { return 40.0f; } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *FirstLevelCell = @"FirstLevelCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:FirstLevelCell]; if(cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:FirstLevelCell] autorelease]; } NSInteger row = [indexPath row]; NSString *level = self.atLevel; if([level isEqualToString:@"level2"]) { NSMutableArray *stream = [self.dataList objectAtIndex:row]; NSString *newsTitle = [stream valueForKey:@"title"]; if( ![newsTitle isKindOfClass:[NSString class]] ) { cell.textLabel.text = @""; } else { cell.textLabel.text = [stream valueForKey:@"title"]; } cell.textLabel.numberOfLines = 2; cell.textLabel.font =[UIFont systemFontOfSize:10]; cell.detailTextLabel.numberOfLines = 1; cell.detailTextLabel.font= [UIFont systemFontOfSize:8]; cell.detailTextLabel.text = [stream valueForKey:@"created"]; NSData *imageURL = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.how-do.co.uk/images/stories/Cimex.jpg"]]; UIImage *newsImage = [[UIImage alloc] initWithData:imageURL]; cell.imageView.image = newsImage; [imageURL release]; [newsImage release]; } else { cell.textLabel.text = [dataList objectAtIndex:row]; } return cell; } - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; NSMutableString *levelType = (NSMutableString *) [dataList objectAtIndex:row]; if(![levelType isKindOfClass:[NSString class]]) { if(self.generalNewsDetailViewController == nil) { GeneralNewsDetailViewController *generalDetail = [[GeneralNewsDetailViewController alloc] initWithNibName:@"GeneralNewsDetailView" bundle:nil]; self.generalNewsDetailViewController = generalDetail; [generalDetail release]; } NSDictionary *stream = [self.dataList objectAtIndex:row]; NSString *newsTitle = [stream valueForKey:@"title"]; if( ![newsTitle isKindOfClass:[NSString class]] ) { generalNewsDetailViewController.newsTitle = @""; } else { generalNewsDetailViewController.newsTitle =[stream valueForKey:@"title"]; } generalNewsDetailViewController.newsId = [stream valueForKey:@"id"]; generalNewsDetailViewController.fullText = [stream valueForKey:@"fulltext"]; generalNewsDetailViewController.newsImage = [stream valueForKey:@"images"]; generalNewsDetailViewController.created = [stream valueForKey:@"created"]; HowDo_v1AppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.generalNewsNavController pushViewController:self.generalNewsDetailViewController animated:YES]; } else { GeneralNewsTableViewController *generalSubDetail = [[GeneralNewsTableViewController alloc] initWithNibName:@"GeneralNewsTableView" bundle:nil]; NSMutableArray *array; NSString *titleSelected = (NSString *) [dataList objectAtIndex:row]; if([titleSelected isEqualToString:@"Publishing"]) { generalSubDetail.title = @"Publishing news detail"; array = [[NSArray alloc] initWithObjects:@"pub News1", @"pub News2",@"pub News3",nil]; generalSubDetail.atLevel = @"level1"; } else if ([titleSelected isEqualToString:@"Broadcasting"]) { generalSubDetail.title = @"Broadcasting news detail"; /// START [self performSelectorOnMainThread:@selector(startIndicator) withObject:nil waitUntilDone:YES]; if(jSONDataAccessWrapper == nil) { jSONDataAccessWrapper = [JSON_DataAccess_Wrapper alloc]; } array = [jSONDataAccessWrapper downloadJSONFeed]; [self performSelectorOnMainThread:@selector(stopIndicator) withObject:nil waitUntilDone:YES]; generalSubDetail.atLevel = @"level2"; } else if ([titleSelected isEqualToString:@"Marketing Services"]) { generalSubDetail.title = @"Marketing Services news detail"; array = [[NSArray alloc] initWithObjects:@"Marketing News1", @"Marketing News2",@"Marketing News3",nil]; generalSubDetail.atLevel = @"level1"; } generalSubDetail.dataList = array; [self.navigationController pushViewController:generalSubDetail animated:YES]; [titleSelected release]; } } - (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section //- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSIndexPath *) section { return [self.dataList count]; } Cheers for any feedback Frames

    Read the article

1