Posts

Showing posts from August, 2015

vba - How do i make one form in a word document open multiple other documents and fill out identicall headers in word / excel? -

i want user open 1 document prompts bunch of header information, once user presses button, opens other selected word docs , excel spreadsheets (if possible) saves , closes them. you can use workbooks.open(filename:="c:\test.xls") and activeworkbook.save , .close accodingly note can work on 1 workbook @ time

Using MEF in a windows service? -

i'd use mef in windows service / wcf service. the configuration of aggregatecatalog no problem, do methods createshell() , initializeshell()? service can't have shell, return null? and create , run bootstrapper? in onstart of service class? mef doesn't have createshell , initializeshell methods. think methods prism uses. prism ui application framework uses mef. since writing service, wouldn't use prism, use mef. create compositioncontainer connected catalog you've created, , can pull exports container.

javascript - How local use Google closure compiler through php? -

how use closure compiler library ( local ) , php can obfuscate js? i grateful code. perhaps there php class? thanks. use system() or backtick operator execute it.

c# - Expressions<func>? -

can explain use of expressions<func> ? i'm going assume mean expression<func> func variety of generic func delegate. if case, expression<func> doing getting expression tree of lambda you're passing in place. you'll find commonly on variants of iqueryable<t> or in many fluent interfaces. the expression trees used @ run-time translate lambda expression other format. such sql in case of linq sql. you can read more on expression , more expression trees in .net

C++ copy constructor - small but important difference -

i couldn't figure out happening here, thought strange, , after getting understand reason thought sharing answer valuable somebody's time. so given simple code: #include <iostream> using namespace std; class shape { public: int* a; shape(){ cout<<"default shape constructor"<<endl; = new int(8); // default } shape(int n){ = new int(n); cout<<"shape(n) constructor"<<endl; } // copy constructor shape(const shape& s){ cout<<"shape copy constructor"<<endl; = new int(*(s.a)); } shape& operator=(const shape& s){ cout<<"shape operator="<<endl; if (&s == (this)) return (*this); // this.clear(); = new int(*(s.a)); return (*this); } virtual void draw(){ cout<<"print shape number "<<*a<...

Loading SVG files with python and pygame -

possible duplicate: svg rendering in pygame application can load .svg files created inkscape python via pygame? , if so, how can it? no cannot, pygame supports following image formats: jpg png gif (non animated) bmp pcx tga (uncompressed) tif lbm (and pbm) pbm (and pgm, ppm) xpm you can rasterize svg using cairo rsvg library . there documentation on pygame's web .

performance - Excanvas: Can I use Processing.js with it at near-normal (for <canvas>) speeds? -

i've come across google's excanvas stuff... it's , having <canvas> turdier browsers out there, wondering how optimised was; can use processing.js on (probably) , framerates close i'd on native canvas in chrome/firefox? thanks, james this depend on sturdiness of machine code gets executed on, , speed of javascript interpreter run code. extcanvas means overhead, , versions of chrome , firefox support hardware acceleration of canvas rendering. this makes unlikely using extcanvas yield same results (as far speed concerned) canvas tag

asp.net newbie question - css href path -

when start debug mode of asp.net website, renders in browser url http://localhost:111/mywebsite/default.aspx the css file referenced in html <link href="~/css/style.css" runat="server" rel="stylesheet" type="text/css" /> so naturally site breaks because looks css file in localhost:111/css/ instead of localhost:111/mywebsite/css /. when launch website, served url: http://mywebsite.com so there way reference stylesheet in both dev , production area simple prefix <?=$site_url ?> or something? additional info in solution explorer, see project marked path c:\...\mywebsite . why ~ assumes project in subdirectory? how tell visual studios project should served http://localhost:111/default.aspx ? this see in page source of both localhost , production server: <link href="~/css/style.css" rel="stylesheet" type="text/css"></link> . css active on production, not localhost. ...

PrestaShop Product Import Issues -

first of all, give specifications of install: prestashop version: 1.3.6 php version: 5.2.6 mysql version: 5.0.51b apache version: 2.2.8 all above running on wamp install. now, error. attempting import product catalog of 4,521 products install. in order run smoothly, have split import 41 different csv files. ranging 5 products minimum in 1 sheet maximum limit of 150 products per sheet. import importing 7 fields: category, name, price tax incl., image, custom feature 1, custom feature 2 , reference #. the issue arises during import. csv 30 products imports fine, 1 90 products fails @ 76 , 1 146 fails @ 87. reason not importing more , backend import screen fails , shows header , footer blank tiny content area if page didn't load! i find strange csv 146 products gave no problem during import limits importing 87 products! has every had occur or similar, , if so, how did fix it?? ps: before asks, have upped memory limits in php.ini such as: upload_max_filesize; max_inpu...

java - Interprocess communication between Android and C# -

attempting perform sockets communication between android , c# seem stuck. this code have far. android: public void onclick(view v) { try { inetaddress serveraddr = inetaddress.getbyname("localhost"); socket mysocket = new socket(serveraddr, 666); } catch (unknownhostexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } } c#: tcplistener listener = new tcplistener(system.net.ipaddress.parse("127.0.0.1"), 666); listener.start(); using (socket socket = listener.acceptsocket()) { using (stream stream = new networkstream(socket)) { } } when hitting line socket mysocket = new socket(serveraddr, 666); in android application getting following error. "java.net.connectexception: localhost/127.0.0.1:666 - connection refused" anyone able guide me doing wrong? ps: testing through emulator wondering if there possibly sort of limitation ability commu...

html - How to do something like Google/Wiki/Facebook search field? -

their search fields can type , have kind of list showing here.... example, when type "wikipedia" , when start type "w", have "wi", "wii", "will" , somethings that... ...how similar this? thank you. several javascript libraries provide functionality. example jquery, can use autocomplete pulgin . link includes demo.

.net - Get The Version Of Executable From Lua -

i need version of executable function getassemblyversion(assemblyname) print(assemblyname) luanet.load_assembly("system") fileversioninfo = luanet.import_type("system.diagnostics.fileversioninfo") return fileversioninfo.getversioninfo(assemblyname).fileversion end version = getassemblyversion('c:\\temp\\new\\setup.exe') print(version ) it's not clear in question, if you're looking lua version, can use _version . see http://www.lua.org/manual/5.1/manual.html#pdf-_version

jquery - Call a JavaScript function when an element is fully loaded -

i have on modalwindow (from wicket extensions) following code (in html file): <wicket:head> <script src="static/js/scroll.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { ffscroll('.scroller2'); }); </script> </wicket:head> <wicket:panel> <div wicket:id="scroller2" id="scroller2" style="overflow-x: hidden; overflow-y: auto; height: 240px" class="scroller2 yyyy zzzz"> .... </div> </wicket:panel> and scroll.js function ffscroll(id) { $(id).scroll(function () { alert(id); }); }; if use simple page code works fine: every time scroll receive alert. but in modalwindow saw javascript code executed before modal window displayed, suppose need call ffscroll('.scroller2'); after modal window displayed, don't know how this. a s...

css - GWT Tree styling -

i have normal tree widget want style. know tree widget has following styles: •.gwt-tree { tree } •.gwt-tree .gwt-treeitem { tree item } •.gwt-tree .gwt-treeitem-selected { selected tree item } the webb people sent me css , html example how should like css: /* menu styling */ #menu li { margin-top: 8px; margin-bottom: 8px; /*margin: 8px 0 8px 0;*/ padding: 0; } .menuitems,.indented { background: none repeat scroll 0 0 transparent; border-width: 0; float: left; font-size: 100%; list-style-image: none; list-style-type: none; margin: 0; padding: 0; } .menuitems { * display: block; * float: left; * clear: left; } .indented { border-left: 1px solid #005284; border-right: none; padding-left: 5px; margin-left: 20px; } .menuitems { color: #000000; display: block; } .men...

html - How to make this background stretch throughout the whole website -

hi guys have site: http://www.ryansammut.com/orijen/ basically far managed make top part strech background, need make other parts too. i'm not sure how it, i'm asking ideas how done best, keeping positioning relative , background image adjust according needed content area. ps. needed resolutions greater 1280px, zoom out if need see what's happening. you can not stretch elements because contained in div named 'wrapper', has maximum width of 1280px. add following properties : header, contentbackground, , footer: margin-left:auto; margin-right:auto; this make sure elements centered. then remove width property #wrapper, , add background reads follows : #wrapper { position: relative; margin: 0 auto; top: 0px; padding: 0px; background-image: url(../images/contentbg.png); } however, won't see horizontal stretch of header anymore, need move #header above #wrapper. <div id="header"> ... </div> <div id...

jquery - Why does this not work on blackberry -

i have ajax function works on android, iphone, blackberry torch , webkit browsers. im trying test on various version 5 , 6 blackberry simulators error handler gets called. eg response in message boxes is: error, complete. the error returned function is: 'error- status: error jqxhr status: 0 responsetext:' whereas other devices is: success complete. do have special blackberry? $(document).ready(function () { //login form login link click $("#login a.login").click(function () { //call approve method on code behind $.ajax({ type: "post", url: "login.aspx/loginuser", data: "{'username':'admin', 'password':'admin' }", //pass parameter names , values contenttype: "application/json; charset=utf-8", datatype: "json", async: true, ...

java - Why not to start a thread in the constructor? How to terminate? -

i learning how use threads in java. , wrote class implements runnable run concurrently thread. main thread handles listening serial port second thread handle sending data same port. public class mynewthread implements runnable { thread t; mynewthread() { t = new thread (this, "data thread"); t.start(); } public void run() { // new thread code here } there first thread starts second this: public class main { public static void main(string[] args) throws exception{ new mynewthread(); // first thread code there } } this works complier flags warning saying: dangerous start new thread in constructor. why this? the second part question is: how if have loop running in 1 thread (the serial port listen thread) , type exit command in second thread. how first thread terminate? thanks. to first question: starting thread in constructor passing in this escapes this . means giving out refere...

c# - Visual Studio 2010: Add new class file that inherits from existing class? -

is there way in visual studio 2010 add new file (class) project inherits existing base class, abstract or otherwise? seems simple concept can't find way it. i'd able example right click class name in ide , and select "add new inheriting class" or similar. 1 of things save lot of repetition. ideally implement (generate stubs) abstract members, etc. does know way either through stock vs2010 or resharper? i've dug through both , can't find anything. interestingly enough, resharper allow generating superclass, not subclass.. i don't think it's faster right click -> add base class add class file , type : base behind it. if want implement abstract class can right click on base class , select "implement abstract members" you can use class diagram tool (right click project , select view class diagram) add class , drag inheritance arrow toolbox onto it.

php - array type of question -

i'm trying figure out way make small "table" style system in php 10 data rows. because requires constant editing, want replace mysql system in php directly. the data 10 rows of: id first name last name i give php file id , want pull out first name , last name. i tried using associative array, turned coding mess syntax on place. how can set 1 can edit data in single place , first , last name of row $id? edit - example: id fname lname 1 john ter 2 mark laken 3 peter lars 4 vlad morch basically, how set info above in php such can add new rows without trouble , code still work, , such possible output fname , lname $_get of id value... hope makes sense! i'm not understanding why wouldn't want store changing data in database, here how hardcode it: $data = array( 'id01' => array( 'firstname' => 'eric', 'lastname' => 'smith', ), 'id02' => array( 'firs...

iphone - AVAssetExportSession Error -11820 -

i'm writing application works video using avfoundation. the behaviour of application simple: take video camera roll, create avmutablecomposition audio tracks. mix composition initialize avassetexportsession stores video file in documents directory of app. until point it's ok: video stored , i'm able play in controller. if take video have stored in documents folder make editing (in same way of first time avmutablecomposition, avassetexportsession) it's ok again. but third time process editing video avassetexportsession status becomes "fail" , error: "domain=avfoundationerrordomain code=-11820 "cannot complete export" userinfo=0x1a9260 {nslocalizedrecoverysuggestion=try exporting again., nslocalizeddescription=cannot complete export}" i have read general error session couldn't exported. sense of this? why third time made editing process? memory management mistake? bug?. code of avassetexportsession: _assetexport = [[...

iOS build settings Property List Output Encoding -

what's property list output encoding for? if set binary, compress plist files? if set binary , xcode appears take in xml property lists , save them application bundle binary property lists. binary property list has more compact file format xml property list, don't know if you'd call compressed. from property list programming guide : xml property lists more portable binary alternative , can manually edited, binary property lists more compact; result, require less memory , can read , written faster xml property lists. in general, if property list relatively small, benefits of xml property lists outweigh i/o speed , compactness comes binary property lists.

javascript - Positioning Element Relative to its Friend Element -

i create effect same position relative in css using jquery. i have created type of tooltip trying attach different objects such textboxes, checkboxes, text etc. so code along lines of <input id="adsfjlk" type="textbox" /> <div class="tooltipballoon"> text</div> now of course css relative positioning based on elements parent. cannot in case cannot place div inside of input element. currently use jquery position tooltip right of textbox. the problem comes when on page changes. example if have elastic textarea above textbox. when expands pushes down textbox , tooltip no longer aligned correctly. because of amount of different things happen cannot apply onchange type event elastic , instead need better way keep elements positioned relative each other. i'm not sure how displaying tooltips (on focus, on hover), have created example of how may create tooltips inputs. http://jsfiddle.net/c4kyd/2/ i followed each...

c - Awkward data structure -

i writing utility takes tab delimited text files , outputs html tables. part of functionality ability pass filter values @ command prompt. so, example, if have column "a" should able pass --filter "a" "foo" , see rows column "a" contained "foo." this brings me question. i'm writing in c, , perhaps due inexperience language, i'm having trouble expressing "filter" data structure. my initial stab @ problem store filters upfront: //parse parameters , values, i.e. --start, --length (; i<argc; i++){ if (argv[i][1] == '-'){ argv[i]++; //strip long options if (i+1 == argc || argv[i+1][0] == '-'){ fprintf(stderr, "error: missing argument optional parameter!\n"); exit(1); } } if (strcmp(argv[i], "-start")==0) start = strtol(argv[i+1], null, 0); else if (strcmp(argv[i], "-length")==0) ...

c# - Path functions for URL -

i want use functions of path class ( getdirectoryname , getfilename , combine ,etc.) paths in url format slash (/). example of path: "xxx://server/folder1/folder2/file" i tried job path functions , in end replaced separator. i've found getdirectoryname function not correctly replace slashes: path.getdirectoryname(@"xxx://server/folder/file") -> @"xxx:\server\folder" like see 1 slash lost. how can cause path functions use 'alternative' separator? can use class same functionality? i'm afraid getdirectoryname , getfilename , combine ,etc. use path.directoryseparatorchar in definition , want path.altdirectoryseparatorchar . and since path sealed class, think way go string replacement.you can replace path.directoryseparatorchar ('\') path.altdirectoryseparatorchar ('/') , path.volumeseparatorchar (':') ":/"

email - How to send BCC via MFMailComposeViewController in iPhone SDK? -

one part of app sends e-mail attachment. i'm using mfmailcomposeviewcontroller class, , well. i know if can send stealth bcc message myself, statistics purposes keep track of how many messages have been sent. thank you! update: user tc didn't understand trying accomplish. don't want invade user's privacy. need keep track of events on app. didn't make myself clear on needed. how setbccrecipients: method on instance of mfmailcomposeviewcontroller ? depending on content of e-mail message being composed, might want re-think sending bcc yourself, unbeknownst users... sayin'...

iphone - Make Sure Database Records Are Consecutive -

i'm making iphone rss app downloads articles internet, cache them in database. fetch 25 articles @ time internet, problem when last fetch long time ago, there gap between latest 25 articles , cached 25 articles. means need continue download articles between them. but, how know wether or not 2 fetch's articles consecutive? need flags in database? ideas? any appreciated! lot. kai. have timestamp articles, latest timestamp of stored items (this give latest stored rss article) , start comparing timestamp of items fetched. once find first date newer local stored one, it's point want start fetching new results.

actionscript 2 - Variable names in AS2 # -

can use # sign in as2 variable names? like ->> var item_#_productname = "test" i must use list of preset varilable names getting syntax error when use # sign. any thoughts on how this? thank you if stuck #, can try omitting var , use: set: this["item_#_productname"] = "test"; get: return this["item_#_productname"]; // returns "test"

backslash - Need to select only data that contains backslashes in MySQL -

i'm attempting correct entries in database have been double-escaped. believe magic_quotes on while mysql_real_escape_string being used. double-escaping has caused search results incorrect/missing. i've turned magic_quotes off , planning search entries backslash , update them remove double-escaping. trouble is, when perform query search entries backslashes, no results. select title exampletable title '%\\\\%' i'm using '%\\\\%' recommended here: http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like if output every title, many of them have unwanted backslashes, know they're there. can't seem isolate them in query. example data: old king\'s road running down dream can\'t stop sun one's me again, trying return entries \ in them. edit: mysql version 5.0.92-community. collation latin1_swedish_ci. charset utf-8 unicode %\\% not work. i've tried. listed incorrect on mysql.com: t...

asp.net - label text not persisting on a published website -

i have label on master page default text <dxe:aspxlabel id="m_label" runat="server" font-bold="true" forecolor="white" righttoleft="true" text="labeltext"> </dxe:aspxlabel> and set text on master page if (!page.ispostback && !page.iscallback) { if(condition) { m_label.text="one" } else { m_label.text="two" } } if run web page source code displays correct text i.e 1 or two. if publish web page , open page says "labeltext" am missing anything? just thought, page being cached? noticed code set run when not postback (i.e. request) , such, subject caching. try ctrl+f5 in internet explorer force refresh. alternatively, using proxy server? may caching page.

iPhone - UIButton with non resized image inside -

i have uibutton "custom" type, "image" property gets image resources. image smaller button. cannot achieve interface builder keep original size of image while scaling button's dimensions want. how may have button of size ib, keeping original image size, aligning on center, left right, bottom, inot button... ? isn't possible without putting uiimageview on ? make sure contenthorizontalalignment , contentverticalalignment properties of button not set uicontrolhorizontalalignmentfill , uicontrolverticalalignmentfill respectively. values scale button image fill button frame. other value align image appropriately.

sorting - SQL sort based on sum of various columns -

i have ms-sql table of game results contains home team, home team score, away team, , away team score. attempting query teams, wins, , losses ordered first, total wins(descending) , total losses(ascending). table does not contain wins or losses column. wins , losses must calculated based on score. if need create view or temporary table, how create view teams, wins, , losses? select * mytable ... order sum(win) desc, sum(loss) asc for more detailed answer, provide schema , sample data.

c# - Evaluate expression as string, return object? -

basically have code when happens, need set object equal expression. of "what do" jazz stored string. parse it, , use reflection find object doing to. need find out how store value object. problem value "1", "1*(5/2)", or "some string value". cool if have expressions "this.someproperty" or "(x > 3 ? 4 : 5)". also, object storing to, string, int, double, or float @ minimum. the vs2008 samples included nifty expressionparser used generic expression parser ( vs2008 samples ). few small updates, , custom factory class, can turn bit more expressive: string expression = "(1 + 2)"; var func = functionfactory.create<int>(expression); or: expression = "(a * b)"; var func2 = functionfactory.create<int, int, int>(expression, new[] { "a", "b" }); the return types of these create methods func<> instances, means nice type delegates: int result = func2(45...

How to shift elements of an array to the left without using loops in matlab? -

i have fixed sized array in matlab. when want insert new element following: to make room first array element overwritten every other element shifted @ new location index-1 ---left shift. the new element inserted @ place of last element becomes empty shifting elements. i without using loops. i'm not sure understand question, think mean this: a = [ a(1:pos) newelem a((pos+1):end) ] that insert variable (or array) newelem after position pos in array a . let me know if works you! [edit] ok, looks want use array shift register. can this: a = [ a(2:end) newelem ] this take elements 2nd last of a , added newelem variable (or array) end.

plugins - need to update plug-in to work with jquery 1.4.3 -

i've been using excellent plug-in called imageswitch avaliable from: http://www.hieu.co.uk/blog/index.php/imageswitch/ ive been using succseusfully in site did few months agao needs update, needed switch jquery 1.4.3 use html5 .data() the imageswitch plug-in not work under version of jquery, i'm not @ sure start looking fix plug-in use 1.4.3 so asking here if knows can find version works 1.4.3 maybe else has run same problem , has copy of updated script. heres code in case simple fix: * jquery.imageswitch * version: 1.0.2 * http://www.hieu.co.uk/imageswitch/ * * copyright (c) 2009 hieu pham - http://www.hieu.co.uk * common development , distribution license (cddl) * http://www.opensource.org/licenses/cddl1.php * * date: 13/03/2009 * revision: 50 */ //this function preload image before using in function (function($){ $.fn.imageswitch = function(arguements, funtionhandle) { var defaults = { type: "fadein", // type of eff...

java - Hibernate data export / import for a single tenant -

i have posted quite general question implementing multi-tenant solution using specific technologies in past. have more specific question hoping input on. for our multi-tenant application have requirement export single tenant's data 1 database database. example, our db might contain 10 tenants' data 1 of these 10 tenants wants have own instance of application (for whatever reasons, e.g. require specific customizations). so want able write "tool" take data tenant x , move it's own database. we using mysql database , latest version of hibernate core , annotations. the way have implemented multi-tenancy add tenant id our tables / base class our entities extend. originally thought use this: mysqldump -uusername -ppassword database_name -w "tenant_id=1" > dump.sql but unfortunately @jointables not have tenant_id fails. my question is: have ideas how export single tenant's data , import new database (which guess can create using stand...

python - Validate form A's data by usuing form B's data -

so have these 2 forms. able access data in form env_form when checking add_urg other form. possible this? env form common form through out app keep separate instead of including on every form. class env_form(forms.form): env = forms.choicefield(choices=env, required=true) class add_urg(forms.form): user = forms.charfield(max_length=50) group = forms.charfield(required=true) role = forms.charfield(required=true) def clean_user(self): post_user = self.cleaned_data['user'] post_env = self.cleaned_data['env'] c = user.objects.filter(user__contains=post_user, env__contains=post_env ).count() if (c == 0): raise forms.validationerror(u"user not found.") else: user_info = user.objects.filter(user__contains=post_user).values('password').distin...

iphone - iOS Fonts - Why does Interface Builder give you more font options? E.g HelveticaNeue-Medium? -

i've looked @ following link: setting uilabel - font through code - generates error - iphone which provides code see available ios fonts. helveticaneue following: helveticaneue-italic helveticaneue-bold helveticaneue-bolditalic helveticaneue why interface builder provide slew of other options fonts though? i've plopped uilabel down , see options helveticaneue-medium , helveticaneue-light example , seem work fine when compiling ? the reason i'm asking i'm programmatically generating uilabel , set it's font helveticaneue-medium looks that's not option?! the interface builder shows fonts available on mac. not of them available ios. before using font, make sure available on ios.

algorithm - Good books/articles about spatial indexes -

i interested in literature spatial indexes. 1 in use, comparisons between them in speed, space requirements, spatial queries performance when using them etc. i used use kind of home-grown quadtree spatial indexing (well before learned word " quadtree "). ordinary kinds of spatial data (i deal street map data), fast create , fast query, scan many leaf nodes during queries. specifically, reasonable node sizes (50-100), quadtree tended produce around 300 results point query, i.e. 3-6 leaf nodes apply (very rough ballpark; results highly variable.) nowadays, preferred data structure the r*tree. wrote , tested implementation myself obtained results. code building r*tree slow compared quadtree code, bounding boxes on leaf nodes end organized; @ least half of query space answered 1 leaf node (i.e. if random point query, there chance single leaf node returned), , 90% of space covered 2 nodes or less. node size of 80 elements, i'd typically 80 or 160 results point q...

Libsvm python error -

i'm trying figure out proper format of python list given input svm_problem function in python. got following program web, stackoverflow. i have following: from svm import * x=[ [1,0,1],[-1,0,-1],[1,0,0]] #x=[ [1,0,1],[-1,0,-1]] prob = svm_problem( [1,-1],x ) param = svm_parameter(kernel_type = linear, c = 10) m = svm_model(prob, param) print m.predict([ 1,1, 1]) it raises assertion error, says assert failed: assert len(x)==len(y) . but if x=[ [1,0,1],[-1,0,-1]] , program works perfectly. not supposed give train-data problem of length more 2? also don't understand in x=[[1,0,1],[-1,0,-1]] label , data? any highly appreciated. svm_problem() takes 2 parameters: first parameter of vector of labels, , second matrix of features. assertion error because specifying 2 labels, [1, -1] , first parameter in call svm_problem . example: y = [1,-1,1,1] x = [[1,0,1], [-1,0,-1], [1,2,3], [4,5,6]] prob = svm_problem(y, x)

c# - LINQ performing multiple queries instead of a single "joined" query -

i not linq power user means, can fumble way around on basic level. have question regarding how linq formulates it's query "strategy". try explain best can , write extremely dumbed-down example memory. i have data model contains multiple database views. let's views have column structure follows: personview personviewid | surname | givenname | otherviewid ------------------------------------------------ otherview view otherviewid | personviewid | name --------------------------------- after setting primary keys view (personview.personviewid / otherview.otherviewid) , setting appropriate fields non-nulable, create association between personview.personviewid (parent) otherview.personviewid (child). set "one one" , write code consume it: stringbuilder s = new stringbuilder(); foreach(personview p in dc.personviews) { s.appendline(p.otherviews.name + "<br />"); } after noticing extremely poor performance, profiled databa...

ruby on rails - heroku rake db:migrate rake aborted! unable to open database -

i making way through ruby on rails tutorial on @ http://ruby.railstutorial.org/ , trying migrate demo_app database heroku. heroku rake db:migrate rake aborted! unable open database file i have read on other stackoverflow posts people fixed entering group :production, :staging gem "pg" end group :development, :test gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3" end in gemfile. entered gemfile , deleted old gemfile.lock , redid bundle install , rake db:migrate command. still receiving same error. i brand new ruby, rails , heroku understand problem seems using sqlite locally , postgresql in production (on heroku). have install postgresql onto machine , re-migrate db? afraid not able more out of tutorials (or ruby on rails itself) if cannot use heroku. kill it! i having same problem , found no solutions. think doing in tutorials leading mangle database.yml file heroku generates. i ended destroyi...

arrays - How to create a Systematic List in Java? -

hey guys, i'm trying create systematic list generator in java i've come slight error. our example pizza. problem: suppose have 6 total toppings make pizzas with. how many variations of 5 topping pizza's can possibly make? so example : [pepperoni, bacon, pineapple, onion, mushrooms, peppers] [pepperoni, bacon, pineapple, onion, mushrooms, cheese] etc... while developing, have been practising 3 possible options apposed 6, know there 3 total combinations each 2 elements, making multi-dimentional array easy generate @ time. public class systematiclist { static string options[] = { "pepperoni", "bacon", "cheese" }; public static void main(string[] args) { /** * generate multi-dimensional array represent combinations of * pizza toppings can possibly have available <code>options</code> * */ string[][] combos = new string[3][2]; /** * ideally create. * combos[0][0] = ...

Vim, 8 spaces after { <ENTER> -

i need use 4 spaces indent in project i'm working in. .vimrc: "autouzupelnianie nawiasow "inoremap { {<cr>}<c-o>o inoremap { {}<left> inoremap [ []<left> inoremap ( ()<left> syntax on set autoindent set number "pokazywanie numerow lini set modifiable set write filetype indent on "wlaczenie rozpoznawania wciec set showmatch "nawiasy "backup set backup set backupdir=/ho...

iPhone - Preventing UIImageView to rotate when switching from vertical to horizontal -

i have app camera overlay. overlay view have 2 imageviews , 1 view. 1 image view overlay graphic drawing. image view put taken picture it. custom view custom drawing. when iphone in horizontal position when taking photo, displayed photo image view rotated. have big space on both sides of picture. i've tried put overlayviewcontroller without effect : shouldautorotatetointerfaceorientation - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { return (interfaceorientation == uiinterfaceorientationportrait); } all view , image view have same params ib (for params common). how may prevent picture rotate image view when phone not vertical ? note : must able keep ability auto rotate other views can display in app. in view controller's willanimaterotationtointerfaceorientation:duration: method, can apply opposite rotation uiimageview's transform property. example, if controller rotating uiinterfaceorientatio...

postgresql - problems installing pdo_psql on snow leapord -

i'm trying install pdo drivers on osx 10.6 , i've been following directions found here: installing pdo-drivers postgresql on mac (using zend eclipse) every time try , compile pdo_psql.so driver compiles fine 'make test' finds problem. php warning: php startup: unable load dynamic library '/users/me/temp/pdo_pgsql-1.0.2/modules/pdo_pgsql.so' - dlopen(/users/me/temp/pdo_pgsql-1.0.2/modules/pdo_pgsql.so, 9): no suitable image found. did find: /users/me/temp/pdo_pgsql-1.0.2/modules/pdo_pgsql.so: mach-o, wrong architecture in unknown on line 0 warning: php startup: unable load dynamic library '/users/me/temp/pdo_pgsql-1.0.2/modules/pdo_pgsql.so' - dlopen(/users/me/temp/pdo_pgsql-1.0.2/modules/pdo_pgsql.so, 9): no suitable image found. did find: /users/me/temp/pdo_pgsql-1.0.2/modules/pdo_pgsql.so: mach-o, wrong architecture in unknown on line 0 php warning: php startup: unable load dynamic library '/users/me/temp/pdo_pgsql-1...