Daily Archives

Articles indexed Tuesday March 16 2010

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

  • How to force laptop mode on/off

    - by Vi
    root@vi-notebook:/home/vi# laptop_mode start force Laptop mode enabled, not active How to start laptop mode? It starts successfully when AC adapter is removed, but not by explicit command. The system is GNU/Linux Debian i386 squeeze (not up to date), 2.6.30-zen2-31270-gc7099db-dirty, Acer Extensa 5220. Update: Changed to ENABLE_LAPTOP_MODE_ON_AC=1 in /etc/laptop_mode/laptop-mode.conf, now it is turned on always. But I can't turn it off with laptop_mode stop force, it stays turned on anyway. How do I turn it off again?

    Read the article

  • Hyphen and &nbsp; differences between Firefox and other browsers

    - by cbp
    Firefox and seems to render a hyphen followed by   differently to other browsers. Here is some test code that demonstrates the problem: <html> <body> <div style="border: 1px solid blue;width: 50px"> This text can break. Do&nbsp;not&nbsp;-&nbsp;break&nbsp;this&nbsp;text. </div> </body> </html> Notice how in Firefox the second sentence does not break, but in Chrome and IE it breaks at the hyphen. Does anyone know a good workaround so that the break does not occur?

    Read the article

  • Suggestions for debugging print stylesheets?

    - by Jim Puls
    I've recently been working on a print stylesheet for a website, and I realized that I was at a loss for effective ways to tweak it. It's one thing to have a reload cycle for working on the on-screen layout: change code command-tab reload but that whole process gets much more arduous when you're trying to print: change code command-tab reload print squint at print-preview image open PDF in Preview for further inspection Are there tools I'm missing out on here? Does WebKit's inspector have a "pretend this is paged media" checkbox? Is there some magic that Firebug (shudder) can do?

    Read the article

  • Formatting numbers by tokens with php

    - by Adam D
    I'm looking for a way to format numbers using "tokens". This needs to be conditional (for the first few leading characters). Example: <?php $styles=array('04## ### ###','0# #### ####','13# ###','1800 ### ###'); format_number(0412345678); /*should return '0412 345 678'*/ format_number(0812345678); /*should return '08 1234 5678'*/ format_number(133622); /*should return '133 622'*/ format_number(1800123456); /*should return '1800 123 456'*/ ?> Incase you haven't guessed, my use of this is to format Australian phone numbers, dependent on their 'type'. I have a PHP function that does this, but it is ~114 lines and contains a lot of repeated code. Can anyone help?

    Read the article

  • Calculating the maximum distance between elements of vector in Matlab

    - by lhahne
    Lets assume that we have a vector like x = -1:0.05:1; ids = randperm(length(x)); x = x(ids(1:20)); I would like to calculate the maximum distance between the elements of x in some idiomatic way. It would be easy to just iterate over all possible combinations of x's elements but I feel like there could be a way to do it with Matlab's built-in functions in some crazy but idiomatic way. Any ideas?

    Read the article

  • What kind of window can be docked in Win7?

    - by CuiPengFei
    I have been developing a toy editor, and I want my editor to look like the VS2010 text editor which can be dragged out of the main window to become a independent window and the dragged-out window can be maximized when it's dragged to the top of the screen, and can be docked by being dragged to the left or right side of the screen(which is a new feature in Win7). So I tried to use AvalonDock(a codeplex project) to do that.But I found the dragged-out DocumentContent(a class in AvalonDock,it inherits from ContentControl) is not treated like a real window in Win7. So I wanna know that What kind of window can be docked by being dragged to the left/right side or the top of the screen in Win7? Thanks!!

    Read the article

  • How to open call out MKAnnotationView programmatically? (iPhone, MapKit)

    - by StijnSpijker
    I want to open up the callout for an MKPinAnnotationView programmatically. Eg I drop 10 pins on the map, and want to open up the one closest to me. How would I go about doing this? Apple has specified the 'selected' parameter for MKAnnotationView's, but discourages setting it directly (this doesn't work, tried it). For the rest MKAnnotationView only has a setHighlighted (same story), and canShowCallout method.. Any hints if this is possible at all?

    Read the article

  • What Use are Threads Outside of Parallel Problems on MultiCore Systesm?

    - by Robert S. Barnes
    Threads make the design, implementation and debugging of a program significantly more difficult. Yet many people seem to think that every task in a program that can be threaded should be threaded, even on a single core system. I can understand threading something like an MPEG2 decoder that's going to run on a multicore cpu ( which I've done ), but what can justify the significant development costs threading entails when you're talking about a single core system or even a multicore system if your task doesn't gain significant performance from a parallel implementation? Or more succinctly, what kinds of non-performance related problems justify threading? Edit Well I just ran across one instance that's not CPU limited but threads make a big difference: TCP, HTTP and the Multi-Threading Sweet Spot Multiple threads are pretty useful when trying to max out your bandwidth to another peer over a high latency network connection. Non-blocking I/O would use significantly less local CPU resources, but would be much more difficult to design and implement.

    Read the article

  • SoundManager2 has irregular latency

    - by Stefan Monov
    I'm playing some notes at regular intervals. Each one is delayed by a random number of milliseconds, creating a jarring irregular effect. How do I fix it? Note: I'm OK with some latency, just as long as it's consistent. Answers of the type "implement your own small SoundManager2 replacement, optimized for timing-sensitive playback" are OK, if you know how to do that :) but I'm trying to avoid rewriting my whole app in flash for now. For an example of app with zero audible latency see the flash-based ToneMatrix. Testcase (see it here live or get it in an zip): <head> <title></title> <script type="text/javascript" src="http://www.schillmania.com/projects/soundmanager2/script/soundmanager2.js"> </script> <script type="text/javascript"> soundManager.url = '.' soundManager.flashVersion = 9 soundManager.useHighPerformance = true soundManager.useFastPolling = true soundManager.autoLoad = true function recur(func, delay) { window.setTimeout(function() { recur(func, delay); func(); }, delay) } soundManager.onload = function() { var sound = soundManager.createSound("test", "test.mp3") recur(function() { sound.play() }, 300) } </script> </head> <body> </body> </html>

    Read the article

  • JTable horizontal scrollbar in Java

    - by Mr CooL
    Is there any way to enable horizontal scrollbar whenever necessary?? The situation was as such: I've a JTable on Netbeans, one of the cells, stored a long length of data. Hence, I need to have horizontal scrollbar. Anyone has idea on this? THanks in advance for any helps..

    Read the article

  • How can I receive CameraActivities result in a DIFFERENT Activity (i.e. not in the launching one)?

    - by steff
    Hi, I hope the title says it all: I've got Activity A which fires up the Camera intent via: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, REQUEST_CAMERA); After the picture is taken I can easily grab the picture in: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) But I'd like to receive the result in Activity B in which the image can be edited. Right now I'm receiving the result in Activity A and pass it over to Activity B which results in showing the GUI of Activity A for a short while: Intent i = new Intent().setAction("DisplayJPEG"); i.setClass(this, EditImageActivity.class); i.putExtra("IMAGE_URI", uri); startActivityForResult(i, REQUEST_EDIT_IMAGE); Of course, I will need the result from Activity B in Activity A after the image has been edited. But that should work with: setResult(resultCode, data); So there has to be a way to do what I need. Please point me into the right direction. Thanks in advance, steff

    Read the article

  • tcpdump on dd-wrt router

    - by Senica Gonzalez
    I'm trying to capture packets from two devices on my network. I have tcpdump installed on my dd-wrt router and working correctly. However, the only packets I capture are broadcast packets when using a tcpdump statement that states only those two devices ./tcpdump -w /tmp/capture.pcap dst 192.168.3.105 or src 192.168.3.105 or dst 192.168.3.136 or src 192.168.3.136 I'm capturing on intefface br0. Is that correct? Both devices are plugged in directly to the ports 1 and 2 with ip addresses 192.168.3.105 and 192.168.3.136 respectively. Do I need to set br0 in promiscuous mode? A little stuck. Thanks.

    Read the article

  • ASP.NET MVC RememberMe(It's large, please don't quit reading. Have explained the problem in detail a

    - by nccsbim071
    After searching a lot i did not get any answers and finally i had to get back to you. Below i am explaining my problem in detail. It's too long, so please don't quit reading. I have explained my problem in simple language. I have been developing an asp.net mvc project. I am using standard ASP.NET roles and membership. Everything is working fine but the remember me functionality doesn't work at all. I am listing all the details of work. Hope you guys can help me out solve this problem. I simply need this: I need user to login to web application. During login they can either login with remember me or without it. If user logs in with remember me, i want browser to remember them for long time, let's say atleast one year or considerably long time. The way they do it in www.dotnetspider.com,www.codeproject.com,www.daniweb.com and many other sites. If user logs in without remember me, then browser should allow access to website for some 20 -30 minutes and after that their session should expire. Their session should also expire when user logs in and shuts down the browser without logging out. Note: I have succesfully implemented above functionality without using standard asp.net roles and membership by creating my own talbes for user and authenticating against my database table, setting cookie and sessions in my other projects. But for this project we starting from the beginning used standard asp.net roles and membership. We thought it will work and after everything was build at the time of testing it just didn't work. and now we cannot replace the existing functionality with standard asp.net roles and membership with my own custom user tables and all the stuff, you understand what i am taling about. Either there is some kind of bug with standard asp.net roles and membership functionality or i have the whole concept of standard asp.net roles and membership wrong. i have stated what i want above. I think it's very simple and reasonable. What i did Login form with username,password and remember me field. My setting in web.config: <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880"/> </authentication> in My controller action, i have this: FormsAuth.SignIn(userName, rememberMe); public void SignIn(string userName, bool createPersistentCookie) { FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); } Now the problems are following: I have already stated in above section "I simply need this". user can successfully log in to the system. Their session exists for as much minutes as specified in timeout value in web.config. I have also given a sample of my web.config. In my samplem if i set the timeout to 5 minutes,then user session expires after 5 minutes, that's ok. But if user closes the browser and reopen the browser, user can still enter the website without loggin in untill time specified in "timeout" has not passed out. The sliding expiration for timeout value is also working fine. Now if user logs in to the system with remember me checked, user session still expires after 5 minutes. This is not good behaviour, is it?. I mean to say that if user logs in to the system with remember me checked he should be remembered for a long time untill he doesn't logs out of the system or user doesn't manually deletes all the cookies from the browser. If user logs in to the system without remember me checked his session should expire after the timeout period values specified in web.config and also if users closes the browser. The problem is that if user closes the browser and reopens it he can still enter the website without logging in. I search internet a lot on this topic, but i could not get the solution. In the blog post(http://weblogs.asp.net/scottgu/archive/2005/11/08/430011.aspx) made by Scott Gu on exactly the same topic. The users are complaining about the same thing in their comments ut there is no easy solution given in by Mr. Scott. I read it at following places: http://weblogs.asp.net/scottgu/archive/2005/11/08/430011.aspx http://geekswithblogs.net/vivek/archive/2006/09/14/91191.aspx I guess this is a problem of lot's of users. As seem from blog post made by Mr. Scott Gu. Your help will be really appreciated. Thanks in advance.

    Read the article

  • Mass-mailing without getting your domain banned

    - by Arpit
    I plan on sending an email to 10k+ email addresses (mostly gmail and yahoo) to announce the launch of my startup's product. I'm planning on using PHPMailer or PHPList to send out the mails. I've never mass-mailed before and had a few basic questions. I've already browsed through some of the other mass-mail threads on this forum but the questions remain hence a new thread. Are newsletters which are sent by so many other organizations sent out in a similar manner - using programs such as PHPMailer or PHPList? When would a GMail or a Yahoo blacklist my domain name - are there any set parameters - 1000 emails in an hour would result in getting banned or some such parameters? If yes, then what sort of settings should I take note of when sending the emails - any format of the email or spread out the 10+ emails over 2 days etc.? If a Gmail or a Yahoo blacklists your domain name - is there any way to get out of the blacklist?

    Read the article

  • Uncompress OpenOffice files for better storage in version control

    - by Craig McQueen
    I've heard discussion about how OpenOffice (ODF) files are compressed zip files of XML and other data. So making a tiny change to the file can potentially totally change the data, so delta compression doesn't work well in version control systems. I've done basic testing on an OpenOffice file, unzipping it and then rezipping it with zero compression. I used the Linux zip utility for my testing. OpenOffice will still happily open it. So I'm wondering if it's worth developing a small utility to run on ODF files each time just before I commit to version control. Any thoughts on this idea? Possible better alternatives? Secondly, what would be a good and robust way to implement this little utility? Bash shell that calls zip (probably Linux only)? Python? Any gotchas you can think of? Obviously I don't want to accidentally mangle a file, and there are several ways that could happen. Possible gotchas I can think of: Insufficient disk space Some other permissions issue that prevents writing the file or temporary files ODF document is encrypted (probably should just leave these alone; the encryption probably also causes large file changes and thus prevents efficient delta compression)

    Read the article

  • Is it a good design to return value by parameter?

    - by aztack
    bool is_something_ok(int param,SomeStruct* p) { bool is_ok = false; // check if is_ok if(is_ok) // set p to some valid value else // set p to NULL return is_ok; } this function return true and set p to a valid value if "something is ok" otherwise return false and set p to NULL Is that a good or bad design? personally, i feel uncomfortable when i use it. If there is no document and comment, i really don know how to use it. BTW:Is there some authoritative book/article about API design?

    Read the article

  • How to fire an event in the code behind when a div's visibility changed?

    - by Vibin Jith
    As part of my web project ,I have designed a div tag like a window form as Shown in the figure.I just want to fill details in the textbox when the user clicks the edit label.The div is Invisible at first time. when the user clicks on edit label ,the form-div get fadein(visible). During this time an event should fired in the code behind. But I am not getting any events in the code behind like visisbility changed or some thing like that. Where can i get this event. Simply i want to display appropriate company name in the textbox in the div , when the user clicks the edit label in each row.

    Read the article

  • DebuggerDisplay attribute does not work as expected!

    - by mark
    Dear ladies and sirs. I know that this attribute should work in C# and yet, in my case it does not. I have a class with a lazy property Children. Accessing this property may have a side effect of roundtripping to the server. So, naturally, I do not want this to happen when I just watch it in the debugger watch window. Omitting all the irrelevant details the source looks pretty ordinary: [DebuggerDisplay("(Frozen) {m_children}")] public IList<IEntityBase> Children { get { if (m_children == null) { m_children = FetchChildrenFromDB(this); } return m_children; } } And yet, when I watch the object and expand this in the watch window I do not see (Frozen) in the display, meaning the debugger simply ignores the attribute. Provided the image link is still valid it should be visible below: http://i28.tinypic.com/2zxo9s5.jpg The attribute is really there, according to Reflector. I use VS2008. Any ideas?

    Read the article

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