Search Results

Search found 1066 results on 43 pages for 'silly dg'.

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

  • Is it safe to put reference to current user in User model in Rails?

    - by Art Shayderov
    You know, I think I have to check current user in the model callbacks (like before_update). Rather than rely solely on adding where ('something.user_id = ?', 'current_user.id') in the controllers. I need something like Thread.CurrentPrincipal in .NET Is it safe to put reference to current user in User model? I'm sorry I don't really understand how it works under the hood yet. Or how you do it The Rails way? Sorry if this a silly question.

    Read the article

  • Mapping over sequence with a constant

    - by Hendekagon
    If I need to provide a constant value to a function which I am mapping to the items of a sequence, is there a better way than what I'm doing at present: (map my-function my-sequence (cycle [my-constant-value])) where my-constant-value is a constant in the sense that it's going to be the same for the mappings over my-sequence, although it may be itself a result of some function further out. I get the feeling that later I'll look at what I'm asking here and think it's a silly question because if I structured my code differently it wouldn't be a problem, but well there it is!

    Read the article

  • LINQ entity query performance

    - by Abdel Olakara
    Hi all, I have a silly question. I would like to know if there is performance deference in these two quries: var cObject = from cust in entities.Customer where cust.id == cid select cust; and var cObject = entities.Customer.First( c=> c.id == cid); My query return only one record as I am querying with the primary key. But do they make any difference?

    Read the article

  • Eclipse: view a document using custom spacing, save using the file's spacing

    - by Steven Sproat
    I have a silly use case for eclipse: At work, they use 2 spaces for a tab character. Indentation looks really squashed and I'm finding it obstructs readability. Now, I can't set Eclipse to use 4 spaces for a tab as it'll edit any files I change, and obviously don't want to violate the coding standards. So, can I have a custom view onto my document, with saving maintaining the original spacing? Cheers

    Read the article

  • How to encrypt information in aspx page?

    - by Jimmyc
    Hi all, I know it's a silly question but , My client asked for encrypting some information form their payment system to prevent user stealing personal information. The system is web-base and written by ASP.NET We have tried some annoying solution such as JavaScript no right-click or css-no-print but apparently my client didn't like it. so are there any commercial solution to encrypt information in aspx produced html pages? or someone can tell me how to pursuit my client to stop these "prevent stealing" idea in a web-base system?

    Read the article

  • Changing image "source" dynamically in runtime

    - by ignatius
    Hello, i am trying to modify during runtime an image in my application, this image is located inside assets folder, so thats why i dissable -use-network=false flag, then i call something like this: img.source="../assets/pict.png"; but it's not working. i know its a silly question but i am stuck here. any hint i appreciate. Br

    Read the article

  • Change size of ImageIcon in a JRadioButton

    - by Frederik Wordenskjold
    I simply want to change the size (diameter) of the actual (default) ImageIcon of my JRadioButton. I've changed the size of the font displayed in the widget, so it really looks silly with such a large radiobutton. JRadioButton button = new JRadioButton("Button"); button.setFont(new Font("Lucida Grande",Font.PLAIN, 11)); gives me this giant button: Do I really have to create my own ImageIcon? Or can I somehow scale the default one, without too much of a hassle?

    Read the article

  • Instantiate dynamic array Magento

    - by Tegan Snyder
    Kick me if I'm being silly but some some reason I'm having a heck of time building a dynamic array in magento. Example: $data = array(); $data[0] = 'test'; $data[1] = 'what'; I keep getting an ERROR: Notice: Undefined offset: 0 Any ideas? Do I need to handle these arrays differently since they are in a class?

    Read the article

  • @Override fix-code shortcut in NetBeans

    - by Bruce
    Hi guys, sorry for a silly question but I got angry after seeking the answer in NetBeans and in the net - is there any key shortcut for fixing @Override annotation in NetBeans (something like ctrl+shift+i for imports)? I do appreciate your answers, cheers.

    Read the article

  • how can multiple trailing slashes can be removed from an url in Ruby

    - by splintercell
    Hello, What i'm trying to achieve here is lets say we have two example urls: url1 "http://emy.dod.com/kaskaa/dkaiad/amaa//////////" & url2 = "http://www.example.com/". How can I extract the striped down urls? url1 : "http://emy.dod.com/kaskaa/dkaiad/amaa" & url2 to "http://http://www.example.com"? URI.parse in ruby sanitizes certain type of malformed url but is ineffective in this case. If we use regex then /^(.*)\/$/ removes a single slash (/) from url1 & is ineffective for url2. Is anybody aware of how to handle this type of url parsing? The point here is I dont want my system to have "http://www.example.com/" & "http://www.example.com" being treated as two different urls. And same goes for "http://emy.dod.com/kaskaa/dkaiad/amaa////" & "http://emy.dod.com/kaskaa/dkaiad/amaa/" cheers, -dg

    Read the article

  • How to process signals in a Qt subclass?

    - by Jen
    How do I process a signal of in a subclass? Let's say my subclass is derived from QTextEdit and is interested in the signal textChanged. It seems silly to connect an object to itself, I should be able to simply override the textChange method -- but it isn't virtual. What is the accepted way to do this?

    Read the article

  • WinForm and WPF Form rendering

    - by Sathish
    Hi, Pardon me, if it is a silly question. Can you anyone tell me how the WinForms are rendered (the background mechanism) Also how is WPF Form are rendered. In simple, i want to know the rendering mechanism of WinForms and WPF Forms.

    Read the article

  • Where to get pure C++ Lame MP3 encoder - PCM to MP3 example?

    - by Ole Jak
    So all I need is a simple function that sets it up (eating incoming PCM RATE (for example: rate near to 44100) It's channels (for example: 2) and -bits (for example: 16) and desirable 128 kb\s rate) and another one that takes PCM data and encodes it into pure MP3 frames. I know it looks like a silly homework task but I assure you - it is not. I hope it will be of help to all C++ developers starting with MP3s. So can anybody please help me with that?

    Read the article

  • Keep background image fixed during scroll using css

    - by Jean
    Hello, This is going to be rather silly of me asking, but how do I keep the background image fixed during a page scroll. I have this css code, and the image is a background of the body and not ** body{ background-position:center; background-image:url(../images/images5.jpg); } Thanks Jean

    Read the article

  • dotted stroke in <canvas>

    - by Sam
    I guess it is not possible to set stroke property such as CSS which is quite easy. With CSS we have dashed, dotted, solid but on canvas when drawing lines/or strokes this doesn't seem to be an option. How have you implemented this? I've seen some examples but they are really long for such a silly function. For example: http://groups.google.com/group/javascript-information-visualization-toolkit/browse_thread/thread/22000c0d0a1c54f9?pli=1

    Read the article

  • Should I consider memmove() O(n) or O(1) ?

    - by Andrei Ciobanu
    Hello, this may be a silly question, but I want to calculate the complexity of one of my algorithms, and I am not sure what complexity to consider for the memmove() function. Can you please help / explain ? void * memmove ( void * destination, const void * source, size_t num ); So is the complexity O(num) or O(1). I suppose it's O(num), but I am not sure as I lack for now the understanding of what's going on under the hood.

    Read the article

  • iPhone SDK in C++?

    - by seed
    This might be a really silly question, but is the iPhone SDK available in C++? Since I heard C++ is an officially supported language, is their any SDK avaliable for it?

    Read the article

  • General Question about MD5

    - by chicane
    So im just playing around with PHP and the MD5 functionality, sorry if this sounds really silly, but I cant seem to understand, how is it possible to represent an unlimited number of characters of input into a 32 bit character output? Is my logic sound here? Or is there a limit to the input that a MD5 function can take? Thanks...

    Read the article

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