Posts

Showing posts from July, 2015

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

winforms - Problem with return in C# -

because of asking last question , i've changed code use return . have problem return: know should use return (where comment in code below) dont know how should define work? help. public double bigzarb(int u, int v) { double n; int x=0; int y; int w=0; int z; string[] = textbox7.text.split(','); int[] nums = new int[i.length]; (int counter = 0; counter < i.length; counter++) { nums[counter] = convert.toint32(i[counter]); } u = nums[0]; double firstdigits =math.floor(math.log10(u) + 1); v = nums[1]; double seconddigits = math.floor(math.log10(v) + 1); if (firstdigits >= seconddigits) { n = firstdigits; } else { n = seconddigits; } if (u == 0 || v == 0) { messagebox.show("the multiply 0"); } string threshold = textbox9.text; int intthreshold = convert.toint32(threshold); int intn = convert.toint32(n); if (intn <=

Javascript setTimeout while loading from XML into Google Maps -

i have been struggling code quite time. loading xml google maps , geocoding addresses xml. need add delay code when there many addresses @ once. here entire code doing this i need have load xml file delay, loads @ once , geocoder can not handle many requests when xml large. xml file changing continuously needs reloaded , re-geocoded. becomes problem when xml file becomes larger, when need work most. i have placed delay around geocoder.getlocations(address,createmarker); address variable contains addresses not delay it. if place delay around var address = markers[i].getattribute("address"); not pass i variable function. can give appreciated. // create marker function createmarker(response) { var place = response.placemark[0]; var point = new glatlng(place.point.coordinates[1], place.point.coordinates[0]); var marker = new gmarker(point); gevent.addlistener(marker, "click"

php - fpdf not works in ie7 -

i using fpdf library displaying pdf viewers. browsers displays pdf met problem ie7. since nothing displayed. sample pdf code had used check in ie. require 'fpdf.php'; class pdf { //necessary codes header footer body sction } $pdf=new pdf(); $title='faq in current account'; $pdf->settitle($title); $pdf->setauthor('rangan'); $content="this sample content"; $pdf->printchapter(1,'title',$content); $pdf->output(); add ?q=123 url calling , change number every time call again when debugging. prevents browser , pdf plugin cache request , previous errors.

php - mysql_real_escape_string and apostrophe problem -

so i've been using mysql_real_escape_string insert data database...but when replaces apostrophes symbol ’ so instead of display it's, it's displaying it’s....... is there way reconvert ’'s apostrophes when read database? this character encoding issue in way. because in utf-8, ’ (u+2019) encoded 0xe28099. , represents characters â (0xe2), € (0x80), , ™ (0x99) in windows-1252 . so seems forgot specify output character encoding properly browser uses default character encoding windows-1252 instead.

flash - I copied and paste sample code from adobe help and it doesn't work -

i create document class main , use adobe sample code from http://help.adobe.com/en_us/as3/components/ws5b3ccc516d4fbf351e63e3d118a9c65b32-7f9f.html and got error: 1046: type not found or not compile-time constant: textinput. i don't understand why: package { import flash.display.movieclip; import fl.controls.label; import fl.controls.textinput; public class main extends movieclip { public function main() { var namelabel:label = new label(); var nameti:textinput = new textinput(); var tf:textformat = new textformat(); addchild(namelabel); addchild(nameti); nameti.restrict = "a-z .a-z"; tf.font = "georgia"; tf.color = 0x0000cc; tf.size = 16; namelabel.text = "name: " ; namelabel.setsize(50, 25); namelabel.move(100,100); name

short list of recently changed pages in mediawiki -

i'm using mediawiki run wiki (relatively small <10 users) team , know if possible short list of, say, last 5 changed pages appear in side bar. know can go recent changes page, users used seeing list of recent changed pages on every page. thanks i saw here got hack put wikitext sidebar: http://www.mwusers.com/forums/showthread.php?15842-show-recent-changes-in-sidebar try transcluding recent changes template, putting template in sidebar.

iphone - where to init another class in NSObject class? -

alright, guys: i met problem during communicating between 2 classes, viewcontrollerclass myviewcontroller calls method changeviewbackgroundcolor nsobjectclass assistant here method: in assistant.h @interface assistant : nsobject { myviewcontrollere *myviewcontroller; in assistant.m - (void)changeviewbackgroundcolor:(id)sender { myviewcontroller.myview.backgroundcolor = [uicolor whitecolor]; } but know not gonna work, need myviewcontroller = [[myviewcontroller alloc] init] myviewcontroller , super class of assistant , there no place implement it, if implement in changeviewbackgroundcolor method, little late, there several methods in assistant class, need myviewcontroller = [[myviewcontroller alloc] init] , question i'm gonna put init call? override init method , in init method create object of myviewcontroller . -(void)init { if(self=[super init]){ //create object view controller } return sel

iphone - Is it possible use UINavigationController but hide its navigation bar (replace it with customized toolbar) and go back button -

i hope switch between 2 uiviewcontroller using uinavigationcontroller. (auiviewcontroller, buiviewcontroller relate uiview aview,bview) aview has uibutton, bview has uibutton also. if press button on aview, push bviewcontroller , display bview. if press button on bview, bviewcontroller pop , go auiviewcontroller. i hope use uinavigationcontroller's navigation function hide 'go back' bar , navigation bar, use 2 buttons tell uinaviationcontroller needs do. possible? to hide uinavigationcontroller's navigation bar: [self.navigationcontroller setnavigationbarhidden:yes]; to push view controller button: - (void)pushnextviewcontroller { nextviewcontroller *page = [[nextviewcontroller alloc] initwithnibname:nil bundle:nil]; [self.navigationcontroller pushviewcontroller:page animated:yes]; } to pop view controller one: - (void)poptolastviewcontroller { [self.navigationcontroller popviewcontrolleranimated:yes]; }

java - Performance implications of handling CLOBs with Oracle JDBC using SetBigStringTryClob -

i in process of reviewing old java/jdbc code clob-handling on oracle database. existing code uses approach similar approach mentioned in this question . i found an article states: prior oracle jdbc 10g, manipulate clob data in jdbc, oracle extension class oracle.sql.clob used. now, oracle jdbc 10g has few enhancements simplifies clob manipulation in jdbc applications. enables handling of large data using of available standard apis, instead of using oracle extension classes. the article gives following information details of enhancement: by default, method preparedstatement.setstring() allow processing of strings 32765 bytes. in order insert data greater 32765 bytes, newly introduced connection property - setbigstringtryclob can set. forces preparedstatement.setstring() use newly introduced method, oraclepreparedstatement.setstringforclob() instead. however warns: ... handling large amounts of data way may not wise; streaming data better alternative. but a

What's the magic of arrays in C# -

int[] = new int[5]; string[] b = new string[1]; the types of both a , b inherit abstract system.array , there no real classes in built-in library(it seems there runtime types, can't find type defination class of int[] ). can tell me happens while compiling? , why did they(the c# team) make design(i mean why it's not array<t> ,instead using abstract class compiler magics)? trying reason out within .net type system doesn't far. there core support built jit compiler , clr deal creating arrays. statement this: var arr = new int[5]; generates il: il_0001: ldc.i4.5 il_0002: newarr [mscorlib]system.int32 which jit compiler translate machine code: 00000035 mov edx,5 ; arg2 = array size 0000003a mov ecx,6f535f06h ; arg1 = typeof(int) 0000003f call ffd52128 ; call jit_newarr1(type, size) core ingredients here dedicated il opcode, newarr , instead of usual newobj opco

windows phone 7 - WP7 dynamic controls -

is possible generate dynamic wp7 controls in code behind (.cs) using .xaml template (like inflating in android) , or should generate manually? example need dynamic tabs (pivotitems) pete brown demonstrated how dynamically generate xaml here if you'd route. dynamically generating controls in wpf , silverlight

wpf - GridSplitter stopped working after upgrading to .net 4 -

i have 2 rows, second row contains grid splitter, defined work on previous , current. on .net 3.5 every thing worked fine. after upgrading .net 4 splitter thumb not response attempts of dragging it. any help? the problem binding i did binding both of grid heights , fix .net 4 binding mechanism caused problems, it's fine.

asp.net mvc 2 - Is there a way to make it look like two programs are listening to port 80 -

i know can't have 2 programs listening same port, wondering if possible fake somehow, example: my machine has 2 applications, 1 listening port 80 , other port 6653 . if incoming connection, let's mysite.com:80/chat forwarded internally application listening on port 6653 , data returned server forwarded port 80 somehow. the reason want accomplish because there many firewalls seem block connections ports other 80. i have chat server want run on port 80, perhaps ip , machine that, feels trouble single chat server. any helpful feedback appreciated. thanks! you can mod_rewrite if you're running apache. link has plenty of examples, including want (i think). edit: see you've updated tags "asp.net". i'm guessing you're not running apache, then. i'm sure there similar tool iis, or can use proxy server same thing.

c# - When to use each type of loop? -

i'm learning basics of programming here (c#) think question generic in nature. what simple practical situations lend closer particular type of loop? the while , for loops seem pretty similar , there several questions addressing differences between two. how foreach ? basic understanding, seems ought able foreach loop within for loop. 1. foreach , for a foreach loop works ienumerator , when for loop works index (in object myobject = mylistofobjects[i] , index). there big difference between two: an index can access directly object based on position within list. an enumerator can access first element of list, , move next element (as described in previous link msdn). cannot access element directly, knowing index of element within list. so enumerator may seem less powerful, but: you don't know position of elements in group, because groups not ordered/indexed. you don't know number of elements in list (think linked list). even when it's o

phpmyadmin - mysql - query inside a query -

how possible following : (i using mysql - phpmyadmin ) this query returns table name : select table_name table1 id = 1 i want use inside query , : select val (select table_name table1 id = 1) but sure not work, , since phpmyadmin not support calling stored procedures, there possible solution ? you cannot in single sql statement. you trying use data (field value) metadata (table name), , sql not allow this. you break in 2 statements or write dynamic sql in stored procedure. note not client layers support returning resultsets stored procedures.

android - ScrollView Inside ScrollView -

i know people google have asked not put scrollable view inside scrollable view there official statement them directing not so? is close enough? you should never use horizontalscrollview listview, since listview takes care of own scrolling. importantly, doing defeats of important optimizations in listview dealing large lists, since forces listview display entire list of items fill infinite container supplied horizontalscrollview. http://developer.android.com/reference/android/widget/horizontalscrollview.html update: since may forced use 2 dimensional scrollview, may consider using this: internet archive of blog.gorges.us/2010/06/android-two-dimensional-scrollview/ i haven't used may reasonable approach.

java - Why does setBounds() method not work even after setting setLayout() as null? -

usually setbounds() method positions called object in specified location , in specified size..right? created jframe class , demonstrated working on button setting setlayout(null). created class extends jpanel , put components in it. bounds these components set inside method. object of class included in class extends jframe. object calls setbound() method. result not show components in jpanel extended class. cde fragment given below. class administrator extends jframe implements actionlistener { public administrator() { settitle("administration"); setsize(500,500); setdefaultcloseoperation(exit_on_close); setlayout(null); jbutton newbutton=new jbutton(" new.. "); newbutton.addactionlistener(this); add(newbutton); newbutton.setbounds(100,100,100,25); setvisible(true); public static void main(string arg[]) { new administrator(); } public void actionperformed(actionevent ae) { string act=(

WPF pre-render a list w/o actually showing it -

is there way "pre-render" list in wpf without showing user? have list renders ( few seconds ) first time displayed user. i'd pre-render/pre-draw list few seconds takes display list users not noticeable. i'd happen while app starting - while splash screen displayed. what best way accomplish this? edit: here list item style. can see target type button. button has routedevent (command) set on it. <style x:key="button_productfinder_item" targettype="button"> <setter property="control.template"> <setter.value> <controltemplate targettype="button"> <grid width="690" height="181" > <image name="up" source="{staticresource img_productfinder_friendup}" stretch="uniform"/> <image name="down" source="{staticresource img_productfinder_friendd

silverlight - open xaml in new web browser -

in silverlight application want open xaml in new web browser. how can that? htmlpage.window.navigate aspx pages - maybe can convert xaml aspx? 10x! a xaml page cannot shown in browser window. silverlight showing silverlight program within < object > tag in aspx (or html) page; nothing more. in silverlight project, if chose host project in new web site, see second project both htm , aspx file hosts object links xap file. so basically, need create second silverlight project hosted in different aspx page. in main silverlight project can open new aspx page in new web browser window.

How often do deadlocks occur(about to occur) in an operating system -

we study lot deadlocks in operating system courses. how occur ? or rather how there chance deadlock(the os doesn't let dead lock occur)? deadlocks occur program multi thread programs synchronizers , don't know you're doing. you have release mutex, example, before placing thread on wait long need same mutex awake thread, , that's small example.

c - Using pointers and structs -

hello i'm not sure if i'm understand following piece of code. glad if read explanations , correct me if i'm wrong. first of i'm declaring struct 3 arrays of char , integer. struct employee { char last[16]; char first[11]; char title[16]; int salary; }; after declare function takes 3 pointers char , integer value. function uses malloc() , sizeof() create struct on heap. creations of object on heap not clear me. when use struct employee* p = malloc(sizeof(struct employee)) , happens there exactly ? happens when use function struct employee* createemployee (char* last, char* first, char* title, int salary) several times different input. know pointer p isn't same pointer same struct on heap. rewrite information on heap, when use function several times? or create new object in different memory space? struct employee* createemployee(char*, char*, char*, int); struct employee* createemployee(char* last, char* first, char* title, int salary

xml - <XSL:for-each> skip nodes with specific values -

still having hard time grasping of harder templates great. right using simple for-each loop sorts , shows data in table. want same thing skip on nodes "state" = "talking out" below current style sheet , below xml. thinking add for-each inside of current loop ignores nodes meet criteria. escaping single quotes since part of larger php script. <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="/"> <html> <body> <table cellpadding="3" cellspacing="0" width="390"> <tr> <th style="text-align:left;"><span style="font:20px arial; font-weight:bold;">agent name</span></th> <th style="text-align:center;"><span style="font:20px arial; font-weight:bold;"&

c# - CredentialCache with IIS vs personal development server -

i have webservice testing. when use personal asp.net webserver, 1 random port works fine. uses credentials when pass defaultcredentials ssrs server run report. when tried move local iis server, defualtcredentials username blank , id gets pass ssrs server aspnet. i turned off annon access , integrated windows authentication on. my local iis 5.1, doesn't have application pools separate object. in web.config authentication set <authentication mode="windows" /> thanks in advance. update have <identity impersonate="true" /> now, problem trickier stated. the outer webservice calls ssrs webservice , works fine in browser. when call outer webservice within ssis, not work, when step through code call outer webservice occurs when make call ssrs 401 authentication error. i have valid credentials in http manager. have package protection level @ encryptsensitivewithuserkey. again if call outer webservice personal asp.net webserver

c# - Parent Child Relationships with Fluent NHibernate? -

i create cascading tree/list of n number of children given parent, child can become parent. given following data structure: countrytype=1; colortype=3; statetype=5 6,7,8 = {can, us, mex} 10, 11, 12 = {red, white, blue} 20,21,22= {california, florida, alberta} treeid listtypeid parenttreeid listitemid 1 1 null 6 (canada country) 2 1 null 7 (us country) 3 1 null 8 (mexico country) 4 3 3 10 (mexico has red) 5 3 3 11 (mexico has white) 6 5 1 22 (alberta in canada) 7 5 7 20 (california in us) 8 5 7 21 (florida in us) 9 3 6 10 (alberta red) 10 3 6 12 (alberta blue) 11

wpf controls - WPF How To Bind Two Nested Usercontrols -

i need bind user control data context other control property : <stackpanel> <custom:usercontrol1 x:name="uc1"/> </stackpanel> <stackpanel> <custom:usercontrol2 datacontext="{binding elementname=uc1, path=myselectedvalue}"/> </stackpanel> of course have implemented dependency property 'myselectedvalue' on usercontrol1. following not work. guess because searches elementname on visual tree , not find because both controls parallel nested. how above work? thanks, how did define myselectedvalue dependencyproperty (is set bindstwowaybydefault )?

web crawler - How reliable are IMAP UIDs? -

i'm writing imap crawler, part of open source app, , incremental crawling i'd use message uids find out whether i've seen particular message or not. now found a post 2007 says imap uids aren't reliable. more specifically, if flag uidnotsticky set, can't assume uids same. question is, have take case uidnotsticky=true seriously, or imap servers non-sticky uids legacy stuff , not in (widespread) use anymore? if uidnotsticky response code returned during select or examine, you'll see uidvalidity value on mailbox (the imap term folder) changes every time select or examine mailbox. have check change in uidvalidity anyway since mailbox's uidvalidity not guaranteed immutable, , such change invalidates cached uids. yes, uidvalidity values generally don't change. code's going have deal case, , doing you'll have covered uidnotsticky case.

wpf - Is there a way to handle WCF server faults in one spot on the client? -

right wrapping wcf service calls in following try/catch block , wondering if there way set in 1 place , have apply service calls. try { product test = client.getproductbyid(1); } catch (timeoutexception ex) { wpfmessagebox.show("the service operation timed out." + ex.message); } catch (faultexception<customfault> ex) { wpfmessagebox.show("customfault:" + ex.tostring()); } catch (faultexception ex) { wpfmessagebox.show("unknown fault:" + ex.tostring()); } catch (communicationexception ex) { wpfmessagebox.show("there communication problem" + ex.message + ex.stacktrace); } you write wrapper method code execute service call passed in delegate: public t servicecallwrapper<t>(func<t> servicecalldelegate) { try { return servicecalldelegate(); } catch (timeoutexception ex) { wpfmessagebox.show("the service operation timed out." + e

regex - JavaScript RegExp Differences -

what difference between var regex = /\d/; and var regex = new regex("\d"); bob both evaluate same exact regex, first literal, meaning cannot use variables inside it, cannot dynamically generate regex. the second uses constructor explicitly , can used create dynamic regular expressions. var x = '3', r = ( new regexp( x + '\d' ) ); r.test('3d') the above example of dynamically constructing regex constructor, can not in literal form. in 99% of cases rely on first version ( literal ) regexpes in js. in advanced scenario need say, user input dynamically construct regex that's when you'll need second form. edit #1 : the first matches digit, second matches letter d . have double-escape second 1 in order equal first one, assume meant do. remember advice typed above accurate if second example new regexp('\d'). /\d/.test('3') // true ( new regexp('\d') ).test('3') // false ( new regexp('

sql - Combine results from two tables into one recordset -

i have 2 tables items , content. items:|id|menu|img table itemcontent |id|parent|title|content content holds paired items parent holding title , content i want search items , print out records wich not have title present in itemcontent table whereby titles printed "empty". printing out output like: title: test1 , id: items.id=1 title: empty , id: items.id=2 title: empty , id: items.id=3 title: test2 , id: items.id=4 title: empty , id: items.id=5 etc... i tried following , no avail: select items.*, itemcontent.title, itemcontent.content items, itemcontent itemcontent.title '%$search%' , itemcontent.parent = items.id order title asc a little appreciated since want rows items whether or not have match in itemcontent, plus field itemcontent when there match need use outer join: select items.*, coalesce(itemcontent.title, 'empty'), itemcontent.content items left outer join itemcontent on itemcontent.parent = items

c - multiple definition of <function> -

/tmp/cctqfvcp.o: in function `whitespace': /home/tommo/fly/flyc/config.c:12: multiple definition of `whitespace' /tmp/cc0ccmfz.o:/home/tommo/fly/flyc/config.c:12: first defined here /tmp/cctqfvcp.o: in function `lineend': /home/tommo/fly/flyc/config.c:16: multiple definition of `lineend' /tmp/cc0ccmfz.o:/home/tommo/fly/flyc/config.c:16: first defined here /tmp/cctqfvcp.o: in function `makesubstr': /home/tommo/fly/flyc/config.c:20: multiple definition of `makesubstr' /tmp/cc0ccmfz.o:/home/tommo/fly/flyc/config.c:20: first defined here i'm getting every function in file config.c every 1 of header files has #ifndef file_h header block thing. why doing this? target = fly src = main.c gfx.c transform.c entity.c list.c v3.c config.c airplane.c cppflags = -wall ldflags = -lglfw -lgl -lglu debug = -g linux: @echo building linux... gcc $(cppflags) $(debug) $(ldflags) $(src) -o $(target) @echo done. clean: rm $(target) help:

ruby on rails - rspec giving incorrect error messages -

following railstutorial, keep getting error message (one of 4 actually) when should working: userscontroller authentication of edit/update pages signed-in users should require matching users 'edit' failure/error: @users = [@user, second, third] undefined local variable or method 'second' #<rspec::core::examplegroup::nested_3::nested_7::nested_2:0x000001040dcb68> # ./spec/controllers/users_controller_spec.rb:275:in 'block (4 levels) in <top (required)>' i have tried fix looking @ other questions on stack overflow no avail. gemfile looks this: gem 'rails', '3.0.3' gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' gem 'gravatar_image_tag', '0.1.0' gem 'will_paginate', '3.0.pre2' group :development gem 'rspec-rails', '2.0.1' gem 'annotate-models', '1.0.4' gem 'faker', '0.3.1' end group :test gem 'rspec-rails

wpf - XAML MVVM Multibinding -

i have mvvm wpf application, has 'user settings' injected view. these settings contain things last used search terms, or column widths on datagrids etc. works nicely , viewmodel unaware of these settings view specific , viewmodel may shared multiple views. these values bound in xaml of view. however, of settings have level of interference properties on viewmodel. an example: viewmodel has property of public int maxresults { get; set; } used limit number of results query brings back. when user changes value from, say, 100 50, ideally want saved in view's settings; enabling next time view used value 50 used rather 100. my first question: how can bind both view settings, , viewmodel property same element? thinking multi value converter, unsure of whether there funkier ways of performing operation. need both bindings 2 way, not horrible update loops. my second question: sometimes i'll want viewmodel take precedence on values supplied view settings. i&

jquery - Line break on some Qtip tooltips -

on page: http://antidote.treethink.com/projects/ of tooltips have line break on them (#2, #8, #9, #10) in firefox rid of line break on these can't figure out why have , others (that longer) don't. this problem isn't there in safari. using qtip (http://craigsworks.com/projects/qtip/) , code calling is: <script type="text/javascript"> $(document).ready(function() { $('#post-11 a[title]').qtip({ position: { corner: { target: 'topmiddle', tooltip: 'bottommiddle' } }, style: { name: 'dark', padding: '7px 13px', width: { max: 4000, min: 0 }, tip: true } }); }); </script> thanks, wade i tried in firefox none of them had linebreaks. if you're still having problem add css #qtip-content{ white-space:nowrap; }

weblogic log4j with incorrect time in logs -

we have weblogic appserver running on unix box our application uses log4j configured dailyrollingfileappender. when try "date" command on unix prompt shows me correct timezone (i in pacific timezone) same time in log files can see 1 hour ahead time. like, date command shows "mon dec 20 15:10:39 pst 2010" if open log file, can see 20-dec-2010 16:10:39,773 debug xyz.... my log4j settings log4j.appender.test=org.apache.log4j.dailyrollingfileappender log4j.appender.test.datepattern='.'yyyy-mm-dd log4j.appender.test.threshold=debug log4j.appender.test.immediateflush=true log4j.appender.test.file=test.log log4j.appender.test.append=true log4j.appender.test.layout=org.apache.log4j.patternlayout log4j.appender.test.layout.conversionpattern=%d{dd-mmm-yyyy hh:mm:ss,sss} %-5p %c:%l - %m%n not sure if unix time proper pst time time log4j using logging, dont see log4j timezone configuration in above settings. how can check timezone settings incorrect in w

html - Google Fonts, CSS, Latin Question -

Image
i'm trying use this font on web. it's in lithuanian language, it's not point, point is, on google fonts previewer can see characters beautifully, on site specific symbols gets nasty look. maybe knows how can solve this, say, issue? p.s. or recommend me other standard light font use ... those glyphs not in font. standard fallback font of serif should making obvious; here’s see (using pangram wikipedia): if download font , inside (using font book on mac, or fontforge), can see glyphs present or absent. fix this, enter characters need previewer. a quick selection of sans-serif fonts contain glyphs need: museo sans 500 weight may used freely online. aller , may require license. dejavu sans , droid sans, many users have installed. helvetica, geneva, , freesans. trebuchet ms, verdana, calibri, candara, , arial, users have installed. calibri appears decent match lato, might use font-family: calibri, sans-serif; (without embedding @ all).

visual studio 2010 - Logging VS2010 unit test results in TFS 2008 not working -

the tests appear run fine after compliation, results don't go anywhere. .trx file written , indicates tests passing. team build thinks no tests have been executed , gives dreaded "partial success" result. suspect tfs cannot publish trx database reason...possibly because vs2010 version of test results not backwards compatible tfs 2008...? i'm running build msbuild 4.0 , using version 10 of mstest. i've read using previous version of mstest (version 9 vs 2008) help. tried this...mstest rightly complained test assembly built against more recent version of .net framework. anyone else had success this? should try next? turns out didn't have right microsoft.teamsystem assemblies in gac. version 9 assemblies there not version 10. due vs2010 being uninstalled / reinstalled out of order w/ vs2008 (or something, knows). "repair installation" setup step solved problem. so, looks mstest 10 can indeed post results tfs 2008 datastore. wee!

c# - Binding Web Application, Site Collection, Sites and Library data to a Sharepoint 2007 dropdown list in a web part -

a. i'd know best way retrieve web applications, site collections, sites , libraries of sharepoint 2007 install (on farm) , display each of data in dropdown list of own web part. b. type of web part should used c. object model or database/tables pieces of information for example: "web applications" dropdownlist1 "site collections" dropdownlist2 "sites" dropdownlist3 "libraries" in scrollable textarea spfarm farm = spfarm.local; spwebservice service = farm.services.getvalue<spwebservice>(""); foreach (spwebapplication webapp in service.webapplications) { foreach (spsite sitecoll in webapp.sites) { foreach (spweb web in sitecoll.allwebs) { <<use recursion here sub webs>> web.dispose(); }

c++ - How to print the #define statement? -

how can cerr print 5 < 6 opposed statement_ ? have access boost , qt. using namespace std; #define some_func( statement_ ) \ if( ! statement_ ) \ { \ throw runtime_error( "statement_" ); \ } \ int main() { try { some_func( 5 < 6 ); } catch(std::exception& e) { cerr << e.what(); } } you need use stringize operator: throw runtime_error(# statement_); if statement_ may macro, you'll want use double stringize trick .

.net - Where does mono put app.config -

i have winforms app has app.config. if config file not present automatically generated. not generated in directory app running from. can't find anywhere. i know generated because setting persisted expected. so has mono put it. (running on ubuntu 10.04) mono 2.4. it seems on windows deleted .config file not regenerated (i error) until rebuild, on mono quite happily continues saving settings after delete config file. most times on linux, user not have write access location of binary. i somewhere in home directory, in ~/.config.

firefox - JQuery Not Working in Chrome -

this code works in firefox not in chrome, if need more of code glad provide it, button changes background image: $(document).ready(function() { var bg = 1; $("#changepic").click(function () { if (bg == 1) { $("#outerwrapper").css("background-image","url(images/background-lodge1.jpg"); bg=2; } else if (bg == 2) { $("#outerwrapper").css("background-image","url(images/background-lodge2.jpg"); bg=3; } else { $("#outerwrapper").css("background-image","url(images/background-lodge.jpg"); bg=1; } }); }); i'm not getting errors in chrome console. thanks! you not closing url background $("#outerwrapper").css("background-image","url(images/background-lodge.jpg)"); missing ^

hierarchy - Solr: how to set up DIH for taxonomy faceting? -

i watched lucid webcast: http://www.lucidimagination.com/solutions/webcasts/faceting it talks encoding hierarchical categories facilitate faceting. category "path" of "nonfic>science" encoded multivalues 0/nonfic & 1/nonfic/science . 1) categories stored in database coded numbers instead of spelled out names. example have category of 2/7 , lookup dictionary convert 2/7 nonfic/science . how do such lookup in dih? 2) once have spelled out category path such nonfic/science , how turn 0/nonfic & 1/nonfic/science using dih? 3) of categories multi-words containing whitespaces, such "computer science" , "functional programming", i'd have facet values such 2/nonfic/computer science/functional programming . how handle whitespaces in case? filtering fq still work? thanks

c - Would this union work if char had stricter alignment requirements than int? -

recently came across following snippet, attempt ensure bytes of i (nad no more) accessible individual elements of c : union { int i; char c[sizeof(int)]; }; now seems idea, wonder if standard allows case alignment requirements char more restrictive int . in other words, possible have four-byte int required aligned on four-byte boundary one-byte char (it 1 byte, definition, see below) required aligned on sixteen-byte boundary? and stuff use of union above? two things note. i'm talking standard allows here, not sane implementor/architecture provide. i'm using term "byte" in iso c sense, it's width of char , not 8 bits. no type can ever have stricter alignment requirements size (because of how arrays work), , sizeof(char) 1. in case it's not obvious: sizeof(t [n]) sizeof(t)*n . sizeof in units of char ; types represented fixed number of bytes ( char ), number being size. see 6.2.6 (representation of types) details. giv

flash - PHP get dimensions of SWF file -

i'm trying load swf file , dynamically determine height , width. there knows can read dimensions of swf file using php? here's worked needs it: $ainfo = getimagesize($sfile); list($iwidth, $iheight) = $ainfo; use getimagesize example: php -r "print_r(getimagesize('http://adsatt.espn.go.com/ad/sponsors/ibm/oct_2010/ibm0-728x90-0160.swf'));" array ( [0] => 728 [1] => 90 [2] => 13 [3] => width="728" height="90" [mime] => application/x-shockwave-flash ) ps: module gd required

mysql - Numbers in SELECT statements -

i encountered sql queries 'select 1 table_name' or 'select 2 table_name' while debugging program. curious numbers in queries , result set return. thanks it return single column number value, n rows, n being number of rows returned select. this usefull in cases such as select * yourtable yt exists( select 1 someothertable sot yt.id = sot.id ) also, article @ select 1 vs select * – interesting observation

how to give background color for button in android -

Image
i have 3 button arranged in table row .i gave background 3 button wraps button . for starters read blog :-) now suggestion use background definitions gradients. nice , simpler create background images. said in blog need 3 of them button work expected. have demo here: button_type_0.xml you need define colours: colors.xml and dimensions: dimens.xml you might want consider different dimensions various dpi values. example use half size corners , border ldpi: ldpi/dimens.xml looks complicated @ beginning worth it. in end this:

linux - What's the relationship between sed, grep, find, awk, gawk, which one is preferred? -

i'm new linux/unix. find task can accomplished many ways using these commands. there relationship between them? or 1 preferred? 1 outdated? thanks. see so 366980 discussion differences between perl, python, awk , sed. there 4 distinct commands in list of five; awk , gawk closely related, gnu awk being gnu implementation of awk. find locating files in set of directories based on file characteristics such name or modification time. gnu find has many more capabilities traditional or posix versions of find. grep locating content within files using regular expressions control selected. gnu grep has many more capabilities traditional or posix versions of grep. sed modifying contents of files using editing commands, including regular expressions. gnu sed has many more capabilities traditional or posix versions of sed. awk pattern matching , formatting language. programming language in way other tools mention not. when needed, useful. however, perl , pytho

hibernate - HQl equivalent of sql query -

string sql_query = "select count(*) (select * url u u.pagetype=" + 1 + " group u.pageid having count(u.pageid) = 1)"; query = session.createquery(sql_query); i getting error org.hibernate.hql.ast.querysyntaxexception: unexpected token: ( near line 1, column 23 [ select count() (select * url u u.pagetype = 2 group u.pageid having count(u.pageid) = 1)] you can use group , having , subqueries in hql well. some examples: link text

ruby on rails - pass a javascript variable as a param in url_for -

i'm trying pass javascript variable ruby on rails 「 url_for」method is possible?? <a href="<%= url_for(:controller => 'epgs', :action => 'show', :parameter1 => myjavascriptvariable %>" data-inline="true"> no, javascript variables not in scope when erb being rendered being done server-side. javascript can used once page has been rendered rails , returned user (i.e in user's browser). if need javascript variable in url simple way add parameter href using javascript once page has loaded: new_link = $('#link').attr('href') + '&parameter_1=' + myjavascriptvariable; $('#link').attr('href', new_link); using jquery or similar.

java - JSF navigation rule not working on menu -

my commandlink on menu.xhtml did not work. have menu.xhtml in template folder under webcontent , list.xhtml in pages folder under webcontent well. when click on link in menu.xhtml did not go list.xhtml page did reach method being called. menu.xhtml <h:commandlink action="#{usermanagerbean.golistpage}"> <h:outputtext value="list"/> </h:commandlink> faces-config.xml <navigation-rule> <display-name>template/menu.xhtml</display-name> <from-view-id>/template/menu.xhtml</from-view-id> <navigation-case> <from-action>#{usermanagerbean.golistpage}</from-action> <from-outcome>success</from-outcome> <to-view-id>/pages/list.xhtml</to-view-id> <redirect /> </navigation-case> </navigation-rule> please me, thank you. it

iphone - What happen when mobile provision expire? -

i have ad hoc build sent persons happen when mobile provision expire? ca run app after that? no won't.... you'll have make new provisioning profile , re-build. that's point in adhoc distro, mean testing , doesn't last forever. if want full app they'll have download off app store. if want give away free there's special feature can create free download coupons or similar in itunes connect.

How to add an Extra button on Extjs grid header menu -

has had need add button grid panel header menu(sorting\columns)? potentially add button menu resets default columns model. can accomplish using jquery wondering if there extjs way it. thanks you need dig through source see it's there, gridpanel has view property gridview in turn has hmenu property menu shows when click on 1 of column headers. so, gridpanel called gridpanel (once it's rendered) can following: gridpanel.view.hmenu.add({ text: 'reset', handler: function() { // reset magicks } });

Ruby on Rails - Getting parameter values as hash onside controller -

how can values passed in url check/1?answers[1]=2&answers[7]=3&answers[6]=4&answers[4]=0 in controller @answers = params[:answers] ? how can convert @answers format {1 => 2, 7 => 3, 6 => 4, 4 => 0} you in string can convert in integer answers = params[:answer].inject({}) |answers, line| answers[line[0].to_i] = line[1].to_i answers end

Best way to stream mp3s from java/c++ server to html5? -

i looking streaming mp3s java (preferably) or c++ server html5 browser on computer. i know html5 (depending on browser) supports rtp, if possible, best way proceed. in terms of server side however, stuck. there java libraries enable mp3 streaming via rtp? have looked @ live555 c++, seems little heavy looking for. or approaching whole thing wrong. looking create program users can point mp3 files on computers/other users can open webpage , stream these mp3 files there. thanks check these java rtp implementations: java.net.rtp rtp java library jlibrtp

javascript - How can i make custom buttons to control the <embed>? -

im trying play sound(mp3) in browser. found <embed> default controllers (pause button, volume , timeslider) aint pretty im wondering how control jquery buttons? i hide embed , call controls jquery , embed tags id. is possible, , find overview of that? actually can better html5 (less load cpu, less crossbrowser too) (google it: custom html5 audio player) but if want flash behind scenes, better go jplayer : http://www.happyworm.com/jquery/jplayer/

Convert php to java/android arrays -

$tagarray = array( "apples" => 12, "oranges" => 38, "pears" => 10, "mangos" => 24, "grapes" => 18, "bananas" => 56, "watermelons" => 80, "lemons" => 12, "limes" => 12, "pineapples" => 15, "strawberries" => 20, "coconuts" => 43, "cherries" => 20, "raspberries" => 8, "peaches" => 25 ); how can in java, , how calling first , second params? java has no built in support associative arrays. corresponding datastructure in java map . in case instance make use of hashmap . here's 1 way. map<string, integer> tagarray = new hashmap<string, integer>() {{ put("apples", 12); put("oranges", 38); put("pears", 10); put("mangos", 24); put("grapes"

winforms - C# how to load a form with marquee progress bar? -

i created loadingform progress bar marquee style. in mainform i'm trying this: //before downloading loadingform lf = new loadingform(); lf.show(); //start downloading //finishdownloading lf.close(); the loadingform shown progress bar didn't appear, , form looked crash. after finishing downloading, loadingform closed , app continued run normally. in loadingform have: void loadingform_load(object sender, eventargs e) { progressbar1.visible = true; } i set progressbar1 style marquee in loadingform.design. how fix this? in advance. you should have @ using backgroundworker class time consuming actions, ui can continue showing progress while background worker thread work. how to: use background worker backgroundworker basics in c# c# backgroundworker tutorial

Python win32 service -

i have minimal python win32 service service.py nothing special: import win32serviceutil import win32service import win32event class smallestpythonservice(win32serviceutil.serviceframework): _svc_name_ = "smallestpythonservice" _svc_display_name_ = "display service" # _svc_description_='ddd' def __init__(self, args): win32serviceutil.serviceframework.__init__(self, args) self.hwaitstop = win32event.createevent(none, 0, 0, none) def svcstop(self): self.reportservicestatus(win32service.service_stop_pending) win32event.setevent(self.hwaitstop) def svcdorun(self): win32event.waitforsingleobject(self.hwaitstop, win32event.infinite) if __name__=='__main__': win32serviceutil.handlecommandline(smallestpythonservice) when run: service.py install service.py start it works fine when compile service.py file py2exe service.exe , run following: service.exe inst

Unable to install zope.interface 3.6.1 in python -

i unable install zope.interface 3.6.1 in python windows. if 1 know please me? in command prompt go install zope.interface 3.6.1 folder write "setup.py install" it install

c# - Problem inheriting from ActiveDirectoryMembershipProvider -

i have direct inheritance validateuser activedirectorymembershipprovider called customactivedirectorymembershipprovider. the method overridden validateuser. when custom provider used work except can't find users. getallusers works not findusersbyname or email. when switch on original provider, same settings, starts work. anyone got problem , solved it? have tried overriding "findusersbyname or email" methods , calling base implementation explicitly? i seem recall guessing method calls made through introspection , assume inheriting implementation

actionscript 3 - Combining a multiple strings and arrays to one dataProvider for a spark List -

i'm struggling one, need combine 5 arrays 5 individual strings (which have come json webservice) 1 single list item in flashbuilder burrito. the web service returns data follows title(string) array[0[name, size, imageurl]][1[name, size, imageurl]][2[name, size, imageurl]] title_1(string) array_1[0[name, size, imageurl]][1[name, size, imageurl]][2[name, size, imageurl]] title_2(string) array_2[0[name, size, imageurl]][1[name, size, imageurl]][2[name, size, imageurl]] title_3(string) array_3[0[name, size, imageurl]][1[name, size, imageurl]][2[name, size, imageurl]] and on. i've pulled these out , each 1 traces in debugger, although need them in same list i'm struggling establish them dataprovider together. if push strings , arrays impossible read properly, main titles @ different level descriptors products in arrays. i'm sort of stuck!! any advice on how best approach this? cheers really depends on design of application on how best approach thi

subscribing to c# CompositeCommand from c++ -

in c# assembly i've got global prism compositecommand subscribe this: private static readonly compositecommand __mycommand = new compositecommand(); public static compositecommand mycommand { { return _mycommand; } } from c# can subscribe command using: [...].mycommand.registercommand(new delegatecommand<myclass>((c) => c.something())); my problem: need subscribe command managed c++, , got no idea how function signature needs to used in delegatecommand. of time errors like: error c2664: 'microsoft::practices::prism::commands::delegatecommand::delegatecommand(system::action ^)': conversion of parameter 1 'void (__clrcall *)(mynamespace::myclass ^)' in 'system::action ^' not possible. how subscribe c# command? or there other way listen event (i can replace compositecommand different). thanks! i'm going assume you're using managed c++ - else, , there's bigger issues worry about. it looks you're getting li

Infinite loop in regex in java -

my purpose match kind of different urls: url.com my.url.com my.extended.url.com a.super.extended.url.com , on... so, decided build regex have letter or number @ start , end of url, , have infinite number of "subdomains" alphanumeric characters , dot. example, in "my.extended.url.com", "m" "my" first class of regex, "m" "com" last class of regex, , "y.", "extended." , "url." second class of regex. using pattern , subject in code below, want find method return me false because url must not match, uses 100% of cpu , seems stay in infinite loop. string subject = "www.association-belgo-palestinienne-be"; pattern pattern = pattern.compile("^[a-za-z0-9]\\.?([a-za-z0-9_-]+\\.?)*[a-za-z0-9]\\.[a-za-z]{2,6}"); matcher m = pattern.matcher(subject); system.out.println(" start"); boolean hasfind = m.find(); system.out

c++ - OPENSSL QUESTION - LINUX .cpp code -

in ubuntu: have .cpp code string value. crypt aes , use base64 encoding. how that?! openssl solution, crypts files or strings command line.:( i crypt , encode string in code. command line want use g++ test.cpp -o test -? , library need. for aes encryption check out http://saju.net.in/code/misc/openssl_aes.c.txt to compile app have : g++ -o test test.cpp -lssl -lcrypto

ruby on rails - Devise within namespace -

i'm trying split rails project in front-end regular users , back-end admins. therefore have created namespace 'admin' can control admin specific controller methods/layouts/authentication in map admin. i'm using devise register/authenticate admins only. because used admins i'm trying move devise admin namespace. i not find looking in documentation of devise tried in routes.rb: namespace 'admin'do devise_for :admins end i tried make custom devise::sessions controller didn't seem work out. does know how this? should use regular routes devise custom(admin) layout? simply "moving" devise admin namespace wrong. devise uses controllers devise::sessionscontroller , cannot "moved". i create own controllers , inherit them devise: class admin::sessionscontroller < ::devise::sessionscontroller layout "admin" # rest inherited, should work end and configure in config/routes.rb : devise_for :admin

visual c++ - c++ adding two wchar_t vars -

windows platform. szpath pre defined. want add szpath2 don't want use pathappend function because 'll need link shlwapi library. what should do? want return wchat_t.. wchar_t szpath[max_path]; wchar_t szpath2[max_path] = l"\\project\\myapplication.exe"; any reason aren't using std::wstring ? you can use wcsncat

math - JavaScript rounding numbers -

i know can round number this var number = 1.3; math.round(number); and result i'm given 1 . but how can round number next highest whole number? round 1.3 2 instead of 1 ? var rounded = math.ceil(number); as aside, in platforms no ceil method available, , assuming round rounds nearest integer, common trick used round upwards is: var rounded = math.round(number + 0.5);

concurrency - When do I need to use AtomicBoolean in Java? -

how can use atomicboolean , class for? when multiple threads need check , change boolean. example: if (!initialized) { initialize(); initialized = true; } this not thread-safe. can fix using atomicboolean : if (atomicinitialized.compareandset(false, true)) { initialize(); }

jquery - Javascript reg ex need integer between 1 and 999999? -

i wish solve myself, have never quite grasped regular expressions. seem powerful. wanted ask best resource learn javascript reg ex, subjective , didn't want question closed. have textbox on web form, when has value, value should integer between 1 & 999999. use jquery numeric plug in allow digits, other keystrokes rejected, there onblur implementation, if regex not matched, callback called... code... $.fn.numeric.blur = function() { var decimal = $.data(this, "numeric.decimal"); var callback = $.data(this, "numeric.callback"); var val = $(this).val(); if(val != "") { var re = new regexp("^\\d+$|\\d*" + decimal + "\\d+"); if(!re.exec(val)) { callback.apply(this); } } } can modify regex assure val valid integer between 1 , 999999? appreciated. myself, whats easy way learn javascript regex? thank much. have terrific holiday all! cheers, ~ck in san diego in particular case, recommen

Bad performance function in PHP. With large files memory blows up! How can I refactor? -

i have function strips out lines files. i'm handling large files(more 100mb). have php memory 256mb function handles strip out of lines blows 100mb csv file. what function must this: originally have csv like: copyright (c) 2007 maxmind llc. rights reserved. locid,country,region,city,postalcode,latitude,longitude,metrocode,areacode 1,"o1","","","",0.0000,0.0000,, 2,"ap","","","",35.0000,105.0000,, 3,"eu","","","",47.0000,8.0000,, 4,"ad","","","",42.5000,1.5000,, 5,"ae","","","",24.0000,54.0000,, 6,"af","","","",33.0000,65.0000,, 7,"ag","","","",17.0500,-61.8000,, 8,"ai","","","",18.2500,-63.1667,, 9,"al","","