Search Results

Search found 6346 results on 254 pages for 'turn a'.

Page 14/254 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • javascript turn single line break to double line break

    - by Eric Sim
    Hm... I'm trying to convert single line break into double line break, as in This is a sentence. This is another sentence. into This is a sentence. This is another sentence. Apparently this doesn't work ThisContent = ThisContent.replace(/(\n)/gm, "\n\n"); since it replace everything, including double line breaks. What's the regex to do this?

    Read the article

  • android: turn off screen when close to face

    - by mtmurdock
    My app allows the user to access their corporate voice mail. Normally, durring a phone call when the user holds the device up to their ear, the screen shuts off so they wont accidentally push buttons with their face. I would like to make my app do the same thing when the user is listening to their voice mail. anyone know how to do this?

    Read the article

  • How to turn this linq query to lazy loading

    - by Luke101
    I would like to make a certain select item to lazy load latter in my linq query. Here is my query var posts = from p in context.post where p.post_isdeleted == false && p.post_parentid == null select new { p.post_date, p.post_id, p.post_titleslug, p.post_votecount, FavoriteCount = context.PostVotes.Where(x => x.PostVote_postid == p.post_id).Count() //this should load latter }; I have deleted the FavoriteCount item in the select query and would like it to ba added later based on certain conditions. Here is the way I have it lazy loaded if (GetFavoriteInfo) { posts = posts.Select(x => new { FavoriteCount = context.PostVotes.Where(y => y.PostVote_postid == x.post_id).Count() }); } I am getting a syntax error with this the above query. How do I fix this

    Read the article

  • How to turn off startup text of GNU gdb in XCode

    - by willc2
    I'm new to XCode 3.1.2 and Objective-C 2.0. I've just discovered using breakpoints for logging instead of littering the code with millions of NSLog() statements. The problem is, when the debugger starts up it spews half a screen full of status and credits info into the console. Is there any way to suppress this text?

    Read the article

  • Turn off the display on remote PC

    - by concretemixer
    Hello. I'm fixing some bugs in the application for remote control (remote desktop-like) for Windows. And there is a feature that you can blank screen on remote machine - all the programms keep running unaffected, but the person who looks into the display on remote PC sees nothing but black screen. It is implemented by sending IoCtl request IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE, which is undocumented. And this request does not work on Vista and above. Are there another ways to do what I want? In fact, SendMessage(-1,WM_SOMMAND,SC_MONITORPOWER,2) does the trick, but screen turns back on if someone toches keyboard/mouse.

    Read the article

  • In Selenium, how do I turn off logging?

    - by someguy
    I am using the following method: set_browser_log_level 'off' but my log level continues to include INFOs. I am trying to suppress both logging and the "Last 4 commands" display for when my test enters a login password. http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/ruby/classes/Selenium/SeleniumDriver.html#M000128

    Read the article

  • Turn off MDI auto-cascading

    - by Serge
    Hello, I am attempting to automatically add some MDI windows: for (int i = 0; i < a.size; i++) { Form child = new Form(); child.MdiParent = this; child.Location = a.Location[i]; child.Size = a.Size[i]; child.Show(); } Now the size works fine, however the location is always cascaded at the top corner instead of the one that I have set. When I just add a new child form and set location it seems to work fine, however when I do many in a loop they all cascade.

    Read the article

  • How to turn this into valid javascript?

    - by Todd Horrtyz
    If the backslashes don't do it, then what? [...] foo: ('lorem ipsum dolor sit amet'), bar: ('lorem ipsum \(dolor\) sit amet'), [...] Here's the full code: google.load('orkut.share', '1'); google.setOnLoadCallback(function() { new google.orkut.share.Button({ title: 'foo', summary: ('foo \(bar\) foo'), thumbnail: ('...'), destination: '...'}).draw('orkut'); });

    Read the article

  • Turn database result into array

    - by Industrial
    Hi everyone, I have just made the update/add/delete part for the "Closure table" way of organizing query hierarchical data that are shown on page 70 in this slideshare: http://www.slideshare.net/billkarwin/sql-antipatterns-strike-back My database looks like this: Table Categories: ID Name 1 Top value 2 Sub value1 Table CategoryTree: child parent 1 1 2 2 2 1 However, I have a bit of an issue getting the full tree back as an multidimensional array from a single query. Here's what I would like to get back: array ( 'topvalue' = array ( 'Subvalue', 'Subvalue2', 'Subvalue3' = array ('Subvalue 1', 'Subvalue 2', 'Subvalue 3' ) ); ); Update: Found this link, but I still have a hard time to convert it into an array: http://karwin.blogspot.com/2010/03/rendering-trees-with-closure-tables.html

    Read the article

  • Cannot turn on gzip compression in JBoss 5

    - by Vladimir Bezugliy
    I added following file deployers\jbossweb.deployer\server.xml <Connector compression="force" compressionMinSize="512" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml,image/png,text/css,text/javascript"> </Connector> But fiddler shows that jboss does not compress responses. How to ensure that gzip compression in JBoss is turned on? Is it possible to check it in jmx-console?

    Read the article

  • Ruby 1.9: turn these 4 arrays into hash of key/value pairs

    - by randombits
    I have four arrays that are coming in from the client. Let's say that there is an array of names, birth dates, favorite color and location. The idea is I want a hash later where each name will have a hash with respective attributes: Example date coming from the client: [name0, name1, name2, name3] [loc0, loc1] [favcololor0, favcolor1] [bd0, bd1, bd2, bd3, bd4, bd5] Output I'd like to achieve: name0 => { location => loc0, favcolor => favcolor0, bd => bd0 } name1 => { location => loc1, favcolor => favcolor1, bd => bd1 } name2 => { location => nil, favcolor => nil, bd => bd2 } name3 => { location => nil, favcolor => nil, bd => bd3 } I want to have an array at the end of the day where I can iterate and work on each particular person hash. There need not be an equivalent number of values in each array. Meaning, names are required.. and I might receive 5 of them, but I only might receive 3 birth dates, 2 favorite colors and 1 location. Every missing value will result in a nil. How does one make that kind of data structure with Ruby 1.9?

    Read the article

  • Eclipse - Ouline View - Turn Off Filtering

    - by Ibolit
    Hi. I recently installed Eclipse on my new computer, and this installation somewhat filters the class members. I think it is somehow related to the Outline, but i couldn't find any settings related to it. The thing is that when i, for example, have an error in a method, and click on the little red square on the margin, eclipse shows me only that method, and nothing else. When i then click on the class name in the outline panel, eclipse shows me the class without import declarations. I can, of course, click on the import declarations in the outline panel, but then i get only them. When I want to jump to the declaration of some method by command-clicking that method's name, I again get only that method on the screen. It is really annoying. Can anyone please help me fix it? Best regards,Timofey.

    Read the article

  • Call from a singleton class to a function which in turn calls that class's method

    - by dare2be
    Hello, I am still looking for a way to phrase it properly (I'm not a native speaker...). So I have this class SQL which implements the singleton pattern (for obvious reasons) and I also have this function, checkUsr(), which queries the database using one of SQL's methods. Everything works fine as long as I don't call checkUsr() from within the SQL class. When I do so, the scripts just exits and a blank page is displayed - no errors are returned, no exception is thrown... What's happening? And how do I work around this problem? EDIT: class SQL { public static function singleton() { static $instance; if(!isset($instance)) $instance = new SQL; return $instance; } public function tryLoginAuthor( $login, $sha1 ) { (...) } } function checkUsr() { if (!isset($_SESSION['login']) || !isset($_SESSION['sha1'])) throw new Exception('Not logged in', 1); $SQL = SQL::singleton(); $res = $SQL->tryLoginAuthor($_SESSION['login'], $_SESSION['sha1']); if (!isset($res[0])) throw new Exception('Not logged in', 1); }

    Read the article

  • JUnit - Testing a method that in turn invokes a few more methods

    - by stratwine
    Hi, This is my doubt on what we regard as a "unit" while unit-testing. say I have a method like this, public String myBigMethod() { String resultOne = moduleOneObject.someOperation(); String resultTwo = moduleTwoObject.someOtherOperation(resultOne); return resultTwo; } ( I have unit-tests written for someOperation() and someOtherOperation() seperately ) and this myBigMethod() kinda integrates ModuleOne and ModuleTwo by using them as above, then, is the method "myBigMethod()" still considered as a "unit" ? Should I be writing a test for this "myBigMethod()" ? Say I have written a test for myBigMethod()... If testSomeOperation() fails, it would also result in testMyBigMethod() to fail... Now testMyBigMethod()'s failure might show a not-so-correct-location of the bug. One-Cause causing two tests to fail doesn't look so good to me. But donno if there's any better way...? Is there ? Thanks !

    Read the article

  • Turn based synchronization between threads

    - by Amarus
    I'm trying to find a way to synchronize multiple threads having the following conditions: * There are two types of threads: 1. A single "cyclic" thread executing an infinite loop to do cyclic calculations 2. Multiple short-lived threads not started by the main thread * The cyclic thread has a sleep duration between each cycle/loop iteration * The other threads are allowed execute during the inter-cycle sleep of the cyclic thread: - Any other thread that attempts to execute during an active cycle should be blocked - The cyclic thread will wait until all other threads that are already executing to be finished Here's a basic example of what I was thinking of doing: // Somewhere in the code: ManualResetEvent manualResetEvent = new ManualResetEvent(true); // Allow Externally call CountdownEvent countdownEvent = new CountdownEvent(1); // Can't AddCount a CountdownEvent with CurrentCount = 0 void ExternallyCalled() { manualResetEvent.WaitOne(); // Wait until CyclicCalculations is having its beauty sleep countdownEvent.AddCount(); // Notify CyclicCalculations that it should wait for this method call to finish before starting the next cycle Thread.Sleep(1000); // TODO: Replace with actual method logic countdownEvent.Signal(); // Notify CyclicCalculations that this call is finished } void CyclicCalculations() { while (!stopCyclicCalculations) { manualResetEvent.Reset(); // Block all incoming calls to ExternallyCalled from this point forward countdownEvent.Signal(); // Dirty workaround for the issue with AddCount and CurrentCount = 0 countdownEvent.Wait(); // Wait until all of the already executing calls to ExternallyCalled are finished countdownEvent.Reset(); // Reset the CountdownEvent for next cycle. Thread.Sleep(2000); // TODO: Replace with actual method logic manualResetEvent.Set(); // Unblock all threads executing ExternallyCalled Thread.Sleep(1000); // Inter-cycles delay } } Obviously, this doesn't work. There's no guarantee that there won't be any threads executing ExternallyCalled that are in between manualResetEvent.WaitOne(); and countdownEvent.AddCount(); at the time the main thread gets released by the CountdownEvent. I can't figure out a simple way of doing what I'm after, and almost everything that I've found after a lengthy search is related to producer/consumer synchronization which I can't apply here.

    Read the article

  • PHP turn off errors - in one file only

    - by Industrial
    Hi! I am well aware about error_reporting(0); & ini_set('display_errors', "Off"); to make error messages go away. What would be an appropriate way to do this - for a specific file or part of code only? Surpressing errors with @'s seems like a bad idea since it apparently slows the code down... Thanks!

    Read the article

  • spaces or %20 in links turn into + signs when page is sent as an email

    - by Obay
    I am creating a web app that accepts input of news items (title, article, url). It has a page news.php which creates a summary of all news items inputted for specified dates, like so: News 4/25/2010 Title 1 [URL 1] Article 1 Title 2 [URL 2] Article 2 and so on... I have two other pages, namely preview.php and send.php , both of which call news.php through a file_get_contents() call. Everything works fine except when the URL contains spaces. During Preview, the urls get opened (FF: spaces are spaces, Chrome: spaces are %20). However, during Send, when received as emails, the urls don't get opened, because the spaces are converted into + signs. For example: 1. Preview in FF: http://www.example.com/this is the link.html 2. Preview in Chrome: http://www.example.com/this%20is%20the%20link.html 3. Viewed as email in both browsers: http://www.example.com/this+is+the+link.html Only #3 doesn't work (link doesn't get opened). Why are the spaces in the urls correct (spaces or %20) when previewed, but incorrect (+) when received in the emails, when in fact, the same page is generated by the same news.php? Any help appreciated :)

    Read the article

  • How can I turn off calculated columns in an Excel table from a macro using VBA?

    - by user41293
    I am working on a macro that inserts formulas into a cell in an Excel table. The Excel table does the automatic filling of columns and fills all the cells in that column with the formula, but all I want is one cell to have the formula. I cannot just turn off automatic formula for tables as I need to have other people use this worksheet on their systems. Is there a way to turn off the automatic filling of formulas in a table using VBA in a macro? It just needs to be temporary: I just want to turn it off, put in my formulas, then turn it back on.

    Read the article

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