Posts

Featured post

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_...