Posts

Showing posts from August, 2014

css float - CSS floating not working with height set to auto -

so trying have leftcontent div floated left, rightcontent div floated left , position content div inbetween them. when adjusted height of album div actual pixel size instead of auto worked fine, height being auto doesn't float divs properly. to see current code doing can go http://www.robhorlacher.ca/images.php give at. html <? print "<div id=\"ccontainer\">"; $execute_statement = "select count(*) imagealbums"; $results = mysql_query($execute_statement) or die ('error executing sql statement!!!'); $entries = mysql_fetch_row($results); $rownumber = $entries[0]; $totalperpage = 3; $totalpages = ceil($rownumber / $totalperpage); if (isset($_get['currentpage']) && is_numeric($_get['currentpage'])) { $currentpage = (int) $_get['currentpage']; } else { $currentpage = 1; } if ($currentpage > $totalpages) { $current...

Changing default image resize dimensions in Wordpress -

how can modify core wordpress files can specify different default dimensions image resizing function in posts? instance i'd 'medium' option have default width of 400px instead of 300px. thanks do have via core wordpress files? can through ui going settings | media | image sizes.

regex - Simple JavaScript Regular Expression -

i'm sure simple haven't been able create 1 works. i need regular expression extract 1 or 2 digit number 1-13 string such "(11)" or "(3)" thanks :) result = subject.match(/\b(?:1[0-3]|0?[1-9])\b/); will match 2 digit number between 1 , 13, wherever may (as long it's not part of longer number or within word). if want hard-code parentheses, it's result = subject.match(/\((?:1[0-3]|0?[1-9])\)/); and if want find more 1 match in single string, use g modifier (after last slash).

c# - Default TabItem Background Color -

i want set background color of tabitem header (tabitem.background) if content not set in tab. accomplish this, have brush property in viewmodel bound background property of tabitem. however, i'm not sure how get/create default tabitem background brush. public brush tabitembrush { { return iscontentset ? defaulttabitembrush : brushes.lightskyblue; } } <tabitem header="some header" background="{binding tabitembrush, mode=oneway}"> i defaulttabitembrush brush match other tabitems if theme changes tabitems still same. is default brush available in systemcolors? using c# / .net 3.5 i ended using solution in wpf, how current theme's button background? then in code looks like: public brush tabitembrush { { return iscontentset ? (brush)uiutilities.getvaluefromstyle(typeof(tabitem), control.backgroundproperty) : brushes.lightskyblue; } } <tabitem header="some header" backgroun...

visual studio 2010 - Create Windows Service and capture touch events Win7 c# -

i create windows service can listen multi-touch event occurances, intercept them , them (not important). need know how send windows messages service , code able receive messages within service. anyone have idea's @ please? i've been cutting code 15 years have never written windows service before , use little on way :( by definition, windows services not supposed user-interactive, therefore, if want multi-touch data, have hook directly operating system input messages using wm_touch windows hook , interpreting data yourself.

asp.net - Mirgrating Document Server to the Cloud -

a client of mine having problems hosting own document server thinking moving document server , application server cloud. problem is, had application scanned documents particular folder on document server (internal network), cloud application may need revised send documents. ftp out. looking host service allows map folder on server or enable upload documents via http/https. can suggest service use accomplish ? please let me knows thanks! you might want @ webdav provider. personal doc backup , management against fastmail dav storage area , works fine. need webdav client. use python lib, there commercial , free clients languages.

css - height of <div> tag -

i have 2 divs in page: <div id="firtdiv" style="top:100px; left:200px; height:unknown"></div> <div style="top:unknow; height:200px" id="seconddiv"></div> i set firstdiv's height auto because put datalist don't know it's height. , secondiv's top property change according fistdiv's height. second div bottom of firstdiv. how can do? i suggest put 2 div's in div (which set absolute). 'coz when set both absolute, there's no way push each other. here's example: <div id="wrapper"> <div id="content"> content... </div> <div id="bottom"> botom.. </div> </div> for css: #wrapper { position:absolute; top: 110px; left: -400px; width:800px; } #bottom { border-top: 2px dotted #2259ff; font-family: ebrima; padding-top: 5px; height: 200px; margin-le...

iphone - applicationDidFinishLaunching not getting called on iPod touch device -

i working on making formerly iphone app universal app. , not getting applicationdidfinishlaunching on ipod touch device. the call come on ipad. come on iphone simulator. , on ipad simulator. don't have iphone device, can't test there. has ever run this? the problem in info.plist, had following: main nib base file name (ipad) mainwindow_ipad main nib base file name (iphone) mainwindow_iphone that looks fine , dandy . . . except before ios 3.2, such key recognized "main nib base file name", not in list. when added that, ending with: main nib base file name (ipad) mainwindow_ipad main nib base file name (iphone) mainwindow_iphone main nib base file name mainwindow_iphone everything worked great. i found clue here .

internet explorer - Kohana 3 Auth in IE -

i'm finding can't log in kohana site through ie. (just ie, works fine everywhere else) it's validating, as, knows if username , password wrong, not creating session. i've added to: application/config/session.php <?php return array( 'cookie' => array( 'name' => 'session_cookie', 'encrypted' => true, 'lifetime' => 43200, ), 'native' => array( 'name' => 'session_native', 'encrypted' => true, 'lifetime' => 43200, ), 'database' => array( 'name' => 'session_database', 'group' => 'default', 'table' => 'sessions', ), ); but wouldn't expect on own. does have helpful pointers? i want re-instate question not answered in way helpful others: kohana 3 auth in ie ok, fact there underscore in url!!.. who'd have tho...

windows - SVN: How to know in which revision a file was deleted? -

given i'm using svn command line on windows, how find revision number, in file deleted? on windows, there no fancy stuff grep , attempting use command line only, without tortoisesvn. in advance! edit: i saw few posts, examining history of deleted file did not answer question. is there way other svn log -v url > log.out , search notepad? install cygwin. i use this: svn log -v --limit <nr> -v | grep -e '<filename>|^r' | grep -b 1 <filename> where filename - name of file or pattern matches nr - number of latest revisions in want this give revisions actions (add, delete, remove, modify) concerning file, simple tweak grep can revisions deletion. (obviously, --limit optional, have overview how deep need search gains performance.)

ios - iOS4 Enterprise App for Wireless Distribution Probelm -

my company joined ios enterprise program distribute in-house app our employees. choose over-the-air installation our app , put .plist , .ipa file inside our web server protected our id/password mechanism. it's means must log our web site first can install app. whole process works fine when put these files in open area(not protected id\password). however, once put files behind protected it's showed "can not connect example.com " , xcode’s device console view shows “jul 21 11:17:39 unknown itunesstored[385] : not load download manifest underlying error: error domain=sserrordomain code=2 "can not connect itunes store" userinfo=0x1c551fb0 {nslocalizeddescription= can not connect itunes store}”. i guess it’s because session it’s not same when open itms-services://… link ios called process install app. stuck problem while. hope can solve it. many help! the ios installer sandboxed process make itms-services request. there absolutely n...

does integrating different google apis in android phone possible? -

i new developing android application. i'd make app capable of using google calendar, google talk, , google docs in single application. i've read 3 apis exist on android phones integrating them nice. possible? ahead replies! cheers :) yes, possible, can use apis in android application in same way in web application. suggest doing basic android tutorials first before trying prototype application. try testing basic apis before working real data.

sorting - How to sort arraylist hashmap in Android? -

i have fetch data website , take data value hashmap. create dynamic linear layout , display ol hashmap value in it. problem comes when want display hashmap value name , data type, how can that? for (int = 0; < nodes.getlength(); i++) { element e = (element) nodes.item(i); node node = nodes.item(i); hashmap<string, string> map = new hashmap<string, string>(); lin = new linearlayout(this); lin.setorientation(linearlayout.vertical); lin.setbackgroundresource(r.drawable.my_border); linearlayout linbsc = new linearlayout(this); linbsc.setorientation(linearlayout.horizontal); map.put("name",node.getattributes().getnameditem("name").getnodevalue()); textview txtbasicname = new textview(this); txtbasicname.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.fill_parent, 1f)); //txtbasicname.setbackgroundcolor(color.white); ...

ruby on rails - 'rake routes' modifies vendor/plugins/haml/init.rb -

i'm getting strange , annoying bug when run rake routes on rails project. every time reason modifies file vendor/plugins/haml/init.rb . here's diff: -# load haml , sass. +# load haml using rails version 2.3.4 , vendored version of haml 2.2.23. i've got couple of other versions of rails (3.0.7, 3.0.4, 3.0.3) , haml (3.1.2, 3.1.1, 3.0.25), along haml-rails (0.3.4). bug pops rake routes rake db: commands, not rake stats . ideas? starting version 3.0.22 haml doesn't include sass anymore. need install sass gem separately or use haml older version 3.0.22.

iis 7 - Sencha extjs Framework giving 500.19 on IIS 7 -

i following error when configure extjs (sencha) framework in iis 7. have anonymous , windows authentication enabled. i've tried without either. , i've tried anonymous. issue? http error 500.19 - internal server error requested page cannot accessed because related configuration data page invalid. requested url http://localhost:80/index.html physical path logon method not yet determined logon user not yet determined had give permission root folder user group iis_iusrs.

r - When trying to install RPostgreSQL, why do I get package 'DBI' does not have a name space? -

i trying following command: r cmd install rpostgresql_0.1-7.tar.gz i following error message: * installing library 'c:/.../r/win-library/2.13' * installing *source* package 'rpostgresql' ... ** libs warning: package has non-empty 'configure.win' file, building main architecture cygwin warning: ms-dos style path detected: c:/progra~1/r/r-213~1.1/etc/x64/makeconf preferred posix equivalent is: /cygdrive/c/progra~1/r/r-213~1.1/etc/x64/makeconf cygwin environment variable option "nodosfilewarning" turns off warning. consult user's guide more details posix paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames x86_64-w64-mingw32-gcc -i"c:/progra~1/r/r-213~1.1/include" -i"c:\program files\postgresql\9.1"/include -o2 -wall -std=gnu99 -c rs-dbi.c -o rs-dbi.o x86_64-w64-mingw32-gcc -i"c:/progra~1/r/r-213~1.1/include" -i"c:\program files\postgresql\9.1"/include -o2 -wa...

.net - Adding color to a table cell using C# -

i creating table , adding cells contents through c sharp code. code given below: //creating table table table1 = new table(); table1.id = "table1"; table1.borderstyle = borderstyle.dashed; table1.gridlines = gridlines.both; this.controls.add(table1); //adding first row tablerow row1 = new tablerow(); //adding first cell tablecell cell1 = new tablecell(); //adding label label text1 = new label(); text1.text = "sourav ganguly"; cell1.controls.add(text1); row1.controls.add(cell1); table1.controls.add(row1); //adding second cell tablecell cell2 = new tablecell(); //adding label label text2 = new label(); text2.text = "rahul dravid"; cell2.controls.add(text2); row1.controls.add(cell2); //adding third cell tablecell cell3 = new tablecell(); //adding label label text3 = new label(); text3.text = "sachin tendulkar"; cell3.controls.add(text3); row1.controls.add(cell3); //adding second row tablerow row2=new tablerow(); //adding first cell...

How to avoid a blink in Translate animation for Android? -

i have image @ position 0,0 initially. when user clicks button animate image , move 0,100 using animation = new translateanimation(0, 0, 0, listinstancedetails.dragitemheight); an.setfillafter(true); since setfillafter true. animation stays @ 0,100. user clicks button again , want come 0,100 0,0. use code animation = new translateanimation(0, 0, 100, 0); an.setfillafter(true); this working fine. when before second animation starts 100,0 gives blink @ 0,0 , starts 100,0 0,0. looks ugly. is there way avoid blink. there has played around lot translate animation , done similar operation. doing wrong. please let me know inputs. thank time , advice. i had used an.setfillbefore(false); in code. removed , started working fine.

c# - Take link in web browser with WP7 -

when click 1 link in web browser of wp7, new web has been open. how can take link, click, textbox use other aim? work ff, when u click link in 1 page - link shown on web address. thank support !! to can use webbrowser control navigating or navigated event (msdn link) , pick url event arguments.

Subkernel memory control in Mathematica -

i have similar question as: mathematica running out of memory i interested in this: paralleltable[f[i], {i, 0, 14.9, 0.001}] where f[i] complicated numerical integral (i haven't yet found easy way reproduce problem without page filling definitions integral). my problem subkernels blow in memory , have stop evaluation if won't let machine swapping. but if have stopped evaluation kernels won't give free occupied memory. clearsystemcache[] i have tried parallelevaluate[clearsystemcache[]] but parallelevaluate[memoryinuse[]] stays @ {823185944, 833146832, 812429208, 840150336, 850057024, 834441704, 847068768, 850424224} it seems memory controlling works main kernel? way shut down kernels , launch them again. i hope there solutions out there... lot. memory control works kernel control expressions involving such functions memoryconstrained , memoryinuse , clear , unset , remove , $historylength , clearsystemcache etc. evaluated. seems...

javascript - Problem with loading content without refresh by .load() -

why after several times click on buttons, hang website? use of function .load() loading content(html). use of firebug solution problem did not succeed. purpose buttons: http://i.stack.imgur.com/elwxy.gif you can see site : http://zigweb.ir/siran/ and can see js code address: http://zigweb.ir/siran/files/js/admin.js $('#icon a').click(function (event) { event.preventdefault(); var id = '#' + this.id; var title = $(id).attr('title'); $(".title").toggleclass("suject").html(title); var url = $(id).attr('href'); $('.table_show, #num_count, #select_box, #input_search').fadeout('slow', function () { $('.results').load(url+' .load', function(){ $(this).hide().show(); $.getscript("http://zigweb.ir/siran/files/js/admin.js"); }) //.hide().show("slow") }); ...

mobile - SVG graphics auto scaling in J2me -

i developing first application using svg graphics , auto scaling of svg background image match device screen width , height ? possible or shall have multiple files different display resolutions i'm not sure j2me specifically, typically accomplished setting viewbox attribute on root svg element, , setting width , height 100%. see here example: <?xml version="1.0" standalone="no"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg version="1.1" viewbox="0 0 1500 1000" preserveaspectratio="none" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"> <desc>example viewbox - uses viewbox attribute automatically create initial user coordinate system causes graphic scale fit viewport no matter size viewport is.</desc> ...

vba - Word style is changed after applying ApplyListTemplate -

i have word document containing numbered list this item 1 item 2 item 3 the list style "list paragraph". left indent of "list paragraph" 0.5". if run following code reapply style "list paragraph", left indent of style 0.75" dim t listtemplate set t = activedocument.styles("list paragraph").listtemplate t.listlevels(1).resetonhigher = true selection.range.listformat.applylisttemplate t, false, wdlistapplytowholelist as result, list shifted right 0.25". i'm wondering why method applylisttemplate change left indent of style "list paragraph". before , after applying code, description of style are "indent: left: 0.5" hanging: 0.25", numbered + level: 1 + numbering style: 1, 2, 3, … + start at: 1 + alignment: left + aligned at: 0.75" + indent at: 1", style: quick style, priority: 35 based on: text" "indent: left: 0.75" hanging: 0.25", outline numbered ...

variable in the file name for write.table in R -

please me naive question (already googled, , tried lot of variations, failed): how save files variable in file name write.table in r? script loop on files in dir, apply functions , save results file same name additional ending. thank's! for (x in list.files(pattern="sim")) { u <- read.table(x, header = t, row.names = 1, sep = " ") ut <- t(u) utm <- colmeans(ut) utms <- sort(utm, decreasing = t) write.table(utms, "$x.mean") } you can use paste this. try following: write.table(utms, file=paste(x, ".mean", sep="")) paste concatenates character vectors. see ?paste more details.

c# - Windows Phone 7 - Use Native DLL - Need GUID of Class and Interface -

i need use c++ native dll in windows phone 7 application. using dllimport project shows way include native code in windows phone 7 application. uses filesystem.dll file perform actios using native code. need use encryption dll instead of that. code given uses following way import functions filesystem.dll: [comimport, guid("f0d5afd8-da24-4e85-9335-bebcade5b92a"), classinterface(classinterfacetype.none)] public class filesystemclass { } [comimport, guid("2c49fa3d-c6b7-4168-be80-d044a9c0d9dd"), interfacetype(cominterfacetype.interfaceisiunknown)] public partial interface ifilesystemio { ... } only problem that, not able guid used in comimport attribute. knows, how guid class , interface native c++ code? you can try lookup guid c++ library editor or hex viewer, should somewhere @ top. see this link.

apache - xampp - linking to directory not in root -

i have installed xampp , link dev websites on separate(not c) drive. in iis, add virtual directory in default website. how do equivalent in xampp. pointers appreciated. have @ vhosts , or mod_alias .

iphone - Retrieving Latitude & Longitude CoOrdinates, Displaying in UILabel -

i interested in grabbing users current latitude , longitude coordinates, , displaying them literally nssstring in uilabel on view. i don't need mkmapview or show graphically, display coordinates in uilabel. possible? could provide starting block me? thanks ya, possible. import #import <corelocation/corelocation.h> , declare delegate <cllocationmanagerdelegate> . can values in following delegate mathod. - (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation{ cllocationcoordinate2d location=newlocation.coordinate; nsstring *s = [nsstring stringwithformat:@"%f,%f",location.latitude,location.longitude]; }

javascript - how to make a class accept a method without specifying the method in advance? -

if have : function foo(class){ for(i=0; i<(class.length);i++){ return document.getelementsbyclassname(class)[i]; } } and want this: foo("someclass").innerhtml="something"; it first element , understand why happens , how make work correctly, how can make function other methods without telling in loop do,like this foo("someclass").innerhtml="something";//this put inside element foo("someclass").style.backgroundcolor="#000");// , work so,if possible,how can make function without putting these methods in foo function loop? there way put these methods in variable this function foo(class).variablemethod{ for(i=0; i<(class.length);i++){ document.getelementsbyclassname(class)[i].variablemethod; } } is possible? you can pass function foo() , , have foo() call function each matched element: function foo(classname, func) { var elements = document.getelementsbyclassnam...

c++ - Connecting a desktop application with a website -

i made application using qt/c++ reads values every 5-7 seconds , sends them website. my approach simple. reading values want send , make http post website. send username , password website. the problem cannot find out if request successful. mean if send request , server gets it, http:200 always. example if password not correct, there no way know it. way http works. now think need kind of protocol take care communication between application , website. the question protocol use? if action performed completes before response header sent have option of adding custom status it. if website built on php can call header() add custom status of operation. header('xapprequest-status: complete');

events - How to trigger DataGridevents DataGridBeginningEdit, DataGridCellEditEnding with a Combobox in Silverlight? / CellTemplate for a Combobox -

i want use datagridevents (datagridbeginningedit, datagridcelleditending, ..etc) handle , detect changes. far understood, without "celltemplate" these not triggered. trying create appropriate celltemplate using textblock, guess not straightforward binding using combobox in celleditingtemplate, because using "displaymemberpath".. there examples of simpler cases couldn't find smth scenario. see xaml snippet below; <data:datagridtemplatecolumn width="100"> <data:datagridtemplatecolumn.celltemplate> <datatemplate> <textblock horizontalalignment="center" /> </datatemplate> </data:datagridtemplatecolumn.celltemplate> <data:datagridtemplatecolumn.celleditingtemplate> ...

android - Fill parent not working on My list view -

here xml code. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#e7f7ff" android:gravity="top"> <!-- header text here --> <textview /> <!-- scrollable layout --> <scrollview > <relativelayout android:layout_height="fill_parent" android:layout_margintop="5dip" android:layout_width="fill_parent"> <linearlayout > <imageview /> </linearlayout> <linearlayout > <textview /> <textview /> <framelayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <li...

java - How to format a number from other locale to normal en locale -

i have string "45,78" . how can format normal format 45.78 in java? probably think need create format object , format according en number format. how can that? use predefined decimalformats jdk offers locales: public static void main(string[] args) throws parseexception { string input = "45,78"; numberformat = decimalformat.getnumberinstance(locale.france); numberformat = decimalformat.getnumberinstance(locale.us); string output = to.format(from.parse(input)); system.out.println(output); // "45.78" } chose locales suit you. this case of "don't reinvent wheel" , "use jdk offers"

css - Why don't margin-top: auto and margin-bottom:auto work the same as their left and right counterparts? -

if set css margin properties of div so: div { margin-left: auto; margin-right: auto; } i div centered horizontally in page, like so . however, if change css this: div { margin-top: auto; margin-bottom: auto; } my div not vertically centered. don't need know workaround ( plenty of solutions are available ) know reason behaviour. why don't margin-top , margin-bottom work in same way? missing? the short answer spec says so. 10.6.2 inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow , floating replaced elements if 'margin-top', or 'margin-bottom' 'auto', used value 0. http://www.w3.org/tr/css2/visudet.html#computing_heights_and_margins

php - accessing mysql using different server to which db connection data is located -

i'm trying include file db connection info (hostname password username). this have far: include ('http://site.com/config35sdf322e54353452d/wp2154654315634652132513546541564.php'); mysql_connect($hostname,$username,$password); @mysql_select_db($dbname) or die( "unable select database"); include ('../refference.php'); $select = mysql_query("select my_field $usertable ". "gdi_username = '$sponsor_gdi_id' , unique_id = '$sponsor_refference'"); while($check = mysql_fetch_array($select)) { $sponsor_email = $check["email"]; $sponsor = $check["gdi_username"]; $sponsor_first_nme = $check["first_name"]; $sponsor_second_nme = $check["last_name"]; $sponsor_domain = $check["gdi_domain"]; $unq_id = $check["unique_id"]; } $sponsor_name = "$sponsor_first_nme $sponsor_second_nme"; echo "$sponsor $hostname" ?> i err...

Django - Overriding get_form to customize admin forms based on request -

i've tried various methods achieve this. i decided against overriding formfield_for_dbfield it's doesn't copy of request object , hoping avoid thread_locals hack. i settled on overriding get_form in modeladmin class , tried following: class pageoptions(admin.modeladmin): def get_form(self, request, obj=none, **kwargs): if request.user.is_superuser: self.fieldsets = ((none, {'fields': ('title','name',),}),) else: self.fieldsets = ((none, {'fields': ('title',),}),) return super(pageoptions,self).get_form(request, obj=none, **kwargs) when print fieldsets or declared_fieldsets within get_form none (or whatever set initial value in pageoptions). why doesn't work , there better way this? i have no idea why printing property doesn't give want assigned (i guess may depends on print, exactly), try overriding get_fieldsets instead. base implementation looks this...

Rails 3.1 (rc4), AJAX and UTF-8 -

i believe ok, creating question have answer other peoples benefit. problem: i'm using remote link send request information , returning script containing information. data comes reason encoded in iso-8859-15 though have done find make rails & ruby use utf-8. show.coffee $('#messages_messages').html("<%= escape_javascript(render 'show') %>") # _show.html.erb create output characters such åäö the response contains bunch of ?-characters instead of åäö. for reason bug happens when using .coffee filename. solution: don't use .coffee , end of filename. show.js.erb $('#messages_messages').html("<%= escape_javascript(render 'show') %>"); # _show.html.erb create output characters such åäö no encoding errors.

asp.net - if a resource value is missing in one resx file will it use the same value from the default resx file -

just simple question, if have several resource files page (contains strings each language set) , 1 of files missing particular string, string taken resource file automatically fill gap? if culture specific resource file don't contain key, asp.net automatically search key in default resource file.

debugging - Debug mode and Attach to Process... in Visual Studio 2008 -

Image
i following dialog box when try attach vs2008 debugger windows service. googled , tried lot, nothing worked. and checked "project build configuration", set following mode. changed debug tried, :( seems service built in release (ie no debug info, optimized performance) instead of debug, there go..can't attach debugger process. edit also, make sure in debug configuration of project have define debug constant check, , under advanced (c# environment, there button @ bottom of project properties - build page) have debug info of output set "full".

How to pass names of partials in Jekyll -

i want include file, name in page.var. how can get included? if partial in page.var written in markdown, how can processed html included? i've tried {% include {{page.var}} | markdownify %}, , every variation can think of - , no output , no error message. i'm using standard jekyll - version 0.11.0 thanks edit: it's possible usage of {% include {{my_partial}} %} , per alexpeller's response. old answer, before jekyll allowed this: you can't in jekyll. include directive expects string; doesn't "process" argument. can't assign filename regular liquid variable , include it. has string.

sql - How to create a function that converts a set of strings to integer -

i have been struggling couple of days before turning here. i'm trying build function, stringtointeger, converts textstring integer. have researched web , gotten far have code convert 1 string, entered in variable, integer. declare @yourstring varchar(500) select @yourstring='select' ;with allnumbers ( select 1 number union select number+1 allnumbers number<len(@yourstring) ) select (select right('000'+convert(varchar(max),ascii(substring(@yourstring,number,1))),3) allnumbers order number xml path(''), type ).value('.','varchar(max)') newvalue --option (maxrecursion 500) --<<needed if have string longer 100 i found code on how query table, tableb, , send result function , have whole set run. select * tableb cross apply dbo.stringtointeger(tableb.columnwithtext) integeroutoftext my question is, how should code @ top adjusted loaded db function when run? h...

actionscript 3 - Flash Programming Local To Global problem -

i've got weird problem , cant figure out. i'm using localtoglobal coordinates character , hittestpoint on level clip. works fine in flash player 10.1. r52 but open exact same .swf on other machine running flash player 10.0 r22, , hittesting doesnt work. tried everything, tracing parents etc. the setup: main class, in main class add game class(sprite). in game class add level class(sprite) , character class(sprite) the 'camera' follows character, , game class moved arround. so main (static x & y)> game (dynamic x & y)> level(static x & y) & character (dynamic x & y) code: private function checklanded():boolean {//this code runs on character class, 'this' = character var localpoint:point = new point(this.x, this.y + this.myheight / 2 + 1); var globalpoint:point = parent.localtoglobal(localpoint) if (settings.levelground.hittestpoint(globalpoint.x,globalpoint.y,true) || settings.levelplatf...

php - How to create thumbnails or preview for links to websites? -

i'd able, being provided link website example, generate thumbnail of website page 'new tab' page of chrome example. is possible php? look using wkhtmltopdf. linux binary generates pdf/png images of web pages using webkit engine.

css - div showing up twice in IE -

i'm finished site , reason it's not appearing wanted in ie. div "content" (with top border) showing twice - once content in it, centered, , again below navigation, aligned left , no content in it. showing fine in safari , firefox. here css code: #content { #content { position:relative; top: 50px; width:900px; height:580px; border-top-color:#000000; border-top-style: solid; border-top-width:1px; } and here link site: http://www.thomas-collection.eu/home.html thank you! validating html fix problem (you have open div among other things.) http://validator.w3.org/check?verbose=1&uri=http%3a%2f%2fwww.thomas-collection.eu%2fhome.html

asp.net - How can I duplicate a gridview's header? -

i want have duplicate gridview's header row after each 25 "normal" rows. i'd save option sort grid clicking on these columns. possible? set allowsorting="true" , if gridview has sqldatasource/objectdatasource. and need set sortexpression="fieldname" columns <asp:boundfield datafield="" headertext="" sortexpression="fieldname" />

wpf - using WF to orchestrate views -

i know if possible use 1 (or many) activity workflows handle different views in mvvm wpf+wcf application. let's want implement workflow: user wants add new customer a new customerview displayed user fills in few fields user wants insert new "office" a new officeview displayed user fills in officeview fields user closes form office's filled in data passed on customerview customerview's save button clicked information persisted would possible use workflow foundation handle scenario? in mvvm scenario, normally, in order pass data between different views/viewmodels, use: * mediator pattern * service pattern * ioc would advice against "workflow pattern" approach? i reading workflow have sort of datacontext. therefore, thinking use share , pass data on other views... thanks in advance opinions, cheers, gianluca.

ruby on rails - View association object -

hi have table called contractors acting users model logging system. have second table called employees. have created relationship between 2 tables. contractors has_many employees , employees belong_to contractor. the employee table has field contractor id foreign key. when contractor logs how can set view show him employees belong him thanks in advance! i don't know how authentication works, sou should have current_user helper retrieves logged in user session. devise gem, example, creates automatically. @employees = current_user.employees

C Pointer Arrays Initializtion -

im quite confused difference between these 2 initializations: int (*p)[10]; and int *p[10] i know both can point 2d array element count in row 10.... to elaborate bit on correct answers here already: the first line: int (*p)[10]; declares "p" pointer memory address of array capacity of 10 ints. can read in english as: "integer-pointer 'p' points 10 sequential ints in memory". the second line: int *p[10] declares "p[]" array of 10 pointers integers. array of memory addresses point integers. in case, "p" sequence of 10 pointers in memory (which happen memory addresses of other ints).

javascript - get url with content after hash -

how can url content after hash ? window.location return me url without hash :/ for example: www.mystore.com#prodid=1 window.location return www.mystore.com window.location.hash https://developer.mozilla.org/en/window.location note properties section.

iphone - How to highlight CoreText with changing highlight colors? -

i have subclass of uiview implements code draw coretext. in application, uiview drawn inside uiscrollview. here code use in drawrect: render nsattributedstring: cgcontextref context = uigraphicsgetcurrentcontext(); float viewheight = self.bounds.size.height; cgcontexttranslatectm(context, 0, viewheight); cgcontextscalectm(context, 1.0, -1.0); cgcontextsettextmatrix(context, cgaffinetransformmakescale(1.0, 1.0)); cgmutablepathref path = cgpathcreatemutable(); cgrect bounds = cgrectmake(padding_left, -padding_top, self.bounds.size.width-20.0, self.bounds.size.height); cgpathaddrect(path, null, bounds); ctframesetterref framesetter = ctframesettercreatewithattributedstring((cfmutableattributedstringref)attrstring); ctframeref frame = ctframesettercreateframe(framesetter, cfrangemake(0, 0), path, null); cfrelease(framesetter); cfrelease(path); ctframedraw(frame, context); in nsattributedstring, have text attributes color text. what need conceptually, how should accomplished?...

c# - Automate SSH Connection from Windows? -

i'm trying automate ssh connection server windows box. ssh server, log in (using password not certificate), execute few commands, read output, close connection. what best way accomplish this? there c# libraries, or command line ssh clients called c#? doesn't have c#, whatever works fine. if need free, sharpssh known (although not updated). there recent rewrite of ssh client in c#, somehere on sourceforge, don't remember it's name , can't find @ moment. update: it's dotnetssh . there exist several commercial solutions, include vendor-provided support , timely updates. our sshblackbox package 1 of options.

python - Scipy: difference between optimize.fmin and optimize.leastsq -

what's difference between scipy's optimize.fmin , optimize.leastsq? seem used in pretty same way in this example page . difference can see leastsq calculates sum of squares on own (as name suggest) while when using fmin 1 has manually. other that, 2 functions equivalent? different algorithms underneath. fmin using simplex method; leastsq using least squares fitting.

iphone - should I release NSTimer if it has a repeats attribute equal to YES? -

sometimes confused when not releasing object. have: nstimer *timer2; timer2 = [nstimer scheduledtimerwithtimeinterval: (5) target: self selector: @selector(somemethod:) userinfo: nil repeats: yes]; and method get's executed every 5 seconds is: -(void) somemethod:(nstimer*)thetimer { nslog(@"code got executed"); } i have method places nib file on root view controller: viewcontrollerobjetivos *control = [viewcontrollerobjetivos alloc]; [control initwithnibname:@"viewcontrollerobjetivos" bundle:nil]; uinavigationcontroller *navcontrol = [[uinavigationcontroller alloc] initwithrootviewcontroller:control]; [self presentmodalviewcontroller:navcontrol animated:no]; [navcontrol setnavigationbarhidden:yes]; [control release]; [navcontrol release]; when ...

Accessing a text Input inside iFrame (Google Forms) - Javascript -

cutting chase: i have google forms survey, , need dynamically edit 1 of text-inputs. the forms survey 1 out of 6 possible surveys, javascript adds it: '<iframe name="survey" id="ifrm" src="https://spreadsheets.google.com/spreadsheet/embeddedform?formkey=dhpym1nvtfn4oelnwnbjwutjdhhld2c6mq" width="760" height="623" frameborder="0" marginheight="0" marginwidth="0">loading...</iframe>' the trouble accessing textbox - used settimeout() wait until iframe loaded properly. , want this: function writeencoded() { alert("now attempting inject"); var if = document.getelementbyid('ifrm'); alert( if); //works here var form = if.contentwindow.document; //does not run. alert (form); form.getelementbyid('entry_3').value = "hi"; } any ideas what's going wrong? guys. you’re see...

struts2 - Struts-jquery dialog confirm + link id -

i using struts2-jquery , trying create modal dialog box confirmation purposes delete something. don't know how pass id or upon 'ok' complete action. below code create dialog based on struts2-jquery: <sj:dialog id="anchordialogconfirm" buttons="{ 'ok':function() { //id of link needed c $(this).dialog('close'); }, 'cancel':function() { $(this).dialog('close'); } }" resizable="false" autoopen="false" modal="true" title="remove?" > sure want remove it? </sj:dialog> <sj:a opendialog="anchordialogconfirm" id="71" cssclass="deleteemp">delete</sj:a> obviously if put href='' anchor dialog opens link rather getting modal confirmation dialog. how can retrieve id of anchor? want id of link delete or ...

creating an object in pyqt4 python -

here's code pygame ive created. can create object in pyqt4 one? create array of object has own attributes. or there better way of creating it? thanks main.py: comp = pygame.sprite.group() dic = [{"name":"aa","loc":[30,170],"status":0}, {"name":"bb","loc":[130,170],"status":0}, {"name":"cc","loc":[230,170],"status":1}] in range(len(dic)): comp.add(pcsprite(dic[i])) mysprites.py: class pcsprite(pygame.sprite.sprite): image = none pcname = "" location ="" status="" def __init__(self,data): pygame.sprite.sprite.__init__(self) self.pcname = data['name'] self.status = data['status'] self.location = data['loc'] if self.status ==1: pcsprite.image = pygame.image.load("res/images/x.png...

Wordpress search custom fields -

i have custom field meta_name product_id. trying determine how search field when using wordpress search. i know wordpress search results page uses query_string contains "s" value keyword searched don't know how change code below search custom field mentioned. $loop = new wp_query("$query_string . '&posts_per_page=-1&post_type=product'"); ?> think section in codex should have answers need regards adding in custom field parameters query: http://codex.wordpress.org/function_reference/wp_query#custom_field_parameters not sure whether allow search within particular custom field though. can't think you'd have make changes on search form end of things. see how on adding in custom field parameters. off top of head think need like: $query = new wp_query( array( 'meta_key' => 'product_id', 'meta_value' => $query_string, 'posts_per_page' => '-1', 'p...

android - getFilesDir() returning null -

getfilesdir() returning null, bizarre. what's worse, code is...painfully simple: public class main extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); file f = this.getfilesdir(); f.getabsolutepath(); tempclicked((togglebutton)findviewbyid(r.id.temptoggle)); } this crash on f.getabsolutepath(). it's running in emulator emulating 2.3.3 system @ 1024x600. google returns nothing on this...so why on earth happening? , how fix it?! thanks lot! edit:: solved! well, somewhat... i think turned out emulator error. changed skin of emulator wxvga, , allowed write files correctly. , when changed resolution 1024x600 kept working correctly. so, if has similar error, suggest play around emulator until find way past bug. try adding before f.getabsolutepath(): file f = new file(this.getapplicationcontext().g...

ruby on rails - How to keep log tail alive on Heroku using ssh? -

using heroku logs --tail works great few minutes. stops displaying logs. seems ssh connection timing out , dying. there no error or message. working in ubuntu 11.04 on wired conneciton. i added following ~/.ssh/config: serveraliveinterval 5 but didn't work. need else in config file? how know if doing anything? how can monitor traffic , see keepalive request? looking @ system monitor don't see every 5 seconds. thanks. have done of this: $ heroku config:add log_level=debug $ heroku addons:upgrade logging:expanded $ heroku logs --tail

Idiomatic way to port C bitfiddling to Python -

how port following c code in pythonic way (especially bit fiddling part in get2, get3, ...) switch(mem[pos-1]) { ... case 0x10: pos+=get2(&mem[pos+0x02])+0x04; break; case 0x11: pos+=get3(&mem[pos+0x0f])+0x12; break; case 0x16: pos+=get4(&mem[pos+0x00])+0x04; break; ... case 0x20: pos+=0x02; break; } ... ////////////////////////////////////////////////////////// // conversion routines fetch bytes in big endian order ////////////////////////////////////////////////////////// unsigned int get2(unsigned char *pointer) { return (pointer[0] | (pointer[1]<<8)); } unsigned int get3(unsigned char *pointer) { return (pointer[0] | (pointer[1]<<8) | (pointer[2]<<16)); } unsigned int get4(unsigned char *pointer) { return (pointer[0] | (pointer[1]<<8) | (pointer[2]<<16) | (pointer[3]<<24)); } this i've got far: x = struct.unpack('b', mem[pos-1])[0] if x == 0x10: # pos += ??? continu...

asp.net - Javascript & Listbox Item Removal -

i've got simple aspx page listbox, textbox , button. listbox loaded @ page_load event 40 or items. the button fires off following javascript, supposed remove listbox item not contain value typed user in textbox. basically, it's supposed search tool. problem is, removes half of items should. have click button 4 times results should have gotten on first click. here's function: function search() { var strsearch = document.getelementbyid("<%= txtsearch.clientid %>").value; var lstrsns = document.getelementbyid("<%= lstreasons.clientid %>"); var temp; var i; for(i=0;i<lstrsns.options.length;i++) { temp = lstrsns.options[i].text.touppercase(); if (temp.indexof(strsearch.touppercase()) == -1) { lstrsns.remove(i); } } } what doing wrong? seems should work. thanks any/all advice, jason the list keeps shortening remove elements.. lstrsns.remove(0); in loop until hit 1 you...

xml - How can I call an NSMutableArray created in another class? -

i have created 1 class xmlparsing.h/m, loads url, parses xml nsstrings , nsnumbers, , puts parsed strings nsmutablearray called "showarray". the xml set each child has "id", , other variables. in array, have: nsnumber: (the id xml) nsstring: (title) nsstring: (description) nsstring: (venue) in class, showdetailviewcontroller.h/m, want load array , it's objects, and, based on tableview cell clicked in previous view, items in nib (labels in case) populated "id-specific" data xml. so, instance: in tableview, titles of each show listed (from xml). user clicks on title, , view pushed, displays show's title, description, , venue, loaded parsed xml. all of parsed data exists in nsmutablearray, problem is, can't seem access objects in class. array keeps returning null. i have tried: in showdetailviewcontroller.m, have 1 method contains: xmlparsing *xmlclass = [[xmlparsing alloc] init]; nslog(@"the array contains: %@", xmlc...

Scala - omit parentheses from apply method for a DSL -

i'm trying create dsl , running problem. have these definitions: case class var(name: string) case class lam(v: var, t: var) val (a, b) = (var("a"), var("b")) i want able this: scala> \ b lam(var(a),var(b)) reading on rules of parenthesis dropping, see need chain functions take 1 parameter each, i've created series of "builder" classes perform construction: class lambuilderb(v: var) { def apply(t: var) = lam(v, t) } class lambuildera { def apply(v: var) = new lambuilderb(v) } val \ = new lambuildera i had hoped work since each apply takes 1 argument. but, doesn't seem dropping parentheses legal apply since wants treat argument method name: scala> \(a)(b) res95: lam = lam(var(a),var(b)) scala> \ b error: value not member of lambuildera \ b ^ any ideas how how can dsl syntax without parentheses? bonus question : can this?: scala> \a.b lam(var(a),var(b)) you can pretty close usi...

Emacs M-x shell and the overriding of bash keyboard bindings -

if understand correctly, when running bash under m-x shell , emacs overrides of bash keyboard bindings, , can make bash commands , features not work in "native bash" (for example see this thread) one of commands use in bash clear-screen (bounded ctrl-l default ). is there easy way of asking emacs reproduce same behavior in shell-mode can clear bash screen within emacs? i know can use m-x term real terminal, work out solution m-x shell edit : when type c-l c-l , emacs moves current line top of window, enter new command in bash, window scrolled again original position. thanks just type m-> go bottom of buffer (if necessary), c-l c-l move current line top of window. looks if you've cleared screen, of content have been erased still present above top of window. edit: to keep emacs scrolling window described, put in .emacs file: (remove-hook 'comint-output-filter-functions 'comint-postoutput-scroll-to-bottom) i fou...