Daily Archives

Articles indexed Thursday May 20 2010

Page 17/120 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How can I work with the Tag property of a winforms checked listbox item?

    - by JMSA
    How can I write a C# winforms code like this? CheckedListBox items don't have 'Tag' and 'ValueMember' properties. I know there are many alternatives to this. But I need to work it this way. private void LoadPermissionsToCheckedListBox() { Role selctedRole = (Role)comboBox1.SelectedItem; int i = 0; foreach (Permission p in selctedRole.PermissionItems) { checkedListBox1.Items.Add(p); checkedListBox1.Items[i].Tag = p; } checkedListBox1.DisplayMember = "PermissionKey"; checkedListBox1.ValueMember = "PermissionID"; }

    Read the article

  • Capture form fields and repopulate the form with them

    - by Joel Cunningham
    I am currently testing a large web form and would like to be able to easily populate the form with several different lots of test data without having to type them each time. Is there a generic way to capture form inputs on a web page and have them repopulated on a different page load? I thought a tool like greasemonkey might be able to do something like this.

    Read the article

  • Hibernate Que related to database i want select query generic without using property name

    - by Sudhir Gudhe
    Hi My que is i tried to get the data from data base using String SQL_QUERY ="from dat_personal_info "; Query query = session.createQuery(SQL_QUERY); for( it=query.iterate();it.hasNext();) { Object[] rowObject =(Object[]) it.next(); } but error occurs Hibernate: select dat_person0_.row_id as col_0_0_ from dat_personal_info dat_per son0_ java.lang.ClassCastException: bn.com.server.database.maptables.dat_personal_info $$EnhancerByCGLIB$$e1ffd36e cannot be cast to [Ljava.lang.Object; pls any who ans pls reply Thanks & Regards Sudhir gudhe

    Read the article

  • Apache is running the wrong version of PHP.

    - by The Rook
    I am trying to enable CURL in php, and possibly update php as well. I have run into a road block where Apache seems to be running the wrong version of PHP. Here is some evidence. #lsof | grep php httpd 18397 nobody 135w REG 8,3 242 528537 /usr/local/apache/modules/libphp5.so I download the latest php 5.2.13 and build from source. I run a service httpd stop, do a make install and then I manually overwrite /usr/local/apache/modules/libphp5.so just to be safe. Using ldd i can see that its my fresh binary compiled with curl (the old one doesn't have curl.) ldd /usr/local/apache/modules/libphp5.so | grep curl libcurl.so.4 => /usr/local/lib/libcurl.so.4 (0x0064e000) I execute a phpinfo() and 5.2.3 is being executed instated of my new 5.2.13 and "curl" is nowhere to be found. What am I doing wrong? Why is curl disabled even though its statically linked? This is a RHEL 5.5 system.

    Read the article

  • loading custom view using loadNibNamed showing memory leaks

    - by user307550
    I have a number of custom table cells and views that I built using interface builder In interface builder, everything is set up similarly. There is a table cell and a couple other UILabels and a background image Object owner if the nib is NSObject Class for the table cell is the name of the class for my table cell Here is how I create the table cell in my code: SectionedSwitchTableCell *cell = nil; NSArray *nibs = [[NSBundle mainBundle] loadNibNamed:kSectionedSwitchTableCellIdentifier owner:owner options:nil]; for(id currentObject in nibs) { if([currentObject isKindOfClass:[SectionedSwitchTableCell class]]) { cell = (SectionedSwitchTableCell *)currentObject; break; } } return cell; For my custom table headers I have this NSArray *nibs = [[NSBundle mainBundle] loadNibNamed:@"CustomTableHeader" owner:self options:nil]; for(id currentObject in nibs) { if([currentObject isKindOfClass:[CustomTableHeader class]]) { return header } } In my .h and .m files for the custom view, I have IBOutlet, @property set up for everything except for the background image UIImageView. Everything that has the IBOutlet and @property are also @synthesized and released in the .m file. Leaks is showing that I have memory leaks with CALayer when I create these custom view objects. Am I doing something wrong here when I create these custom view objects? I'm kind of tearing my hair out trying to figure out where these leaks are coming from. As a side note, I have a UIImageView background image defined in these custom views but I didn't define properties and IBOutlets in my .h and .m files. Defining them doesn't make a difference when I run it through Leaks but just wanted to confirm if I'm doing the right thing. Any input would be super helpful. Thanks :)

    Read the article

  • How to make a div to fill a remaining horizontal space (a very simple but annoying problem for CSS e

    - by janoChen
    I have 2 divs: one in the left side and one in the right side of my page. The one in the left side has fixed width and I want the one of the right side to fill the remaining space. The one on the right side is the navigation and I want it to to fill the remaining space on it right side: My CSS: #search { width: 160px; height: 25px; float: left; background-color: #FFF; } #navigation { width: 780 float: left; /*background-color: url('../images/transparent.png') ;*/ background-color: #A53030; } My Html: <div id="search"> </div> <?php include("navigation.html"); ?> <div id="left-column"> Thank in advance!

    Read the article

  • Flex Drag & Drop: Detecting when all data has been moved from source to destination

    - by Adam Tuttle
    I have two mx:TileList controls that I'm using to allow editing of objects in batch. The first contains a collection of all available data, and the 2nd contains the current batch. Both are bound to ArrayCollections, and using the native drag-n-drop functionality of the TileList control the data is moved from one ArrayCollection to the other when an object is dragged between them. I need to change the currentState to show & reset the batch manipulation controls when the batch count goes from 0 to n or n to 0 items. Based on the documentation, I would have thought that I should listen to the dragComplete event, but my testing shows that instead of firing after the data has been removed from the source ArrayCollection and added to the destination ArrayCollection, it fires (consistently) between these two actions. Both lists are similar to this: <mx:TileList id="srcList" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true" dataProvider="{images}" dragComplete="handleDragComplete(event)" allowMultipleSelection="true" /> And here's the source of the handleDragComplete function: private function handleDragComplete(e:DragEvent):void{ trace(e.dragInitiator.name + '.dragComplete: batch.length=' + batch.length.toString()); trace(e.dragInitiator.name + '.dragComplete: images.length=' + images.length.toString()); if (batch.length > 0){ currentState = 'show'; }else{ currentState = ''; } } And lastly, here's some example output from running the code. These are all run one after the other. Case 1: The application loads with 10 objects in the first list and the batch is empty. I dragged 1 object from the source list to the batch list. srcList.dragComplete: batch.length=1 srcList.dragComplete: images.length=10 (Expected: 1,9) Clearly, the object has been added to the batch ArrayCollection but not removed from the source. Case 2: Now, I'll drag a 2nd object into the batch. srcList.dragComplete: batch.length=2 srcList.dragComplete: images.length=9 (Expected: 2,8) Firstly, we can see that images.length has changed, showing that the object that I dragged from the source list to the batch list was removed AFTER the dragComplete event fired. The same thing happens this time: The new object is added to the batch ArrayCollection (batch.length=2), the dragComplete event fires (running these traces), and then the object is removed from the source ArrayCollection. Case 3: Now, I'll drag both images from the batch list back to their original location in the source list. batchList.dragComplete: batch.length=2 batchList.dragComplete: images.length=10 (Expected: 0,10) We can see that batch.length hasn't gone down, but the source images array is back at its original length of 10. QUESTION: Am I doing something wrong? Is there another event I could listen for? (Note: I tried both DragExit and DragDrop, just to be sure, and those behave as expected, but are not what I need.) Or is there another way to get the data that I want? Or... have I found a bug in the SDK?

    Read the article

  • Android: Autoscrolling HorizontalScrollView

    - by DroidIn.net
    I'm using the following code to simulate tabs and since there are more tabs that width can accommodate user can scroll left or right to make a tab button visible. It all works, however I also provide user with ability to fling between tabs by swiping finger left or right on the tab contents. Again - it works. But when I fling to the rightmost tab its corresponding button is barely visible. I want to autoscroll table inside the HorizontalScrollView so the selected tab button will be visible but when I execute HorizontalScrollView.smoothScrollTo(300, 0) nothing happens. It doen't matter how high I set first x parameter nothing will ever move (yes I do have an algorithm to calculate exact position). Here's XML code for scrolling tab buttons <HorizontalScrollView android:layout_width="fill_parent" android:background="@color/tabs_header" android:layout_height="55dip" android:scrollbars="none" android:id="@+id/tabsButtonView"> <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="0dip" android:paddingTop="5dip" android:paddingLeft="3dip"> <ImageButton android:src="@drawable/linkup_logo_small" android:id="@+id/tabBtt0" android:layout_width="wrap_content" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:layout_height="fill_parent" android:padding="5dip" android:background="@drawable/tab_selected"></ImageButton> <ImageButton android:src="@drawable/simplyhired_small" android:id="@+id/tabBtt1" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:padding="5dip" android:background="@drawable/tab_normal"></ImageButton> <ImageButton android:src="@drawable/indeedcom_small" android:id="@+id/tabBtt2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dip" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:background="@drawable/tab_normal"></ImageButton> <ImageButton android:src="@drawable/careerbuilder_logo_small" android:id="@+id/tabBtt3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dip" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:background="@drawable/tab_normal"></ImageButton> </TableRow> </TableLayout> </HorizontalScrollView>

    Read the article

  • How to unescape special characters from BeautifulSoup output?

    - by Suhail
    Hi, I am facing issues with the special characters like ° and ® which represent the degree Fahrenheit sign and the registered sign, when i print the string the contains the special characters, it gives output like this: Preheat oven to 350&deg; F Welcome to Lorem Ipsum Inc&reg; Is there a way I can output the exact characters and not their codes? Please let me know.

    Read the article

  • VS2010 Ultimate - Unable to launch ASP.NET Development Server

    - by sohum
    I've worked with ASP.NET once before and had a project where it was potentially useful, so I started creating an ASP.NET website as part of a solution that contained several C# class libraries. I'm using Visual Studio 2010 Ultimate Edition and Windows 7 Professional x64. The issue is that when I try to debug my website project, I get the following error message: Unable to launch the ASP.NET Development Server There's no other information (it seems a popular variant is the "port in use" error). Interestingly, I can run single pages on the application by right-clicking on the ASPX and selecting "View in Browser". This does not allow me to debug into my breakpoints, though. I have no clue what the problem could be. I'm running VS2010 in Administrator mode. One of the questions that popped up here suggested I uncomment the "127.0.0.1 localhost" line from my HOSTS file, which I did, and restarted VS with no luck. I also tried both setting a static port for the web server to run on as well as let it dynamically generate one. Both do not help the situation. Any help? Thanks.

    Read the article

  • Length of data returned from CGImageGetDataProvider is larger than expected

    - by jcoplan
    I'm loading a grayscale png image and I want to access the underlying pixel data. However after I load get the pixel data via CGImageGetDataProvider, the length of the data returned is longer than expected. CCGDataProviderRef provider = CGDataProviderCreateWithFilename(cStr); CGImageRef image = CGImageCreateWithPNGDataProvider(provider, NULL, FALSE, kCGRenderingIntentDefault); mapWidth = CGImageGetWidth(image); mapHeight = CGImageGetHeight(image); lookupMap = CGDataProviderCopyData(CGImageGetDataProvider(image)); mapWidth comes out to 1804 and mapHeight comes out to 1005. The product of which is 1813020 When I call CFDataGetLength(lookupMap) the response is 1833120. Where are these extra 20100 bytes coming from? Any help here is much appreciated. Am I missing something about the underlying format of the image?

    Read the article

  • Efficient way in Python to add an element to a comma-separated string

    - by ensnare
    I'm looking for the most efficient way to add an element to a comma-separated string while maintaining alphabetical order for the words: For example: string = 'Apples, Bananas, Grapes, Oranges' addition = 'Cherries' result = 'Apples, Bananas, Cherries, Grapes, Oranges' Also, a way to do this but while maintaining IDs: string = '1:Apples, 4:Bananas, 6:Grapes, 23:Oranges' addition = '62:Cherries' result = '1:Apples, 4:Bananas, 62:Cherries, 6:Grapes, 23:Oranges' Sample code is greatly appreciated. Thank you so much.

    Read the article

  • When is a scala partial function not a partial function?

    - by Fred Haslam
    While creating a map of String to partial functions I ran into unexpected behavior. When I create a partial function as a map element it works fine. When I allocate to a val it invokes instead. Trying to invoke the check generates an error. Is this expected? Am I doing something dumb? Comment out the check() to see the invocation. I am using scala 2.7.7 def PartialFunctionProblem() = { def dream()() = { println("~Dream~"); new Exception().printStackTrace() } val map = scala.collection.mutable.HashMap[String,()=>Unit]() map("dream") = dream() // partial function map("dream")() // invokes as expected val check = dream() // unexpected invocation check() // error: check of type Unit does not take parameters }

    Read the article

  • LINQ Equivalent for Standard Deviation

    - by Steven
    Does LINQ model the aggregate SQL function STDDEV() (standard deviation)? If not, what is the simplest / best-practices way to calculate it? Example: SELECT test_id, AVERAGE(result) avg, STDDEV(result) std FROM tests GROUP BY test_id

    Read the article

  • ADO.NET DataService Exception

    - by Ravi
    Hi, I am working on C#.Net with ADO.NET Dataservice. I try to update one record to relational tabel, when I reach context.SetLink() I am getting exception("The context is not currently tracking the entity"). I don't know how to solve this problem. My code is specified below. LogNote dbLogNote =logNote; LogSubSession dbLogSubSession = (from p in context.LogSubSession where p.UID == logNote.SubSessionId select p).First<LogSubSession>() as LogSubSession; context.AddToLogNote(dbLogNote); dbLogNote.LogSubSession = dbLogSubSession; context.SetLink(dbLogNote, "LogSubSession", dbLogSubSession); context.SaveChanges(); Here LogSubSession is a primary table and LogNote is a foreign table. I am updating data into foreign table based on primary key table. Thanks

    Read the article

  • How to take a Serialized String from the DB and output a UL list with Coldfusion

    - by nobosh
    Given a string from the database as follows: ul[0][id]=main1&ul[0][children][0][id]=child2&ul[0][children][0][class]=&ul[1][id]=main3&ul[2][id]=main4&ul[3][id]=main5 Where what's after the equal sign is an ID, how can I take this string on the backend and build out a list as following from front-end output? <UL id="container"> <LI id="main1"> Lorem ipsum dolor sit amet, consectetur <UL> <LI id="child2"> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> </LI> <LI id="main3"> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main4"> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main5"> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> Thanks

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >