Daily Archives

Articles indexed Saturday March 20 2010

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

  • 3 Basic SEO Tips For New Online Marketers

    It is prudent to start promoting a website using free SEO methods first. That way you gain knowledge and experience without the risk of losing any money should you make a few wrong moves. From then on, you can choose to wisely transition to paid methods if need be.

    Read the article

  • Why does the JavaScript need to start with ";" ?

    - by TK
    I have recently noticed that a lot of JavaScript files on the web starts with ; immediately following the comment section. For example, this jQuery plugin's code starts with /** * jQuery.ScrollTo * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * Date: 9/11/2008 .... skipping several lines for brevity... * * @desc Scroll on both axes, to different values * @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } ); */ ;(function( $ ){ Why does the file needs to start with ;? I see this convention on server-side JavaScript files as well. What is an advantage and disadvantage of doing this?

    Read the article

  • Google maps api - not found address suggestion

    - by diamandiev
    Usually when you try to add a marker to an unknown/ambiguous address you just get an error from the api. It would be much nicer if i could display a list of suggestions related to the address that was not found. The Google maps site has this feature but i do not know how to do with the api. Any help would be appreciated.

    Read the article

  • Convert Option[Object] to Option[Int] Implicitly

    - by wheaties
    I'm working with legacy Java code which returns java.lang.object. I'm passing it into a function and I'd like to do some implicit conversions as such: implicit def asInt( _in:Option[Object] ) = _in asInstanceOf[ Option[Int] ] implicit def asDouble( _in:Option[Object] = _in asInstanceOf[ Option[Double] ] private def parseEntry( _name:String, _items:Map[String,Object] ) = _name match{ case docName.m_Constants => new Constants( _items get( Constants m_Epsilon ), _items get( Constant m_Rho ), _items get( Constants m_N ) ) Technically it goes on but I keep getting the same errors: expected Int, Option[Object] found. How have I done my implicits wrong? I was hoping it would do the transformation for me instead of me having to write "asInstanceOf" each and every time.

    Read the article

  • How to return a string literal from a function

    - by skydoor
    Hi I am always confused about return a string literal or a string from a function. I was told that there might be memory leak because you don't know when the memory will be deleted? For example, in the code below, how to implement foo() so that make the output of the code is "Hello World"? void foo ( ) // you can add parameters here. { } int main () { char *c; foo ( ); printf ("%s",c); return 0; } Also if the return type of foo() is not void, but you can return char*, what should it be.

    Read the article

  • Scan from last instance of character to end of string using NSScanner

    - by Virgil Disgr4ce
    Given a string such as: "new/path - path/path/03 - filename.ext", how can I use NSScanner (or any other approach) to return the substring from the last "/" to the end of the string, i.e., "03 - filename.ext"? The code I've been trying to start with is: while ([fileScanner isAtEnd] == NO){ slashPresent = [fileScanner scanUpToString:@"/" intoString:NULL]; if (slashPresent == YES) { [fileScanner scanString:@"/" intoString:NULL]; lastPosition = [fileScanner scanLocation]; } NSLog(@"fileScanner position: %d", [fileScanner scanLocation]); NSLog(@"lastPosition: %d", lastPosition); } ...and this results in a seg fault after scanning to the end of the string! I'm not sure why this isn't working. Ideas? Thanks in advance!

    Read the article

  • Add transparent JPanel upon AWT Component to paint on

    - by Gambrinus
    Hi, I've got a Problem: In my Java application I've got an AWT Component (cannot change that one) that streams and shows an avi-file. Now I want to draw upon this movie and thought about putting a transparent JPanel above it and draw on that one. This does not work since I either see the avi-stream or the drawn lines but not both. I read somewhere that AWT does not support transparency of components - but the panel is a JPanel which is able to do so. Can someone please help me with this one - thanks in advance.

    Read the article

  • To get a prompt which indicates Git-branch in Zsh

    - by Masi
    I run the following codes separately as my prompt unsuccessfully in .zshrc. This suggests me that apparently I do not have a program called __git_ps1. It is not in MacPorts. #1 PROMPT="$(__git_ps1 " \[\033[1;32m\] (%s)\[\033[0m\]")\$"$ #2 PROMPT="$(__git_ps1 " (%s)")\$"$ #3 # Get the name of the branch we are on git_prompt_info() { branch_prompt=$(__git_ps1) if [ -n "$branch_prompt" ]; then status_icon=$(git_status) echo $branch_prompt $status_icon fi } # Show character if changes are pending git_status() { if current_git_status=$(git status | grep 'added to commit' 2> /dev/null); then echo "?" fi } autoload -U colors colors setopt prompt_subst PROMPT=' %~%{$fg_bold[black]%}$(git_prompt_info) ? %{$reset_color%}' How can you get a prompt which shows the name of a Git-branch?

    Read the article

  • SQL Azure maximum database size rises from 10GB to 50GB in June

    - by Eric Nelson
    At Mix we announced that we will be offering a new 50gb size option in June. If you would like to become an early adopter of this new size option before generally available, send an email to [email protected]  and it will auto-reply with instructions to fill out a survey to nominate your application that requires greater than 10gb of storage. Other announcements included: MARS in April: Execute multiple batches in a single connection Spatial Data in June: Geography and geometry types SQL Azure Labs: SQL Azure Labs provides a place where you can access incubations and early preview bits for products and enhancements to SQL Azure. Currently OData Service for SQL Azure. Related Links: SQL Azure Announcements at MIX http://ukazure.ning.com

    Read the article

  • Why sometimes Windows cannot kill a process?

    - by Néstor Sánchez A.
    Right now I'm trying to Run/Debung my app on VisualStudio, but it cannot create it because the las instance of the app.vshost.exe is still running. Then, by using the Task Manager i'm trying to kill it, but it just remains there with no signal of activity. Beyond that particular case (maybe a VS bug), i'm very curious about the technical reasons why sometimes Windows cannot kill a process??? Can, an enlighted OS related developer, please try to explain? (And please don't start a Unix/Linux/Mac battle against Windows)

    Read the article

  • How to "Un-Eject" a USB Flash drive -- Eject is easy (safely remove hardware), but what about Un-Eje

    - by Jian Lin
    There are times after I eject a USB Flash drive, I want to copy some more files over to the USB Flash drive. In this case, do I always need to unplug the drive and plug it back in? Is there a way to "reconnect" or "un-eject" the drive? To eject, that are two ways: 1) Right Click the drive (say H:) and choose Eject 2) Click "Safely remove hardware" from the icon tool But there seems to be no way to un-eject or reconnect a drive.

    Read the article

  • NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException

    - by Shane
    I have the following code set up in my Startup IDictionary properties = new Dictionary(); properties.Add("connection.driver_class", "NHibernate.Driver.SqlClientDriver"); properties.Add("dialect", "NHibernate.Dialect.MsSql2005Dialect"); properties.Add("proxyfactory.factory_class", "NNHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle"); properties.Add("connection.provider", "NHibernate.Connection.DriverConnectionProvider"); properties.Add("connection.connection_string", "Data Source=ZEUS;Initial Catalog=mydb;Persist Security Info=True;User ID=sa;Password=xxxxxxxx"); InPlaceConfigurationSource source = new InPlaceConfigurationSource(); source.Add(typeof(ActiveRecordBase), (IDictionary<string, string>) properties); Assembly asm = Assembly.Load("Repository"); Castle.ActiveRecord.ActiveRecordStarter.Initialize(asm, source); I am getting the following error: failed: NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException : Unable to load type 'NNHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed. I have read and read I am referecning the All the assemblies listed and I am at a total loss as what to try next. Castle.ActiveRecord.dll Castle.DynamicProxy2.dll Iesi.Collections.dll log4net.dll NHibernate.dll NHibernate.ByteCode.Castle.dll I am 100% sure the assembly is in the bin. Anyone have any ideas?

    Read the article

  • Reviving a deleted file for use in my workspace

    - by John Cowan
    Greetings We run perforce with several users. Each user has their own development website that shows files in their workspace. This is great for making and viewing changes to webpages before submitting them. Sometime ago, we deleted a few pages in Perforce. I would like to revive these pages, but not to make them visible on our live site. I want to view them in my workspace and on my dev site, but I do want to push them out to our live server. In the "depot" tab of my P4 client, I can see the deleted files. I cannot see them in the "Workspace" tab of my client. How can I revive them for use in my Workspace, but not make them live to the world? I'm not a P4 admin so I could use a little guidance. Thanks for any help,

    Read the article

  • Converting switch statements to more elegant solution.

    - by masfenix
    I have a 9 x 9 matrix. (think of suduko). 4 2 1 6 8 1 8 5 8 3 1 5 8 1 1 7 5 8 1 1 4 0 5 6 7 0 4 6 2 5 5 4 4 8 1 2 6 8 8 2 8 1 6 3 5 8 4 2 6 4 7 4 1 1 1 3 5 3 8 8 5 2 2 2 6 6 0 8 8 8 0 6 8 7 2 3 3 1 1 7 4 now I wanna be able to get a "quadrant". for example (according to my code) the quadrant 2 , 2 returns the following: 5 4 4 2 8 1 6 4 7 If you've noticed, this is the matrix from the very center of the 9 x 9. I've split everything up in to pairs of "3" if you know what i mean. the first "ROW" is from 0 - 3, the second from 3 - 6, the third for 6 - 9.. I hope this makes sense ( I am open to alternate ways to go about this) anyways, heres my code. I dont really like this way, even though it works. I do want speed though beccause i am making a suduko solver. //a quadrant returns the mini 3 x 3 //row 1 has three quads,"1", "2", 3" //row 2 has three quads "1", "2", "3" etc public int[,] GetQuadrant(int rnum, int qnum) { int[,] returnMatrix = new int[3, 3]; int colBegin, colEnd, rowBegin, rowEnd, row, column; //this is so we can keep track of the new matrix row = 0; column = 0; switch (qnum) { case 1: colBegin = 0; colEnd = 3; break; case 2: colBegin = 3; colEnd = 6; break; case 3: colBegin = 6; colEnd = 9; break; default: colBegin = 0; colEnd = 0; break; } switch (rnum) { case 1: rowBegin = 0; rowEnd = 3; break; case 2: rowBegin = 3; rowEnd = 6; break; case 3: rowBegin = 6; rowEnd = 9; break; default: rowBegin = 0; rowEnd = 0; break; } for (int i = rowBegin ; i < rowEnd; i++) { for (int j = colBegin; j < colEnd; j++) { returnMatrix[row, column] = _matrix[i, j]; column++; } column = 0; row++; } return returnMatrix; }

    Read the article

  • Explain JAVA code

    - by MIW
    I need some help to explain the meaning from line 5 to line 9. Thanks String words = "Rain Rain go away"; String mutation1, mutation2, mutation3, mutation4; mutation1 = words.toUpperCase(); System.out.println ("** " + mutation1 + " Nursery Rhyme **"); mutation1 = words.concat ("\nCome again another day"); mutation2 = "Johnny Johnny wants to play"; mutation3 = mutation2.replace (mutation2.charAt(5), 'i'); mutation4 = mutation3.substring (7, 27); System.out.print ("\'" + mutation1 + "\n" + mutation4 + "\'\n"); 10.System.out.println ("Title length: " + words.length());

    Read the article

  • Attempting to find a formula for tessellating rectangles onto a board, where middle square can't be

    - by timemirror
    I'm working on a spatial stacking problem... at the moment I'm trying to solve in 2D but will eventually have to make this work in 3D. I divide up space into n x n squares around a central block, therefore n is always odd... and I'm trying to find the number of locations that a rectangle of any dimension less than n x n (eg 1x1, 1x2, 2x2 etc) can be placed, where the middle square is not available. So far I've got this.. total number of rectangles = ((n^2 + n)^2 ) / 4 ..also the total number of squares = (n (n+1) (2n+1)) / 6 However I'm stuck in working out a formula to find how many of those locations are impossible as the middle square would be occupied. So for example: [] [] [] [] [x] [] [] [] [] 3 x 3 board... with 8 possible locations for storing stuff as mid square is in use. I can use 1x1 shapes, 1x2 shapes, 2x1, 3x1, etc... Formula gives me the number of rectangles as: (9+3)^2 / 4 = 144/4 = 36 stacking locations However as the middle square is unoccupiable these can not all be realized. By hand I can see that these are impossible options: 1x1 shapes = 1 impossible (mid square) 2x1 shapes = 4 impossible (anything which uses mid square) 3x1 = 2 impossible 2x2 = 4 impossible etc Total impossible combinations = 16 Therefore the solution I'm after is 36-16 = 20 possible rectangular stacking locations on a 3x3 board. I've coded this in C# to solve it through trial and error, but I'm really after a formula as I want to solve for massive values of n, and also to eventually make this 3D. Can anyone point me to any formulas for these kind of spatial / tessellation problem? Also any idea on how to take the total rectangle formula into 3D very welcome! Thanks!

    Read the article

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