Daily Archives

Articles indexed Saturday June 5 2010

Page 21/79 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • WPF XAML: how to get StackPanel's children to fill maximum space downward?

    - by Edward Tanguay
    I simply want flowing text on the left, and a help box on the right. The help box should extend all the way to the bottom. If you take out the outer StackPanel below it works great. But for reasons of layout (I'm inserting UserControls dynamically) I need to have the wrapping StackPanel. How do I get the GroupBox to extend down to the bottom of the StackPanel, as you can see I've tried: VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="Auto" XAML: <Window x:Class="TestDynamic033.Test3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Test3" Height="300" Width="600"> <StackPanel VerticalAlignment="Stretch" Height="Auto"> <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Margin="10"> <GroupBox DockPanel.Dock="Right" Header="Help" Width="100" Background="Beige" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="Auto"> <TextBlock Text="This is the help that is available on the news screen." TextWrapping="Wrap" /> </GroupBox> <StackPanel DockPanel.Dock="Left" Margin="10" Width="Auto" HorizontalAlignment="Stretch"> <TextBlock Text="Here is the news that should wrap around." TextWrapping="Wrap"/> </StackPanel> </DockPanel> </StackPanel> </Window> Answer: Thanks Mark, using DockPanel instead of StackPanel cleared it up. In general, I find myself using DockPanel more and more now for WPF layouting, here's the fixed XAML: <Window x:Class="TestDynamic033.Test3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Test3" Height="300" Width="600" MinWidth="500" MinHeight="200"> <DockPanel VerticalAlignment="Stretch" Height="Auto"> <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" MinWidth="400" Margin="10"> <GroupBox DockPanel.Dock="Right" Header="Help" Width="100" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="Auto"> <Border CornerRadius="3" Background="Beige"> <TextBlock Text="This is the help that is available on the news screen." TextWrapping="Wrap" Padding="5"/> </Border> </GroupBox> <StackPanel DockPanel.Dock="Left" Margin="10" Width="Auto" HorizontalAlignment="Stretch"> <TextBlock Text="Here is the news that should wrap around." TextWrapping="Wrap"/> </StackPanel> </DockPanel> </DockPanel> </Window>

    Read the article

  • Why repeat database constraints in models?

    - by BWelfel
    In a CakePHP application, for unique constraints that are accounted for in the database, what is the benefit of having the same validation checks in the model? I understand the benefit of having JS validation, but I believe this model validation makes an extra trip to the DB. I am 100% sure that certain validations are made in the DB so the model validation would simply be redundant. The only benefit I see is the app recognizing the mistake and adjusting the view for the user accordingly (repopulating the fields and showing error message on the appropriate field; bettering the ux) but this could be achieved if there was a constraint naming convention and so the app could understand what the problem was with the save (existing method to do this now?)

    Read the article

  • Codeigniter - Is it ok to add functionality to the constructor in controllers?

    - by Irro
    I'm making a project where I want the user to search for shops in different cities and would like the url to be like this: domain/shop/city/name. So I created a controller in codeigniter called Shop. But I cant create a city function since the city part of the url changes dependent on city name. One easy way to do it would be to add a function called "search" and add the functionality there but then I get url's like: domain/shop/search/city/name which I really would like to avoid. So my question is if it's ok to add my functionality directly into the constructor to avoid that extra "search" part in the url? I'm afraid that there might be some performance tricks involved that potentially keeps the class in memory so the constructor will not be called every time.

    Read the article

  • How do make my encryption algorithm encrypt more than 128 bits?

    - by Ranhiru
    OK, now I have coded for an implementation of AES-128 :) It is working fine. It takes in 128 bits, encrypts and returns 128 bits So how do i enhance my function so that it can handle more than 128 bits? How do i make the encryption algorithm handle larger strings? Can the same algorithm be used to encrypt files? :) The function definition is public byte[] Cipher(byte[] input) { }

    Read the article

  • Will Sytem.currentTimeMillis always return a value >= previous calls?

    - by 1984isnotamanual
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#currentTimeMillis() says: Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds. It is not clear to me if I am guaranteed that this code will always print ever increasing (or the same) numbers. while (1) { System.out.println(System.currentTimeMillis() ); }

    Read the article

  • Creating a border around cells with the same value.

    - by Liam
    I have a table like the one below. How can I get Excel to put borders around groups with the same number in the 4th column so that there is a border around the groups. I was thinking conditional formatting could do it but I can't think how. So I think the only option is a macro. Could anybody help? 1 64436 549419 1 2 64437 549420 1 3 64438 549421 1 4 64439 549422 1 5 64440 549423 1 6 64441 549424 1 7 64442 549425 1 8 64443 549426 1 9 64444 549427 1 10 64445 549428 1 11 64446 549429 1 12 64447 549430 1 13 64448 549431 2 14 64449 549432 2 15 64450 549433 2 16 64451 549434 2 17 64452 549435 2 18 64453 549436 2 19 64454 549437 2 20 64455 549438 2 21 64456 549439 2 22 64457 549440 4 23 64458 549441 4 24 64459 549442 5 25 64460 549443 5 26 64461 549444 5 27 64462 549445 5 28 64463 549446 5 29 64464 549447 5 30 64465 549448 6 31 64466 549449 6 32 64467 549450 6 33 64468 549451 6 34 64469 549452 6 35 64470 549453 6 36 64471 549454 6 37 64472 549455 9 38 64473 549456 9 39 64474 549457 9

    Read the article

  • git rebase without changing commit timestamps

    - by Olivier
    Would it make sense to perform git rebase while preserving the commit timestamps? I believe a consequence would be that the new branch will not necessarily have commit dates chronologically. Is that theoretically possible at all? (e.g. using plumbing commands; just curious here) If it is theoretically possible, then is it possible in practice with rebase, not to change the timestamps? For example, assume I have the following tree: master <jun 2010> | : : : oldbranch <feb 1984> : / oldcommit <jan 1984> Now, if I rebase oldbranch on master, the date of the commit changes from feb 1984 to jun 2010. Is it possible to change that behaviour so that the commit timestamp is not changed? In the end I would thus obtain: oldbranch <feb 1984> / master <jun 2010> | : Would that make sense at all? Is it even allowed in git to have a history where an old commit has a more recent commit as a parent? Edit A crucial question of Von C helped me understand what is going on: when your rebase, the committer's timestamp changes, but not the author's timestamp, which suddenly all makes sense. So my question was actually not precise enough. The answer is that rebase actually doesn't change the author's timestamps (you don't need to do anything for that), which suits me perfectly.

    Read the article

  • How to configure and access IIS in windows 7

    - by user28233
    I've installed IIS on Windows 7(Ultimate) by going to control paneladd/remove features/ then checking the IIS. How do I access something like a preference editor like in wamp server. In wamp server I go to http://localhost/phpmyadmin. And accessing the pages I made in http://localhost/pages/ What about in IIS? How do I access something like phpmyadmin. And how do I access the webpages that I made. This is only for educational purposes. And I do not need a site to be accessible on the net. And I already have something like this: What do I do with it. Please help,thanks

    Read the article

  • SQL Server 2008 error message from store procedure

    - by George2
    Hello everyone, When we met with such error message from store procedure, Message 1205, Level 13, State 52, the process Pr_FooV2, Line 9 Services (Process ID 111) and another process is deadlock in the lock | communication buffer resources, and has been chosen as the deadlock victim. Rerun the transaction. I am wondering whether such messages are stored in log files? I searched log folder of my SQL Server 2008 installation root (in my environment, it is C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log), but can not find such files. thanks in avdance, George

    Read the article

  • can you use proxies to do load/stress testing on a server, with proxy serving as a sort of mirror?

    - by EndangeringSpecies
    suppose I want to test a server's and its web application's ability to handle many simultaneous connections well and show decent latency. So ideally I would want a thousand machines to bombard it with usage requests, but that's not practicable. So instead, can I just make a testing script with a thousand threads to run on the same server and have them perform the testing, connecting to the server via a geographically far-away proxy? My reasoning here is that the signal will have to travel realistically big distances to the proxy and back, so that sort of emulates the reality of real clients accessing the server. Then again, to take this one step further, are there prepackaged emulators/frameworks that could perform a similar test without using internet at all, just simulating the latency of the network, realistically creating all the socket connections and other resource intensive stuff etc?

    Read the article

  • Use HTTParty methods in a subclass

    - by cpjolicoeur
    I'm trying to write an API wrapper in ruby and am stumped on how I can call HTTParty methods from a subclass. For instance, I want the user to create a connection to the api and then be able to query results from subclasses. module ApiWrapper class Connection include HTTParty base_uri '...' def initialize( u, p ) ... end def contacts ApiWrapper::Contact end end end module ApiWrapper class Contact def all # issue httparty get request here that is created from the Connection class end end end ## The user would do this conn = ApiWrapper::Connection.new( 'username', 'password' ) contacts = conn.contacts.all

    Read the article

  • Clickonce appref.ms argument

    - by alan
    I have a clickonce application that is available online or offline. The program takes an argument. When online I pass the argument on the url like so "url?argument" and it works well. Offline i start a process with the startmenu link to the application. My question is, is it possible to pass an argument to my application via this link? I guess I could somehow work out the location of the application file but is there an alternative?

    Read the article

  • Async networking + threading problem

    - by randallmeadows
    I kick off a network request, assuming no login credentials are required to talk to the destination server. If they are required, then I get an authentication challenge, at which point I display a view requesting said credentials from the user. When they are supplied, I restart the network request, using those credentials. That's all fine and dandy, as long as I only do one request at a time. But I'm not, typically. When both requests are kicked off, I get the first challenge, and present the prompt (using -presentModalViewController:). Then the 2nd challenge comes in. And I crash when it tries to display the 2nd prompt. I have the bulk of this wrapped in an @synchronized() block, but this has no effect because these delegate methods are all being called on the same (main) thread. The docs say the delegate methods are called on the same thread in which the connection was started. OK, no problem; I'll just write a method that I run on a background thread using -performSelectorInBackground: NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO]; [connections addObject:connection]; [self performSelectorInBackground:@selector(startConnection:) withObject:connection]; [connection release]; - (void)startConnection:(NSURLConnection *)connection { NSAutoreleasePool *pool = [NSAutoreleasePool new]; [connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [connection start]; [pool drain]; } which should put every network request, and its callbacks, on its own thread, and then my @synchronized() blocks will take effect. The docs for -initWithRequest:... state "Messages to the delegate will be sent on the thread that calls this method. By default, for the connection to work correctly the calling thread’s run loop must be operating in the default run loop mode." Ok, I'm doing that. They also state "If you pass NO [for startImmediately], you must schedule the connection in a run loop before starting it." OK, I'm doing that, too. Furthermore, the docs for NSRunLoop state "Each NSThread object, including the application’s main thread, has an NSRunLoop object automatically created for it as needed. If you need to access the current thread’s run loop, you do so with the class method currentRunLoop." I'm assuming this applies to the background thread created by the call -performSelectorInBackground... (which does appear to be the case, when I execute 'po [NSClassFromString(@"NSRunLoop") currentRunLoop]' in the -startConnection: method). The -startConnection: method is indeed being called. But after kicking off the connection, I now never get any callbacks on it. None of the -connectionDid… delegate methods. (I even tried explicitly starting the thread's run loop, but that made no difference; I've used threads like this before, and I've never had to start the run loop manually before--but I'm now grasping at straws...) I think I've come up with a workaround such that I only handle one request at a time, but it's kludgy and I'd like to do this the Right Way. But, what am I missing here? Thanks! randy

    Read the article

  • html5 video player with simplest controls (only play and paus)

    - by mathiregister
    hi guys, somehow there are really little tutorials out there for html5 video and audio playback. I simply want to embed video and audio files with customized controls. However the controls should be farely simple. I only need a play-button. If clicked, play gets replaced by pause. that's all! however i even don't know how to embed/display a video without "preload controls". Somehow if i only set (without preload controls) Firefox even don't shows anything. Chrome does show a black window. I would love to be able to use jquery to control the video play and pause button. Maybe you have some little start-approach for me! thank you very much!

    Read the article

  • Using ASP.NET Automatically login to an external website and redirect

    - by DoodleWalker
    Hello, We have a series of products with built in web servers each of which has a login page, a customer wants to create a web portal in which they log into once, from there they can simply click on any of the devices (external websites) and it will automatically login to that site and redirect them to the page after the login screen. The portal is using ASP.NET MVC, the external devices are Windows CE based units running embedded web servers. Can find a lot on scraping, but not much on redirection after the event. Many Thanks Andy

    Read the article

  • Can I pull the next element from within a Perl foreach loop?

    - by Thilo
    Can I do something like the following in Perl? foreach (@tokens) { if (/foo/){ # simple case, I can act on the current token alone # do something next; } if (/bar/) { # now I need the next token, too # I want to read/consume it, advancing the iterator, so that # the next loop iteration will not also see it my $nextToken = ..... # do something next; } }

    Read the article

  • OpenGLES iPhone Depth Blending problem

    - by user359103
    Hi, I am trying to make an OpenGLES 2.0 cube application. The idea was to have a texture (with an alpha 75%) applied to all 6 faces of the cube. This would mean that even if I rotate the cube i would be able to see all 6 faces at any given frame. Now I have enabled depth test(my app needs this!!) and blending. The Depth func is LEQUAL and blend func is SRC_ALPHA, ONE_MINUS_SRC_ALPHA. Now, the issue is that at some cube faces don't show the underlying faces. I am not able to understand this because the logic works fine with the other cube faces. Just for the record, I have disabled CULL_FACE. Thanks in advance. Regards, Puzzler

    Read the article

  • Multi-threaded library calls in ASP.NET page request.

    - by ProfK
    I have an ASP.NET app, very basic, but right now too much code to post if we're lucky and I don't have to. We have a class called ReportGenerator. On a button click, method GenerateReports is called. It makes an async call to InternalGenerateReports using ThreadPool.QueueUserWorkItem and returns, ending the ASP.NET response. It doesn't provide any completion callback or anything. InternalGenerateReports creates and maintains five threads in the threadpool, one report per thread, also using QueueUserWorkItem, by 'creating' five threads, also with and waiting until calls on all of them complete, in a loop. Each thread uses an ASP.NET ReportViewer control to render a report to HTML. That is, for 200 reports, InternalGenerateReports should create 5 threads 40 times. As threads complete, report data is queued, and when all five have completed, report data is flushed to disk. My biggest problems are that after running for just one report, the aspnet process is 'hung', and also that at around 200 reports, the app just hangs. I just simplified this code to run in a single thread, and this works fine. Before we get into details like my code, is there anything obvious in the above scendario that might be wrong?

    Read the article

  • new Date() In javascript :: need Help

    - by gskoli
    Dear all, i am creating a digital clock using images & javascript but i want to pass a server time that time ... How to do that ... I am getting time from server and passing it to Date Following i have given snippet . var time_str = document.clock_form.time_str.value ; //alert (time_str); function dotime(){ theTime=setTimeout('dotime();',1000); //d = new Date(Date.parse(time_str)); d= new Date(time_str); hr= d.getHours()+100; mn= d.getMinutes()+100; se= d.getSeconds()+100; var time_str = document.clock_form.time_str.value ; //alert (time_str); alert(' TIME ---> '+hr+' :: '+mn+' :: '+ se); if(hr==100){ hr=112;am_pm='am'; } else if(hr<112){ am_pm='am'; } else if(hr==112){ am_pm='pm'; } else if(hr>112){ am_pm='pm';hr=(hr-12); } tot=''+hr+mn+se; document.hr1.src = '/flash_files/digits/dg'+tot.substring(1,2)+'.gif'; document.hr2.src = '/flash_files/digits/dg'+tot.substring(2,3)+'.gif'; document.mn1.src = '/flash_files/digits/dg'+tot.substring(4,5)+'.gif'; document.mn2.src = '/flash_files/digits/dg'+tot.substring(5,6)+'.gif'; document.se1.src = '/flash_files/digits/dg'+tot.substring(7,8)+'.gif'; document.se2.src = '/flash_files/digits/dg'+tot.substring(8,9)+'.gif'; document.ampm.src= '/flash_files/digits/dg'+am_pm+'.gif'; } dotime(); But it is not working Help me out Thanks in advance.

    Read the article

  • Windows 2003 Server Intermittent DNS Issues

    - by Mike
    Looking for a little help here. I have a Windows 2003 DNS Server set up on our network. Lately computers on our LAN have been, at times, unable to resolve a certain sub domain for our website whereas other times the request is resolved just fine. During these periods of "downtime" all other network activity (i.e web sites, internal resolutions, network shares, etc.) remains normal. I can tell it is a problem with our DNS server because the resolution always works from outside our network. I'm hoping someone out there has experienced something similar or could at least offer me place to start troubleshooting. Thanks!

    Read the article

  • Open Source App Stor

    - by Kortex786
    Hy Everyone, I want to manage a kind of private App Store. All users of my company can download apps or software from the Intranet. Here is a sample of what I want for a private use : http://www.01net.com/telecharger/ Does anyone know a open source service that can do that ? Thx.

    Read the article

  • How to add a local file to trusted zone in IE8?

    - by Raghu Dodda
    I want to add a file on my local drive (C:\something.html) to the Trusted Zone in IE8 (my OS is Windows Server 2003). The Add Sites Dialog box, does not seem to take entries for files on the local drive. I have tried: file://C:\something.html file:\\localhost\c$\something.html I have seen other solutions (on superuser and elsewhere) such Mark of Web, that allow your local file to be treated as if it were part of the internet zone, but I want to add my file to the Trusted Zone. How can I do this? Thanks.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >