Search Results

Search found 3195 results on 128 pages for 'tip and tricks'.

Page 42/128 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Language Tricks to Shorten My Java Code?

    - by yar
    I am currently rediscovering Java (working with Ruby a lot recently), and I love the compilation-time checking of everything. It makes refactoring so easy. However, I miss playing fast-and-loose with types to do an each loop. This is my worst code. Is this as short as it can be? I have a collection called looperTracks, which has instances that implement Looper. I don't want to modify that collection, but I want to iterate through its members PLUS the this (which also implements Looper). List<Looper> allLoopers = new ArrayList<Looper>(looperTracks.length + 1); for (LooperTrack track : looperTracks) { allLoopers.add(track); } allLoopers.add(this); for (Looper looper : allLoopers) { // Finally! I have a looper I'm particularly concerned about any features that are new to Java from 1.5 on that I may have missed. For this question I am not asking about JRuby nor Groovy, though I know that they would work for this. Edit: Sorry (too much Ruby!)... looperTracks is of type LooperTrack[] and LooperTrack implements Looper.

    Read the article

  • Performance Tricks for C# Logging

    - by Charles
    I am looking into C# logging and I do not want my log messages to spend any time processing if the message is below the logging threshold. The best I can see log4net does is a threshold check AFTER evaluating the log parameters. Example: _logger.Debug( "My complicated log message " + thisFunctionTakesALongTime() + " will take a long time" ) Even if the threshold is above Debug, thisFunctionTakesALongTime will still be evaluated. In log4net you are supposed to use _logger.isDebugEnabled so you end up with if( _logger.isDebugEnabled ) _logger.Debug( "Much faster" ) I want to know if there is a better solution for .net logging that does not involve a check each time I want to log. In C++ I am allowed to do LOG_DEBUG( "My complicated log message " + thisFunctionTakesALongTime() + " will take no time" ) since my LOG_DEBUG macro does the log level check itself. This frees me to have a 1 line log message throughout my app which I greatly prefer. Anyone know of a way to replicate this behavior in C#?

    Read the article

  • .Net4 ConcurrentDictionary: Tips & Tricks

    - by SDReyes
    Hi guys, I started to use the new ConcurrentDictionary from .Net4 yesterday to implement a simple caching for a threading project. But I'm wondering what I have to take care of/be careful about when using it? What have been your experiences using it?

    Read the article

  • What is your favourite Windbg tip/trick?

    - by user15071
    I have come to realize that Windbg is a very powerful debugger for the Windows platform & I learn something new about it once in a while. Can fellow Windbg users share some of their mad skills? ps: I am not looking for a nifty command, those can be found in the documentation. How about sharing tips on doing something that one couldn't otherwise imagine could be done with windbg? e.g. Some way to generate statistics about memory allocations when a process is run under windbg.

    Read the article

  • wonder about some #define tricks

    - by kingkai
    Whlie reading codes of my group project, I come across many DEFINEs, and some of them seems strange. To generalize it, please look at the following 2 examples. Example 1: #define SNPRINTF(dst, fmt, arg...) snprintf(dst, sizeof(dst), fmt, ##arg) what does "##" means in this circumstance? I've tried to delete both of them, and write codes like "char buf[1024]; SNPRINTF(buf,"%s,%s","abcd","efg");" which produced the same result. So "##" seems no use and no harm to me. Example 2: #define CLOSE(fd) do { \ if (-1 != (fd)) { \ close(fd); \ (fd) = -1; \ } \ } while (0) Necessary to stuff the inner code to the do{}while(0) statement? what's the use? Thanks!

    Read the article

  • Combo box items tool tip not displayed

    - by SriniWeb
    Hello, I have written a combo box populated with items in ExtJs framework. I could not able to get the tooltips when the user hovers over the items. Below is the code: $formPanel .= " new Ext.form.ComboBox({ tpl:'<tpl for =\".\"><div ext:qtip=\"{abbr}\" class=\"x-combo-list-item\">{state}</div></tpl>', id:'type_blackout_weekly', store: sstore, displayField:'state', typeAhead: true, mode: 'local', triggerAction: 'all', emptyText:'Select a state...', selectOnFocus:true, forceSelection: true, width:135 }),"; var statedata = [ ['AL', 'Alabama'], ['AK', 'Alaska'], ['AZ', 'Arizona'], ['WV', 'West Virginia'], ['WI', 'Wisconsin'], ['WY', 'Wyoming'] ]; var sstore = new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : statedata }); Any guidance is highly appreciated.

    Read the article

  • Php string handling tricks

    - by Dam
    Hi my question Need to get the 10 word before and 10 words after for the given text . i mean need to start the 10 words before the keyword and end with 10 word after the key word. Given text : "Twenty-three" The main trick : content having some html tags etc .. tags need to keep that tag with this content only . need to display the words from 10before - 10after content is bellow : removed Thank you

    Read the article

  • Help with link tricks

    - by Colre
    I have a php script that accepts one single query: ie., name=micheal. For now I query it over the net like so: www.mydomain.net/mysript.php?name=micheal. But I do want to query it like this: www.mydomain.net/micheal. Unfortunately, I do not know how to do that. Would you please help me out?

    Read the article

  • Lining up the text in a tool tip, with the text in a combobox

    - by Steve P
    I see a lot of programs where if the text doesn't fit inside the bounds of the control, you can put your mouse over the control and the tooltip text will show you the full unclipped text, and also the tooltip text lines up completly with the text in the control. I'm trying to do that with a combobox in VB 2005 (.net version 2.0). In the tooltip draw event I've tried setting the tooltip location to the location of the AssociatedControl.DisplayRectangle, and the AssociatedControl.ClientRectangle. Each of these seem to put the tooltip text in the top left corner of the combobox, just slightly offset from the text in the combobox. Is there some type of padding I need to account for? or what's going on here?

    Read the article

  • CSS - image overflow tricks

    - by rnk
    I'm stucking with some design techniques where I want to make image item box like this Where the actual image can be upto maximum height of 300px and width of 225px. The width and height of the item box including the image and the text is 190px x 190px I'm using this image http://farm8.staticflickr.com/7122/7424355198_72620895bd_m.jpg I tried using overflow: hidden for the image item to hide it's height below to show the image text. But I'm getting only like this http://jsfiddle.net/Dkh4q/ Could anyone tell the mistake I've done? Thanks! UPDATE For more information about the expected result, if you can login to zerply, then please check this http://zerply.com/christievdc/portfolio for example.

    Read the article

  • Actionscript3 button tip

    - by Mango
    Please, someone could help me? I need to send the parameter ad_mc by the command: ad_btn.addEventListener (MouseEvent.MOUSE_MOVE, MouseOver); to use the same function for all buttons function MouseOver(evt:MouseEvent):void{ ad_mc.gotoAndPlay("on"); } function MouseOut(evt:MouseEvent):void{ ad_mc.gotoAndPlay("off"); } ad_btn.addEventListener(MouseEvent.MOUSE_OUT, MouseOut); ad_btn.addEventListener(MouseEvent.MOUSE_OVER, MouseOver); If I wanted to send the parameter ad_btn I would use: MovieClip (evt.target). GotoAndPlay ("on"); but is not the case

    Read the article

  • Mercurial commit only tip

    - by kiw
    In my setup I have a central Hg repo to which I'm pushing my local changes. Say in my local clone I have a series of local commits and then I want to push the changes to the central repo. How can I push only the final state without including all of the "small" local commits that I made? I want this because sometimes I dont want to pollute the central repo's history with all of the small local commits that I made.

    Read the article

  • Uninstalling Reporting Server 2008 on Windows Server 2008

    - by Piotr Rodak
    Ha. I had quite disputable pleasure of installing and reinstalling and reinstalling and reinstalling – I think about 5 times before it worked – Reporting Server 2008 on Windows Server with the same year number in name. During my struggle I came across an error which seems to be not quite unfamiliar to some more unfortunate developers and admins who happen to uninstall SSRS 2008 from the server. I had the SSRS 2008 installed as named instance, SQL2008. I wanted to uninstall the server and install it to default instance. And this is when it bit me – not the first time and not the last that day . The setup complained that it couldn’t access a DLL: Error message: TITLE: Microsoft SQL Server 2008 Setup ------------------------------ The following error has occurred: Access to the path 'C:\Windows\SysWOW64\perf-ReportServer$SQL2008-rsctr.dll' is denied. For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.0.1600.22&EvtType=0x60797DC7%25400x84E8D3C0 ------------------------------ BUTTONS: OK This is a screenshot that shows the above error: This issue seems to have a bit of literature dedicated to it and even seemingly a KB article http://support.microsoft.com/kb/956173 and a similar Connect item: http://connect.microsoft.com/SQLServer/feedback/details/363653/error-messages-when-upgrading-from-sql-2008-rc0-to-rtm The article describes issue as following: When you try to uninstall Microsoft SQL Server 2008 Reporting Services from the server, you may receive the following error message: An error has occurred: Access to the path 'Drive_Letter:\WINDOWS\system32\perf-ReportServer-rsctr.dll' is denied. Note Drive_Letter refers to the disc drive into which the SQL Server installation media is inserted. In my case, the Note was not true; the error pointed to a dll that was located in Windows folder on C:\, not where the installation media were. Despite this difference I tried to identify any processes that might be keeping lock on the dll. I downloaded Sysinternals process explorer and ran it to find any processes I could stop. Unfortunately, there was no such process. I tried to rerun the installation, but it failed at the same step. Eventually I decided to remove the dll before the setup was executed. I changed name of the dll to be able to restore it in case of some issues. Interestingly, Windows let me do it, which means that indeed, it was not locked by any process. I ran the setup and this time it uninstalled the instance without any problems:   To summarize my experience I should say – be very careful, don’t leave any leftovers after uninstallation – remove/rename any folders that are left after setup has finished. For some reason, setup doesn’t remove folders and certain files. Installation on Windows Server 2008 requires more attention than on Windows 2003 because of the changed security model, some actions can be executed only by administrator in elevated execution mode. In general, you have to get used to UAC and a bit different experience than with Windows Server 2003. Technorati Tags: SQL Server 2008,Windows Server 2008,SRS,Reporting Services

    Read the article

  • SSIS - Access Denied with UNC paths - The file name is a device or contains invalid characters

    - by simonsabin
    I spent another day tearing my hair out yesterday trying to resolve an issue with SSIS packages runnning in SQLAgent (not got much left at the moment, maybe I should contact the SSIS team for a wig). My situation was that I am deploying packages to a development server, and to provide isolation I was running jobs with a proxy account that only had access to the development servers. Proxies are an awesome feature and mean that you should never have to "just run the job as sysadmin". The issue I was facing was that the job step was failing. The job step was a simple execution of the package.The following errors appeared in my log file. I always check the "Log step output in history" for a job step, this ensures you get all the output from the command that you run. I'll blog about this later. If looking at the output in sysdtslog90 then you will have an entry with datacode -1073573533 and error message File or directory "<filename>" represented by connection "<connection>" does not exist.  Not exactly helpful. If you get the output from the console then you will also get these errors. 0xC0202070 "The file name property is not valid. The file name is a device or contains invalid characters." 0xC001401E "specified in the connection was not valid." It appears this error is due to the use of a UNC path and the account runnnig the package not having access to all the folders in the path. Solution To solve this you need to ensure that the proxy account has access to ALL folders in the path you are accessing. To check this works, logon as the relevant proxy user, or run a command window as the specified user. Then try and do net use \\server\share and then do a dir for each folder in the path and check you have access. If these work and you still have the problem then you have some other problem, sorry. The following are posts on experts exchange that also discuss this,http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/Q_24056047.htmlhttp://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/Q_23968903.html This blog had a post about it being a 64 bit issue. That definitely wasn't the issue for me as I was on a 32 bit server http://blogs.perkinsconsulting.com/post/64-bit-SQL-Server-2005-SSIS-and-UNC-paths-Part-2.aspx  

    Read the article

  • How To Restore Firefox Options To Default Without Uninstalling

    - by Gopinath
    Firefox plugins are awesome and they are the pillars for the huge success of Firefox browser. Plugins vary from simple ones like changing color scheme of the browser to powerful ones likes changing the behavior of the browser itself. Recently I installed one of the powerful Firefox plugins and played around to tweak the behavior of the browser. At the end of my half an hour play, Firefox has completely become useless and stopped rending web pages properly. To continue using Firefox I had to restore it to default settings. But I don’t like to uninstall and then install it again as it’s a time consuming process and also I’ll loose all the plugins I’m using. How did I restore the default settings in a single click? Default Settings Restore Through Safe Mode Options It’s very easy to restore default settings of Firefox with the safe mode options. All we need to do is 1.  Close all the Firefox browser windows that are open 2. Launch Firefox in safe mode 3. Choose the option Reset all user preferences to Firefox defaults 4. Click on Make Changes and Restart button. Note: When Firefox restore the default settings, it erases all the stored passwords, browser history and other settings you have done. That’s all. This excellent feature of Firefox saved me from great pain and hope it’s going to help you too. Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

  • How To Restore Firefox Options To Default Without Uninstalling

    - by Gopinath
    Firefox plugins are awesome and they are the pillars for the huge success of Firefox browser. Plugins vary from simple ones like changing color scheme of the browser to powerful ones likes changing the behavior of the browser itself. Recently I installed one of the powerful Firefox plugins and played around to tweak the behavior of the browser. At the end of my half an hour play, Firefox has completely become useless and stopped rending web pages properly. To continue using Firefox I had to restore it to default settings. But I don’t like to uninstall and then install it again as it’s a time consuming process and also I’ll loose all the plugins I’m using. How did I restore the default settings in a single click? Default Settings Restore Through Safe Mode Options It’s very easy to restore default settings of Firefox with the safe mode options. All we need to do is 1.  Close all the Firefox browser windows that are open 2. Launch Firefox in safe mode 3. Choose the option Reset all user preferences to Firefox defaults 4. Click on Make Changes and Restart button. Note: When Firefox restore the default settings, it erases all the stored passwords, browser history and other settings you have done. That’s all. This excellent feature of Firefox saved me from great pain and hope it’s going to help you too. Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >