Search Results

Search found 1506 results on 61 pages for 'ben mezger'.

Page 42/61 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Could I be writing this code better?

    - by Ben Dauphinee
    Is there any website out there somewhere where a programmer such as myself might be able to post pieces of code to be looked at by more experienced people? I am thinking of something that programmers could use to have advice given on how to improve their ability. I really like the atmosphere here, but am not sure that posting code for review here is appropriate.

    Read the article

  • Haskell - function (that returns a list) on each element in a list

    - by Ben
    The assignment is to create a multiples function and I essentially want todo the following code: map (\t -> scanl (\x y -> x+y) t (repeat t)) listofnumbers The problem is that the scanl function returns a list of results rather than the one which the map function requires. So is there a function that will allow the return of lists?

    Read the article

  • Animated status bar style transition, a la iPod app

    - by Ben Williamson
    In the iPod app, the navigation views have the default status bar style, and the Now Playing view is in the black style. The transition between them is animated with a crossfade. I want to do that. My first attempt: [UIView beginAnimations:@"whatever" context:nil]; [UIView setAnimationDuration:0.5]; self.navigationController.navigationBar.barStyle = UIBarStyleBlack; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlack [UIView commitAnimations]; No joy, it pops to black. Takers?

    Read the article

  • How can I make jQuery select an element in the style of CSS?

    - by ben
    <div id="id" class="div-style"><img id="1" class="img-style"></div> I would like to use the id attribute as a way for jQuery to select the element, and the class attribute for CSS to style it. My guess for jQuery selector ran thusly: $("#id .div-class") and $("#id .img-class") This returns the error "Selector expected"

    Read the article

  • WPF: Text wrapping not working

    - by Ben
    I've got a grid defined simply: <Grid Margin="0,5,0,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="50"></ColumnDefinition> <ColumnDefinition Width="50"></ColumnDefinition> <ColumnDefinition Width="48"></ColumnDefinition> <ColumnDefinition Width="Auto"></ColumnDefinition> </Grid.ColumnDefinitions> Then I'm trying to bind some content like this: <TextBlock TextWrapping="Wrap" Grid.Column="3" Text="{Binding Text}"> Set up like this, the text won't wrap. It simply expands the column to fit the text. If I set the Width to a fixed amount on the last column, wrapping works as expected. The problem there is that if the user widens the window, the column stays at a fixed size. How can I get the column to size dynamically with the width of the grid, but still wrap the text within it?

    Read the article

  • Facebook offline access step-by-step

    - by Ben
    After searchinge litteraly 1 day on fb and google for an up-to-date and working way to do something seemingly simple: I am looking for a step-by-step explanation to get offline_access for a user for a facebook app and then using this (session key) to retrieve offline & not within a browser friends & profile data. Preferrably doing this in the Fb Java API. Thanks. And yes I did check the facebook wiki. Update: Anyone? this: http://www.facebook.com/authorize.php?api_key=<api-key>&v=1.0&ext_perm=offline_access gives me offline_Access, however how to retrieve the session_key? Why can't facebook just do simple documentation, I mean there are like 600 people working there? The seemingly same question: http://stackoverflow.com/questions/617043/getting-offlineaccess-to-work-with-facebook Does not answer how to retrieve the session key Edit: I am still stuck with that. I guess nobody really tried such a batch access out yet...

    Read the article

  • How can I run code in a C# class definition each time any instance of the class is deserialized?

    - by Ben
    I am trying to derive a class from ObservableCollection and I need to run just a single line of code each and every time any instance of this class is deserialized. My thought was to do this: [Serializable] public class ObservableCollection2<T> : ObservableCollection<T>, ISerializable { public ObservableCollection2() : base() { } public ObservableCollection2(SerializationInfo info, StreamingContext context) : base(info, context) { // Put additional code here. } void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); } } But I don't have access to those base methods related to serialization. Am I forced to re-write all of the serialization manually?

    Read the article

  • Jquery, checkboxes and isChecked

    - by Ben
    When I bind a function to a checkbox element like: $("#myCheckbox").click( function() { alert($(this).is(":checked")); }); The checkbox changes it checked attribute before the event is triggered, it's it normal behavior, thus giving and inverse result. However, when I do: $("#myCheckbox").click(); The checkbox changes it checked attribute after the event is triggered. My question is, is there a way to trigger the click event from jquery like a normal click would do (first scenario)? PS: I've already tried with trigger('click');

    Read the article

  • In the following implementation of static_strlen, why are the & and parentheses around str necessary

    - by Ben
    If I change the type to const char str[Len], I get the following error: error: no matching function for call to ‘static_strlen(const char [5])’ Am I correct that static_strlen expects an array of const char references? My understanding is that arrays are passed as pointers anyway, so what need is there for the elements to be references? Or is that interpretation completely off-the-mark? #include <iostream> template <size_t Len> size_t static_strlen(const char (&str)[Len]) { return Len - 1; } int main() { std::cout << static_strlen("oyez") << std::endl; return 0; }

    Read the article

  • How to make the value of one select box drive the options of a second select box

    - by Ben McCormack
    I want to make an HTML form with 2 select boxes. The selected option in the first select box should drive the options in the second select box. I would like to solve this dynamically on the client (using javascript or jQuery) rather than having to submit data to the server. For example, let's say I have the following Menu Categories and Menu Items: Sandwiches Turkey Ham Bacon Sides Mac 'n Cheese Mashed Potatoes Drinks Coca Cola Sprite Sweetwater 420 I would have two select boxes, named Menu Category and Items, respectively. When the user selects Sandwiches in the Menu Category box, the options in the Items box will only show Sandwich options. I'm stuck as how I might approach this. Once I filter out the 2nd list one time, how do I "find" the list options once I change my menu category in the 1st list? Also, if I'm thinking in SQL, I would have a key in the 1st box that would be used to link to the data in the 2nd box. However, I can't see where I have room for a "key" element in the 2nd box. How could this problem be solved with a combination of jQuery or plain javascript?

    Read the article

  • Can I use Duff's Device on an array in C?

    - by Ben Fossen
    I have a loop here and I want to make it run faster. I am passing in a large array. I recently heard of Duff's Device can it be applied to this for loop? any ideas? for (i = 0; i < dim; i++) { for (j = 0; j < dim; j++) { dst[RIDX(dim-1-j, i, dim)] = src[RIDX(i, j, dim)]; } }

    Read the article

  • Has anyone noticed that a WPF file dialog will pass through a click to the UI when double clicking t

    - by Ben
    I have some buttons on my WPF UI and I also need to choose files from time to time. I kept noticing strange problems where when I double-click an item in the file dialog, a button on the main UI would also get clicked. After experimenting, it seems that if you line up an item in the file dialog with a button behind it on the main UI and double click to select the file, it will single-click the button behind it as well. Has anyone else noticed this, or is it just a freak bug with the way I have my UI laid out?

    Read the article

  • Why does first call to java.io.File.createTempFile(String,String,File) take 5 seconds on Citrix?

    - by Ben Roling
    While debugging slow startup of an Eclipse RCP app on a Citrix server, I came to find out that java.io.createTempFile(String,String,File) is taking 5 seconds. It does this only on the first execution and only for certain user accounts. Specifically, I am noticing it Citrix anonymous user accounts. I have not tried many other types of accounts, but this behavior is not exhibited with an administrator account. Also, it does not matter if the user has access to write to the given directory or not. If the user does not have access, the call will take 5 seconds to fail. If they do have access, the call with take 5 seconds to succeed. This is on a Windows 2003 Server. I've tried Sun's 1.6.0_16 and 1.6.0_19 JREs and see the same behavior. I googled a bit expecting this to be some sort of known issue, but didn't find anything. It seems like someone else would have had to have run into this before. The Eclipse Platform uses File.createTempFile() to test various directories to see if they are writeable during initialization and this issue adds 5 seconds to the startup time of our application. I imagine somebody has run into this before and might have some insight. Here is sample code I executed to see that it is indeed this call that is consuming the time. I also tried it with a second call to createTempFile and notice that subsequent calls return nearly instantaneously. public static void main(final String[] args) throws IOException { final File directory = new File(args[0]); final long startTime = System.currentTimeMillis(); File file = null; try { file = File.createTempFile("prefix", "suffix", directory); System.out.println(file.getAbsolutePath()); } finally { System.out.println(System.currentTimeMillis() - startTime); if (file != null) { file.delete(); } } } Sample output of this program is the following: C:\java.exe -jar filetest.jar C:/Temp C:\Temp\prefix8098550723198856667suffix 5093

    Read the article

  • private home proxy server

    - by Ben
    How do I make a proxy site for a home URL (EX: 192.168.1.190) to bypass the web filter we have set? Don't worry, I am in cahoots with the person that monitors this stuff, so this is for that person. Thanks!

    Read the article

  • How to set skin at runtime in Flex 4

    - by Ben
    Hi, I have a bunch of custom controls based on a SkinnableContainer. When adding the control at design time, I can specify a skin by using the skinClass attribute on the tag. I need to add some of these elements during runtime, and I can't figure out how to specify the skinClass for my controls. eg. var something:CustomThing = new CustomThing(); /* mistery code here to attach the skin ? */ addElement(something); How do I do this? Thanks!

    Read the article

  • How to access global variable in a view in Ruby on Rails?

    - by ben
    I have a User model. I have a Session controller, in which I have a global user variable that is assigned as follows: $user = User.authenticate(params[:session][:email], params[:session][:password]) (I've made user global just to try to solve this problem, so if there's a better way please let me know!) I need to use the email of the logged in user as a parameter to send to Flex part of my website. At the moment I'm creating the link as follows: <%= link_to "secondpage", secondpage_path(:email => @session.$user.email) But I'm getting the following error: compile error /Users/benhartney/rails_projects/talk/app/views/layouts/_header.html.erb:12: syntax error, unexpected tGVAR ..._path(:email = @session.$user.email) ).to_s); @output_buffe... There's also a little arrow pointing at $user If I remove the $ from $user, I get this error: undefined method `user' for nil:NilClass If I remove the (:email => @session.user.email) part, everything works fine, so I think all of the code except for this is ok. Can anyone tell me what I'm doing wrong? Thanks for reading!

    Read the article

  • Cant set drop down list selected value in page load

    - by Ben
    Hi, I'm trying to set the selected value of a ddl during page load ie. before databind. This causes "selected value does not exist" errors. So I force a databind, and add a new element if it does not exist in the data source. However it looks like when the databind is performed later in the page lifecycle that my added element(s) are removed/overwritten. Am I setting the values in the wrong part of the life cycle? what I'm doing seems rather hackish and I think im going about this the wrong way... is there a better way to do this?

    Read the article

  • Detect if camera is capturing in Flash

    - by Ben
    I'm having trouble with Camera.getCamera() in Flash AS3. If there are multiple camera drivers, it does not necessarily pick the correct one. If the default is the correct, the program works fine; however, if another driver is selected as the default then LED on the webcam does not come on and no video is captured. I can cycle through the available cams and select an arbitrary one. I don't, however, know how to determine if the selected camera is correct. It is not returning null. I considered using camera.currentFPS, but it's not clear when this gets updated. I'm really struggling to determine dynamically which camera will do the trick!

    Read the article

  • slideDown() Makes Everything in Wrapper Shift

    - by Ben
    Hello everyone, I am currently creating a simple menu where there are several names of services and a user can click on one and jQuery will show it's corresponding paragraph describing it below it. My jQuery code is fine and does exactly what I want, however, I have one bug I have yet to iron out. Whenever I click one of these headings and it's description displays, everything in the wrapper for the page shifts to the left about 7 pixels in Firefox, it does the same thing is Google Chrome however I have not measured the amout but I am sure it is irrelevant. Anyways, I am using the slideToggle() command to show the hidden parragraph. I assume this is occuring because when the slideDown occurs it is somehow changing the width of everything and the "margin: 0 auto;" setting for the wrapper rule in my css is compensating for this change. Does anyone have any way I can remedy this problem? I have tried several other fixes I've found around the internet but to no avail. Here is what my code looks like, I put it on jsFiddle to make it easier to view: http://jsfiddle.net/vcH7m/ Feel free to edit it there if you like, or post what needs to be fixed here. Whatever is more convenient. Thank you very much for the help!

    Read the article

  • Best cheap GUI for converting to f4v

    - by Ben
    Hi, I need to give one client the ability to convert some videos to f4v h264 before loading it up to an AIR app. I normally doing with the Adobe Media Encoder CS4 but that only ships with adobe products (you can't download it as a free standalone app - which, start rant is odd, you'd think they would push the format - Microsoft's competing expresssion encoder is free end rant) Anyway, I need to get a (hopefully not too expensive, but willing to pay for it) good 3rd part app that can take any video and convert it to an f4v. Can you suggest any? Everything i've found is horrible or jammed with ads and crap. What would you use? Any suggestion? (please don't just say ffmpeg - I know it can do it but we need to good simple GUI) Thanks!

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >