Daily Archives

Articles indexed Thursday January 13 2011

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

  • how to get empty row in DropDownList

    - by Gali
    hi i have this citys in my database: city1 city2 city3 city4 i what to see this in my DropDownList: [empty] city1 city2 city3 city4 this is my bind code: SQL = "select distinct City from MyTbl order by City"; dsClass = new DataSet(); adp = new SqlDataAdapter(SQL, Conn); adp.Fill(dsClass, "MyTbl"); adp.Dispose(); DropDownList3.DataSource = dsClass.Tables[0]; DropDownList3.DataTextField = dsClass.Tables[0].Columns[0].ColumnName.ToString(); DropDownList3.DataValueField = dsClass.Tables[0].Columns[0].ColumnName.ToString(); DropDownList3.DataBind(); how to do it (asp.net C#) ? thanks in advance

    Read the article

  • Display streaming video in desktop app.

    - by Roddy
    I have a Windows native desktop app (C++/Delphi), and I'm successfully using Directshow to display live video in it from a 'local' video capture device. The next thing I want to do is display video from a 'remote' capture device, streamed over the LAN. To stream the video, I guess I can use something like Expression Encoder or VLC, but I'm not sure what's the easiest way to receive/decode the streamed video. Inserting an ActiveX VLC or Flash player might be one option (although the licensing may be an issue then), but I was wondering if there's any way to achieve this with Directshow... Application needs to run on XP, and the video decoding should ideally be royalty free. Suggestions, please!

    Read the article

  • Is Python good for highload web projects?

    - by Vitali Fokin
    Hello! I decidet to start my own web project. It should be highload project, and I can't decide which technologies should I use. I'm good in ASP.NET MVC, but I like languages like Python more than C#. I read a lot about Python and Django/Pylons/etc but I didn't find any good examples of highload projects on python. So, the question is: Is Python good for highload project? Is it enough fast? And if it is, are python frameworks like django/pylons/etc good for this? Or asp.net mvc will be better choice? PS, I'm not interesting in Java, Ruby and PHP :) So, I'm choosing only between Python + django/pylons/etc and asp.net mvc. Thanks in advance. Please, don't make holywars :)

    Read the article

  • having problems using Zend_Db_Table_Abstract::createRow()

    - by Gootik
    Hey, I have built a model that extends Zend_Db_Table_Abstract and I can't figure out why I can't use createRow(); here is my code: class Model_User extends Zend_Db_Table_Abstract { public function createUser() { $row = $this->createRow(); $row->name = 'test'; $row->save(); } } and in a controller I use: $userModel = new Model_User(); $userModel->createUser(); which when run displays an error An error occurred Application error here is my setup in application.ini resources.db.adapter = "pdo_mysql" resources.db.params.host = "localhost" resources.db.params.username = "root" resources.db.params.password = "pass" resources.db.params.dbname = "app_db" resources.db.isDefaultTableAdapter = true I am sure that my user/pass/dbname is correct. I would appreciate it if you point me in the right direction.

    Read the article

  • IPhone avcomposition issue

    - by user346443
    Hi, Im trying to create a video that shows two videos one after the other using avcomposition on the iphone. This code works, however i can only see one of the videos for the entire duration of the newly created video - (void) startEdit{ AVMutableComposition* mixComposition = [AVMutableComposition composition]; NSString* a_inputFileName = @"export.mov"; NSString* a_inputFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:a_inputFileName]; NSURL* a_inputFileUrl = [NSURL fileURLWithPath:a_inputFilePath]; NSString* b_inputFileName = @"output.mov"; NSString* b_inputFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:b_inputFileName]; NSURL* b_inputFileUrl = [NSURL fileURLWithPath:b_inputFilePath]; NSString* outputFileName = @"outputFile.mov"; NSString* outputFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:outputFileName]; NSURL* outputFileUrl = [NSURL fileURLWithPath:outputFilePath]; if ([[NSFileManager defaultManager] fileExistsAtPath:outputFilePath]) [[NSFileManager defaultManager] removeItemAtPath:outputFilePath error:nil]; CMTime nextClipStartTime = kCMTimeZero; AVURLAsset* a_videoAsset = [[AVURLAsset alloc]initWithURL:a_inputFileUrl options:nil]; CMTimeRange a_timeRange = CMTimeRangeMake(kCMTimeZero,a_videoAsset.duration); AVMutableCompositionTrack *a_compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; [a_compositionVideoTrack insertTimeRange:a_timeRange ofTrack:[[a_videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:nextClipStartTime error:nil]; nextClipStartTime = CMTimeAdd(nextClipStartTime, a_timeRange.duration); AVURLAsset* b_videoAsset = [[AVURLAsset alloc]initWithURL:b_inputFileUrl options:nil]; CMTimeRange b_timeRange = CMTimeRangeMake(kCMTimeZero, b_videoAsset.duration); AVMutableCompositionTrack *b_compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; [b_compositionVideoTrack insertTimeRange:b_timeRange ofTrack:[[b_videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:nextClipStartTime error:nil]; AVAssetExportSession* _assetExport = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetLowQuality]; _assetExport.outputFileType = @"com.apple.quicktime-movie"; _assetExport.outputURL = outputFileUrl; [_assetExport exportAsynchronouslyWithCompletionHandler: ^(void ) { [self saveVideoToAlbum:outputFilePath]; } ]; } - (void) saveVideoToAlbum:(NSString*)path{ if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)){ UISaveVideoAtPathToSavedPhotosAlbum (path, self, @selector(video:didFinishSavingWithError: contextInfo:), nil); } } - (void) video: (NSString *) videoPath didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo { NSLog(@"Finished saving video with error: %@", error); } I've posted the whole code as it may help someone else. Shouldn't nextClipStartTime = CMTimeAdd(nextClipStartTime, a_timeRange.duration); [b_compositionVideoTrack insertTimeRange:b_timeRange ofTrack:[[b_videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:nextClipStartTime error:nil]; add the second video to the end of the first Cheers

    Read the article

  • how to call windows paint event from child thread

    - by RAJ K
    If I am wrong then please correct me as I am new in this. I have one thread which display image captured from webcam on a windows created using CreateWindowEx() function. Now when i execute my program I can see that my paint code (in WindowProc()) in never reached (called InvalidateRect() from child thread to redraw), checked using breakpoint. Actually frame capture and display is being done in thread and I think because its in child thread and Window is in Main thread that is why its not able to call paint event. Can you help me on this

    Read the article

  • MSTest/NUnit Writing BDD style "Given, When, Then" tests

    - by Charlie
    I have been using MSpec to write my unit tests and really prefer the BDD style, I think it's a lot more readable. I'm now using Silverlight which MSpec doesn't support so I'm having to use MSTest but would still like to maintain a BDD style so am trying to work out a way to do this. Just to explain what I'm trying to acheive, here's how I'd write an MSpec test [Subject(typeof(Calculator))] public class when_I_add_two_numbers : with_calculator { Establish context = () => this.Calculator = new Calculator(); Because I_add_2_and_4 = () => this.Calculator.Add(2).Add(4); It should_display_6 = () => this.Calculator.Result.ShouldEqual(6); } public class with_calculator { protected static Calculator; } So with MSTest I would try to write the test like this (although you can see it won't work because I've put in 2 TestInitialize attributes, but you get what I'm trying to do..) [TestClass] public class when_I_add_two_numbers : with_calculator { [TestInitialize] public void GivenIHaveACalculator() { this.Calculator = new Calculator(); } [TestInitialize] public void WhenIAdd2And4() { this.Calculator.Add(2).Add(4); } [TestMethod] public void ThenItShouldDisplay6() { this.Calculator.Result.ShouldEqual(6); } } public class with_calculator { protected Calculator Calculator {get;set;} } Can anyone come up with some more elegant suggestions to write tests in this way with MSTest? Thanks

    Read the article

  • problm with MANIFEST.MF in jar

    - by Atul
    hi I have created jar in the following folder: /usr/local/bin/niidle.jar. And my MANIFEST.MF file is as follows: Manifest-Version: 1.0 Main-Class: com.ensarm.niidle.web.scraper.NiidleScrapeManager Class-Path: hector-0.6.0-17.jar And I verified that,this 'hector-0.6.0-17.jar' file is also present in the folder: /Projects/EnwelibDatedOct13/Niidle/lib/hector-0.6.0-17.jar I don't want to give full class-path name in MANIFEST.MF file,because I have to run this jar on other's machine,so I gave only jar file name 'Class-Path=hector-0.6.0-17.jar' in MANIFEST.MF file. Inspite of mentioning the Class-Path in MANIFEST.MF file, when I run this using command: java -jar /usr/local/bin/niidle.jar arguments... It is showing error massage: --Exception in thread "main" java.lang.NoClassDefFoundError: me/prettyprint/hector/api/Serializer at com.ensarm.niidle.web.scraper.NiidleScrapeManager.main(NiidleScrapeManager.java:21) Caused by: java.lang.ClassNotFoundException: me.prettyprint.hector.api.Serializer at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 1 more Please give me solution for this error message..

    Read the article

  • Increasing speed of python code

    - by Curious2learn
    Hi, I have some python code that has many classes. I used cProfile to find that the total time to run the program is 68 seconds. I found that the following function in a class called Buyers takes about 60 seconds of those 68 seconds. I have to run the program about 100 times, so any increase in speed will help. Can you suggest ways to increase the speed by modifying the code? If you need more information that will help, please let me know. def qtyDemanded(self, timePd, priceVector): '''Returns quantity demanded in period timePd. In addition, also updates the list of customers and non-customers. Inputs: timePd and priceVector Output: count of people for whom priceVector[-1] < utility ''' ## Initialize count of customers to zero ## Set self.customers and self.nonCustomers to empty lists price = priceVector[-1] count = 0 self.customers = [] self.nonCustomers = [] for person in self.people: if person.utility >= price: person.customer = 1 self.customers.append(person) else: person.customer = 0 self.nonCustomers.append(person) return len(self.customers) self.people is a list of person objects. Each person has customer and utility as its attributes. EDIT - responsed added ------------------------------------- Thanks so much for the suggestions. Here is the response to some questions and suggestions people have kindly made. I have not tried them all, but will try others and write back later. (1) @amber - the function is accessed 80,000 times. (2) @gnibbler and others - self.people is a list of Person objects in memory. Not connected to a database. (3) @Hugh Bothwell cumtime taken by the original function - 60.8 s (accessed 80000 times) cumtime taken by the new function with local function aliases as suggested - 56.4 s (accessed 80000 times) (4) @rotoglup and @Martin Thomas I have not tried your solutions yet. I need to check the rest of the code to see the places where I use self.customers before I can make the change of not appending the customers to self.customers list. But I will try this and write back. (5) @TryPyPy - thanks for your kind offer to check the code. Let me first read a little on the suggestions you have made to see if those will be feasible to use. EDIT 2 Some suggested that since I am flagging the customers and noncustomers in the self.people, I should try without creating separate lists of self.customers and self.noncustomers using append. Instead, I should loop over the self.people to find the number of customers. I tried the following code and timed both functions below f_w_append and f_wo_append. I did find that the latter takes less time, but it is still 96% of the time taken by the former. That is, it is a very small increase in the speed. @TryPyPy - The following piece of code is complete enough to check the bottleneck function, in case your offer is still there to check it with other compilers. Thanks again to everyone who replied. import numpy class person(object): def __init__(self, util): self.utility = util self.customer = 0 class population(object): def __init__(self, numpeople): self.people = [] self.cus = [] self.noncus = [] numpy.random.seed(1) utils = numpy.random.uniform(0, 300, numpeople) for u in utils: per = person(u) self.people.append(per) popn = population(300) def f_w_append(): '''Function with append''' P = 75 cus = [] noncus = [] for per in popn.people: if per.utility >= P: per.customer = 1 cus.append(per) else: per.customer = 0 noncus.append(per) return len(cus) def f_wo_append(): '''Function without append''' P = 75 for per in popn.people: if per.utility >= P: per.customer = 1 else: per.customer = 0 numcustomers = 0 for per in popn.people: if per.customer == 1: numcustomers += 1 return numcustomers

    Read the article

  • Is the XML processing instructions node mandatory ?

    - by ereOn
    I had a discussion with a colleague of mine about the XML processing instructions node (I'm talking about this = <?xml version="1.0" encoding="UTF-8"?>). I believe that for something to be called "valid XML", it requires a processing instructions node. My colleague states that the processing instruction node is optionnal, since the default encoding is UTF-8 and the version is always 1.0. This make sense, but what does the standard says ? In short, given the following file: <books> <book id="1"><title>Title</title></book> </book> Can we say that: It is valid XML ? It is a valid XML node ? It is a valid XML document ? Thank you very much.

    Read the article

  • Problem when use compiled .A with simulator mode

    - by Paska
    Hi all, i have a lib .a that run only in device mode. My sdk vers is 4.2 with xcode 3.2.x. In simulator, compile correctle with no warning and no errors, but in run mode (simulator) it crash with this error: Detected an attempt to call a symbol in system libraries that is not present on the iPhone: strtod$UNIX2003 called from function pj_init in image MyAPP. If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first Program received signal: “SIGABRT”. I try to clean, rebuild and set "set start-with-shell off" from terminal in this way: cd ~ echo '' >> .gdbinit echo 'set start-with-shell 0' >> .gdbinit Restarted all, but nothing. The problem don't wont to resolve! Is there any tag or property that i forgotted to set in the options? In other linker flag is there only "-ObjC". It's very important to solve this issue... any idea please? thanks, A EDIT: It's my lib, compiled in simulator mode! EDIT: It run only with Simulator 4.1. Don't work with iphone 4.0, 4.2 and ipad 3.2 (all simulator).

    Read the article

  • need help understanding a function.

    - by Adam McC
    i had previously asked for help writing/improving a function that i need to calculate a premium based on differing values for each month. the premium is split in to 12 months and earned on a percentage for each month. so if the policy start in march and we are in jan we will have earned 10 months worth. so i need to add up the monthly earning to give us the total earned. wach company wil have differeing earnings values for each month. my original code is Here. its ghastly and slow hence the request for help. and i was presented with the following code. the code works but returns stupendously large figures. begin set @begin=datepart(month,@outdate) set @end=datepart(month,@experiencedate) ;with a as ( select *, case calmonth when 'january' then 1 when 'february' then 2 when 'march' then 3 when 'april' then 4 when 'may' then 5 when 'june' then 6 when 'july' then 7 when 'august' then 8 when 'september' then 9 when 'october' then 10 when 'november' then 11 when 'december' then 12 end as Mnth from tblearningpatterns where clientname=@client and earningpattern=@pattern ) , b as ( select earningvalue, Mnth, earningvalue as Ttl from a where Mnth=@begin union all select a.earningvalue, a.Mnth, cast(b.Ttl*a.earningvalue as decimal(15,3)) as Ttl from a inner join b on a.Mnth=b.Mnth+1 where a.Mnth<=@end ) select @earningvalue= Ttl from b inner join ( select max(Mnth) as Mnth from b ) c on b.Mnth=c.Mnth option(maxrecursion 12) SET @earnedpremium = @earningvalue*@premium end can someone please help me out?

    Read the article

  • replaceWith Automatically Closes the Tag

    - by Warrantica
    I have 3 divs and I want to replace the first div with an opening tag of another div and the third with the closing tag. This is what I meant: <div>1</div> <div>2</div> <div>3</div> When I tried to replace (using replaceWith()) the first div with <div class="foo"> and the third with </div>, jQuery somewhat misinterpret it as: <div class="foo"></div> <div>2</div> </div> While what I actually want is: <div class="foo"> <div>2</div> </div> Thank you in advance,

    Read the article

  • Benchmarking Java programs

    - by stefan-ock
    For university, I perform bytecode modifications and analyze their influence on performance of Java programs. Therefore, I need Java programs---in best case used in production---and appropriate benchmarks. For instance, I already got HyperSQL and measure its performance by the benchmark program PolePosition. The Java programs running on a JVM without JIT compiler. Thanks for your help! P.S.: I cannot use programs to benchmark the performance of the JVM or of the Java language itself (such as Wide Finder).

    Read the article

  • Best way to import a pack or "system" of new classes??

    - by Joe Blow
    Here's an Advanced question for Advanced developers. So I've written a largish "subsystem". It is essentially a UIViewController called CleverViewController which is a UIViewController. Now, there are a large number of supporting classes (about ten) that do the hard work: perform math functions, image processing, purely logical functions, build images or what have you with thousands of lines of code. (To do this, I simply started a new XCode project / app "Scratchpad" which does little other than load and launch the CleverViewController. So currently it works as an app, which launches CleverViewController. The ten or so classes I mention that are part of the "subsystem" simply sit there in that project/app.) So now, we will use CleverViewController, the new technology generally, in various apps. (Or perhaps friends would want to use it, etc.) What's the best way to "do" this? Have I screwed everything up, and really it should just be ONE (pretty big) class rather than a dozen classes? (I could understand that then as I would simply add that new (big) class where needed, like adding any other class.) Do I have to make a "framework" like the Apple frameworks? (If so, what the hell are they, how do you do it, etc?!?) In fact, do you just have to lamely include all of the dozen classes and that's that (obviously perhaps putting them in a grouped subfolder). What about all the headers and so on? (Currently I just have the dozen includes in the pch file of the scratchpad project.) Shouldn't it be easy to "maintain" this "subsystem" separately and so on? I'm afraid I know nothing about this: if the answer is obvious, hit me over the head and let me know. Thank you for any info on this !

    Read the article

  • Error loading a persisted workflow

    - by fra
    Hi, I have a workflow started and persisted using messaging activities. The correlation between the Start initial command and the Stop final command works well if they're sent within few seconds. Problems begin when the workflow is unloaded, because the following Stop message throws the following FaultException: If LoadWorkflowByInstanceKeyCommand.AssociateLookupKeyToInstanceId is not specified, the LookupInstanceKey must already be associated to an instance, or the LoadWorkflowByInstanceKeyCommand will fail. For this reason, it is invalid to also specify the LookupInstanceKey in the InstanceKeysToAssociate collection if AssociateLookupKeyToInstanceId isn't set Can anybody help me? The variables inside the workflow are of types int and XDocument. Any help appreciated, thank you

    Read the article

  • linq to xml selection/update

    - by gleasonomicon
    If I have the following xml, how would I use linq to xml blank out the date fields in each video node? I wanted to do it for the purpose of a comparison in a unit test. <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <main> <videos> <video> <id>00000000-0000-0000-0000-000000000000</id> <title>Video Title</title> <videourl>http://sample.com</videourl> <thumbnail>http://sample.com</thumbnail> <dateCreated>2011-01-12T18:54:56.7318386-05:00</dateCreated> <dateModified>2011-02-12T18:54:56.7318386-05:00</dateModified> <Numbers> <Number>28</Number> <Number>78</Number> </Numbers> </video> <video> <id>00000000-0000-0000-0000-000000000000</id> <title>Video Title</title> <videourl>http://sample.com</videourl> <thumbnail>http://sample.com</thumbnail> <dateCreated>2011-01-12T18:54:56.7318386-05:00</dateCreated> <dateModified>2011-02-12T18:54:56.7318386-05:00</dateModified> <Numbers> <Number>28</Number> <Number>78</Number> </Numbers> </video> </videos>

    Read the article

  • No results are returned when using Flickr JSON request

    - by Martijn1981
    I'm still fairly new to AJAX and I'm experimenting with Twitter and Flickr. Twitter is working fine so far, but I've run into some issues with the Flickr API. I'm getting no results back. The URL seems to be working fine and I'm pointing to the right object containing the array ('items'). Can anybody tell me what I'm doing wrong please? Thanks! $('#show_pictures').click(function(e){ e.preventDefault(); $.ajax({ url: 'http://api.flickr.com/services/feeds/photos_public.gne?format=json&jsoncallback=?&tags=home', dataType: 'jsonp', success: function(data) { $.each(data.items, function(i, item){ $('<div></div>') .hide() .append('<h1>'+item.title+'</h1>') .append('<img src="'+item.media.m+'" >') .append('<p>'+item.description+'</p>') .appendTo('#results') .fadeIn(); }) }, error: function(data) { alert('Something went wrong!'); } }); });

    Read the article

  • Highlight Row in GridView with Colored Columns

    - by Vincent Maverick Durano
    I wrote a blog post a while back before here that demonstrate how to highlight a GridView row on mouseover and as you can see its very easy to highlight rows in GridView. One of my colleague uses the same technique for implemeting gridview row highlighting but the problem is that if a Column has background color on it that cell will not be highlighted anymore. To make it more clear then let's build up a sample application. ASPX:   1: <asp:GridView runat="server" id="GridView1" onrowcreated="GridView1_RowCreated" 2: onrowdatabound="GridView1_RowDataBound"> 3: </asp:GridView>   CODE BEHIND:   1: private DataTable FillData() { 2:   3: DataTable dt = new DataTable(); 4: DataRow dr = null; 5:   6: //Create DataTable columns 7: dt.Columns.Add(new DataColumn("RowNumber", typeof(string))); 8: dt.Columns.Add(new DataColumn("Col1", typeof(string))); 9: dt.Columns.Add(new DataColumn("Col2", typeof(string))); 10: dt.Columns.Add(new DataColumn("Col3", typeof(string))); 11:   12: //Create Row for each columns 13: dr = dt.NewRow(); 14: dr["RowNumber"] = 1; 15: dr["Col1"] = "A"; 16: dr["Col2"] = "B"; 17: dr["Col3"] = "C"; 18: dt.Rows.Add(dr); 19:   20: dr = dt.NewRow(); 21: dr["RowNumber"] = 2; 22: dr["Col1"] = "AA"; 23: dr["Col2"] = "BB"; 24: dr["Col3"] = "CC"; 25: dt.Rows.Add(dr); 26:   27: dr = dt.NewRow(); 28: dr["RowNumber"] = 3; 29: dr["Col1"] = "A"; 30: dr["Col2"] = "B"; 31: dr["Col3"] = "CC"; 32: dt.Rows.Add(dr); 33:   34: dr = dt.NewRow(); 35: dr["RowNumber"] = 4; 36: dr["Col1"] = "A"; 37: dr["Col2"] = "B"; 38: dr["Col3"] = "CC"; 39: dt.Rows.Add(dr); 40:   41: dr = dt.NewRow(); 42: dr["RowNumber"] = 5; 43: dr["Col1"] = "A"; 44: dr["Col2"] = "B"; 45: dr["Col3"] = "CC"; 46: dt.Rows.Add(dr); 47:   48: return dt; 49: } 50:   51: protected void Page_Load(object sender, EventArgs e) { 52: if (!IsPostBack) { 53: GridView1.DataSource = FillData(); 54: GridView1.DataBind(); 55: } 56: }   As you can see there's nothing fancy in the code above. It just contain a method that fills a DataTable with a dummy data on it. Now here's the code for row highlighting:   1: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { 2: //Set Background Color for Columns 1 and 3 3: e.Row.Cells[1].BackColor = System.Drawing.Color.Beige; 4: e.Row.Cells[3].BackColor = System.Drawing.Color.Red; 5:   6: //Attach onmouseover and onmouseout for row highlighting 7: e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='Blue'"); 8: e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=''"); 9: }   Running the code above will show something like this in the browser: On initial load: On mouseover of GridView row:   Noticed that Col1 and Col3 are not highlighted. Why? the reason is that Col1 and Col3 cells has background color set on it and we only highlight the rows (TR) and not the columns (TD) that's why on mouseover only the rows will be highlighted. To fix the issue we will create a javascript method that would remove the background color of the columns when highlighting a row and on mouseout set back the original color that is set on Col1 and Col3. Here are the codes below: JavaScript   1: <script type="text/javascript"> 2: function HighLightRow(rowIndex, colIndex,colIndex2, flag) { 3: var gv = document.getElementById("<%= GridView1.ClientID %>"); 4: var selRow = gv.rows[rowIndex]; 5: if (rowIndex > 0) { 6: if (flag == "sel") { 7: gv.rows[rowIndex].style.backgroundColor = 'Blue'; 8: gv.rows[rowIndex].style.color = "White"; 9: gv.rows[rowIndex].cells[colIndex].style.backgroundColor = ''; 10: gv.rows[rowIndex].cells[colIndex2].style.backgroundColor = ''; 11: } 12: else { 13: gv.rows[rowIndex].style.backgroundColor = ''; 14: gv.rows[rowIndex].style.color = "Black"; 15: gv.rows[rowIndex].cells[colIndex].style.backgroundColor = 'Beige'; 16: gv.rows[rowIndex].cells[colIndex2].style.backgroundColor = 'Red'; 17: } 18: } 19: } 20: </script>   The HighLightRow method is a javascript function that accepts four (4) parameters which are the rowIndex,colIndex,colIndex2 and the flag. The rowIndex is the current row index of the selected row in GridView. The colIndex is the index of Col1 and colIndex2 is the index of col3. We are passing these index because these columns has background color on it and we need to toggle its backgroundcolor when highlighting the row in GridView. Finally the flag is something that would determine if its selected or not. Now here's the code for calling the JavaScript function above.     1: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { 2:   3: //Set Background Color for Columns 1 and 3 4: e.Row.Cells[1].BackColor = System.Drawing.Color.Beige; 5: e.Row.Cells[3].BackColor = System.Drawing.Color.Red; 6:   7: //Attach onmouseover and onmouseout for row highlighting 8: //and call the HighLightRow method with the required parameters 9: int index = e.Row.RowIndex + 1; 10: e.Row.Attributes.Add("onmouseover", "HighLightRow(" + index + "," + 1 + "," + 3 + ",'sel')"); 11: e.Row.Attributes.Add("onmouseout", "HighLightRow(" + index + "," + 1 + "," + 3 + ",'dsel')"); 12: 13: }   Running the code above will display something like this: On initial load:   On mouseover of GridView row:   That's it! I hope someone find this post useful!

    Read the article

  • How can I "shadow" the filesystem on Linux?

    - by happy_emi
    On a Linux environment sometimes I need to run a script as root which will add/modify serveral files on my fs. Basically I'd like to know exactly which files are modified and how WITHOUT opening the script and trying to guess the code. I was thinking about using something like unionfs: the main fs would be accessible in readonly mode and all changes are written on a file used as a partition and "mounted" in write mode. Are there other ways to achieve the same goal (i.e. other than unionfs)?

    Read the article

  • Shared configuration for Eclipse on Debian server

    - by Joris Meys
    I've manually installed the latest Eclipse on our debian server and wanted to configure it so all users share the same configuration. It turned out less obvious than I thought: I don't seem to be able to install packages for all users. If I run it myself, all configuration data is saved under my own home directory. If I run Eclipse using sudo, everything is saved under the root directory but is not accessible for other users when they run Eclipse. I've been browsing the manual of Eclipse and some forums, but apart from a "yes, you can" I couldn't find any information on how that should be done. The biggest problem is installing plugins for all users to be found. Any help is greatly appreciated. Eclipse : 3.6.1 classic, installed using this procedure. Server uname: GNU/Linux * 2.6.26-2-amd64 Server is accessed using Putty, and Gnome desktop through realVNC. Just mentioning it if that is of any importance. Our sysadmin is on "prolonged leave" (working in Spain and never replaced), so I'm stuck without help here. EDIT : -- I asked this question also on StackOverflow as I wasn't certain this is a genuine server-related question. Please feel free to merge both questions at the appropriate place. --

    Read the article

  • website lookup extremely slow in ubuntu

    - by ubuntulover
    Hi I have a wireless broadband connection through a router and wireless modem. Everything works fine in Windows. However, in ubuntu on the same machine, websites seem to take longer to start loading. I think the dns lookup is slow. I think https sites may be slower, as Ijust can't log in to gmail. I am also using a mercurial repo with remote origin, and it takes forever (like 5 minutes) to push one small change. I think it is because it has to communicate through https multiple times. Should I change my dns server? I've seen that I don't have these problems at my work network (they have another dns server). This happens with the IPv4 settings being automatic (dhcp). When I change it to automatic (dhcp) addresses only, and add google's 8.8.8.8 in the dns servers, it still takes forever. Why is this happening?

    Read the article

  • Ubuntu 10.04 Apache Configuration for Websites

    - by completenoob
    Looking at a basic Ubuntu 10.04 server setup, Apache points to /var/www for where to it looks for files to serve up. The default apache user is www. I'm just trying to set up a plain old WordPress blog. Should I just dump the files into /var/www/ as root or www? User www seems inconvenient since I won't log in as the user, but I guess I can chown the files in /var/www to www. Not that I would log in as root either, but what is the recommended user who should own the /var/www files? Thanks for the help.

    Read the article

  • how to acces host services in virtual box with out additional networking

    - by jspeshu
    i have ubuntu 10.04 and virtual box running win xp now i want to test my page layout in ie so i want to access apache from with in my virtual box how can i set up this with out additional networking on the host (i.e. i want to have some kind'a peer to peer connection between the host and the guest) EDIT: auto eth0 iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1 and for the win xp i gave a static ip address 192.168.0.200 netmask 255.255.255.0 gateway 192.168.0.1

    Read the article

  • Photoshop / Illustrator Fill text box with large string.

    - by Xetius
    I have a massive string (lots of Fibonacci numbers concatenated together). I don't know how much of this text I need to fill an A4 page. What I was hoping for was to paste a large block into a text box and have it display as much as possible, wrapping the text at the end of a line, but it is not doing that. It is just displaying a blank box (With the text overflowing into an awaiting textbox or something. I have tried pasting smaller amounts of text into the text box, and it appears that it will get about half way and then go into 'blank' mode. All I need is a simple way of creating a background of numbers which I don't have to type in. Any ideas?

    Read the article

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