Posts

Showing posts from May, 2010

c# - Consuming Multiple Webservices at once -

i´ve been checking kayak.com , many other comparison websites create on demand queries multiple web services in order display best results. wondering best strategy consume multiple web services @ once these website do. thank much. sebastian. you need threading in 1 form or other. using fx <= 3.5, use threadpool from 4.0 on, can use tasks better control on it.

c - What is the correct type to use for declaring a metavariable that possibly could match either variables or members in a struct? -

what correct type use declaring metavariable possibly match either variables or members in struct? take instance following example source code: #include <stdio.h> #include <stdlib.h> struct some_struct { int i; char *s; }; void test(void) { struct some_struct *ptr; char *s; s = malloc(100); ptr = malloc(sizeof(struct some_struct)); ptr->s = malloc(100); puts("done"); } with following semantic patch : @@ identifier ptr; //idexpression ptr; //expression ptr; expression e; @@ ptr = malloc(e); +if (ptr == null) + return; the ptr->s allocation not matched unless expression ptr used. use expression seems bit broadly me. correct , way it? in general, want catch lvalue pointer - since you're matching places expression assigned value malloc , plain expression job fine (since non-pointer or non-lvalue should make compiler complain). the problem you're going h...

ruby on rails - What does RJS stand for? -

what letters rjs stand for? simple rails java script? actually, it's ruby javascript. it's simple. sometimes, it's referred "ruby-enhanced javascript" or "javascript with/enhanced ruby".

sql - Representing ecommerce products and variations cleanly in the database -

i have ecommerce store building. using rails/activerecord, isn't necessary answer question (however, if familiar things, please feel free answer in terms of rails/ar). one of store's requirements needs represent 2 types of products: simple products - these products have 1 option, such band's cd. has basic price, , quantity. products variation - these products have multiple options, such t-shirt has 3 sizes , 3 colors. each combination of size , color have own price , quantity. i have done kind of thing in past, , done following: have products table, has main information product (title, etc). have variants table, holds price , quantity information each type of variant. products have_many variants . for simple products , have 1 associated variant . are there better ways doing this? i worked on e-commerce product few years ago, , did way described. added 1 more layer handle multiple attributes on same product (size , color, said). tracked ...

oop - PHP empty() on __get accessor -

using php 5.3 i'm experiencing weird / non-intuitive behavior when applying empty() dynamic object properties fetched via __get() overload function. consider following code snippet: <?php class test { protected $_data= array( 'id'=> 23, 'name'=> 'my string' ); function __get($k) { return $this->_data[$k]; } } $test= new test(); var_dump("accessing directly:"); var_dump($test->name); var_dump($test->id); var_dump(empty($test->name)); var_dump(empty($test->id)); var_dump("accessing after variable assignment:"); $name= $test->name; $id= $test->id; var_dump($name); var_dump($id); var_dump(empty($name)); var_dump(empty($id)); ?> the output of function follow. compare results of empty() checks on first , second result sets: set #1, unexpected result: string(19) "accessing directly:" string(9) "my string" int(23) bool(true) bool(true) expecting set #1 ...

Are the W3C geolocation API accuracy parameter in diameter or radius of your position? -

maybe got head around wrong, after stfw not find info on this. when geolocation api returns position latitute, longitude , accuracy (p.coords.accuracy), accuracy parameter return diameter or radius of position? instance, if accuracy of position 24 meters, mean standing anywhere within radius of 24 meters of position, or within 12 meters radius of position (that give 24 meters diameter, me being in middle of circle of accuracy) any appreciated! it radius. if accuracy 24, true position within 24 meters, mean lie within circle radius 24 around coordinate.

swing - Fickle JMenuBar -

i ran following code 10 times. of 10 runs, 3 showed both menu bar , rectangle, 3 showed rectangle, , 4 showed nothing @ all. doing wrong? import java.awt.*; import java.awt.event.*; import javax.swing.*; import static java.awt.color.*; import java.awt.image.*; public class gui extends jframe implements keylistener, actionlistener { int x, y; public static void main(string[] args) { new gui(); } public gui() { try { uimanager.setlookandfeel(uimanager.getsystemlookandfeelclassname()); } catch (exception e) { e.printstacktrace(); } frameinit(); setsize(1024,768); setdefaultcloseoperation(exit_on_close);; setvisible(true); setjmenubar(createmenubar()); addkeylistener(this); createbufferstrategy(2); x = 0; y = 49; } public void paint(graphics gm) { bufferstrategy bs = getbufferstrategy(); ...

c# - How to substitute place holders in a string with values -

given string string command = "%ans[1]%*100/%ans[0]%" will replace %ans[1]% array[1] %ans[0]% array[2] how substitute place holders in command values in array following result? should use regular expressions this? and using regex.replace ? "test2*100/test1" you try using standard replace . something like string command = "%ans[1]%*100/%ans[0]%"; string[] array = new string[] { "test1", "test2" }; (int ireplace = 0; ireplace < array.length; ireplace++) command = command.replace(string.format("%ans[{0}]%", ireplace), array[ireplace]);

javascript - Single Click issue in IE 6 -

i have following code. code populates list box basing on selection done. code works on ie 7 & fails on ie 6. //---------------------------------------------------------------------------------------------- //fill location list on basis of country function filllocationlist() { var opt = document.createelement("option"); var selected =document.getelementbyid('drpcountryname').selectedindex; var size = document.getelementbyid('drpcountryname').options.length; if(!event.ctrlkey && !event.shiftkey) { document.getelementbyid('drplocation').options.length = 0; for(var i=0;i<locationarray.value.length;i++) { //if(document.getelementbyid('drplocationreportsto').value == locationarray.value[i].locationrptid) if(document.getelementbyid('drpcountryname').value == locationarray.value[i].countrycode) { opt = document.createelem...

Oracle connection not closing in Java Application -

i have connection leak in older java web applications not utilize connection pooling. trying find leak hard because not grant me access v$session select count(*) v$session; so instead trying debug system.out statements. after closing connection conn.close(); when print conn system log file gives me connection object name. try { connection conn; conn.close() } catch (sqlexception e) { } { if (conn != null) { try { system.out.println("closing connection"); conn.close(); } catch (exception ex) { system.out.println("exception " + ex); } } } // check conn , not null , can print object name. if (conn != null) { system.out.println("connection still open , " + conn); } however if add conn = null; below conn.close(); statement connection seems closed. question conn.close(); release connection or have make null release...

how to implement color search with sphinx? -

searching photo dominant colors using mysql quite simple. assuming r,g,b values of dominant colors of photo stored in database, achieved example like: select * colors abs(dominant_r - :r) < :threshold , abs(dominant_g - :g) < :threshold , abs(dominant_b - :b) < :threshold i wonder, if it's anyhow possible store colors in sphinx , perform querying using sphinx search engine? thanks! i have done search colors sphinx. it's there http://code.google.com/p/hppg/ . how works? simple, each color store it's dominant colors in database. database table, witch used sphinx indexing, has column named "colors", it's content filled in following way: /** * part changed based on formula * * fits here better algorithm * * http://en.wikipedia.org/wiki/tag_cloud * 15400 number of maximum matches based on indexed thumbnail size 120x130 px. * */ $max = 15400; $min = 25; $rmax = 50; $rmin = ...

iphone - Custom UITableViewCell imageView not updating after setImage -

i've got custom uitableviewcell class model object performs asynchronous download of image displayed in cell. know i've got outlets connected in ib widgettvc, know image data being returned server, , i've alloc/init'd widget.logo uiimage too. why image blank in tableviewcell? in advance. - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { widget *thewidget = [widgetarray objectatindex:indexpath.row]; static nsstring *cellidentifier = @"widgetcell"; widgettvc *cell = (widgettvc*)[self.tableview dequeuereusablecellwithidentifier:cellidentifier]; if(cell == nil) { [[nsbundle mainbundle] loadnibnamed:@"widgettvc" owner:self options:nil]; cell = self.widgettvc; self.widgettvc = nil; } [cell configurewithwidget:thewidget]; return cell; } in widgettvc class, have following method: - (void)configurewithwidget:(widget*)awidget { s...

android - How to get more control over gradients -

i have following drawable: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startcolor="#2f2f2f" android:endcolor="#5a5a5a" android:angle="90" android:dither="true" /> </shape> is there anyway start startcolor @ 50% or endcolor @ 50%? are there links show me of attributes can apply gradient? these pages show attributes can apply gradient. http://developer.android.com/guide/topics/resources/drawable-resource.html#shape http://developer.android.com/reference/android/graphics/drawable/gradientdrawable.html to in middle asking, try experimenting android:centercolor attribute.

Java-String is never read error! -

this driving me insane! here's code: public static void main(string[] strings) { int input; string source; textio.putln("please enter shift value (between -25..-1 , 1..25)"); input=textio.getint(); while ((input < 1 || input > 25) && (input <-25 || input >-1) && (input != 999 && input !=-999)) { textio.putln(input + " not valid shift value."); textio.putln("please enter shift value (between -25..-1 , 1..25)"); input=textio.getint(); } textio.putln("please enter source text (empty line quit)"); //textio.putln(source); source = textio.getln(); textio.putln("source :" + source);?"); } } however, telling me 'source' never read! it's not allowing me input! can see problem may be? the compiler correct; variable source never read. you're assigning value ( source = textio.getln(); ), you're n...

c# - How to transform ASP.NET URL without URL routing or URL rewrite? -

i using asp.net 2.0 on iis6 therefore can’t use system.web.routing. i’ve tried few url rewriters none did wanted. i need transform (read/parse redirect) url 1 2 minimum iis configuration because don't have full authority reconfigure web servers (i.e. isap on iis6 or install 3rd party extensions/libraries). , can’t transform url 3 because physical links break. http://www.url.com/abc123 http://www.url.com/default.aspx?code=abc123 http://www.url.com/abc123/default.aspx?code=abc123 thank you! create 404 error handler, e.g. 404.aspx. in page, parse request url , extract code using request.path . then, redirect default.aspx?code=abc123. you should able set 404 (page not found) handler 404.aspx website, hosting providers allow that.

python - Command for clicking on the items of a Tkinter Treeview widget? -

i'm creating gui tkinter, , major part of gui 2 treeview objects. need contents of treeview objects change when item (i.e. directory) clicked twice . if treeview items buttons, i'd able set command appropriate function. i'm having trouble finding way create "on_click" behavior treeview items. what treeview option, method, etc, enables me bind command particular items , execute command "on_click" ? if want happen when user double-clicks, add binding "<double-1>" . since single click sets selection, in callback can query widget find out selected. example: import tkinter tk tkinter import ttk class app: def __init__(self): self.root = tk.tk() self.tree = ttk.treeview() self.tree.pack() in range(10): self.tree.insert("", "end", text="item %s" % i) self.tree.bind("<double-1>", self.ondoubleclick) self.root.mainl...

jquery - lazy loading of images on my webpage -

after research , after i've asked questions, i've realized following: jquery plugin lazy load (http://www.appelsiini.net/projects/lazyload) doesn't work on safari , not on firefox. i've tested demo. please need use firebug, , see how images loaded @ once @ beginning , loaded again on scroll (so have double downloading). could give me solution how implement mashable.com images lazy layout ? thanks do this: <img alt='some_text' _src="img_url" class='lazyload'> // please note have added underscore character before 'src' jquery(function(){ jquery('.lazyload').each(function(){ var _elm= jquery(this); _elm.attr('src',_elm.attr('_src')); //on dom ready loop through each //image class=lazyload , add src attribute it. }) });

android - I copy and paste image on EditText, but EditText show me 'obj' -

adding image on edittext works fine. however, copying image problem. when insert image on edittext using imagespan shows correctly, copy inserted image, edittext shows me 'obj'. is there know how solve problem? according documentation clipboardmanager can retrieve text clipboard don't think possible paste image. you can hook paste edittext using ontextcontextmenuitem() method may possible create imagespan manually don't think there image in clipboard paste.

How to set Chrome's user script version number -

edit : bug caused problem has been fixed. @version tag works in stable release. see issue 30760 hey. i've been wondering how might set version number displayed user-scripts in chrome's extension tab example image http://atli.advefir.com/images/chrome_user-script_version.jpeg so far obvious methods have failed: // ==userscript== // @version 1.1.5 // @uso:version 1.1.5 // ==/userscript== i know greasemonkey firefox doesn't use version value, since chrome displays version number, thought might. perhaps feature has not been implemented? or maybe never intended there, there because extensions have version numbers, , user-scripts installed extensions? (i'm using linux beta, version: 4.0.249.43, way) thanks. ok, appears confirmed bug now. ( issue 30760 ) seems standard @version meta-data correct usage, but has not yet been implemented. edit : @version tag works in stable release of chromium (and, therefore, chrome).

javascript - I'm using a mobile broadband usb stick and it's inserting a script into my pages. How can I stop it? -

i've started using 3g mobile broadband usb stick. it's t-mobile, uk mobile commmunications company. seemed well, until tried test site i've been developing locally on uploading live server. when @ code of live site, can see 2 things strange happening: a script being inserted head of documents specifically: <script src="http://1.2.3.8/bmi-int-js/bmi.js" language="javascript"></script> is there can put in code prevent script insertion? normally css included in page like: <link href="style.css" rel="stylesheet" type="text/css" /> however when in source, css has been inserted directly page between script tags like: <style type="text/css" style="display:none">div.calendar{color:#000;font-family:verdana,geneva,arial,helvetica,sans-serif;-moz-box-shadow:0px..... this happening javascript files also. what going on? the modifications you're seeing aren...

java ee - how to allow user comments editable for a few minutes,after which should be made readable -

just want know logic behind , allowing user comments editable few minutes in site ,after should made readable.i had seen in linkedin site. solution use create session during comments submission , refresh every 3 minutes , check whether session has timed out after 14 minutes through ajax.let me know solutions. i need know best solution implement. why not refuse changes after time? when comment made, store 'changesexpire' date (say, 10m in future). when change comment that's past 'changesexpire' date, refuse them. on ui, can have simple countdown timer. put 'edit' button, fire off timer. when timer goes off, hide button. if leave page, no big deal, goes away. if come back, create new timer set remaining time in 'changesexpire' value. no reason keep connections open or here.

How to add datagrid column name in Adobe Flex -

i have defined datagrid follows <mx:datagrid id="dg" width="100%" height="100%" > in part trying details database , setting dataprovider datagrid follows. var arraycontent:arraycollection = new arraycollection(); for(var i:int=0;i<assetclassdetails.length;i++) { var assetclass_:assetitemclassvo = new assetitemclassvo(); var array:arraycollection = new arraycollection(); var embeddablelocale:embeddableassetitemclasslocale = new embeddableassetitemclasslocale(); var assetclassd_:assetitemclasslocale = new assetitemclasslocale(); assetclass_ = assetclassdetails.getitemat(i) assetitemclassvo; array = assetclass_.assetitemclasslocale; if(assetclass_ != null && array != null && array.length >0) { assetclassd_ = ...

What does -%> mean in Ruby on Rails, compared to %> -

this question has answer here: difference between -%> , %> in rails [duplicate] 4 answers what difference between <%, <%=, <%# , -%> in erb in rails? 5 answers i've used <%= some_code %> insert ruby html when using ruby on rails. i've noticed other projects use <%= some_code -%> . <%= some_code -%> minus @ end removes newline. useful formatting generated html, while <%= some_code %> not. thanks, anubhaw

sql - How to create conditional destinations in SSIS Data Flow? -

Image
goal: have db source. depending on variable, need store fixed width file or delimited file. how do in data flow? tried creating conditional split, 2 conditions. 1 condition going fixed width destination, , 1 delimited condition. problem conditional split executed both conditions if no data comes in 1 condition. becuase filename same, errors out. i keep solution folowing tweeks. write out 2 filename-fixed.txt , filename-delim.txt. before steps add row count tasks. then in control flow have 2 success paths. edit success paths both success , expression. add expression checks count new row count tasks in dataflow. if have file system tasks end point have them rename fixed or delim file correct file name. note: didn't try , pics have red x's because find helpful have picture figure out logic not because coded solution.

c# - Provider Design Patterns in asp.net -

i need dll architecture / design patterns / oo. i have been learning class factory design patterns solution current challenge , use feedback @ point. i have 3 classes custom wrappers asp.net 2.0's profileprovider, membershipprovider, , roleprovider. i'd implement way of calling each reasonably simple , intuitive developers. effect of: object obj = new users().permissions.createrole(); object obj = = new users().membership.createuser(); object obj = = new users().profile.getuserprofile(); the examples have read on how using abstract class factory (if, indeed, way go) confusing (i have been working way round this link ). any suggestions on best practices how started? or, better, code illustrations? :) the apis membership provider classes pretty straightforward , don't think there's gained wrapping them. think you're looking facade pattern . create class encapsulates user management activities application , hides internal implementation. cal...

C# checking white space in a textbox -

how can check in c# there white space in textbox , perform operation after that? this ensures multiple spaces caught in check. bool hasallwhitespace = txtbox1.text.length>0 && txtbox1.text.trim().length==0; to check single space only: bool hassinglewhitespace = txtbox1.text == " ";

iphone - initializing viewcontroller(piechartController) to viewcontroller's(covVC) variable -

i doing following initialize viewcontroller(piechartcontroller) viewcontroller's(covvc) variable following …is right change view controller variable ? self.pie = [[chatcontroller alloc] initwithnibname:@"chat" bundle:nil]; self.covvc = [[coverassetcontroller alloc] init]; self.covvc.pieobj = self.pie; coverassetcontroller.h------> @interface coverassetcontroller : uiviewcontroller { chatcontroller *pieobj; } you need add property in coverassetcontroller : @interface coverassetcontroller : uiviewcontroller { piechartcontroller *pieobj; } @property(nonatomic, assign) piechartcontroller *pieobj; and in implementation add : @synthesize pieobj; anyway, it's ok ^^ in fact depends want etc etc.

Deployment items not working with new Visual Studio 2010 test project -

i created new visual studio 2010 test project. <solution> <test-project> resources test-data.csv tests.cs i added 1 test 1 deployment item attribute. [testmethod] [deploymentitem("test-project\resources")] public void some_unit_test() { ... } the file in resources folder not moving test results out directory , not being found test code. you must check "enable deployment" in deployment section of test settings project.

full text search - Searching and and ampersand -

i have php/mysql directory. if searches company name "johnson & johnson" , it's db "johnson , johnson" doesn't match. i'm doing name '% var %' kind of search currently. there easy way work? i'm not sure if it's matter of setting table innodb full text on column or if there's more involved. thanks, don yeah, need more sophisticated search capable of tokenising search terms , searching through tokenised index. of way there full text search in innodb table engine, @ other options. consider: sphinx lucene solr nutch all of these more sophisticated full text indexers , searchers built database engine, require more work set , going mysql full text search too, depends on features need.

python - Why should I make multiple wx.Panel's? -

following this tutorial on wxpython, i've noticed in find/replace dialog example there panels doesn't seem they're doing anything. in fact, seem mess more layout (though mistake made somewhere) example, tutorial has code: panel = wx.panel(self, -1) panel1 = wx.panel(panel, -1) grid1 = wx.gridsizer(2, 2) grid1.add(wx.statictext(panel1, -1, 'find: ', (5, 5)), 0, wx.align_center_vertical) grid1.add(wx.combobox(panel1, -1, size=(120, -1))) grid1.add(wx.statictext(panel1, -1, 'replace with: ', (5, 5)), 0, wx.align_center_vertical) grid1.add(wx.combobox(panel1, -1, size=(120, -1))) panel1.setsizer(grid1) vbox.add(panel1, 0, wx.bottom | wx.top, 9) why different from: panel = wx.panel(self, -1) grid1 = wx.gridsizer(2, 2) grid1.add(wx.statictext(panel, -1, 'find: ', (5, 5)), 0, wx.align_center_vertical) grid1.add(wx.combobox(panel, -1, size=(120, -1))) grid1.add(wx.statictext(panel, -1, 'replace with: ', (5, 5)), 0, wx.align_center_ver...

Formatting columns in C++ -

i have following program generates multiplication table. formatting problem arises when outputs reach double digits. how straighten out columns? #include <iostream> using namespace std ; int main() { while (1 != 2) { int column, row, c, r, co, ro; cout << endl ; cout << "enter number of columns: " ; cin >> column ; cout << endl ; cout << "enter number of rows: " ; cin >> row ; cout << endl ; int temp[column] ; c = 1 ; r = 1 ; for(ro = 1; ro < row ; ro ++ ){ for(co = 1; co < column ; co ++ ){ c = c ++ ; r = r ++ ; temp [c]= co * ro; cout << temp[c] << " "; } cout << endl ; } system("pause"); } } use setw output manipulator : cout << setw(3) << temp[c]; by default, uses spaces fill, looks want. you need i...

Retrieve data for a time interval from a DATETIME Column MySQL /PHP -

im pulling information database , ive got query working fine except i'd select conent date range. each row has field created date stored datetime field. basic syntax? select fields table date between '$startdate' , '$enddate' dates in mysql in yyyy-mm-dd format, actual query like: select fields table date between '2010-10-01' , '2010-09-25'

c - k&r exercise confusion with bit-operations -

the exercise is: write function setbits(x,p,n,y) returns x n bits begin @ position p set rightmost n bits of y, leaving other bits unchanged. my attempt @ solution is: #include <stdio.h> unsigned setbits(unsigned, int, int, unsigned); int main(void) { printf("%u\n", setbits(256, 4, 2, 255)); return 0; } unsigned setbits(unsigned x, int p, int n, unsigned y) { return (x >> (p + 1 - n)) | (1 << (n & y)); } it's incorrect, on right path here? if not, doing wrong? i'm unsure why don't understand this, spent hour trying come this. thanks. here's algorithm: if n 0, return x. take 1, , left shift n times , subtract 1. call mask . left shift mask p times call mask2 . and x inverse of mask2. and y mask, , left shift p times. or results of 2 operations, , return value.

c++ - Cross compiling Direct3D on Linux with mingw -

how configure mingw32 cross-compile direct3d apps windows? there possibility? have succeeded compiling code tutorial: http://www.directxtutorial.com/tutorial9/b-direct3dbasics/dx9b4.aspx - using code::blocks on kubuntu i586-mingw32msvc-g++. needed add #define unicode , remove #pragma ... parts this, , used header files /usr/i586-mingw32msvc/include , libs mingw package. however cannot compile code tutorial: http://www.directxtutorial.com/tutorial9/b-direct3dbasics/dx9b5.aspx mingw doesn't have d3dx9.h file. i've installed wine1.2-dev package wine versions of windows-related header files, have errors: with #define unicode : -------------- build: debug in d3d --------------- i586-mingw32msvc-g++ -wall -g -i/usr/include/wine/windows -c /home/silmeth/programowanie/codeblocks/d3d/main.cpp -o obj/debug/main.o /home/silmeth/programowanie/codeblocks/d3d/main.cpp: in function ‘int winmain(hinstance__*, hinstance__*, char*, int)’: /home/silmeth/programowanie/codebl...

linux - Is there a way to know the creation time of a file in ubuntu? -

i using ubuntu , want know creation time of file when gets modified or accessed ? unfortunately unix not store creation time of file. all able using stat is time of last access time of last modification time of last status change note: when using filesystem type ext4 crtime available!

bash - How can I execute a cron job five seconds after the full minute? -

basically trying execute script '/path/to/my/script/script.sh -value 2' 'testuser' @ every minute's 5th second. (5 seconds delay required "some reason" have been part of script itself, want put on cron). is right way this? * * * * * testuser sleep 5 && /path/to/my/script/script.sh -value 2 yes. yes will.

wpf - please explain what is themes and generic.xaml? -

i noticed when create custom control in visual studio adds generic.xaml themes folder. what purpose of folder, special generic.xaml? why when try link own dictionaries generic.xaml not seem picked application? thanks! konstantin

html - How to edit and see live CSS effect in IE8 like we see in Firefox > Web developer toolbar > Edit CSS function? -

how edit , see css effect in ie8 see in firefox > web developer toolbar > edit css function? where similar function in ie8 developer toolbar or other ie plugin have type functionality? according msdn, doable directly ie8 developer tools: http://msdn.microsoft.com/en-gb/library/dd565628%28vs.85%29.aspx#html_liveedit

windows - TWebBrowser and IE version -

when asked this question accepted answere because made sense , documentation pointed right. testing machine ie6 against other 1 ie7 same compiled executable using twebbrowser behaviour indeed pointed in answere. now put answere in doubt again, in machine ie8 same executable being identified ie7 server. wrote simple rails app pirnts user agent , clear. in same machine if access rails app in ie prints: mozilla/4.0 (compatible; msie 8.0; windows nt 6.0; trident/4.0; gtb6.5; slcc1; .net clr 2.0.50727; .net clr 3.5.30729; infopath.2; .net clr 3.0.30729) when access using executable: mozilla/4.0 (compatible; msie 7.0; windows nt 6.0; trident/4.0; gtb6.5; slcc1; .net clr 2.0.50727; .net clr 3.5.30729; infopath.2; .net clr 3.0.30729) furthermore, little friend process monitor realized classid called instantiate twebbrowser {8856f961-340a-11d0-a96b-00c04fd705a2} wich in windows registry has name "microsoft web browser" , points ieframe.dll. now things little more s...

graphics - C# Drawing, Strange Behaviour -

the following code straight forward - fills design surface randomnly selected pixels - nothing special (ignore xxxxxxx's in 2nd method now). private void paintbackground() { random rnd = new random(); bitmap b = new bitmap(this.width, this.height); (int vertical = 0; vertical < this.height; vertical++) { (int horizontal = 0; horizontal < this.width; horizontal++) { color randomcolour = getrandomcolor(rnd); b.setpixel(horizontal, vertical, randomcolour); } } graphics g = this.creategraphics(); g.drawimage(b, new point(0, 0)); } public color getrandomcolor(random rnd) { xxxxxxxxxxxxxxxx byte r = convert.tobyte(rnd.next(0, 255)); byte g = convert.tobyte(rnd.next(0, 255)); byte b = convert.tobyte(rnd.next(0, 255)); return color.fromargb(255, r, g, b); } the question have this... if replace xxxxxxxxx "random rnd = new random();" test pattern changes horizontal b...

moss - SharePoint 2007: How to get List URL from List Name using Web services? -

i have moss list, how can url list list name using web service methods? for next poor sucker working without documentation: /// <summary> /// sharepoint web service: lists. /// </summary> private readonly sharepoint.lists.lists wslists = new sharepoint.lists.lists(); private string getlisturlfromname(string listname) { xmlnode node = wslists.getlist(listname); return node.attributes["rootfolder"].value; }

PHP drop down return to previous selection -

ok small section of original code. have 2 pages page full of forms , boxes page puts information db. oasis.php page right here code changes client name , code. on entire page. on change event. $sql = "select * client_lookup order client_full_name asc"; $result = mysql_db_query ($dbname, $sql, $dblink); $options4=""; while ($row = mysql_fetch_array($result)) { $id=$row["client_code"]; $thing=$row["client_full_name"]; $options4.="<option value=\"$id, $thing\">".$thing; } ?> <form name="form" action="<?php echo $_server['php_self']; ?>" method="post"> <select name="clientnamefour" onchange="this.form.submit()"> <option value=0>client <?php echo $options4?> </select> </form> once form below on oasis.php page submitted goes process page , puts information data base. once done have...

ASP.NET MVC 2 Html.TextAreaFor not updating on Edit -

i have form lets user enter in text. longer few characters want use textarea instead of textbox. the html.textboxfor works without issue, , html.textareafor works when create entry, not store new value when edit , shows whatever value before went edit upon saving. on page: <div> <label>work performed:</label> <%: html.textareafor(model => model.workperformed)%> <%: html.validationmessagefor(model => model.workperformed) %> </div> code behind create: maintperformed.maintdate = datetime.parse(request.form["maintdate"]); maintperformed.workperformed = request.form["workperformed"]; maintperformedrepository.add(maintperformed); maintperformedrepository.save(); return redirecttoaction("details", new { id = maintperformed.id }); code behind edit: maintperformed.maintdate = datetime.parse(request.form["maintdate"]); maintperformed.wor...

Progress bar in ASP.NET for imported/exported table data -

i have asp.net application in data getting imported/exported. wish have progressbar, below. a table 1 row , cells keep on adding. once row full, empty row , add new cells same row. for think need have thread functionality keep "rendering table" client without postback while export/import. how can that? the following code doesn't use table, instead divs, should you're after. included html , body tags can copy , paste see looks like. client side of course, , not depend on asp.net, idea start progress bar onsubmit event, , response page doesn't start loading until data inport/export has completed <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html><body> <div id="progressdiv" style="width:100%;"></div> <script type="text/javascript"> timerid = setinterval("addblock()", 100...

websphere - Where can I find a particular version of the IBM JDK/JRE for Windows? -

i'm trying rather jdk-sensitive piece of oracle software working websphere, , need find particular versions of ibm jdk try. problem ibm doesn't make these readily available sun/oracle theirs, , versions i've been able hands on haven't worked 1 reason or another. specifically, need 1 of: ibm java 5 sr9 windows (ideal) ibm java 5 sr2 windows ibm java 5 sr10 windows how these directly ibm? company has support contract websphere, , have 1 of our websphere engineers download if can tell them go. if there's no direct download, free products ibm jdks scavenge old version from? i don't know if still true(but true in past), here story. due java license restrictions earlier, jdk cannot provided alone vendors ibm. i unable pull info ibm site @ moment pretty these license restrictions in past. here post gentleman in space: : http://www.ibm.com/developerworks/forums/thread.jspa?messageid=14514070 unfortunately can hold of jdk part of ibm p...

r - ggplot2: Use options for multiple plots -

i create 10 plots have different data, same optical appearance. example, i’d change colour of gridline each plot. done adding + opts(panel.grid.major = theme_line(colour = "white") to each plot definition. however, when decide change background colour let’s “grey25”, i’d have modify each plot individually. seems way work. ;) so, thought doing like opt1 <- '+ opts(panel.grid.major = theme_line(colour = "white")' and define each plot like pl_x <- pl_x + opt1 pl_y <- pl_y + opt1 ... other options (margins, fonts, scales,…) added opt1. however, doesn’t work (error message when trying print pl_x). maybe knows how accomplish i’d do? i played around theme_set , theme_update, resulted in none off plots working anymore unless restarted r. you don't have add + sign. opt <- opts(panel.grid.major = theme_line(colour = "white")) pl_x <- pl_x + opt although doesn't work: opt <- opts(...) + scale_y_con...

regex - Matching non-whitespace in Java -

i detect strings have non-whitespace characters in them. right trying: !pattern.matches("\\*\\s\\*", city) but doesn't seem working. have suggestions? know trim string , test see if equals empty string, rather way what think regex matches? try pattern p = pattern.compile( "\\s" ); matcher m = p.matcher( city ); if( m.find() ) //contains non whitespace the find method search partial matches, versus complete match. seems behavior need.

diff - TFS commits unchanged files -

we're using ms visual studio 2008. tfs seems take account creation date of file or something, determine whether files should committed. is possible make tfs test on filename , content? i check out xml or txt file i copy content i open notepad , paste i save file using same name, , confirm overwrite i commit: tfs by default selects file committing although name nor content has changed. our concrete use case: nightly run script generates xml files (overwriting existing files) , commits them. commit ones changed keep history clean. thanks in advance! jan when perform check-in of file, have @ changeset created in history view. tfs check contents of files uploaded , include file in changeset if md5 hash of file different last version in version control. is not see? have multiple versions of same file identical in content? if - extension files have? .xml or else?

php - class array within double quotes -

i have follow 2 classes class { .... protected $arr = array('game_id','pl_id'); ... } class b extends { //for example here add method private function add_to_db() { $query = "insert table(game_id,player_id) values(????,????)"; //here question,what must write?? mysql_query($query); } } i try write ..values(\"$this->arr[game_id]\",\"$this->arr[pl_id]\")" , or values(".$this->arr[game_id].",".$this->arr[pl_id].")" ,but not working. thanks advise i think found solution of question. in class must have _ set , _ methods. class a { .... protected arr = array('game_id'=>null,'pl_id'=>null); function __set($property, $value) { if (array_key_exists($property, $this->arr)) { $this->arr[$property] = $value; } else { ...

c++ - cublas link in visual studio -

i trying use cublas.h in visual studio. program doesn't compile because can't find of external link. can 1 tell me how link .dll file, believe in ../c/common/bin. you need link lib file, not dll.

Silverlight (4.0) for WPF users -

for years have exclusively worked wpf , never touched silverlight. there quick tour wpf pros introduces me silverlight (4.0) unique features , differences wpf? pls, see if links below useful you contrasting silverlight , wpf silverlight 4 beta information silverlight architecture

terminology - What do Push and Pop mean for Stacks? -

long story short lecturer crap, , showing infix prefix stacks via overhead projector , bigass shadow blocking missed important stuff he referring push , pop, push = 0 pop = x he gave example cant see how gets answer @ all, 2*3/(2-1)+5*(4-1) step 1 reverse : )1-4(*5+)1-2(/3*2 ok can see that he went on writing x's , o's operations , got totally lost answer 14-5*12-32*/+ reversed again +/*23-21*5-41 if 1 explain me push pop understand greatful, have looked online alot stuff im finding seems step above this, need understanding here first hopefully visualize stack, , how works. empty stack: | | | | | | ------- after pushing a , get: | | | | | | ------- after pushing b , get: | | | b | | | ------- after popping, get: | | | | | | ------- after pushing c , get: | | | c | | | ------- after popping, get: | | | | | | ------- after popping, get: | | | | | | ---...

html - Generate "table" with <div> -

Image
i'd generate representation below <div> . constraints : the full size = 100% the first + second column = 50%, 3rd + 4th column = 50% the first column smaller second, second take "the rest of place", same column 3 , 4 :) the 3rd lines, combines 2 cells the last line combine 4 cells don't worry color :) ps : no debate table vs div ;-) here proposed markup: <div class="row"> <div class="col half"> <div class="col narrow">(1)</div> <div class="col remainder">(2)</div> </div> <div class="col remainder"> <div class="col narrow">(1)</div> <div class="col remainder">(2)</div> </div> </div> <div class="row"> <div class="col half">(3)</div> <div class="col remainder">(3)</div> </div> <div class=...

c# - Designing database interaction while following Single Responsibility Principle -

i'm trying adhere single responsibility principle better, , i'm having issues grasping how structure general class design communicating database. in simplified version, have database containing: manufacturer <== probes <==> probesettings a probe has manufacturer. probe has 1 set of settings. related objects accessed on application, , quite frankly, current implementation mess. currently, here's general view of how communication , objects implemented: public class manufacturer { public int id; // primary key, auto-incrementing on insert public string name; } public class probe { public int id; // primary key, auto-incrementing on insert public int manufacturerid; public string name; public int elements; } public class probesettings { public int probeid; // primary key, since unique. public int randomsetting; } // class mess... public static class database { public static string connectionstring; public static void insertmanuf...

java - ctrl-click goes to the declaration of the method I clicked. For interfaces with one implementation, how can I just directly go to that implementation? -

i have debug java code written there interface , 1 implementation of interface. for instance there interface foo 1 implementation called fooimpl. in following code if ctrl-click on dothings it'll jump foo.java when want go fooimpl.java see implementation. public void dostuff(foo foo) { foo.dothings(); } when end @ interface have use ctrl-shift-r open fooimpl. it'd nice if lick ctrl-alt-click on dothings , end inside fooimpl.java. if there multiple implementations in workspace perhaps pop box telling me are. is there plugin or existing function in eclipse this? know go foo.java , hierarchy , go implementation, that's more clicks necessary when there 1 implementation of interface. the implementors plugin pretty ask for. if there 1 implementation open directly, otherwise let choose.

ssl - ASP.NET MVC 2 and request client certificate (Smart Card authentication) -

i need capture user's x.509 certificates cards , map user table forms authentication in asp.net mvc. have created mvc (ver 2) project in vs 2008, configured run virtual directory under default web site in local iis on vista using default template added requirehttpsattribute account/logon actionresult. no other changes. using local iis manager, created self-signed cert , applied it, set account/logon.aspx page require ssl , require client certificates. running in debug, when click 'log on' link welcome page (home/index view), correctly routes account/logon.aspx using https no prompt certificate. using dynatrace (awesome, http://ajax.dynatrace.com ), can see response status getting set 403 again, no cert prompt. as sanity check, set default asp.net web app project run in virtual directory in default web site (same mvc project above) in vista , configured default.aspx page require ssl , require client certificates, done in mvc project above. ran it, works fine, ce...