Daily Archives

Articles indexed Saturday March 27 2010

Page 11/84 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • JQuery function not working as expected

    - by Mike
    I've written a little function to position a logo midway between the left hand side of the browser window and the (centered) navigation menu. The menu items are populated from a database, with the first item given the id item0. function positionLogo(){ var $menuleft=0; var $element=document.getElementById('item0'); if ($element.offsetParent) { do { $menuleft+=$element.offsetLeft; } while ($element=$element.offsetParent); } var $logoleft=($menuleft/2)-130; // As logo is 260px wide if ($logoleft<0) { $logoleft=0; } $('#logo').css('left',$logoleft); } $(document).ready(function(){ positionLogo(); }); $(window).resize(function(){ positionLogo(); }); This works fine when the window is resized, but when it first runs when the page is loaded, the position it sets is about 20px too far right (ie $logoleft is 20 more than it should be). As soon as the page is resized it jumps into the correct position. Haven't got it live anywhere at the moment but does anyone have any ideas? Thanks!

    Read the article

  • How do you call a generic method on a thread?

    - by cw
    How would I call a method with the below header on a thread? public void ReadObjectAsync<T>(string filename) { // Can't use T in a delegate, moved it to a parameter. ThreadStart ts = delegate() { ReadObjectAcync(filename, typeof(T)); }; Thread th = new Thread(ts); th.IsBackground = true; th.Start(); } private void ReadObjectAcync(string filename, Type t) { // HOW? } public T ReadObject<T>(string filename) { // Deserializes a file to a type. }

    Read the article

  • Odd compiler error on if-clause without braces

    - by DisgruntledGoat
    The following Java code is throwing a compiler error: if ( checkGameTitle(currGame) ) ArrayList<String> items = parseColumns( tRows.get(rowOffset+1), currGame, time, method ); checkGameTitle is a public static function, returning a boolean. The errors are all of the type "cannot find symbol" with the symbols being variable ArrayList, variable String and variable items. However, if I add {curly braces} then the code compiles with no errors. Why might this be? Is there some ambiguity on the if clause without them?

    Read the article

  • Configure a SPF rule on Ubuntu

    - by TiuTalk
    Where I can create/insert the SPF rules to allow a external server to authenticate and send e-mails using the domain name of my server running Ubuntu? I need to insert this rule: v=spf1 ip4:111.111.111.111/29 ip4:111.111.111.111/24 a mx ~all Thanks :)

    Read the article

  • Making a Form Input Field Large

    - by John
    Hello, For the form below, how could I make the input field big, like maybe 100 pixels in height by 400 pixels in length? Thanks in advance, John <form action="http://www...com/sandbox/comments/comments2.php" method="post"> <input type="hidden" value="'.$_SESSION['loginid'].'" name="uid"> <div class="addacomment"><label for="title">Add a comment:</label></div> <div class="submissionfield"><input name="title" type="title" id="title" maxlength="1000"></div> <div class="submissionbutton"><input name="submit" type="submit" value="Submit"></div> </form>

    Read the article

  • Why is FLT_MIN equal to zero?

    - by Nick Forge
    limits.h specifies limits for non-floating point math types, e.g. INT_MIN and INT_MAX. These values are the most negative and most positive values that you can represent using an int. In float.h, there are definitions for FLT_MIN and FLT_MAX. FLT_MAX is equal to a really large number, as you would expect, but why does FLT_MIN equal zero?

    Read the article

  • NHibernate + Sql Compact + IoC - Connection Managment

    - by Michael
    When working with NHibernate and Sql Compact in a Windows Form application I am wondering what is the best practice for managing connections. With SQL CE I have read that you should keep your connection open vs closing it as one would typically do with standard SQL. If that is the case and your using a IoC, would you make your repositories lifetime be singletons so they exist forever or dispose of them after you perform a "Unit of Work". Also is there a way to determine the number of connections open to Sql CE?

    Read the article

  • Test Case Design and Responsibility

    - by Sakamoto Kazuma
    So it seems like a lot of people are playing the blame game around where I work, and it brings up an interesting question. Knowns: Requirements team writes requirements for product. Developers create their own unit tests out of requirements. Testing team creates their general tests out of requirements and past customer issues. Product released if and only if X% of testcases from Testing team passes Customer response team gets bugs from the field, and lets the testing team know about these issues. Question: If the customer ends up filing a lot of defects, who is to blame? Is it the Testing team for not covering those? Or is it the requirements team for not writing better requirements? And how does one improve upon the system?

    Read the article

  • Silverlight 4 crashing every browser (SL3 doesn't)

    - by Simon_Weaver
    I am testing my application on a number of machines. It is fine on every machine except 1. I'm having problems with one XP machine where in internet explorer, chrome and firefox the Silverlight plugin crashes on EVERY page with Silverlight. Pages that used to work fine with silverlight 3 crash instantly - including my app and the Silverlight Beta 4 demo page!!! The browser crashes instantly and doesn't even attempt to load the page. I don't know how to debug this because there's no error. It just crashes instantly in all these browsers. Reinistalling, rebooting didn't fix the problem.

    Read the article

  • sudo port install cmake trouble (for MGTwitterEngine)

    - by RexOnRoids
    I am following This Tutorial on installing MGTwitterEngine on my MAC osx 10.6.2. I am stuck on this step: sudo port install cmake it gives me the following error: dlopen(/opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib, 10): no suitable image found. Did find: /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib: no matching architecture in universal wrapper while executing "load /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib" ("package ifneeded Pextlib 1.0" script) invoked from within "package require Pextlib 1.0" (file "/opt/local/bin/port" line 40) Rex-MacBook-Pro:~ Rex$ Thus, I cannot use TERMINAL to install YAJL to get my app to build. Help needed. P.S. In terminal preferences, Shells Open With is either /usr/bin/login or /bin/bash YAJL is supposedly installed at /Users/Rex I am using OSX 10.6.2

    Read the article

  • Silverlight: Binding a child controls property to a property in a user control

    - by Jeremy
    If I have a user control defined: public partial class MainFooter : UserControl { public System.Windows.Media.Color BkColor; } and it's xaml: <UserControl x:Class="Test.MainFooter"> <Grid x:Name="LayoutRoot"> <Rectangle x:Name="rctBottom_Background2" HorizontalAlignment="Stretch" Grid.Row="2"> <Rectangle.Fill> <LinearGradientBrush EndPoint="0.82,0.895" StartPoint="0.911,-0.442"> <GradientStop Color="{**How can I bind this to the BkColor property?}"/**> <GradientStop Color="#00FFFFFF" Offset="1"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> </Grid> </UserControl> and used: <MyControls:MainFooter x:Name="rcrMainFooter" BkColor="#FFE2B42A"> </MyControls:MainFooter> How would I go about binding the GradientStop Color in the Rectangle to the value of the it's user controls BkColor property?

    Read the article

  • How to convert a MKV video to a less CPU intensive video format?

    - by marco.ragogna
    I have a couple of videos at 1920x800 that use the MKV format (4.7 GB). A friend of mine has an old PC that has some problems playing them; the CPU is working at nearly 100%. Is it possible to convert these videos to a less CPU intensive video format? The final size is not a problem, it can also double or more. Into which format should I convert it and which software for Windows should I use (better if free)? Thank you in advance.

    Read the article

  • Some Keyword Optimization Tips For Your Work From Home

    Part of search engine optimization or SEO is keyword optimization. We optimize our keywords for our website because these words or phrases are the ones that will link us to our customers or target audience. By typing these keywords in the search box of popular search engines, customers are able to find us, our website and of course, our business or work from home.

    Read the article

  • Why is FLT_MIN equal to zero on OS X?

    - by Nick Forge
    limits.h specifies limits for non-floating point math types, e.g. INT_MIN and INT_MAX. These values are the most negative and most positive values that you can represent using an int. In float.h, there are definitions for FLT_MIN and FLT_MAX. If you do the following: NSLog(@"%f %f", FLT_MIN, FLT_MAX); You get the following output: FLT_MIN = 0.000000, FLT_MAX = 340282346638528859811704183484516925440.000000 FLT_MAX is equal to a really large number, as you would expect, but why does FLT_MIN equal zero?

    Read the article

  • How does lookup work?

    - by badgirl
    Hello. I have BeanTreeView, and some nodes in it. Every node has constructor public class ProjectNode extends AbstractNode { public ProjectNode(MainProject obj, DiagramsChildren childrens) { super (new ProjectsChildren(), Lookups.singleton(obj)); setDisplayName ( obj.getName()); } I set Rootnode as a root for tree in ExplorerTopComponent as this: private final ExplorerManager mgr = new ExplorerManager(); public ExplorerTopComponent(){ associateLookup (ExplorerUtils.createLookup(mgr, getActionMap())); mgr.setRootContext(new RootNode()); } And now, how I can get MainProject obj from some node? I need to get it in another class.

    Read the article

  • How to decipher this code?

    - by Igor
    $o="QAAAOzh3b3cnYGJzWG9iZmNidQAgLy48Jzg5Cg0KDQGjbmlka3IAAGNiJy9TQkpXS0ZTQldGU08ABScpJyAoYGZra2J1fikEACADXIQABPFhaGhzBPU="; eval(base64_decode("JGxsbD0wO2V2YWwoYmFzZTY0X2RlY29kZSgiSkd4c2JHeHNiR3hzYkd4c1BTZGlZWE5sTmpSZlpHVmpiMlJsSnpzPSIpKTskbGw9MDtldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkd3OUoyOXlaQ2M3IikpOyRsbGxsPTA7JGxsbGxsPTM7ZXZhbCgkbGxsbGxsbGxsbGwoIkpHdzlKR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xsbGxsbC0tO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkd4c2JEMG5ZMmh5SnpzPSIpKTskbGxsbGw9MDtldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkQwaVB5SXVKR3hzYkd4c2JHeHNiR3hzYkNnMk1pazciKSk7JGxsbGxsbGxsbGw9IiI7Zm9yKDskbGxsbGw8JGxsbGxsbGw7KXskbGxsbGxsbGxsbC49JGxsbGxsbGxsbGxsbCgkbGxsbGxsbGxbJGxsbGxsKytdXjB4MDcpO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkM0OUpHeHNiR3hzYkd4c2JHd3VKR3hzYkd4c2JHeHNiR3hzYkNnMk1Da3VJajhpT3c9PSIpKTtldmFsKCRsbGxsbGxsbGwpOw==")); return;?>

    Read the article

  • Binding property to Silverlight dependency property independent of DataContext

    - by Simon_Weaver
    I'm trying to make an Address control that has an IsReadOnly property, which will make every TextBox inside read only when set to true. <my:AddressControl Grid.Column="1" Margin="5" IsReadOnly="True"/> I've managed to do this just fine with a dependency property and it works. Here's a simple class with the dependency property declared : public partial class AddressControl : UserControl { public AddressControl() { InitializeComponent(); this.DataContext = this; } public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(AddressControl), null); public bool IsReadOnly { get { return (bool)GetValue(IsReadOnlyProperty); } set { SetValue(IsReadOnlyProperty, value); } } } In the XAML for this codebehind file I have a Textbox for each address line: <TextBox IsReadOnly="{Binding IsReadOnly}" Text="{Binding City, Mode=TwoWay}"/> <TextBox IsReadOnly="{Binding IsReadOnly}" Text="{Binding State, Mode=TwoWay}"/> <TextBox IsReadOnly="{Binding IsReadOnly}" Text="{Binding Zip, Mode=TwoWay}"/> Like i said this works just fine. The problem is that the Address control itself is bound to its parent object (I have several addresses I am binding). <my:AddressControl DataContext="{Binding ShippingAddress, Mode=TwoWay}" IsReadOnly="True"> <my:AddressControl DataContext="{Binding BillingAddress, Mode=TwoWay}" IsReadOnly="True"> The problem is that as soon as I set DataContext to something other than 'this' then the binding for IsReadOnly breaks. Not surprising because its looking for IsReadOnly on the Address data entity and it doesn't exist or belong there. I've tried just about every combination of binding attributes to get IsReadOnly to bind to the AddressControl obejct but can't get it working. I've tried things like this, but I can't get IsReadOnly to bind independently to the AddressControl property instead of its DataContext. <TextBox IsReadOnly="{Binding RelativeSource={RelativeSource Self}, Path=IsReadOnlyProperty}" Text="{Binding City, Mode=TwoWay}" /> I think I'm pretty close. What am I doing wrong?

    Read the article

  • Chrome Tab Ordering?

    - by Mark
    If I'm on the first tab, and I hit Ctrl+T, I want it to open next to (to the right of) the current tab. Is there an extension for this? I think I want to change the closed tab ordering too... but I can never remember how I like it until I play with it. I think move to the left tab is what I like. TabMixPlus gives me these options in FF, is there a similar extension available yet? Or some hidden options in Chrome?

    Read the article

  • Brand New MOnitor Won't Get Input From CPU

    - by HollerTrain
    I have an old Dell 2350. I found a HD a few months ago and plugged it in and it booted up. So I just purchased a monitor and plugged it in, and put the HD inside and connected the two connections (Bus, and a four pronged connector) and no signal is being sent to monitor. is this a monitor issue or the HD is just dead? HD is spinning. CPU is turned on :) Yet no signal.. any thoughts?

    Read the article

  • Which career path to take to get hired by big companies like Google and Microsoft

    - by Wonder
    I am in second year computer science program. This summer I am starting a quality database developer position at RIM for 8 months. My goal is to work as a software developer (architect or consultant eventually) at Google. After this 8 months, I am still going to do 12 months of co-op. In which direction should I be trying to steer my career in? Is there any certain positions (other than software developer) or companies I should work for?

    Read the article

  • Transport Codes in OSB

    - by hakish
    hi, i am getting this 2 Internal Server Error utf-8 http:http-response-code500 What does the transport response code 2 mean? I have seen many others as well, Can someone tell me what they mean?

    Read the article

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