Posts

php - How to get mod rewrite to change an url's symbol for display purposes? -

good day all, ive been wondering, google searching , goign greyer quicker thinking if possible mod rewrite change specific symbol grabs url else? i.e. if url www.website.com/foo-bar using rewriterule can hyphen become forward slash? <?php $foobar = "foo-bar"; ?> <a href="/<?php echo $foobar; ?>">foo-bar</a> .htacces code have.. rewriterule ^([^/]+)$ index.php?page=$1 [l] so mod rewrite make url display on addressbar www.website.com/foo/bar if possible? regards, dan. have @ this: http://forum.modrewrite.com/viewtopic.php?t=2799

c# - How to get unique key for any method invocation? -

i need generate 'hash' unique method invocation in project. example, have method string getsomestring(int someint) . so, need different hashes in cases: string getsomestring(1) -- key 1 string getsomestring(2) -- key 2 string getsomestring(3) -- key 3 how generate kind of hashes? upd: want log method execution unique hash each method invocation. this: public delegate t helperfactorymethod<t>(); public static logmethodexecution<t>(helperfactorymethod<t> factorymethod) t: class { string key = gethashstring(factorymethod); storetodatabase(key); ... } result example of gethashstring() must : list getsomeobjects(1, objecttype.simple) must 'listgetsomeobjects_1_objecttype.simple' or this. list getsomeobjects(2, objecttype.none) must 'listgetsomeobjects_2_objecttype.none' or this. you use hash function generete unique key parameter values. example: public string getsomestring(int someint) { md5cryptoservic...

scope - Python module visiable only in iPython -

i have used set pythonpath=%pythonpath%;dictionary_containing_modules make modules globaly visiable. i have script importing modules import my_module . when run script ipython shell ( run my_script.py ), no errors , script runs intended, when run script command promt (windows) python my_script.py error: importerror: no module named my_module i checked pwd use same working directory. remember can dynamically change system path within script, using sys.path or site module . maybe want add them script... or maybe want write bat or python launcher script sets pythonpath... or want edit windows environment variables (somewhere inside system properties win + break ).

visual studio 2008 - Where is the RemovePreviousVersions property in VS2008? -

can tell me exactly removepreviousversions property in setup project in visual studio 2008? feel i'm in twilight zone. select setupproject in solution explorer(view -> solution explorer) , open properties window (view -> properties window) , there it. :)

ios - AlertView to Pause Code -

this seems white elephant iphone. i've tried sorts, loops , can't make work. i have view loads table. i've moved object archiving , development purposes want have initial alertview asks if user wants use saved database or download fresh copy (void)showdbalert { uiactionsheet *alertdialogopen; alertdialogopen = [[uiactionsheet alloc] initwithtitle:@"downloaddb?" delegate:self cancelbuttontitle:@"use saved" destructivebuttontitle:@"download db" otherbuttontitles:nil]; [alertdialogopen showinview:self.view]; } i'm using actionsheet in instance. , have implemented protocol: @interface clubtableviewcontroller : uitableviewcontroller <uitableviewdelegate, uitableviewdatasource, uiactionsheetdelegate> based on run check button pressed: (void)actionsheet:(uiactionsheet *) actionsheet clickedbuttonatindex:(nsinte...

substring - Creating sub-directories using first 2 characters of a file name in a batch file -

i'm trying create batch file loop around list of jpgs/pngs in folder, , create sub-directories using first 2 characters of these image names. after creating sub-directories, move image correct sub folder. for example, abc.jpg , def.png create ab , de, , move abc.jpg ab , def.png de. the problem i'm having extracting first 2 characters , creating sub-directories. here relevant code have far: for %%a in (*.jpg,*.png) ( set _xx=%%a md %_xx:~0,2% ) [error / duplication handling, , file move has been removed clarity] echoing out variable _xx shows no value assigned it, echoing out %%a gives correct file name. running script creates 2 sub-directories called '2' , '~0' any suggestions? you need use setlocal enabledelayedexpansion at top of file, , instead of md %_xx:~0,2% use md !_xx:~0,2!

linux - How to write a path that include environment variables? -

i'm writing qt app runs in linux. need write file to: "$xdg_config_dirs/whatever"/ "$home/whatever" how resolve environment variables ## heading ##in code? using nothing plain library functions, use getenv() value of environment variables: const char *dirs = getenv("xdk_config_dirs"); this return null if variable not set in environment, make sure code handles case. you'll have "interpolation" of variable values rest of text yourself, in case. not sure if qt provides wrapper or more high-level can interpolation you, haven't worked qt.