Posts

.net - please get me started on querying DB with c# -

i need started accessing database c# please give me simplest example possible!! perhaps mysql database simplest example? please show me how connect mysql database , data if want use mysql, you'll need .net data provider mysql or mysql odbc driver. or install sql server express edition ( free download ). then walk through beginner tutorial, of there plenty on web: msdn tutorial here , one here , here , , here simple msdn sample covering ado, odbc, oledb. really there huge wealth of out there.

javascript - When should I use a semicolon after curly braces? -

many times i've seen semicolon used after function declaration, or after anonymous "return" function of module pattern script. when appropriate use semicolon after curly braces? you use semi-colon after statement. statement: var foo = function() { alert("bar"); }; because variable assignment (ie creating , assigning anonymous function variable). the 2 things spring mind aren't statements function declarations: function foo() { alert("bar"); } and blocks: { alert("foo"); } note: same block construct without semi-colon applies for , do , while loops.

Silverlight 4 Canvas.Left binding without canvas per item -

i'm getting performance issues code, mousing on canvas area laggy if leave in canvases within data template, no lag if take them out (but canvas.left bindings don't work ellipses in wrong place!) there way position these items without each 1 needing own canvas? <canvas> <itemscontrol itemssource="{binding path=spatialdata.trainevents.arrdepellipseoflines}" name="ctrlcharttraineventsarrdep" > <itemscontrol.itemtemplate> <datatemplate> <canvas> <ellipse width="{binding eventshape.width}" height="{binding eventshape.height}" stroke="{binding path=stroke}" strokethickness="{binding strokethickness}" fill="{binding path=fill}" canvas.left="{binding canvasplacement.x}" canvas.top="{binding canvasplacement.y}" /> </canvas> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol> <...

character encoding - Convert a text file from UTF-8 to ASCII to avoid python UnicodeEncodeError? -

i'm getting encoding error script, follows: from django.template import loader, context t = loader.get_template(filename) c = context({'menus': menus}) print t.render(c) file "../django_to_html.py", line 45, in <module> print t.render(c) unicodeencodeerror: 'ascii' codec can't encode character u'\u2019' in position 34935: ordinal not in range(128) i don't own script, don't have ability edit it. thing can change filename supplied doesn't contain unicode character script objecting. this file text file i'm editing in textmate. can identify , rid of character script barfing on? could use iconv, , if how? thanks! how find nasties in file: import unicodedata ucd import sys open(sys.argv[1]) f: linex, line in enumerate(f): uline = line.decode('utf-8') bad_line = false charx, char in enumerate(uline): if char <= u'\xff': continue ...

unicode - In MySQL how can I tell what character set a particular table is using? -

i have large mysql table think might using wrong character set. if i'll need change using alter table mytable convert character set utf8 but since large table, i'd rather not run command unless have to. question is, how can ask mysql character set on particular table? i can call status in mysql see database's character set, doesn't mean tables have same character set, right? try: show create table my_table;

java - Checking JAR Usage at the Package Level -

is there tool out there can check if imported jar being used within package? want remove unused jars project , not want have remove each jar one-by-one , check possible reference issues each removed jar. proguard trick you! configured correctly , given initial rules take jar files in input directory , output same jars output directory. java class files aren't needed won't included in output jars , if jar has no classes left, it's removed. website includes tons of examples . in addition doing this, has number of great features in compacting , obfuscating final project. configuration files may seem bit tricky @ first -- pays off. in projects @ work, have final archive sizes reduced on 1000%. how have included library use fraction of functionality? proper setup final product include what's needed.

android - How to disable background screen -

i have linearlayout set inside oncreate() method setcontentview(), creating popup @ runtime in same activity linearlayout b, popup placed bottom of screen/activity, want to disable background screen no touch/tap/click work. how can that. thanks this how it... recommend make root of layout relativelayout, put linearlayout inside that. linearlayout b should full size of screen , have 2 views inside (a top , bottom). bottom view popup using. top basic view has background color set black .25 (or .1) alpha on it's entirely see through. when want display popup (and disable interaction controls outside of popup), add linearlayout b relative layout attached top left (i.e. b should cover a). user able interact popup controls @ bottom , still able see linearlayout through transparent top portion of layout b, since grayed out user know aren't allowed interact it... , prevented interacting because overlay view block interaction.