Search Results

Search found 80 results on 4 pages for 'janochen'.

Page 1/4 | 1 2 3 4  | Next Page >

  • Tips or techniques to use when you do't know how to code something?

    - by janoChen
    I have a background as UI designer. And I realized that it is a bit hard for me to write a pieces of logic. Sometimes I get it right, but most of the time, I end up with something hacky (and it usually takes a lot of time). And is not that I don't like programming, in fact, I'm starting to like it as much as design. It's just that sometimes I think that I'm better at dealing with colors an shapes, rather than numbers and logic (but I want to change that). What I usually do is to search the solution on the Internet, copy the example, and insert it into my app (I know this is not a very good practice). I've heard that one tip was to write the logic in common English as comment before writing the actual code. What other tips and techniques I can use?

    Read the article

  • How to select the first ocurrence in the auto-completion menu by pressing Enter?

    - by janoChen
    Every time there's is a pop up menu. I select the first occurrence and press enter but nothing happens (the word is not completed with he selected occurrence). The only way is to press Tab until you reach the term for a second time. Is there a way of selecting the first occurrence pressing Enter (or other Vim hotkey)? My .vimrc: " SHORTCUTS nnoremap <F4> :set filetype=html<CR> nnoremap <F5> :set filetype=php<CR> nnoremap <F3> :TlistToggle<CR> " press space to turn off highlighting and clear any message already displayed. nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR> " set buffers commands nnoremap <silent> <M-F8> :BufExplorer<CR> nnoremap <silent> <F8> :bn<CR> nnoremap <silent> <S-F8> :bp<CR> " open NERDTree with start directory: D:\wamp\www nnoremap <F9> :NERDTree /home/alex/www<CR> " open MRU nnoremap <F10> :MRU<CR> " open current file (silently) nnoremap <silent> <F11> :let old_reg=@"<CR>:let @"=substitute(expand("%:p"), "/", "\\", "g")<CR>:silent!!cmd /cstart <C-R><C-R>"<CR><CR>:let @"=old_reg<CR> " open current file in localhost (default browser) nnoremap <F12> :! start "http://localhost" file:///"%:p""<CR> " open Vim's default Explorer nnoremap <silent> <F2> :Explore<CR> nnoremap <C-F2> :%s/\.html/.php/g<CR> " REMAPPING " map leader to , let mapleader = "," " remap ` to ' nnoremap ' ` nnoremap ` ' " remap increment numbers nnoremap <C-kPlus> <C-A> " COMPRESSION function Js_css_compress () let cwd = expand('<afile>:p:h') let nam = expand('<afile>:t:r') let ext = expand('<afile>:e') if -1 == match(nam, "[\._]src$") let minfname = nam.".min.".ext else let minfname = substitute(nam, "[\._]src$", "", "g").".".ext endif if ext == 'less' if executable('lessc') cal system( 'lessc '.cwd.'/'.nam.'.'.ext.' &') endif else if filewritable(cwd.'/'.minfname) if ext == 'js' && executable('closure-compiler') cal system( 'closure-compiler --js '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') elseif executable('yuicompressor') cal system( 'yuicompressor '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') endif endif endif endfunction autocmd FileWritePost,BufWritePost *.js :call Js_css_compress() autocmd FileWritePost,BufWritePost *.css :call Js_css_compress() autocmd FileWritePost,BufWritePost *.less :call Js_css_compress() " GUI " taglist right side let Tlist_Use_Right_Window = 1 " hide tool bar set guioptions-=T "remove scroll bars set guioptions+=LlRrb set guioptions-=LlRrb " set the initial size of window set lines=46 columns=180 " set default font set guifont=Monospace " set guifont=Monospace\ 10 " show line number set number " set default theme colorscheme molokai-2 " encoding set encoding=utf-8 setglobal fileencoding=utf-8 bomb set fileencodings=ucs-bom,utf-8,latin1 " SCSS syntax highlight au BufRead,BufNewFile *.scss set filetype=scss " LESS syntax highlight syntax on au BufNewFile,BufRead *.less set filetype=less " Haml syntax highlight "au! BufRead,BufNewFile *.haml "setfiletype haml " Sass syntax highlight "au! BufRead,BufNewFile *.sass "setfiletype sass " set filetype indent filetype indent on " for snipMate to work filetype plugin on " show breaks set showbreak=-----> " coding format set tabstop=4 set shiftwidth=4 set linespace=1 " CONFIG " set location of ctags let Tlist_Ctags_Cmd='D:\ctags58\ctags.exe' " keep the buffer around when left set hidden " enable matchit plugin source $VIMRUNTIME/macros/matchit.vim " folding set foldmethod=marker set foldmarker={,} let g:FoldMethod = 0 map <leader>ff :call ToggleFold()<cr> fun! ToggleFold() if g:FoldMethod == 0 exe 'set foldmethod=indent' let g:FoldMethod = 1 else exe 'set foldmethod=marker' let g:FoldMethod = 0 endif endfun " save and restore folds when a file is closed and re-opened "au BufWrite ?* mkview "au BufRead ?* silent loadview " auto-open NERDTree everytime Vim is invoked au VimEnter * NERDTree /home/alex/www " set omnicomplete autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType c set omnifunc=ccomplete#Complete " Remove trailing white-space once the file is saved au BufWritePre * silent g/\s\+$/s/// " Use CTRL-S for saving, also in Insert mode noremap <C-S> :update!<CR> vnoremap <C-S> <C-C>:update!<CR> inoremap <C-S> <C-O>:update!<CR> " DEFAULT set nocompatible source $VIMRUNTIME/vimrc_example.vim "source $VIMRUNTIME/mswin.vim "behave mswin " disable creation of swap files set noswapfile " no back ups wwhile editing set nowritebackup " disable creation of backups set nobackup " no file change pop up warning autocmd FileChangedShell * echohl WarningMsg | echo "File changed shell." | echohl None set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\<cmd' let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction

    Read the article

  • What's the default traditional Chinese font?

    - by janoChen
    The only fonts that can render Chinese text are: WenQuanYi Micro Hei, WenQuanYi Micro Hei Mono, Droid Sans (I think is unicode), FreeSans (I think is unicode too). Changing Chinese text to Sans, FreeSans, Droid Sans render the same font). WenQuanYi Micro Hei, WenQuanYi Micro Hei Mono render 'bolder' Chinese text. EDIT: What I discovered so far: Is not WenQuanYi Micro Hei, WenQuanYi Micro Hei, Droid Sans Fallback (Droid with CJK support). It can only be FreeSans, or Deja vu Sans. I'm not sure which one is being used as default one (clean installation) Any idea?

    Read the article

  • FTP Connection established...Connection timed out problem with all my sites and FTP programs?

    - by janoChen
    Just few hours ago FileZilla was working fine. Then, suddenly I started to get this error: Status: Resolving address of ftp.readtypechinese.com Status: Connecting to 69.175.14.60:21... Status: Connection established, waiting for welcome message... Error: Connection timed out Error: Could not connect to server And it happens with all my sites: Status: Resolving address of edasich.dreamhost.com Status: Connecting to 173.236.223.223:21... Status: Connection established, waiting for welcome message... Error: Connection timed out Error: Could not connect to server I'm using FileZilla 3.5.0 and Ubuntu 11.10. Any suggestions to fix this? (I already tried Passive mode and it doesn't work). EDIT: Ocasionally, the log goes beyond the ...waiting for welcome message: Status: Connection established, waiting for welcome message... Response: 220 DreamHost FTP Server Command: USER aleche23 Error: Connection timed out Error: Could not connect to server But the connection gets timed out again. Weird...I just realized that I have the same problems with other FTP programs too: gFTP: Looking up ftp.readtypechinese.com Trying readtypechinese.com:21 Connected to readtypechinese.com:21 220 ProFTPD 1.3.2 Server (server) [69.175.14.60] USER [email protected] Connection to ftp.readtypechinese.com timed out

    Read the article

  • Tips or techniques to use when you don't know how to code something?

    - by janoChen
    I have a background as UI designer. And I realized that it is a bit hard for me to write a pieces of logic. Sometimes I get it right, but most of the time, I end up with something hacky (and it usually takes a lot of time). And is not that I don't like programming, in fact, I'm starting to like it as much as design. It's just that sometimes I think that I'm better at dealing with colors an shapes, rather than numbers and logic (but I want to change that). What I usually do is to search the solution on the Internet, copy the example, and insert it into my app (I know this is not a very good practice). I've heard that one tip was to write the logic in common English as comment before writing the actual code. What other tips and techniques I can use?

    Read the article

  • How to enable the user to add background images to anchor links thought Wordpress admin panel? [closed]

    - by janoChen
    I have css selectors like this on in my style.css: .jimgMenu ul li.landscapes a { background: url(../images/landscapes.jpg) repeat scroll 0%; } What's the easiest way to enable the user to add background images to anchor links like the ones below? front-page.php: <div class="jimgMenu"> <ul> <li class="landscapes"><a href="#nogo">Landscapes</a></li> <li class="people"><a href="#nogo">People</a></li> <li class="nature"><a href="#nogo">Nature</a></li> <li class="abstract"><a href="#nogo">Abstract</a></li> <li class="urban"><a href="#nogo">Urban</a></li> <li class="people2"><a href="#nogo">People</a></li> </ul> </div> To illustrate: .jimgMenu ul li.landscapes a { background: url(<add background image>) repeat scroll 0%; } What that code would look like?

    Read the article

  • When I access my new domain name it displays for me but not for other people? [closed]

    - by janoChen
    Possible Duplicate: How long does propagation of newly registered private name servers typically take? I just bought this domain at GoDaddy (48 hours ago): http://formatron.net/ My hosting provider is Webhostingpad.com. I Added their name servers to GoDaddy 48 hours ago. More information in this previous question. It is working in my computer but some people just see a "cannot found error." What could be the reason? EDIT: I checked on my mobile phone and it works.

    Read the article

  • Should I create topics in a forum I'm about to launch so that new users won't feel it is "empty"?

    - by janoChen
    I'm about to launch a discussion forum about Taiwan. I'm really trying to figure out how to deal with the first visitors. I've thought about the following so far: Invite few friends to start some discussions and give some replies. Create discussions myself and reply them myself (with another account). I don't want the first visitors to feel like the site is empty. Maybe I'm missing something. Any suggestions?

    Read the article

  • Moving (efficiently) vertically in Vim

    - by janoChen
    When I want to reach to a certain part of a word in Vim (horizontally) I simply press w, b, f or t (something). Is there a good way of doing this vertically? For instance, I want to get to a certain word or a letter of a line that is below or above the line I'm currently in. PS: Without using :(line number)

    Read the article

  • Using PHP Gettext Extension vs PHP Arrays in Multilingual Websites?

    - by janoChen
    So far the only 2 good things that I've seen about using gettext instead of arrays is that I don't have to create the "greeting" "sub-array" (or whatever its called). And I don't have to create a folder for the "default language". Are there other pros and cos of using gettext and php arrays for multilingual websites? USING GETTEXT: spanish/messages.po: #: test.php:3 msgid "Hello World!" msgstr "Hola Mundo" index.php: <?php echo _("Hello World!"); ?> index.php?lang=spanish: <?php echo _("Hello World!"); ?> turns to Hola Mundo USING PHP ARRAYS: lang.en.php <?php $lang = array( "greeting" => "Hello World", ); ?> lang.es.php <?php $lang = array( "greeting" => "Hola Mundo", ); ?> index.php: <?php echo $lang['greeting']; ?> greeting turns to Hello World index.php?lang=spanish <?php echo $lang['greeting']; ?> greeting turns to Hola Mundo (I first started with gettext, but it wasn't supported in my shared free hosting Zymic. I didn't want to use Zend_translate, I found it too complicated to my simple task, so I finally ended up using php define, but later on someone told me I should use arrays)

    Read the article

  • How can I move the close button to the top-right corner of the box in slimbox (jQuery)

    - by janoChen
    I want to have my button in the top-right corner, I tried position: absolute, but I think the position of the box is not relative so I can't use top: 0;. Any suggestions? CSS: /* SLIMBOX */ #lbOverlay { position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background-color: #000; cursor: pointer; } #lbCenter, #lbBottomContainer { position: absolute; z-index: 9999; overflow: hidden; background-color: #fff; } .lbLoading { background: #fff url(slimbox2/loading.gif) no-repeat center; } #lbImage { position: absolute; left: 0; top: 0; border: 10px solid #fff; background-repeat: no-repeat; } #lbPrevLink, #lbNextLink { display: block; position: absolute; top: 0; width: 50%; outline: none; } #lbPrevLink { left: 0; } #lbPrevLink:hover { background: transparent url(slimbox2/prevlabel.gif) no-repeat 0 15%; } #lbNextLink { right: 0; } #lbNextLink:hover { background: transparent url(slimbox2/nextlabel.gif) no-repeat 100% 15%; } #lbBottom { font-family: Verdana, Arial, Geneva, Helvetica, sans-serif; font-size: 10px; color: #666; line-height: 1.4em; text-align: left; border: 10px solid #fff; border-top-style: none; } #lbCloseLink { display: block; float: right; width: 31px; height: 32px; background: transparent url(slimbox2/closelabel.gif) no-repeat center; margin: 5px 0; outline: none; } #lbCloseLink:hover { background: transparent url(slimbox2/closelabel_hover.gif) no-repeat center; border-bottom: 0px; } #lbCaption, #lbNumber { margin-right: 71px; } #lbCaption { font-weight: bold; }

    Read the article

  • How to make a div to fill a remaining horizontal space (a very simple but annoying problem for CSS e

    - by janoChen
    I have 2 divs: one in the left side and one in the right side of my page. The one in the left side has fixed width and I want the one of the right side to fill the remaining space. The one on the right side is the navigation and I want it to to fill the remaining space on it right side: My CSS: #search { width: 160px; height: 25px; float: left; background-color: #FFF; } #navigation { width: 780 float: left; /*background-color: url('../images/transparent.png') ;*/ background-color: #A53030; } My Html: <div id="search"> </div> <?php include("navigation.html"); ?> <div id="left-column"> Thank in advance!

    Read the article

  • Code folding is not saved in my vimrc

    - by janoChen
    I added the following code to my .vimrc: " save and restore folds when a file is closed and re-opened autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview HTML and CSS documents save and restore their folds but code folding is not being saved in my .vimrc Any suggestions? EDIT: The following code solves the problem: au BufWinLeave ?* mkview au BufWinEnter ?* silent loadview but if I write it, the MRU files disappear from my list (and I have to open MRU twice in order to see my list of recent files why?)

    Read the article

  • How to simplify this php switch statement?

    - by janoChen
    I would like to change this: // use appropiate lang.xx.php file according to the value of the $lang switch ($_SESSION['lang']) { case 'en': $lang_file = 'lang.en.php'; break; case 'es': $lang_file = 'lang.es.php'; break; case 'zh-tw': $lang_file = 'lang.zh-tw.php'; break; case 'zh-cn': $lang_file = 'lang.zh-cn.php'; break; default: $lang_file = 'lang.en.php'; } into something like this: //include file for final output include_once 'languages/lang.'.$_SESSION['lang'].'php; So that I can skip the whole switch part. I tried other combinations but they don't seem to work. Any suggestions?

    Read the article

  • How can I display a language according to the user's browser's language inside this code?

    - by janoChen
    How can I display a language according to the user's browser's language inside this mini-framework for my multilingual website? Basically, it has to display the default language of the user if there's no cookies. Example of index.php: (rendered output) <h2><?php echo l('tagline_h2'); ?></h2> common.php: (controller of which language to output) <?php session_start(); header('Cache-control: private'); // IE 6 FIX if(isSet($_GET['lang'])) { $lang = $_GET['lang']; // register the session and set the cookie $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else if(isSet($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; } else { $lang = 'en'; } //use appropiate lang.xx.php file according to the value of the $lang switch ($lang) { case 'en': $lang_file = 'lang.en.php'; break; case 'es': $lang_file = 'lang.es.php'; break; case 'tw': $lang_file = 'lang.tw.php'; break; case 'cn': $lang_file = 'lang.cn.php'; break; default: $lang_file = 'lang.en.php'; } //translation helper function function l($translation) { global $lang; return $lang[$translation]; } include_once 'languages/'.$lang_file; ?> Example of /languages/lang.en.php: (where multilingual content is being stored) <?php $lang = array( 'tagline_h2' => '...',

    Read the article

  • How do I effectively fake a div's background color using an image in the body element?

    - by janoChen
    I want to get something like the following: The dark grey is the sidebar but I want to apply that color into the body element as an image which repeats itself vertically but at the same time doesn't cover the footer (light gray). (this is the easiest way I found to stretch the color (dark gray) until the bottom.) Part of my CSS: body { color: #888; font-family: Arial, "MS Trebuchet", sans-serif; font-size: 75% } .container { margin: 0 auto; overflow: hidden; padding: 0 15px; width: 960px; } /* header */ #header { background: #444; } /* banner */ #header-top { overflow: hidden; height: 77px; width: 960px; /* ie6 hack */ } #lang { float: right; padding: 50px 0 0 0; } /* work */ #content { background: #EEE; } #content a { border-bottom: 0; } #mainbar { overflow: hidden; margin: 0 10px 0 0; width: 644; float: left; } #sidebar { background: #DDD; color: #777; overflow: hidden; margin: 20px 0 10px 0; padding: 15px; width: 240px; float: right; } #sidebar h3 { color: #888; } #about { margin: 0 0 20px; } /* footer */ #footer { color: #777; background: #DDD; clear: both; } /* contact */ #footer-top { line-height: 160%; overflow: hidden; padding: 30px 0; width: 960px; /* ie6 hack */ } #footer-bottom { font-size: 10px; margin: 15px auto; } Part of my HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/> <title>Alex Chen - Web Development, Graphic Design, and Translation</title> <link rel="stylesheet" type="text/css" href="styles/global.css" /> </head> <body id="home"> <div id="header"> <div class="container"> <div id="header-top"> </div> </div><!-- .container --> </div><!-- #header --> <div id="content"> <div class="container"> <div id="mainbar"> </div> <!-- #mainbar--> <div id=sidebar> </div> <!-- #sidebar --> </div><!-- .container --> </div><!-- #content --> <div id="footer"> <div class="container"> <div id="footer-top"> </div><!-- #footer-top --> <div id="footer-bottom"> </div> </div><!-- .container --> </div><!-- #footer --> </body> </html>

    Read the article

  • What is the meaning of this Web kit JavaScript warning? (Thickbox)?

    - by janoChen
    Webkit Develoepr tools says the following Javascript Error: Unsafe JavaScript attempt to access frame with URL file:///D:/wamp/www/projects/c1-marching-band2/instruments.html from frame with URL file:///D:/wamp/www/projects/c1-marching-band2/iframeModal.html?placeValuesBefore. Domains, protocols and ports must match. file:///D:/wamp/www/projects/c1-marching-band2/iframeModal.html?placeValuesBefore:15Uncaught TypeError: Property 'tb_remove' of object [object DOMWindow] is not a function I'm trying to close the Thickbox div (iframe) pressing a submit button. But I think there's something wrong with 'tb_remove'. (Just in Chrome) It doe work in their official page: http://jquery.com/demo/thickbox/

    Read the article

  • About the forward and backward a word behaviour in Emacs

    - by janoChen
    I don't know if there's something wrong with my settings but when I press M-f (forward a word) it doesn't matter where I am, it never place the cursor in the next word (just between words). This doesn't happen with M-b which place my cursor in the beginning of the previous word. Is this a normal behavior? How do I place my cursor at the beginning of the following word?

    Read the article

  • Am I suffering "divitis"? (CSS especialist needed)

    - by janoChen
    I've read lots of articles that condemn the excessive use of divs. I have a feeling that I might be doing that in the following mark up: HTML: <div id="header"> <div class="container"> <div id="banner"> <h1><a href="http://widerdesign.co.nr/">wider design</a></h1> <ul id="lang"> <li><a href="index.php">English</a></li> <li><a href="es/index.php">Español</a></li> <li><a href="tw/index.php">??(??)</a></li> <li><a href="cn/index.php">??(??)</a></li> </ul> </div> <div id="intro"> <div id="tagline"> <h2>Nulla vitae tortor mauris</h2> <p>Pellentesque faucibus est eu tellus varius in susc...</p> </div> <div id="about"> <h2>right</h2> <p>Pellentesque faucibus est eu tellus varius in susc...</p> </div> </div><!-- #intro --> </div><!-- .container --> </div><!-- #header --> CSS: .container { margin: 0 auto; overflow: hidden; width: 960px; } /* header */ #header { background: #EEE; } #header h1 { float: left; } #header h2, #header a, #header p { color: #999; } #header h1 a { background: url(../images/logo.png) no-repeat scroll 0 0; float: left; height: 30px; text-indent: -9999px; width: 500px; } #banner { border-bottom: 1px solid #DDD; padding: 0 0 15px 0; margin: 30px 0 30px 0; overflow: hidden; width: 960px; } #lang { float: right; padding: 9px 0 0 0; } #lang li { float: left; margin: 0 0 0 20px; } #lang li a { font-size: 10px; } /* intro */ #intro { overflow: hidden; padding: 0 0 30px 0; } #tagline { float: left; margin: 0 40px 0 0; width: 540px; /* 560 */ } #tagline h2 { font-size: 24px; } #about { float: right; width: 380px; } Explanation of the use of those divs: header: Defines the background color which expands until the end of the window (lies outside of the div .container). container: centers the content (but not the background). banner: to define the background or border color around ul#lang and h1. intro: same as above but for #tagline and #about (otherwise I have to define say padding or margin for tagline and about individually). Am I overusing divs? Can this be simplified?

    Read the article

1 2 3 4  | Next Page >