Posts

Showing posts from September, 2015

vb.net - Alternative to the T-SQL AS keyword -

please see code below: imports system.data.sqlclient imports system.configuration public class form1 private _constring string private sub form1_load(byval sender object, byval e system.eventargs) handles me.load dim objdr sqldatareader dim objcommand sqlcommand dim objcon sqlconnection dim id integer try _constring = configurationmanager.connectionstrings("testconnection").tostring objcon = new sqlconnection(_constring) objcommand = new sqlcommand("select person.urn, car.urn person inner join car on person.urn = car.urn , personid=1") objcommand.connection = objcon objcon.open() objdr = objcommand.executereader(connectionstate.closed) while objdr.read id = objdr("urn") 'line 19 loop objdr.close()

ios - CFRelease causing crash in iPad application -

i trying merge 4 images make 1 uiimage. when going cfrelease, crashing. if don't this, giving memory leak , crashing. how resolved? see below code. referenceview.frame = cgrectmake(0, 0, 1024, 768); referenceview.hidden = no; [self.view insertsubview:referenceview belowsubview:selfview]; imgview1.image = delegate.imagecroped; imgview2.image = [uiimage imagenamed:@"videobg.png"]; imgview3.image = [uiimage imagenamed:@"videochar.png"];; imgview4.image = smileview.image; imgview1.frame = cgrectmake(456, 311, delegate.imagecroped.size.width-30.8, delegate.imagecroped.size.height-40); imgview2.frame = cgrectmake(0, 0, 1024, 768); imgview3.frame = cgrectmake(392, 187, imgview3.image.size.width, imgview3.image.size.height); imgview4.frame = cgrectmake((smileview.frame.origin.x-((smileview.frame.origin.x > 530) ? 30 : 15)), (smileview.frame.origin.y+((smileview.frame.origin.y <= 307) ? 95 : 50)), smile

python - Setting Tkinter default widgets kwargs -

how change default tkinter kwargs values widgets? i know can set general tkinter theme tk_setpalette(theme) computes , overwrites default values , tries use colors best matches new theme more control. for example, let's want change background color of tkinter widgets, i'd like: import tkinter tk color = 'blue' #this in constant or setting modules class custombutton(tk.button): def __init__(self, root, **options): tk.button.__init__(self, root, bg=color, **options) then if @ point want change background color blue red i'd need edit setting.py module. (background example, want change **kwargs) i'm sure there's better way , somewhere let's set default widgets values without overriding every single widget in wrapper class... i know asked couple of years back, same issue stumbles upon thread, here example of how incorporate generalised settings widgets: my_options = {"bg" : "gray60", "font" :

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

i have php code pulls info database. uses prepared statement, works fine written below: <?php $n = '5'; if ($stmt = $connection->prepare("select title items id = ?")) { $stmt->bind_param("s", $n); $stmt->execute(); $stmt->bind_result($title); while ($stmt->fetch()) { echo $title; } $stmt->close(); } ?> and let's echo "batman". however, when move placeholder here: "select ? items id = 5" and change: $n = 'title'; instead of echoing "batman", echoes "title". not possible use placeholder select parameter? what have done this: select "title" items id = 5 you cant use prepared statement bindings identifiers, parameters.

python remove duplicates from 2 lists -

i trying remove duplicates 2 lists. wrote function: a = ["abc", "def", "ijk", "lmn", "opq", "rst", "xyz"] b = ["ijk", "lmn", "opq", "rst", "123", "456", ] in b: if in a: print "found " + b.remove(i) print b but find matching items following matched item not remove. i result this: found ijk found opq ['lmn', 'rst', '123', '456'] but expect result this: ['123', '456'] how can fix function want? thank you. here what's going on. suppose have list: ['a', 'b', 'c', 'd'] and looping on every element in list. suppose @ index position 1: ['a', 'b', 'c', 'd'] ^ | index = 1 ...and remove element @ index position 1, giving this: ['a', 'c', 'd&

PHP - include(); makes blank line -

hey when add include file @ tag creates blank line (grey) : http://puu.sh/40mvi notice: have seen few questions didn't helped me. <?php require("connection/mysql.php"); ?> <?php @session_start(); ?> <?php if(!isset($_session["language"])) { header("location: ./language/index.php"); } else { include("./language/".$_session["language"]); } ?> <?php if ( isset($_session["bay_username"]) ) { header('location: account/'); }?> <!doctype html> language file <?php // noconnect $lg["ncon_header"] = "bayyak powered sunucularına şu bağlanılamıyor."; $lg["ncon_text"] = "lütfen biraz sonra tekrar deneyiniz. en yakın zamanda sorunu çözeceğiz. İnternet bağlantılarınızı kontrol ediniz. diğer aygıtlarda da aynı hatayı alıyorsanız lütfen <em>error@bayyakpowered.com</em> adresine bu sorunu bildirin.

mysql - Order by date ASC, but DESC within group -

i have 2 tables. imagine first 1 directory, containing lot of files (second table). the second table (files) containing modification_date. now, want select directories , sort them modification date asc (so, latest modification topmost). instead of displaying folder, want display oldest mofified file (so, modification desc, group folder_id) sorting files modification date no problem. my query looks (simplified) this: select f.*, d.* files f left join directories d on f.directory_id = d.id order f.modification_date desc this gives me files in modification order (newest topmost) - now, want group files within folder, see oldest modification (they have "seen" attributes, taking account no big deal, once modification has been seen, second oldest displayed, etc...) how can sort result by modification_date desc , sort modification_date asc after grouping it? example: directories: id | name 1 folder 1 2 folder 2 files id | name | d_

maven - How to use profiles or targets to get the values from xml properties file using a template file -

using maven or ant wanted values xml file , replace variables using targets/profiles. properties.xml looks this: <?xml version="1.0" encoding="utf-8"?> <variables> <variable id="title"> <book.01>abc</book.01> <book.02>def</book.01> <ebook.03>ghi</book.01> <ebook.04>klmn</book.01> </variable> <variable id="author"> <book.01>john</book.01> <book.02>jack</book.01> <ebook.03>simi</book.01> <ebook.04>laura</book.01> </variable> </variables> using maven or ant if select "book.01" target or profile, want replace values in template.xml values of "book.01" properties.xml current template.xml looks this: <?xml version="1.0" encoding="utf-8"?> <projects> <mbean code="org.jboss.namin

javascript - Cant find variable Angular JS -

i following railscasts #405 on angular js , code uses follows app = angular.module("raffler", ["ngresource"]) app.factory "entry", ["$resource", ($resource) -> $resource("/entries/:id", {id: "@id"}, {update: {method: "put"}}) ] @rafflectrl = ["$scope", "entry", ($scope, entry) -> $scope.entries = entry.query() $scope.addentry = -> entry = entry.save($scope.newentry) $scope.entries.push(entry) $scope.newentry = {} $scope.drawwinner = -> pool = [] angular.foreach $scope.entries, (entry) -> pool.push(entry) if !entry.winner if pool.length > 0 entry = pool[math.floor(math.random()*pool.length)] entry.winner = true entry.$update() $scope.lastwinner = entry ] i tried implement similar in application practically same code issue when drawwinner function called browser logs error "cant find variable entry"

.net - dropdown selected value is getting lost when inside a hidden asp:panel -

i have web form consisting of few asp:panels. 1 panel visible @ time. user fills forms next panel becomes visible. in second panel there dropdown list. i setting selectedvalue of dropdownlist on page load, if not page postback. when second panel becomes visible, dropdownlist not preselected. everything else prepopulated except dropdown list. there other dropdown lists on other hidden panels, prepopulated appropriately. furthermore, if move dropdownlist outside panel, works intended, meaning, selectedvalue prepopulated. if remove line panels set visible = false, dropdownlist gets populated fine. as add code hide panels , show them 1 one, selected value not there. here code protected sub page_load(sender object, e system.eventargs) handles me.load if not page.ispostback ... dropdownlist1.selectedvalue = .item("city") hideallpanels() ... end sub protected sub linkbutton2_click(byval sender object, byval e system.eventargs) handles linkbutto

java - How should I use EasyMock's @Mock annotation (new in version 3.2)? -

it looks easymock version 3.2 supports using annotations setup mock objects. new easymock (and java in general) , trying understand how use this. these annotations new or provide alternative way things? documentation says: since easymock 3.2, possible create mocks using annotations. nice , shorter way create mocks , inject them tested class. here example above, using annotations: ... then there listing shows use of @testsubject , @mock annotations, don't understand how works. seems if magically sets private field of class under test mock object. in of cases, want make mock objects return pre-defined values use in junit test cases (don't care verifying ones called, how many times called, etc). example, tests want create fake httpservletrequest object this: public class sometest { // construct mock object typical http request url below private static final string request_url = "http://www.example.com/path/to/file?query=1&b=2#some-fragment&quo

Retrieve serial number from USB memory (Windows environment c++) -

i need retrieve serial number usb memory, namely hard disk's serial number manufacturer assigns. reason cannot use getvolumeinformation() suggested in other threads. need have "unique" number i kindly ask if can share example in c++ , windows environment (visual c++) thanks! you can check out article:- http://oroboro.com/usb-serial-number/ #include <winioctl.h> #include <api/usbioctl.h> #include <setupapi.h> define_guid( guid_devinterface_usb_disk, 0x53f56307l, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b ); void getdeviceinfo( int vol ) { usbdeviceinfo info; // device handle char devicepath[7] = "\\\\.\\@:"; devicepath[4] = (char)( vol + 'a' ); handle devicehandle = createfile( devicepath, 0, file_share_read | file_share_write, null, open_

python numpy set elements of list by condition -

i want set specific element of list specific value low overhead. example if have : a = numpy.array([1,2,3,0,4,0]) want change every 0 value 10; in end want have [1, 2, 3, 10, 4, 10] in matlab can a(a==0) = 10, there equivalent in numpy? remarkably similar matlab: >>> a[a == 0] = 10 >>> array([ 1, 2, 3, 10, 4, 10]) there's nice "numpy matlab users" guide @ scipy website. i should note, doesn't work on regular python lists. numpy arrays different datatype work lot more matlab matrix python list in terms of access , math operators.

iphone - Sending NSString to viewController returns a null -

i sent nsstring viewcontroller, tried log viewcontroller, , turned null. code below edit: im deleting code , showing code application. because still getting (null) habitviewcontroller.h #import <uikit/uikit.h> @interface habitviewcontroller : uitableviewcontroller { nsstring *cellname2; } @property(nonatomic,retain) nsstring *cellname2; @end habitviewcontroller.m @synthesize cellname2; - (void)viewdidload { [super viewdidload]; nslog(@"%@",cellname2); } detailviewcontroller.h #import <uikit/uikit.h> @interface detailviewcontroller : uiviewcontroller { nsstring *cellname; } @property(nonatomic,retain) nsstring *cellname; @end detailviewcontroller.m #import "detailviewcontroller.h" #import "habitviewcontroller.h" @end @implementation detailviewcontroller @synthesize cellname; #pragma mark - managing detail item - (void)viewdidload { [super viewdidload]; cellname = @"hello w

android - Facebook page's status updates -

i'm using facebook sdk 3. how can public status of special page in facebook without authentication? how can put list of of facebook page's status updates in android? i think can want facebook graph. go , read out documentaion paging section. find out answer.!! heres link, may help.: facebook graph api

c# - openfile dialog cancel crash -

i making basic word processor in c# training. making open file part of it. can open text file without issue. when open open file dialog , cancel it, crashes :/ private void opentoolstripmenuitem_click(object sender, eventargs e) { openfiledialog1.showdialog(); var openfile = new system.io.streamreader(openfiledialog1.filename); getrichtextbox().text = openfile.readtoend(); } i know because streamreader has nothing read not sure how solve this. thanks in advance! edit: thank you! worked :) you need check result of dialog: private void opentoolstripmenuitem_click(object sender, eventargs e) { if (openfiledialog1.showdialog() == dialogresult.ok) { using (var openfile = new streamreader(openfiledialog1.filename)) { getrichtextbox().text = openfile.readtoend(); } } } i've added using statement ensure file closed when you're done reading it. you can simplify code further using file.readalltext instead of mes

php - Does the number of remote requests affects performance? -

i have photobook making site , i'm trying improve loading , saving performance. the photobook making tool displayed in web browser, done in flash, , remote calls database operations done through amfphp. the algorithm saving photobook says: foreach(page in photobook){ foreach(component in page){ //make remote call saves component in database } } this means if photobook has 30 pages, 10 components(photos) per page, tool create approximately 300 simultaneous connections without counting uploads connections. firefox example, seems ready create queue process requests. does affects performance @ all? will create queue controls number of simultaneous remote calls? is worth it? thank can give me. every request remote server result in time increase script execution. 3 queries database faster 3 remote requests. so yes performance heavily impacted 300 remote requests. best solution either paginate, or serialize of data in xml. though carefu

linker - Compiling Glew and SDL in C++ with Code::Blocks -

i've spent last 24 work hours trying compile, using multiple searches , tutorials (some need link dynamically while others need statically), can not work. i'm relatively new compiling , linking appreciated. here code(as can tell comments tired last night coding this): #define no_sdl_glext #define glew_static #include "gl/glew.h" #include "sdl/sdl.h" #include "sdl/sdl_opengl.h" int main (int argc, char* args[]){ //loads sdl video module sdl_init(sdl_init_video); //creates sdl surface opengl draw sdl_surface* surface = sdl_setvideomode(800,600,32, sdl_hwsurface | sdl_doublebuf | sdl_opengl ); //sets caption... sdl_wm_setcaption("opengl",0); glewexperimental = gl_true; glewinit(); //main event loop, bread , butter ladies , gentlemen sdl_event windowevent; while (true){ if (sdl_pollevent(&windowevent)){ //if close appplication, causes stop running :d

gruntjs - Hard cache busting of assets w/ Compass -

i have hard cache busting compass, i.e. have hash-suffixed assets. compass using soft cache busting adding ?v parameter in query string, apparently not supported every cdn service, , avoid , encode file hash directly in filename ( myfile-2q7de.png ). is possible ? current approach copy assets, hash them all, write mapping file , use in minimal sass extension real file path it's non-hashed path. works great, except spritesheets : makes compass add hash sprites class names, makes them unusable : .sprite-myfile-2q7de { ... } i should add i'm using grunt this. compass adds hash cache buster in generated sprite sheets (eg icons-sf6a3361a01.png ). for other images, can use following code in config.rb , found in documentation : asset_cache_buster |path, real_path| if file.exists?(real_path) pathname = pathname.new(path) modified_time = file.mtime(real_path).strftime("%s") new_path = "%s/%s-%s%s" % [pathname.dirname, pathn

python - find a number between a range of numbers -

i have file1 has ranges this 10 20 50 60 70 100 150 170 .... .... file2 15 55 80 160 .... .... i want read ranges in file1 , in file2 , values between them final output: 15 value between 10 , 20 55 value between 50 , 60 .... .... if want results other print them out, can create dictionary maps ranges (from file1) numbers within ranges (from file2.) ranges = [] open('file1') f: line in f: ranges.append(line.strip().split(' ')) ranges = [tuple(int(_) _ in r) r in ranges] in_range = {range_: set() range_ in ranges} open('file2') f: line in f: num = int(line.strip()) range_ in ranges: if range_[0] < num < range_[1] # between low , high in_range.add(num) # print in_range

c# - "Parameter is not valid" When getting a frame from an avi file. -

so have code here pulls out frames avi file, makes clone of them, , stores them in array. after few hundred times, error saying "parameter not valid." i've searched around answers, answers when works once, doesn't work again. 1 on average executes these lines 490 times before error occurs. wondering if 1 of tell me what's wrong here? also, file = null changed later down in code have value, in case think that's got error. help: i'm using aforge.video.vfw; aviwriter , reader, , i'm calling void in different thread. sorry if isn't enough. first question i've ever asked on here. aviwriter writer = new aviwriter("wmv3"); avireader reader = new avireader(); string file = null; bitmap[] aviimages = new bitmap[1]; int imagesprocessed = 0; double progressvalue = 0; private void getimages() { reader.open(file); while (reader.position - reader.start < reader.length) { application.doevents(); aviimages[i

Google Analytics not showing referrer even though utmr is being passed -

is there reason why sending utmr param not working? opening in browser , works correctly except referrer. code: http://www.google-analytics.com/__utm.gif?utmwv=5.2.5&utmac=ua-421439xx-1&utmhn=mytest.localhost&utms=1&utmn=1036417932&utmcc=__utma%3d197102573.94578827.1376336986.1376336986.1376336986.1%3b&utmp=test&utmcs=-&utmr=www.test.com%2ftest&utmip=225.15.15.25&utmul=&utmfl=-&utmje=-&utmhid=1624818097 if apply ga code (on utmac= ) , open in browser should see page view in analytics account. however, source 'direct' though utmr being passed (as can seen on utmr=www.test.com%2ftest ). why? try using full url (you missing protocol).

C#: Fast and Smart algorithm to Compare two byte array (image) -

i'm running process on webcam image. i'd wake process if there major changes. something moving in image lights turn on ... so i'm looking fast efficient algorithm in c# compare 2 byte[] (kinect image) of same size. i need kind of "diff size" threashold i found motion detection algorithm it's "too much" i found xor algorithm might simple ? great if ignore small change sunlight, vibration, etc, ... mark pixels different previous image (based on threshold i.e. if pixel has been changed - ignore noise) ' changed ' filter out noise pixels - i.e. if pixel marked changed neighbors not - consider noise , unmark changed calculate how many pixels changed on image , compare threshold (you need calibrate manually) make sure operating on greyscale images (not rgb). i.e. convert yuv image space , comparison on y. this simplest , fastest algorithm - need tune these 2 thresholds.

c++ - GDI+ Double Buffering: backbuffer dual-colored monochrome -

i trying build simple graphical app using c++, windows api , gdi+. when first trying build app, heavy flickering introduced, code tries use double buffering, fails. hdcbuf backbuffer. when trying draw backbuffer using gdi+ graphics::drawcachedbitmap bitmap drawn dual-colored in black , white. loadbitmapres creates cachedbitmap exe resources; function works single buffering. is there wrong in code? in advance! global: cachedbitmap* fish; hdc hdc; hdc hdcbuf; hbitmap hbmpbuf; graphics* gfxbuf; wm_create: hdc = getdc(hwnd); hdcbuf = createcompatibledc(hdc); hbmpbuf = createcompatiblebitmap(hdcbuf, 640, 480); selectobject(hdcbuf, hbmpbuf); gfxbuf = graphics::fromhdc(hdcbuf); fish = loadbitmapres(gfxbuf, makeintresource(fish2), "sprite"); wm_paint: hdc temp = beginpaint(hwnd, &ps); gfxbuf->drawcachedbitmap(fish, x, y); bitblt(temp, 0, 0, 640, 480, hdcbuf, 0, 0, srccopy); endpaint(hwnd, &ps); when creating memory dc using createcompatibled

exchange server - Active Directory VBScript Get Users shared mailbox list -

i have found few scripts online confusing , 10 pages long lol... what im after enter userid , search ad , result im after like: name: pavle stoj email: pavle.stoj@... shared mailboxes pavle has access too: mailbox 1 mailbox 2 mailbox 3 i can name , email etc when shared mailbox access dont know commands run them ? example of have far works fine me.. ' check exchange attributes 'user' ' ' ' ------------------------------------------------- ' ------------------------------------------------- ' search box userid ' ---------------------- strusername = inputbox ("userid ?") ' ------------------------------------------------- ' ------------------------------------------------- ' connect ad , use userid entered ' ------------------------------------------------- set objrootdse = getobject("ldap://rootdse") strdomain = objrootdse.get("defaultnamingcontext") set objconnection = createobje

python - Concetenating arrays in a dictionary -

say have python dictionary 100's of keys. each key, dictionary holds 2d array. all these 2d arrays have same number of rows. how can concatenate these arrays efficiently in final 2d array along column axis? is worth going through pandas this? if so, how? e.g. from collections import ordereddict() dct = ordereddict() key in xrange(3): dct[key] = np.random.randint(3,size=(2,np.random.randint(10))) # print dictionary: > dict(dct) {0: array([[1, 0, 2, 2, 2, 1, 0],        [1, 2, 2, 1, 1, 1, 0]]),  1: array([[2, 1, 0, 1, 1],        [1, 1, 2, 2, 2]]),  2: array([[2],        [0]])} the result of concatenation should be: array([[1, 0, 2, 2, 2, 1, 0, 2, 1, 0, 1, 1, 2],     [1, 2, 2, 1, 1, 1, 0, 1, 1, 2, 2, 2, 0]]) the hstack function want. since have unordered dict, implied order in keys, want this: >>> dct defaultdict(<built-in function array>, {0: array([[0, 1, 2, 0, 2, 2, 0], [0, 0, 0, 2, 0, 0, 2]]), 1: array([[0, 1, 2, 0, 0],

c# - How to cast to an object to a type when type is known during runtime? -

i have statement this: myclass myclass = report.datasource myclass during runtime, type of datasource myclass it's in different namespace current running project. that's because 2 projects creating same classes same service reference. datasource points 1 namespace , myclass cast different namesapce. (it's complicated explain how occured) during runtime, how use type returned report.datasource.gettype() (returns myclass namespace) , use type cast instead of 'myclass' in namespace don't want? (i hope i've explained clearly. brain foggy now!) unfortunately, it's not "same class in different namespace"... basically, have 2 classes. different classes, because of auto generated code. as far .net runtime concerned, might different "int" , "string". hail different assemblies. i've had similar issue - , @ point, easiest thing can make own generic converter method read public properties 1 type, , populate th

Having trouble accessing the rest of the row with MySQL MAX function -

im trying return different column on row returned max function. instance have table eggs => 10 , bacon => 20. i'm trying return eggs or bacon based on value. i've tried this: select column1, max(column2) table i can't seem access value of column1. missing max function? answer: select column1, max(column2) col2 table group column1 order col2 you want apply max() aggregate function on group of data: select column1, max(column2) table group column1

ios - Core Data - How to access entity attribute? -

i have 2 entities. athlete , eval. athlete has to-many relationship eval. athlete can have multiple evals eval can have 1 athlete. first view controller displays table view controller athlete. display athletes. when click on athlete takes table view controller displays evals athlete. how can display attributes eval @ top of evalarray[0] in athlete table view? this have far: allevals.h eval *mostrecenteval = evalarray.firstobject; allathletes *allathletes = [self.storyboard instantiateviewcontrollerwithidentifier:@"allathletes"]; allathletes.evallastupdated = mostrecenteval.date_recorded; nslog(@"%@",mostrecenteval.date_recorded); when log it, correctly displays attribute, when go athletes, log again when view appears, says (null). can tell me why? in athletes view controller, inside tableview:cellforrowatindexpath: , athlete row, eval objects , sort them date (however building eval array) , recent 1 , use populate label on athlete table view

ios - Why I can't save and preview photo -

if comment code saving photo, can preview photo , if comment code preview photo, can save photo camera roll - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingimage:(uiimage *)image editinginfo:(nsdictionary *)editinginfo { [self.library saveimage:image toalbum:@"testing" withcompletionblock:^(nserror *error) { if (error!=nil) { nslog(@"big error: %@", [error description]); } }]; [picker dismissmodalviewcontrolleranimated:no]; } - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { [picker dismissmodalviewcontrolleranimated:yes]; photopreview.image = [info objectforkey:@"uiimagepickercontrolleroriginalimage"]; } well, if you're commenting 1 out of course isn't going work. have merge methods. - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingimage:(uiimage *)image editinginfo:(nsd

perl - How to test that a method generating random numbers does generate random numbers -

how can test method generating random numbers generates random numbers? there ($tested_method, rand) sort of syntax? specifically, i'm referring ping generator method: sub _create_ping_number { ( $ping, @random_array ); $max = 100000; $random_counter = 0; if ( $random_counter == $max ) { @random_array = (); $random_counter = 0; } until ( !undef( $random_array[ $ping = int( rand($max) ) ] ) ) { } $random_array[$ping] = 1; $random_counter++; return $ping; } the links in comment mob provide detail on how difficult assert data source random. for unit test, may better off using srand in test setup (making technically "white box" test), , relying on fact behaviour of rand() known. normal practice far know, unless want test prng or entropy source have written.

msbuild - Adding ColinsALMCorner.CustomBuildTasks.dll to Toolbox causes 'could not load file or assembly' error -

i adding this custom build task tfs 2010 build workflow, when attempting add ( colinsalmcorner.custombuildtasks.dll ) toolbox, error: 'could not load file or assembly file 'colinsalmcorner.custombuildtasks.dll' or 1 of dependencies. operation not supported' . i have added of dependencies (i admit, redundant): 1) same location colinsalmcorner.custombuildtasks.dll resides, ..\buildprocesstemplates\customactivities 2) in public assemblies folder: microsoft visual studio 10.0\common7\ide\publicassemblies and have build definition xaml file correctly importing colinsalmcorner.custombuildtasks namespace although activity set target .net 4.5, documentation says tfs 2010 / .net 4.0 supported, assume should possible. my questions: is possible tfs 2010 / .net 4.0 development environment? concern error message isn't telling real story, example maybe able find it, not right version of assembly. is since dll targets .net 4.5 need have of referenced dl

label - FormView to refer different data sources in asp.net -

i having formview in have edititemtemplate. the formview refering 1 datasource(say datasource1) , values controls in edititemtemplate populated datasource. till here fine. i have label in same formview, edititemtemplate should refer datasource(say datasource2). (i want value populated datasource2). how this? i beginner. please help!! any appreaciated!! what have done bind element (label in case, textbox in mine) (in case) sqldatasource. control data sdstbinfo, when want write data back, use updateparameters of sqlsomething , in code behind. in aspx code "title" sql datasource called sdstbinfo <edititemtemplate> <asp:textbox id="someuniqueid" runat="server" text='<%# bind("title") %>' /> . . then when want new data same control , pass different datasource.... private void onbuttonclick() { //first find control want textbox tb = fvform.findcontrol["txtboxwithnewinfo"]; //then pass it

css - IE9 DIV background image does not resize -

i found following css instruction not resize div background image showing in ie9. have idea? html: <div id=window20 class="window smallwindow"> <strong>abcde</strong> <br /><br /> </div> css: .window { z-index: 20; border-bottom: #346789 2px dotted; position: absolute; border-left: #346789 2px dotted; padding-bottom: 0.5em; padding-left: 0.5em; width: 14em; padding-right: 0.5em; font-family: helvetica; height: 4em; color: white; font-size: 1.0em; border-top: #346789 2px dotted; border-right: #346789 2px dotted; padding-top: 0.5em; border-radius: 0.6em; -moz-border-radius: 0.6em } .smallwindow1 { background-color: #558822 } #window20 { top: 10em; left: 8em; width: 8em; height: 4em; background-image :url(../image/interface_system.png); background-repeat: no-repeat; background-size: auto; background-origin: content-box; }

nodetool - Knowing which real node is up in a Cassandra cluster under virtual node setting -

virtual node powerful setting in cassandra ease burden of assigning proper initial token each node, found pain when reading output of nodetool ring each node described tons of lines. example: node-1 155 normal 228.55 kb 8.31% 7196378057413163154 node-1 155 normal 228.55 kb 8.31% 7215375135797395653 node-1 155 normal 228.55 kb 8.31% 7299851409832649823 node-1 155 normal 228.55 kb 8.31% 7361899028342316034 node-1 155 normal 228.55 kb 8.31% 7470359832465044920 node-1 155 normal 228.55 kb 8.31% 7631123206720404219 node-1 155 normal 228.55 kb 8.31% 7675034684873781539 node-1 155 normal 228.55 kb 8.31% 7871044212864174985 node-1 155 normal 228.55 kb 8.31% 7888407753199222932 node-1

MySQL multiple column relationships between 2 tables -

i have problem in table there 4 columns include terms describing product. want make terms editable (and can add more) in app , there 4 groups of them obviously. created table has these terms altogether product table have create 4 relationships id of terms table. is solution? the main reason don't want make 4 different tables terms because there aren't many of them , app progresses might have more different term groups, adding many small tables cluttering database. any suggestion? update #1: here current schema http://i.imgur.com/q2a1ldk.png you try mapping table: apputamenti(id, ...) term_map (apputamenti_id, term_id) terms (id, text, type) so can add many terms want. or if want specify mapping 1 more field, change: term_map (apputamenti_id, term_id, map_type) so can use enum map_type enum(tipologia, feedback, target) or whatever original fields

Selenium freezes after waiting for element (Python) -

we're using python bindings of selenium , django-selenium (seleniumtestcase) doing selenium tests. on our tested page there html elements created after seconds delay. want wait them , continue test. waiting works, every command after wait call fails: class sometestcase(seleniumtestcase): def test_something(self): ... (some testing code works) self.driver.wait_element_present('span.available') # works self.driver.wait_element_present('span.connected') # works, self.driver.find_element_by_css_selector('body') # fails i debugged through selenium code , found out "find_element_by_css_selector" internally posts http request selenium server (as on every "check if xxx there" command): http://127.0.0.1:42735/hub/session/<session-id>/element but request returns status code 500 , response text: { "status": 13, "value": { "message": "json.pa

winforms - c# - adding listBox data using list<Object> -

i want populate listbox list of objects properties , , want know how define listbox display property within object text, , other name of methods invoked while listbox items clicked (selectindexchanged) hope helps. public partial class form1 : form { public form1() { initializecomponent(); //create listbox, given height/width , top/left var lstbox = new listbox { width = 300, height = 300, top = 10, left = 10 }; //add listbox form this.controls.add(lstbox); //create list of customclass var listcustomclass = new list<customclass>(); //populate list values (int = 0; < 50; i++) { //create instanze of customclass var customclass = new customclass(); //set properties of class

iphone - Using UIAppearance with a subclass of UIBarButtonItem is causing unrecognized selector being sent to UINavigationButton -

tl&dr; setting custom property of subclass of uibarbuttonitem using uiappearance proxy causing "unrecognized selector" exception, beause setter being forwarded uiappearance uinavigationbutton, not bar button itself. sdk overview i using ios 7 beta 5 sdk xcode 5 dp5. please, don't tell me under nda, because not discuss new features or new classes in question. inform of sdk, because can found out it's bug in beta software. what did i subclassed uibarbuttonitem , created custom property in header file: @property (nonatomic, strong) nsstring *mysubclassedproperty ui_appearance_selector; my setter , getter this: - (void)setmysubclassedproperty:(nsstring *)mysubclassedproperty { _mysubclassedproperty = mysubclassedproperty; nslog(@"%p %s %@", self, __pretty_function__, mysubclassedproperty); } nothing special, huh? doesn't work uiappearance @ all. when try set default appearance in application's delegate, gives me no e

c# - Getting the immediate response from server without waiting to 200 message -

is possible send response (200) client , process request after response send client? example: if send request 1 page takes 2 min response. don’t want wait 2 min response (because don’t need response server) want immediate response server. don’t worry if process complete after response send. anyone have idea implement process? thank you. it sounds service writing web should make use of off-line process. web communications work synchronously, don't want client hanging around while server busy request. suggest separate service running on web server can offload processes to. perhaps this: client sends request server server accepts client data server inserts request data database a. windows service monitors database request queue , processes server responds client "200"

web application design - How to manually change what the users see through a back-end of a Rails app? -

i designing voting application. want users have few views: view 1: please wait view 2: text of question view 3: text of question + voting buttons bellow it view 4: text of question + “you voted… (for/against/abstained)” message below it restart view 1 the app used during meeting, agenda items voted on. users have tablets , there live speaker. before speaker has asked first question, users see view 1 on devices. speaker/admin initiates view 2 , @ same time reads question out loud. speaker/admin initiates view 3 start voting. users vote , when admin sees voting complete (they have back-end reports if eligible users have voted), restart cycle. thing transfer 1 view other initiated users , (more often) - admin. because new ruby , rails, far experience in rails app, have links, trigger actions, render views. how change views for/on behalf of users? how do this, when user not initiate action, admin decides when view should changed? my assumption in admin back-end there

android - statfs /storage/sdcard0 failed, errno: 13 -

receiving error in logcat illegal argument exception statfs /storage/sdcard0 failed, errno: 13 my code public double totalstorage() throws exception { **stat = new statfs(environment.getexternalstoragedirectory().getpath());** return ((double) stat.getblocksize() * (double) stat.getblockcount()); } please help errno 13 indicates "permission denied", meaning have insufficient privileges.

flex - translate values in dataprovider for a datagrid -

i have dataprovider arraycollection of simple string values. need these strings translated before rendered in datagrid. how can this? note not want copy new arraycollection translated values since allowing inline editing update dataprovider source. current datagrid without translation values in dataprovider <mx:datagrid width="100%" height="100%" id="contactinfogrid" dataprovider="{model.selectedcustomer.contacts}" editable="true" itemeditend="contactinfochanged(event)"> <mx:columns> <mx:datagridcolumn width="200" datafield="type" editable="false" headertext="{resourcemanager.getstring('customer','customer.contactinformation.type')}"/> <mx:datagridcolu

java - .listFiles() returned file object returns false on .exists() - file contains special character(s) -

i've got java application zipping given directory. file omitted containing special character (e.g. umlaut - ä, ö, etc.). debugging showed, file omitted because not exist if(file.exists()) { //zip } else { system.err.println("file " + file.getabsolutepath() + " not exist!"); } the thing - retrieve file object from file[] files = directory.listfiles(); and iterrate through them. for(file file : files) { if(file.exists()) { //zip file } else { system.err.println("..."); } } what saw is, file.getabsolutepath() shows me following path /tmp/myspecialchar?file.txt instead of /tmp/myspecialcharÖfile.txt . any ideas how hold of file. unfortunately special characters translated "?" cannot implement mapping. listing names returns "?" instead of correct special character. before forget - jvm version 1.6.31. you need set file.encoding system property of jvm -dfile.encoding=utf-8 please, note

java - how to change Jslider value and pass to paintComponent? -

i developing application in brightness of image change per user change value of jslider. jslider display on window image not loaded , don't know how pass value of jslider paintcomponent() method. my code : public class neo_2010_slider1 extends jframe { private static final long serialversionuid = 1l; private container container ; private jslider slider1 ; private jlabel lbl1 ; private jpanel panel1 ; private jtextfield txt1 ; public neo_2010_slider1() { super("slider"); setalwaysontop(true); setdefaultcloseoperation(jframe.exit_on_close); setbackground(new color(14555)); setsize(new dimension(400,400)); setresizable(true); container = getcontentpane(); borderlayout containerlayout = new borderlayout(); container.setlayout(containerlayout); lbl1 = new jlabel("slider 1"); /****************** textfield properties **********************