Daily Archives

Articles indexed Monday March 29 2010

Page 4/123 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • To change the text of LinkButton in EditItemTemplate

    - by Nandini
    Hi, I have a table from which i am getting my data to the GRidview control.I need to Insert Or Update this row to another table, according to some condition.If one condition is true, i need to change the text of the linkbutton in edititemtemplate to insert,else to update itself.How can i change the text of linkbutton in rowcommand? Please Help

    Read the article

  • Hibernate N+1 from select across multiple tables

    - by Marty Pitt
    Given the following hibernate query: String sql = "select distinct changeset " + "from Changeset changeset " + "join fetch changeset.changeEntries as changeEntry " + "join fetch changeEntry.repositoryEntity as repositoryEntity " + "join fetch repositoryEntity.project as project " + "join fetch changeset.author as changesetAuthor " + "where project.id = :projectID "; Why is this resulting in an N+1 problem? I expect this to generate the following single SQL statement (or something similar) select * from Changeset inner join changeEntry on changeset.id = changeEntry.changeset_id inner join repositoryEntity on changeEntry.repositoryentity_id = repositoryentity.id inner join project on repositoryentity.project_id = project.id where project.id = ? Instead, I see many many select statements firing. The data model here looks like this: I would like the full object graph returned from the Select statement in a single trip to the database, which is why I'm explicitly using "fetch" in the hibernate query. The Hibernate log statements are as follows: Hibernate: select distinct changeset0_.id as id2_0_, changeentr1_.id as id1_1_, repository2_.id as id9_2_, project3_.id as id6_3_, user4_.id as id7_4_, changeset0_.author_id as author5_2_0_, changeset0_.createDate as createDate2_0_, changeset0_.message as message2_0_, changeset0_.revision as revision2_0_, changeentr1_.changeType as changeType1_1_, changeentr1_.changeset_id as changeset4_1_1_, changeentr1_.diff as diff1_1_, changeentr1_.repositoryEntity_id as reposito5_1_1_, changeentr1_.repositoryEntityVersion_id as reposito6_1_1_, changeentr1_.sourceChangeEntry_id as sourceCh7_1_1_, changeentr1_.changeset_id as changeset4_0__, changeentr1_.id as id0__, repository2_.project_id as connecti6_9_2_, repository2_.name as name9_2_, repository2_.parent_id as parent7_9_2_, repository2_.path as path9_2_, repository2_.state as state9_2_, repository2_.type as type9_2_, project3_.projectName as connecti2_6_3_, project3_.driverName as driverName6_3_, project3_.isAnonymous as isAnonym4_6_3_, project3_.lastUpdatedRevision as lastUpda5_6_3_, project3_.password as password6_3_, project3_.url as url6_3_, project3_.username as username6_3_, user4_.username as username7_4_, user4_.email as email7_4_, user4_.name as name7_4_, user4_.password as password7_4_, user4_.principles as principles7_4_, user4_.userType as userType7_4_ from Changeset changeset0_ inner join ChangeEntry changeentr1_ on changeset0_.id=changeentr1_.changeset_id inner join RepositoryEntity repository2_ on changeentr1_.repositoryEntity_id=repository2_.id inner join project project3_ on repository2_.project_id=project3_.id inner join users user4_ on changeset0_.author_id=user4_.id where project3_.id=? order by changeset0_.revision desc Hibernate: select repository0_.id as id10_9_, repository0_.changeEntry_id as changeEn2_10_9_, repository0_.repositoryEntity_id as reposito3_10_9_, changeentr1_.id as id1_0_, changeentr1_.changeType as changeType1_0_, changeentr1_.changeset_id as changeset4_1_0_, changeentr1_.diff as diff1_0_, changeentr1_.repositoryEntity_id as reposito5_1_0_, changeentr1_.repositoryEntityVersion_id as reposito6_1_0_, changeentr1_.sourceChangeEntry_id as sourceCh7_1_0_, changeset2_.id as id2_1_, changeset2_.author_id as author5_2_1_, changeset2_.createDate as createDate2_1_, changeset2_.message as message2_1_, changeset2_.revision as revision2_1_, user3_.id as id7_2_, user3_.username as username7_2_, user3_.email as email7_2_, user3_.name as name7_2_, user3_.password as password7_2_, user3_.principles as principles7_2_, user3_.userType as userType7_2_, repository4_.id as id9_3_, repository4_.project_id as connecti6_9_3_, repository4_.name as name9_3_, repository4_.parent_id as parent7_9_3_, repository4_.path as path9_3_, repository4_.state as state9_3_, repository4_.type as type9_3_, project5_.id as id6_4_, project5_.projectName as connecti2_6_4_, project5_.driverName as driverName6_4_, project5_.isAnonymous as isAnonym4_6_4_, project5_.lastUpdatedRevision as lastUpda5_6_4_, project5_.password as password6_4_, project5_.url as url6_4_, project5_.username as username6_4_, repository6_.id as id9_5_, repository6_.project_id as connecti6_9_5_, repository6_.name as name9_5_, repository6_.parent_id as parent7_9_5_, repository6_.path as path9_5_, repository6_.state as state9_5_, repository6_.type as type9_5_, repository7_.id as id10_6_, repository7_.changeEntry_id as changeEn2_10_6_, repository7_.repositoryEntity_id as reposito3_10_6_, repository8_.id as id9_7_, repository8_.project_id as connecti6_9_7_, repository8_.name as name9_7_, repository8_.parent_id as parent7_9_7_, repository8_.path as path9_7_, repository8_.state as state9_7_, repository8_.type as type9_7_, changeentr9_.id as id1_8_, changeentr9_.changeType as changeType1_8_, changeentr9_.changeset_id as changeset4_1_8_, changeentr9_.diff as diff1_8_, changeentr9_.repositoryEntity_id as reposito5_1_8_, changeentr9_.repositoryEntityVersion_id as reposito6_1_8_, changeentr9_.sourceChangeEntry_id as sourceCh7_1_8_ from RepositoryEntityVersion repository0_ left outer join ChangeEntry changeentr1_ on repository0_.changeEntry_id=changeentr1_.id left outer join Changeset changeset2_ on changeentr1_.changeset_id=changeset2_.id left outer join users user3_ on changeset2_.author_id=user3_.id left outer join RepositoryEntity repository4_ on changeentr1_.repositoryEntity_id=repository4_.id left outer join project project5_ on repository4_.project_id=project5_.id left outer join RepositoryEntity repository6_ on repository4_.parent_id=repository6_.id left outer join RepositoryEntityVersion repository7_ on changeentr1_.repositoryEntityVersion_id=repository7_.id left outer join RepositoryEntity repository8_ on repository7_.repositoryEntity_id=repository8_.id left outer join ChangeEntry changeentr9_ on changeentr1_.sourceChangeEntry_id=changeentr9_.id where repository0_.id=? The 2nd one is repeated many times - for a result set of 17 objects, the 2nd statement executed 521 times. I suspect this is as a result of the parent/child relationship in the RepositoryEntity object. For the purposes of this select, I actually only require the parent object fetched. Any suggestions?

    Read the article

  • Xcode duplicate symbol _main .

    - by Prithvi Raj
    I'm getting the following error in Xcode 3.2.1 on Snow Leopard 10.6.2 whenever I try to compile any iPhone application generated by Appcelerator's Titanium . However , the build error only appears when I select iPhone simulator on the architecture menu , and if I select iPhone device , I am able to run the app on my device . Further , the iPhone simulator launches successfully and executes the program directly from the Titanium environment , which uses Xcode to build . Why is this happening ? ld: duplicate symbol _main in Resources/libTitanium.a(main.o) and /Users/prithviraj/Documents/project/Final/build/iphone/build/Final.build/Debug-iphonesimulator/Final.build/Objects-normal/i386/main.o collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

    Read the article

  • Binding to filtered version of collection

    - by Shane Fulmer
    I have a collection that contains all the items that I want to keep track of. I want to display 3 different grids, and in each one I want to display a different filtered version of the items. Is there a way to bind to a filtered version of the main collection without having to maintain 3 separate collections to bind to?

    Read the article

  • fastest way convert tab-delimited file to csv in linux

    - by andrewj
    I have a tab-delimited file that has over 200 million lines. What's the fastest way in linux to convert this to a csv file? This file does have multiple lines of header information which I'll need to strip out down the road, but the number of lines of header is known. I have seen suggestions for sed and gawk, but I wonder if there is a "preferred" choice.

    Read the article

  • 1D Function into 2D Function Interpolation

    - by Drazick
    Hello. I have a 1D function which I want to interpolate into 2D function. I know the function should have "Polar Symmetry". Hence I use the following code (Matlab Syntax): Assuming the 1D function is LSF of the length 15. [x, y] = meshgrid([-7:7]); r = sqrt(x.^2 + y.^2); PSF = interp1([-7:7], LSF, r(:)); % Sometimes using 'spline' option, same results. PSF = reshape(PSF, [7, 7]); I have few problems: 1. Got some overshoot at the edges (As there some Extrapolation). 2. Can't enforce some assumptions (Monotonic, Non Negative). Is there a better Interpolation method for those circumstances? I couldn't find "Lanczos" based interpolation I can use the same way as interp1 (For a certain vector of points, in "imresize" you can only set the length). Is there such function anywhere? Has anyone encountered a function which allows enforcing some assumptions (Monotonically Decreasing, Non Negative, etc..). Thanks.

    Read the article

  • Core Data Error "Fetch Request must have an entity"

    - by Graeme
    Hi, I've attempted to add the TopSongs parser and Core Data files into my application, and it now builds succesfully, with no errors or warning messages. However, as soon as the app loads, it crashes, giving the following reason: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'executeFetchRequest:error: A fetch request must have an entity.' I have renamed all files, including the .xcdatamodel file. Could this be the problem (the renaming of the .xcdatamodel)? I'm assuming this error means that no data can be found. Thanks.

    Read the article

  • Performance mitigations serving content from a UNC share via IIS 6

    - by codepoke
    I have a quad processor vmware instance running Windows 2003 and 1gb ethernet. I'm comparing serving the exact same heavy .NET 2.0 content from the local hard drive versus serving it from a UNC drive. If I use WCAT to load it down, I see about a 40% reduction in transactions/sec while serving from the UNC. Processor time barely moves from 45% and the NIC sits around 40% either way. I don't see any significant memory loading either way. Context Switches/Transaction, though, more than doubles when serving from the UNC. Pathlengths more than double as well, but I believe that's just an expression of the effect of context switching. All told, it looks like the bottleneck is processor switching while waiting on content from the UNC share. Is my experience about the norm? Is there some mitigation I might try? I twiddled HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters\MaxCmds a little bit per http://technet.microsoft.com/en-us/library/dd296694(WS.10).aspx, but to no obvious effect. I kind of doubt my problem is lack of connections, but rather just the act of switching from thread to thread while waiting on data.

    Read the article

  • Cause of flapping UNKNOWN Nagios status?

    - by jldugger
    We run some Nagios service checks via OpsView, and one of our hosts is getting a strange response for SSH: "UNKNOWN: Service results are stale" It happens regularly, but seems to go away as the system retries a 2nd and 3rd time. It started after a patch and reboot of the server in question last week. The system itself responds to SSH from boxes I've tested with (which doesn't include the monitoring system I am not given access to). /var/log/secure is full of lines ala: sshd[15628]: Did not receive identification string from xxx.xxx.226.20 Time stamps are reliably every five minutes, which is pretty obviously the monitoring script disconnecting once it gets a login prompt. Anyone know what might be causing this, or how to fix it? It's really frustrating to see this pop on and off the status page.

    Read the article

  • write-through RAM disk, or massive caching of file system?

    - by Will
    I have a program that is very heavily hitting the file system, reading and writing randomly to a set of working files. The files total several gigabytes in size, but I can spare the RAM to keep them all mostly in memory. The machines this program runs on are typically Ubuntu Linux boxes. Is there a way to configure the file system to have a very very large cache, and even to cache writes so they hit the disk later? I understand the issues with power loss or such, and am prepared to accept that. Crashing aside, in normal operation the writes should eventually reach the disk! Or is there a way to create a RAM disk that writes-through to real disk?

    Read the article

  • How to fix Browser Blue Screen of Death?

    - by WilliamKF
    I am running Windows XP SP3 and Firefox v3.6.2 and Internet Explorer and have an issue with Firefox and IE causing the Blue Screen of Death. If I run in Windows safe mode, it does not occur, but running normally, it seems my firefox profile is going bad and results in certain web pages causing the BSOD. IE is also getting BSOD on some pages. For example, presently, if I visit ebay.com in Firefox, it gets BSOD. It also fails when visiting http://www.google.com/ig?hl=en&source=iglk. IT removed my Firefox profile and that seemed to fix the issue for a while. However, now it has started occurring again. I turned off all firefox extensions and it still occurs. I'd like to fix my system so this does not occur. The IT folks don't seem to be able to solve this, so I am trying to fix it on my own. The BSOD is about something like (from memory) DRIVER_IRQL_NOT_LESS_OR_EQUAL. Why would safe mode avoid the issue and what does that tell us about the probable cause? I don't want to have to keep deleting my profile, so I'd like to find out the cause of the corruption.

    Read the article

  • How can I hash a string to an int using c++?

    - by zebraman
    I have to write my own hash function. If I wanted to just make the simple hash function that maps each letter in the string to a numerical value (i.e. a=1, b=2, c=3, ...), is there a way I can perform this hash on a string without having to first convert it to a c-string to look at each individual char? Is there a more efficient way of hashing strings?

    Read the article

  • Ruby - Call method passing values of array as each parameter

    - by Markus Orreilly
    I'm currently stuck on this problem. I've hooked into the method_missing function in a class I've made. When a function is called that doesn't exist, I want to call another function I know exists, passing the args array as all of the parameters to the second function. Does anyone know a way to do this? For example, I'd like to do something like this: class Blah def valid_method(p1, p2, p3, opt=false) puts "p1: #{p1}, p2: #{p2}, p3: #{p3}, opt: #{opt.inspect}" end def method_missing(methodname, *args) if methodname.to_s =~ /_with_opt$/ real_method = methodname.to_s.gsub(/_with_opt$/, '') send(real_method, args) # <-- this is the problem end end end b = Blah.new b.valid_method(1,2,3) # output: p1: 1, p2: 2, p3: 3, opt: false b.valid_method_with_opt(2,3,4) # output: p1: 2, p2: 3, p3: 4, opt: true (Oh, and btw, the above example doesn't work for me)

    Read the article

  • Three Silverlight 4 issues

    - by Muhammad Jamal Shaikh
    Silverlight version : 4 Silverlight patter :MVVM Visual Studio template :Silverlight navigation application How do I block main navigation on (mainpage.xaml) as in any silverlight navigation application and block page's controls ( i.e whichever page is it in ) during async webservice calls? Any best practices? How do I deal with the browser's forward and backward buttons, specially during async calls? How do I deal with dialogs on the views ( e.g when using a childwindow to select a color). How should the color's picker control hex be communicated to the viewmodel?

    Read the article

  • passing callback function accross windows causing error with ie ...

    - by krul
    I have a problem with IE causing two errors: 1. Object doesn't support this property or method 2. Call was rejected by callee. My Intention: To call window.opener.myObject method that is going to retrieve some data using ajax and pass in callback function that live as nested function in popup window that initiated call that is going to handle response data and modify popup window html accordingly. Here is a scenario: I pull up popup window that handles some specific operation. This popup window calling window.opener.myObject method that using ajax call. I'm passing in popup window function that is going to handle response and it works with ff and safari but not with ie. Here is code sample //RELEVANT SCRIPT ON POPUP WINDOW $('#myButton').live('click', function() { var h = window.opener.myObject, p = { 'p1': 1 }; var responseHandler = function(responseObj) { //in IE we never got here if (!responseObj) { alert('Unexpected error!! No response from server'); return false; } //..handle response }; p.p1 = $('#control').val(); h.executeMethod(p, responseHandler); }); //RELEVANT SCRIPT ON WINDOW OPENER MYOBJECT try { $.ajax({ type: 'POST', async: true, url: url, data: postData, dataType: "json", contentType: 'application/x-www-form-urlencoded; charset=utf-8', success: r, // r here is reference to my responseHandler popup window function error: handleError }); } catch (ex) { alert(ex.message); } Any tips?

    Read the article

  • Extracting a string starting with x and ending with y

    - by DMan
    First of all, I did a search on this and was able to find how to use something like String.Split() to extract the string based on a condition. I wasn't able to find however, how to extract it based on an ending condition as well. For example, I have a file with links to images: http://i594.photobucket.com/albums/tt27/34/444.jpghttp://i594.photobucket.com/albums/as/asfd/ghjk6.jpg You will notice that all the images start with http:// and end with .jpg. However, .jpg is succeeded by http:// without a space, making this a little more difficult. So basically I'm trying to find a way (Regex?) to extract a string from a string that starts with http:// and ends with .jpg

    Read the article

  • Java creation of new set too slow

    - by Mgccl
    I have this program where it have some recursive function similar to this: lambda(HashSet<Integer> s){ for(int i=0;i<w;i++){ HashSet<Integer> p = (HashSet) s.clone(); p.addAll(get_next_set()); lambda(p); } } What I'm doing is union every set with the set s. And run lambda on each one of the union. I run a profiler and found the c.clone() operation took 100% of the time of my code. Are there any way to speed this up considerably?

    Read the article

  • Communication between Outlook addin and Program Automating Outlook

    - by Chris Kinsman
    I have an application that uses the automation interfaces to Microsoft Outlook to create a mail message and then after it is sent save an archive of that email message in my application. I am hitting issues with a number of the third party encryption addins because by the time the Sent event fires what is passed to me is the already encrypted message. I would like to somehow have them fire the event directly without sending a message to pass me the unencrypted version or I would like them to be able to somehow fire an event to me that passes the unencrypted message in a loosely coupled fashion. I can't seem to find a way to define new events on the Outlook application object so I am looking for other ideas. Thanks!

    Read the article

  • How can I build something like Amazon S3 in Perl?

    - by Joel G
    I am looking to code a file storage application in perl similar to amazon s3. I already have a amazon s3 clone that I found online called parkplace but its in ruby and is old also isn't built for high loads. I am not really sure what modules and programs I should use so id like some help picking them out. My requirements are listed below (yes I know there are lots but I could start simple then add more once I get it going): Easy API implementation for client side apps. (maybe REST (?) Centralized database server for the USERDB (maybe PostgreSQL (?). Logging of all connections, bandwidth used, well pretty much everything to a centralized server (maybe PostgreSQL again (?). Easy server side configuration (config file(s) stored on the servers). Web based control panel for admin(s) and user(s) to show logs. (could work just running queries from the databases) Fast High Uptime Low memory usage Some sort of load distribution/load balancer (maybe a dns based or pound or perlbal or something else (?). Maybe a cache of some sort (memcached or parlbal or something else (?). Thanks in advance

    Read the article

  • How to time-delay email deliveries?

    - by Michael D
    I'm currently learning about the Drupal email functions, such as drupal_mail and hook_mail, and hook_mail_alter, and I have a problem before me where I'll need to be able to queue emails for delayed delivery. For example, an event signup notification that needs to wait for an hour after the event was registered by a user. And that email has user specific data, so can't be just a generic template email... I'm using the MailQ module, mainly for it's logging capabilities, but I wonder if it (or something else) could be modified to add a configurable delay function? Any ideas?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >