Monthly Archives

Articles indexed in March 2011

Page 7/223 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • jQuery Looking for a function to equalize heights of divs based on tallest image in a table.

    - by Jamie
    I am doing a site that will have a table with a bunch of images in them. They are user added images so I have no control over aspect ratio, what I do have control over is I can the force a max height/width and the image will not exceed this in either direction, but the height can (and will) fluctuate. <table class="pl_upload"> <tr class="row1"> <td class="col1"> <div> <div class="img-container"> <a href="#"><img src="img.jpg" width="182" alt="X" /></a> </div> </div> </td> ....... What I need ideally is to get the height of the tallest image and then make the all of the children divs the same height based on the height of the tallest one. I hope that makes sense, been a long day. I made a jsfiddle page for it here: http://jsfiddle.net/Evolution/27EJB/

    Read the article

  • How to set global variables to use everywhere in my application?

    - by user502052
    I am using Ruby on Rails 3 and I would like to set some global variable to use those everywhere in my application. In particular, the domain name. If, for example, my website URL is http://subname.domain.com I would like to set or retrieve the subname.domain.com value in order to use that in my application like this request_uri = "http://#{sub_domain_name}" Where and how I have to state\initialize the sub_domain_name variable or other variables at all?

    Read the article

  • Cross-browser padding/margins

    - by Lucifer
    Hi All, I was wondering if you could give me some helpful hints on how to correct this issue? I have a main menu on my site, the code for it is as follows: li:hover { background-color: #222222; padding-top: 8px; padding-bottom: 9px; } And here's a demo of what it actually looks like: The problem is that when I hover over a menu option (li), the background appears, but it overflows to the outside of the menu's background, and makes it look really dodgy/crap/cheap/yuck! Note that (obviously) when I change the padding to make it display correctly in these browsers, it appears too small in height in IE! So I'm screwed either way. How can I make little imperfections like this look the same in all browsers? Update: HTML (The menu): <ul class="menu"> <li class="currentPage" href="index.php"><a>Home</a></li> <li><a href="services.php">Services</a></li> <li><a href="support.php">Support</a></li> <li><a href="contact.php">Contact Us</a></li> <li><a href="myaccount/" class="myaccount">My Account</a></li> </ul> The CSS: .menu { margin-top: 5px; margin-right: 5px; width: 345px; float: right; } li { font-size: 9pt; color: whitesmoke; padding-left: 6px; padding-right: 8px; display: inline; list-style: none; } li:hover { background-color: #222222; padding-top: 8px; padding-bottom: 9px; }

    Read the article

  • Joining Tables Based on Foreign Keys

    - by maestrojed
    I have a table that has a lot of fields that are foreign keys referencing a related table. I am writing a script in PHP that will do the db queries. When I query this table for its data I need to know the values associated with these keys not the key. How do most people go about this? A 101 way to do this would be to query this table for its data including the foreign keys and then query the related tables to get each key's value. This could be a lot of queries (~10). Question 1: I think I could write 1 query with a bunch of joins. Would that be better? This approach also requires the querying script to know which table fields are foreign keys. Since I have many tables like this but all with different fields, this means writing nice generic functions is hard. MySQL InnoDB tables allow for foreign constraints. I know the database has these set up correctly. Question 2: What about the idea of querying the table and identifying what the constraints are and then matching them up using whatever process I decide on from Question 1. I like this idea but never see it being used in code. Makes me think its not a good idea for some reason. I would use something like SHOW CREATE TABLE tbl_name; to find what constraints/relationships exist for that table. Thank you for any suggestions or advice.

    Read the article

  • Java Servlet framework that does things like rencoding images to preferred format etc.

    - by mP
    Are there any frameworks/libraries that provide servlets/filters etc that handle reencoding on the fly of images. interpret the accept headers and output the file, reencoding into the new format if necessary by checking the actual format of the original image file. provide a low and high quality version of an image. re encode an image into new dimensions. width and height parameters might query string parameters. I could create versions of the file in all the formats, at upload time but the seems overkill. I would rather lazily create the rencoded file and stick it in a cache if it gets served again etc.

    Read the article

  • Indirect function call in JavaScript

    - by Art
    There are things like f.call(...) f.apply(...) But then there's this (1, alert)('Zomg what is this????!!!11') "1" does not seem to mean much in this context, the following works just fine: (null, alert)('Zomg what is this????!!!11') (1, null, alert)('Zomg what is this????!!!11') (undefined, alert)('Zomg what is this????!!!11') Could you point to a specific part of ECMAScript which describes that syntax?

    Read the article

  • How to obtain the root of a tree without parsing the entire file?

    - by Matt.
    I'm making an xml parser to parse xml reports from different tools, and each tool generates different reports with different tags. For example: Arachni generates an xml report with <arachni_report></arachni_report> as tree root tag. nmap generates an xml report with <nmaprun></nmaprun> as tree root tag. I'm trying not to parse the entire file unless it's a valid report from any of the tools I want. First thing I thought to use was ElementTree, parse the entire xml file (supposing it contains valid xml), and then check based on the tree root if the report belongs to Arachni or nmap. I'm currently using cElementTree, and as far as I know getroot() is not an option here, but my goal is to make this parser to operate with recognized files only, without parsing unnecessary files. By the way, I'm Still learning about xml parsing, thanks in advance.

    Read the article

  • wxpython: adding panel to wx.Frame disables/conflicts with wx.Frame's OnPaint?!

    - by sdaau
    Hi all, I just encountered this strange situation: I found an example, where wx.Frame's OnPaint is overridden, and a circle is drawn. Funnily, as soon as I add even a single panel to the frame, the circle is not drawn anymore - in fact, OnPaint is not called at all anymore ! Can anyone explain me if this is the expected behavior, and how to correctly handle a wx.Frame's OnPaint, if the wx.Frame has child panels ? Small code example is below.. Thanks in advance for any answers, Cheers! The code: #!/usr/bin/env python # http://www.linuxquestions.org/questions/programming-9/wxwidgets-wxpython-drawing-problems-with-onpaint-event-703946/ import wx class MainWindow(wx.Frame): def __init__(self, parent, title, size=wx.DefaultSize): wx.Frame.__init__(self, parent, wx.ID_ANY, title, wx.DefaultPosition, size) self.circles = list() self.displaceX = 30 self.displaceY = 30 circlePos = (self.displaceX, self.displaceY) self.circles.append(circlePos) ## uncommenting either only first, or both of ## the commands below, causes OnPaint *not* to be called anymore! #~ self.panel = wx.Panel(self, wx.ID_ANY) #~ self.mpanelA = wx.Panel(self.panel, -1, size=(200,50)) self.Bind(wx.EVT_PAINT, self.OnPaint) def OnPaint(self, e): print "OnPaint called" dc = wx.PaintDC(self) dc.SetPen(wx.Pen(wx.BLUE)) dc.SetBrush(wx.Brush(wx.BLUE)) # Go through the list of circles to draw all of them for circle in self.circles: dc.DrawCircle(circle[0], circle[1], 10) def main(): app = wx.App() win = MainWindow(None, "Draw delayed circles", size=(620,460)) win.Show() app.MainLoop() if __name__ == "__main__": main()

    Read the article

  • ASP.NET NamingContainer naming convention

    - by EOLeary
    The Background Hello! I'm working on a project in which the client has required a lot of things to happen on a single page, and this has resulted in a rather large blob of HTML being rendered out to the client browser. The main issue is with input tags (where runat="server" attribute is set), these tend to cause a drastic increase in markup size due to validation, updatepanel triggers, viewstate, and the control markup itself. I've done what I can to reduce the amount of triggers I'm using, I'm compressing the viewstate (to something like 8% of the original viewstate size), I've gotten rid of a lot of ASP.NET Validators and rolled my own, and and I've been using ClientIdMode to reduce the length of the ID attributes of many asp.net elements. All of these combined significantly reduces the amount of HTML being sent to the client, (for example going from 2 megabytes for a request down to 500-600 kb - these are HUGE pages, mind you). The Issue One area which I've been having trouble reducing is simply the auto-generated 'name' attribute of input elements. <input name="ctl00$ctl00$ctl00$_main$_main$_bodyMatterPhase$_phaseTree$ctl00$_taskTree$ctl00$_taskDetails$_detailList$ctrl0$_row$_descriptionText" type="text" value="Investigation Week 1" maxlength="100" id="_taskTree_0__taskDetails_0__detailList_0__row_0__descriptionText_0" style="width:170px;"> As you can see above, the name attribute is 139 out of 297 characters, that's almost 50% of the tag markup taken up by that HUGE name. Does anyone have any ideas on how to stick a hook in somewhere in ASP.NET where I can somehow translate these or generate them differently; say instead of ctl00$ctl00$ctl00$_main$_main$_bodyMatterPhase$_phaseTree$ctl00$_taskTree$ctl00$_taskDetails$_detailList$ctrl0$_row$_descriptionText, it could be a GUID like 0x0AEED4B6445A11E08F873606E0D72085, which is 105 characters shorter. Any help would be greatly appreciated!

    Read the article

  • EF Code First - Include(x => x.Properties.Entity) a 1 : Many association

    - by VulgarBinary
    Given a EF-Code First CTP5 entity layout like: public class Person { ... } which has a collection of: public class Address { ... } which has a single association of: public class Mailbox { ... } I want to do: PersonQuery.Include(x => x.Addresses).Include("Addresses.Mailbox") WITHOUT using a magic string. I want to do it using a lambda expression. I am aware what I typed above will compile and will bring back all Persons matching the search criteria with their addresses and each addresses' mailbox eager loaded, but it's in a string which irritates me. How do I do it without a string? Thanks Stack!

    Read the article

  • Ruby/RoR: calling original method via super()?

    - by fearless_fool
    In a RoR app, I want to specialize ActiveRecord's update_attributes() method in one of my models, extracting some of the attributes for special handling and passing the rest of them to the original update_attributes() method. The details: class Premise < ActiveRecord::Base ... def update_attributes(attrs) attrs.each_pair do |key, val| unless has_attribute?(key) do_special_processing(key, val) attrs.delete(key) end end # use original update_attributes() to process non-special pairs super.update_attributes(attrs) end ... end The call to super.update_attributes(attr) raises an error: undefined method `update_attributes' for true:TrueClass ... which makes me suspect I really don't understand the super keyword in Ruby. What am I missing? Specifically, how do I call the original update_attributes() method?

    Read the article

  • Flash compiler error 1061: Call to a possibly undefined method run... but run exists!

    - by Zane Geiger
    So I've been working on making a game in Processing but I think Flash would be a better way to get more people playing it, so I've decided to learn Flash. The problem is that I keep getting really stupid errors on incredibly simple things. For instance, I want to make a 'Block' object to use in a platform game. So I make a new .as file, name it Block.as, and define the Block class within it like so: package { public class Block { public function Block() { // constructor code } public function run() { } } } I don't want to add the code yet, I just want to ensure that this works. So in my main timeline code, I try to create an instance of the Block object and execute its run method: var block1:Block = new Block(); block1.run(); Every time it gives me this inane error: Scene 1, Layer 'Layer 1', Frame 1, Line 2 1061: Call to a possibly undefined method run through a reference with static type Block. What undefined method!? It's defined RIGHT THERE in Block.as. The class file is even in the same folder and everything. I'm getting REALLY annoyed at how poorly Flash handles such a ridiculously simple project. Does anyone know why Flash hates me?

    Read the article

  • Read-only lock on a SharePoint site collection, or Why can't I edit anymore?

    - by PeterBrunone
    Monday morning, the calls started.  For some reason, long-time users were unable to edit list items.  I figured we had a permissions issue, so I popped in to look at the Site Settings -- and found that I couldn't.  A quick trip to Central Administration showed that I was still listed as a Site Collection Administrator, but I had no power at all on the site collection in question.A quick glance at the logs told me that the server had recently shut down unexpectedly (this is a Hyper-V virtual machine).  Apparently, in the confusion, somehow SharePoint decided to lock the site collection as Read Only.  This can be remedied in one of two ways:1)  In Central Administration, go to Application Management->SharePoint Site Management->Site collection quotas and locks.  Once you have arrived, select the correct application and site collection, and you will have the opportunity to view and set the lock status of the collection (it most likely will be set to "Read-only", and you'll want to move that radio button to "Not locked").2)  Fire up stsadm and issue the following command:stsadm -o setsitelock -url http://myportalsitecollection -lock none

    Read the article

  • Creating an Entity Data Model using the Model First approach

    - by nikolaosk
    This is going to be the second post of a series of posts regarding Entity Framework and how we can use Entity Framework version 4.0 new features. You can read the first post here . In order to follow along you must have some knowledge of C# and know what an ORM system is and what kind of problems Entity Framework addresses.It will be handy to know how to work inside the Visual Studio 2010 IDE . I have a post regarding ASP.Net and EntityDataSource . You can read it here .I have 3 more posts on Profiling...(read more)

    Read the article

  • WIX 3.5 Unexpected Child Element iis:Certificate

    - by Wil Peck
    Came across this today when I switched from WIX 3.0 and VS 2008 to WIX 3.5 and VS 2010.  The solution ended up being pretty simple.  Just need to update the Wix Project Properties to provide an additional parameter to the compiler and linker. These can be found at Wix Installer Project Properties > Tool Settings > Additional Parameters Compiler and Wix Installer Project Properties > Tool Settings > Additional Parameters Linker.  Just make sure to add ‘-ext WixIIsExtension’ in the fields and recompile.   Technorati Tags: WIX,WIX 3.5,Help

    Read the article

  • CheckMemoryAllocationGame Sample

    - by Michael B. McLaughlin
    Many times I’ve found myself wondering how much GC memory some operation allocates. This is primarily in the context of XNA games due to the desire to avoid generating garbage and thus triggering a GC collection. Many times I’ve written simple programs to check allocations. I did it again recently. It occurred to me that many XNA developers find themselves asking this question from time to time. So I cleaned up my sample and published it on my website. Feel free to download it and put it to use. It’s rather thoroughly commented. The location where you insert the code you wish to check is in the Update method found in Game1.cs. The default that I put in is a line of code that generates a new Guid using Guid.NewGuid (which, if you’re curious, does not create any heap allocations). Read all of the comments in the Update method (at the very least) to make sure that your code is measured properly. It’s important to make sure that you meaningfully reference any thing you create after the second call to get the memory or else (in Release configuration at least) you will likely get incorrect results. Anyway, it should make sense when you read the comments and if not, feel free to post a comment here or ask me on Twitter. You can find my utilities and code samples page here: http://www.bobtacoindustries.com/developers/utils/Default.aspx To download CheckMemoryAllocationGame’s source code directly: http://www.bobtacoindustries.com/developers/utils/CheckMemoryAllocationGame.zip (If you’re looking to do this outside of the context of an XNA game, the measurement code in the Update method can easily be adapted into, e.g., a C# Windows Console application. In the past I mostly did that, actually. But I didn’t feel like adding references to all the XNA assemblies this time and… anyway, if you want you can easily convert it to a console application. If there’s any demand for it, I’ll do it myself and update this post when I get a chance.)

    Read the article

  • [EF + Oracle] Intro

    - by JTorrecilla
    Prologue I have a busy personal and working time, and at this moment that I start to get more free time, I decided to start a Serie about Entity Framework with Oracle. A few time ago, I got my first experience with EF and Oracle with Oracle 10 g express and Oracle 10 g with the same results, Doesn’t work. Now I download Oracle 11 g to Test again. Tools To start using EF with Oracle we need the following: 1. Visual Studio 2010. No Express Edition 2. Oracle 11g 3 Oracle Driver for EF (ODAC) Intro People, who are starting with EF developments, I recommend to take a look into Unai Zorrilla’s Blog, the post were written in Spanish but they are great! To this Serie, we are going to define the DB from the Oracle administrator. For that we need to follow the next steps: 1. Create a User with a PassWord. In my example the user will be Jtorrecilla 2. Create a TableSpace 3. Define some example tables   (Image1) When we have created the DB, we are going to start a new project in VS 2010. I will start a C# Project. To start with EF, we need to add a new objet to our Project “ADO .NET Entity Data Model". (Image2) The next step will be to indicate that our model will be based on an existing DB, and indicate the connection string (Images 3 and 4): (Imagen3) (Imagen4) Once we selected the connection string, we will need to indicate that in the connection will be saved “Sensitive” data (Image 5), and in the next step we are going to select the DB objets to use in the project(Image 6).   (Image 5) (Image 6) A the end of the selection, we will press Finish button, and it will generate a EDMX file to add to our solution, and in the IDE will appear the DB Schema with the selected Tables and Relations. (Imagen7) One Entity is composed by a set of properties (each matches with a column from the Table in the DB) and Navigation Properties that represents any relation with other Entities.   Finally With this chapter we have installed the environment, defined a DB and configured the solution to start using EF with Oracle. In the next chapter we are going to see What is a Entity and how it works. I hope you enjoy this Serie!

    Read the article

  • How to disable 3G USB Modem internal storage from being loaded by linux kernel?

    - by Krystian
    Hi, I've got a problem with my 3G modem [Huawei E122]. It has internal storage and kernel assigns a device [/dev/sdX] to it. Because of that, every second time my machine will not boot - kernel panic - as my usb hdd gets assigned /dev/sdb instead of /dev/sda. I cannot use LABEL nor UUID in root= kernel parameter, as it is only available when using initrd, and I can't use it - I am using Debian on my router - mips architecture machine. I have to prevent this from happening, as my router has to start everyday and I have to be sure it works ok. I don't have physical access to restart it when something goes wrong. I don't use my modem internal storage, there's no SD card inserted. However kernel detects the reader and loads it. I can not prevent loading od usb drivers since my hdd is on USB as well. I will appreciate any ideas.

    Read the article

  • ^C not working in zsh on Mac OSX

    - by Vitaly Kushner
    Ctrl-C stopped working for me at the terminal when using zsh (on mac osx). I didn't notice the exact moment that it happend so I can't be sure what caused it. I didd't update zsh in a while though. and didn't touch .zshrc (I have it at a repo http://github.com/astrails/dotzsh) If I run bash, ^C works in it. If I run any command, like cat, ^C will work to stop it too. but inside zsh it just doesn't do anything. bindkey | grep \\^C gives "^B"-"^C" self-insert zsh 4.3.10 (i386-apple-darwin10.4.3), installed though ports (zsh-devel @4.3.10_0+doc+examples+mp_completion+pcre) mac os 10.6.6

    Read the article

  • Windows xp media center, iTunes, Home sharing problem with app Remote and Apple tv2

    - by Amador
    Hello everybody, greetings from Mexico, sorry about my english but here it goes: I recently bought and apple tv 2nd generation it works just fine, i can see you tube videos but i cant see my library. My pc is conected to the same wi-fi than my apple tv. I have the latest software. I have my firewall off. I turned off and on my router. Search for iphone, ipad remotes on, sharing my library on my local network on, in itunes. Ive checked that my id was the same. On top of that the Remote app doesnt seem to work either. Please help, im kinda loosing my mind over this

    Read the article

  • How to tell if OpenGL is really working in Ubuntu 10.04

    - by Jonathan
    I have a lenovo S9e running Intel integrated graphics. Here is my lspci output related to the graphics: 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) Subsystem: Lenovo Device 3870 Flags: bus master, fast devsel, latency 0 Memory at f0580000 (32-bit, non-prefetchable) [size=512K] Capabilities: [d0] Power Management version 2 I want to know how I can make sure OpenGL support is running in full on an Ubuntu 10.04 installation. I have a few hints to think that it is not: The "Desktop Effects" will not load Apps such as stardock, when attempting to use OpenGL rendering, will display black boxes instead of transparency In the games Pioneers, the number-tile icons are suspiciously just black circles Windows games running with Wine will only support software rendering, not hardware rendering When I boot into a Knoppix LiveCD, the desktop effects do work, splendidly, meaning compiz detects my computer as capable. My problem with troubleshooting is that Canonical has basically eliminated the conf-file-based mechanism of X11 as far as I can tell, thus making it even harder to ensure graphics modules are loading properly. How do I debug and test OpenGL on m Ubuntu 10.04 installation?

    Read the article

  • What to do with a broken OS X install disc?

    - by slhck
    First things first: I don't appreciate software piracy and I really want to spend money on software that I use and that I work and make money with. I don't want this question closed just because I consider downloading software, I only want honest opinions and alternatives. Here we go: So I have my OS X Snow Leopard Upgrade DVD, but it's horribly scratched and won't boot anymore. It endlessly loads and at some point I have to force pull it out of the disc slot. How can I reset my Mac then? Can I take my original disk to an Apple Store and ask them for a replacement? Will they believe me, even if I don't have the receipt anymore? Would owning the original disk make it okay for me to look somewhere on the internet and download it? I don't even know if that will work without hassles. Could I try to read the disk to an image with some error correction methods? Maybe during boot it can't read some files, but some other program can? Is there any other way of resetting the Mac? Mine's now over 3 years old an I seem to have misplaced my original discs that had 10.4 on it. Or should I just buy a new 10.6 upgrade disk? (Which is not really what I want to do) Answers and opinions would be much appreciated.

    Read the article

  • Can't initialize drive in Windows 7

    - by Abe
    I have a 2.5" laptop harddrive that I plugged into my laptop through a SATA to USB cable. It's powered by an adapter to a normal wall-plug. I want to use it as an external harddrive. It wouldn't initialize (Device is not ready), so as suggested in some instructions I found I uninstalled the drivers, unplugged it and plugged it back in. That worked, and I initialized the drive and formatted it. However I unplugged it after that and a few days later the same strategy does not work and I can't figure out how to use the drive. I can't initialize it and it doesn't show up in my computer.

    Read the article

  • Disable or sleep secondary HDD in Macbook

    - by cpak
    I've done some quick Googling but didn't find an answer. I've put an SSD in my Macbook, and at the same time moved the original HDD to the optical drive bay. I'm running the OS and most of my daily apps off the SDD so the HDD is really just for storing stuff I need now and then. Now I'd like to disable (as in power off or "force sleep") the HDD when I don't need it. Tried unmounting the disk using diskutil unmountDisk but it kept spinning for like 10 minutes. Maybe that's to be expected, but I'd imagined it would stop instantly on unmount. Also, it would be nice to have it disabled by default, and only mount it (= power on) when I need it. Grateful for any input on this!

    Read the article

  • 10 System LAN latency with ADSL modem as gateway

    - by itsoft3g
    Recently I expanded LAN in my office from 3 to 10 computers. Structure star topology, one ADSL Modem connected to One Switch which is again connected to 10 computers. Also we have Wifi device Netgear which is connected from switch. ADSL Modem acts as the DHCP Server, all the system will have default gateway IP (ADSL Modem's IP) Network latency is now become very high, All the chat severs disconnect often like google talk, skype etc, also internet become very very slow. when all the computer turned on. We have 4 Mbps Download and 100 Kbps upload Net speed. Its look like ADSL Modem cannot able to handle all the connections. I tried to setup a system as default gateway which will connect to modem, not sure how to do this. Please advice on this.

    Read the article

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