Posts

Showing posts from July, 2013

Query to find all FK constraints and their delete rules (SQL Server) -

in sql server 2005, can issue sql query list fk constraints on tables within db, , show delete rule? (ie nothing, cascade, set null, or set default) the output i'm looking akin to: fk_name on_delete ================================== fk_lineitem_statement cascade fk_accountrep_client nothing you can try this: select name, delete_referential_action_desc sys.foreign_keys

java - Help with Preferences and Android Live Wallpaper -

basically want when preference switched default whatever load new set of parallax backgrounds. code on complicated , maybe off when switch preferences nothing changes. can tell i'm novice but, appreciated , gladly credit in app when post it. if need more of code ask. package quotesandothers.livewallpaper.quotesandothers; import org.anddev.andengine.engine.camera.camera; import org.anddev.andengine.engine.options.engineoptions; import org.anddev.andengine.engine.options.engineoptions.screenorientation; import org.anddev.andengine.engine.options.resolutionpolicy.fillresolutionpolicy; import org.anddev.andengine.entity.scene.scene; import org.anddev.andengine.entity.scene.background.autoparallaxbackground; import org.anddev.andengine.entity.scene.background.parallaxbackground.parallaxentity; import org.anddev.andengine.entity.sprite.sprite; import org.anddev.andengine.extension.ui.livewallpaper.baselivewallpaperservice; import org.anddev.andengine.opengl.texture.texture; import...

c# - AppFabric cache and serializing IQueryable objects -

i experimenting appfabric caching , have run issue saving retrieved data in cache. root of problem seems appfabric caching requires data have datacontract , datamember attributes applied class being saved. if case, how can save (simplified code): var q = (from u in dbcontext.users select new { name = u.name, id = u.rowid }); cache.put(“test”, q.tolist()); calling put causes exception: system.runtime.serialization.invaliddatacontractexception caught message=type '<>f__anonymoustypec`6[system.int32,system.string,system.nullable`1[system.int32],system.boolean,system.nullable`1[system.int32],system.int32]' cannot serialized. consider marking datacontractattribute attribute, , marking of members want serialized datamemberattribute attribute. if type collection, consider marking collectiondatacontractattribute. see microsoft .ne...

class - Self-referencing classes in python? -

in python, can have classes members pointers members of type of same class? example, in c, might have following class node in binary tree: struct node { int data; struct node* left; struct node* right; } how equivalently create in python? python dynamic language. attributes can bound @ (almost) time type. therefore, problem describing not exist in python.

Given a string in Java, just take the first X letters -

is there c# substring java? i'm creating mobile application blackberry device , due screen constraints can afford show 13 letters plus 3 dots ellipsis. any suggestion on how accomplish this? i need bare bones java , not fancy trick because doubt mobile device has access complete framework. @ least in experience working java me year ago. you can want string.substring() . string str = "please truncate me after 13 characters!"; if (str.length() > 16) str = str.substring(0, 13) + "..."

mysql - A Database Tool to check changes happened overnight and upload to MasterDB -

hi i have 5 different database , master db same schema .i looking tool can check changes( new row insertion ) has happened since last update , sync master db . there tool available this sounds case using merge replication .

python - Which embedded database to use for file indexing applications -

i need develop file indexing application in python , wanted know embedded database best 1 use indexing. any on topic appreciated. thanks, rajesh you use sqlite : http://www.sqlite.org/ https://github.com/ghaering/pysqlite another 1 explore is http://www.equi4.com/metakit/ for file indexing there tools pylucene, xapian. python file indexing , searching other relevant link on so file indexing (using binary trees?) in python

wpf - Binding from context menu item to parent control -

i have control, on control command called savetoclipboardcommand. want bind context menu item command command when click it, copy clipboard command executed. <control x:name="control"> <control.contextmenu> <contextmenu> <menuitem command={"bind savetoclipboardcommand here"} header="some header" /> </contextmenu> </control.contextmenu/> </control> the control (for argument sake) defined this: partial class control { private icommand _savetoclipboard; public icommand savetoclipboardcommand { { if (_savetoclipboard == null) { _savetoclipboard = new relaycommand( x=> savetoclipboard()); } return _savetoclipboard; } } } i have tried using relativesource , elementname based bindings both failing. trying possible? thank...

datetime - php - adjusting for timezones -

alright have code makes list of dates: $dates = array(); for($i = 1; $i < 10; $i++) { $datetime = mktime(12, 0, 0, date('n'), date('j') + $i, date('y')); if(date('n', $datetime) != 6 && date('n', $datetime) != 7) { $dates[date('l, f js', $datetime)] = date('l, f js', $datetime); } } the dates tomorrow , on long not saturday or sunday. now problem "tomorrow" being changed @ 8:00 pm est. to explain, it's wednesday. first option in list should thursday. however, once 8:00 pm est, first option friday. instead of changing @ 8:00 pm est i'd change @ 3:00 est (so on thursday @ 2:00 should still offer thursday choice) i think getting time zones confused currently. 8pm edt = midnight utc. anyway, in php 5.3: $one_day = new dateinterval(...

python - "Unable to find vcvarsall.bat" error when trying to install qrcode-0.2.1 -

please me solve error c:\python26\lib\site-packages\pyqrcode\encoder>python setup.py install running install running bdist_egg running egg_info writing qrcode.egg-info\pkg-info writing top-level names qrcode.egg-info\top_level.txt writing dependency_links qrcode.egg-info\dependency_links.txt package init file 'qrcode\__init__.py' not found (or not regular file) writing manifest file 'qrcode.egg-info\sources.txt' installing library code build\bdist.win32\egg running install_lib running build_py running build_ext building 'qrcode.encoder' extension error: unable find vcvarsall.bat thanks, manu distutils not play ms compiler tool chain. this file required setup environment distutils use ms compiler tool chains. there quite few ways in has been made work. please @ following post may you. compile python 2.7 packages visual studio 2010 express † † link goes archive.org, since original page went away.

jquery - How can I check if two elements/div belong to the same parent? -

hi working on piece of code shopping cart $('.addtocart').click(function() { //get button id var cartid = $(this).attr("id"); //get check box id var checkboxid = $('input.cartlevelchecked:checked').attr("id"); //get parent id var levellistid = $(this).closest('li').attr("id"); if(('#'+cartid && '#'+checkboxid).parent('#'+levellistid)){ $(".selectplan").show(); } //alert(/*cartid + checkboxid +*/ levellistid); }); basically i'm checking see if check-box user checked , button clicked on belongs same parent show div any appreciated. thanks you need compare levellistid , correctly queried, id of checkbox's closest li parent, should query same way: if (levellistid === $('#' + checkboxid).closest('li').attr('id')) { ... }

php - $row=mysql_fetch_array($result); only returns even rows -

we have code: $rowarray; $rowid = 1; $query = "select idcentros centros"; $result = mysql_query($query); $numrows=mysql_num_rows($result); while($row = mysql_fetch_array($result)){ $rowarray[$rowid] = $row['idcentros']; $rowid = $rowid +1; } $numrows returns 4 (the rows have in table)...but unkown reason loop starts retrieving 2º row next retrieves 4º row , ends loop ($row =false). understand generic code , table definition this: column idcentros int(11) pk notnull autoincremental column nombre mediumtext what happening? in advance... try this: $query = "select idcentros centros"; $result = mysql_query($query); $numrows=mysql_num_rows($result); $rowarray = array(); while($row = mysql_fetch_array($result)) { array_push($rowarray,$row); }

android - how to run an application using 3g -

friend's need on running application in 3g,the application works in wifi,but need work on 3g also,what have work in 3g.is there need add in manifest file 3g? help me. thanks in advance. no, need internet permission. how device connected internet nothing need care about. need handle timeouts , offline modes, doesn't happen on wifi.

Consuming XML from a file/URL without a .xml extension in Flash -

does flash prevent consumption of xml files/urls without .xml extension reason? have verified output of url valid xml purposes flash not recognise it. a few things think about: are allowed access url flash? (security sandbox problems) did convert result xml? i.e. my_xml = xml( loader.data );

c# - How to tell if calling assembly is in DEBUG mode from compiled referenced lib -

i have referenced library, inside there want perform different action if assembly references in debug/release mode. is possible switch on condition calling assembly in debug/release mode? is there way without resorting like: bool debug = false; #if debug debug = true; #endif referencedlib.someclass.debug = debug; the referencing assembly starting point of application (i.e. web application. google says simple. information debuggableattribute of assembly in question: isassemblydebugbuild(assembly.getcallingassembly()); private bool isassemblydebugbuild(assembly assembly) { foreach (var attribute in assembly.getcustomattributes(false)) { var debuggableattribute = attribute debuggableattribute; if(debuggableattribute != null) { return debuggableattribute.isjittrackingenabled; } } return false; }

validation problem in asp.net -

i using page.isvalid function in web page.i have 2 buttons in web page namely "save" , "generate" .when click save button validation summary invoked in validations in page shown. now dont want show particular validation message "save " button, same validation message should shown "generate " button in same page. but using page.isvalid in "save" button click displaying validation messages in page. any appreciated.thanks you can use validationgroup(s) this. <form id="form1" runat="server"> <div> <asp:textbox id="textbox1" runat="server" /> <asp:requiredfieldvalidator id="r1" runat="server" errormessage="*" validationgroup="generateonly" controltovalidate="textbox1" /> <asp:button id="generate" runat="server" text="...

MYSQL Find data in one table based on one of two fields in another table -

complete noob question, apologies that. i have 2 tables, members table email address , telephone number in , second table have email addresses , telephone numbers in many instances of members' telephone number or email address. want query second table , list results corresponding each member's email address or telephone number. thanks much here's rough query based on info supplied: select members_table.*, joined_tables.* members_table, ((select * second_table join members_table on members_table.email_address = second_table.email_address) union /* or intersect if don't want dupes */ (select * second_table join members_table on members_table.telephone_number = second_table.telephone_number) ) joined_tables; at least should give idea on how go it.

arrays - Arithmetic Progression in Python without storing all the values -

i'm trying represent array of evenly spaced floats, arithmetic progression, starting @ a0 , elements a0, a0 + a1, a0 + 2a1, a0 + 3a1, ... numpy's arange() method does, seems allocate memory whole array object , i'd using iterator class stores a0, a1 , n (the total number of elements, might large). exist in standard python packages? couldn't find so, ploughed ahead with: class mylist(): def __init__(self, n, a0, a1): self._n = n self._a0 = a0 self._a1 = a1 def __getitem__(self, i): if < 0 or >= self._n: raise indexerror return self._a0 + * self._a1 def __iter__(self): self._i = 0 return self def next(self): if self._i >= self._n: raise stopiteration value = self.__getitem__(self._i) self._i += 1 return value is sensible approach or revinventing wheel? well, 1 thing doing wrong should for i, x in enumerate(a): print i...

iphone - Click a tab of tabbarController programmatically -

i have 2 tab buttons nib files.... on pressing button on tab1, want want show tab 2's view (not click on tabbar button2). mean, want click second tabbar button programmatically. how can this, possible? you'll have create function in it: [self.tabbarcontroller setselectedindex:1]; so eg: - (void)selectnexttabbarview:(id)selector { [self.tabbarcontroller setselectedindex:1]; } and on button need: [mybutton addtarget:self action:@selector(selectnexttabbarview:) forcontrolevents:uicontroleventtouchupinside];

php - fetching the current date in sql -

in databse have format of date 'yyyy-mm-dd'. how can fetch current date in format? , if want calculate date after 1 week how can that. thanxx in advance. using php , mysql. you don't need use mysql fetch date if want know current date in php. can use php's date function: $current_date = date('y-m-d'); if want date 1 week now, use strtotime : $current_date = date('y-m-d', strtotime('+1 week'));

SQL Server : LENGTH() inside of REPLICATE() -

i have sql server table columns lvl , title . need insert "-" in front of title every character in lvl field. as example: if lvl = 111 title should become --- title . i can edit following sql string. there no possibility create other functions or likewise. select replicate('_', { fn length(lvl) }) + ' ' + title title documents my problem is, length() function doesn't work inside replicate() function. know why or how solve problem? thank you. try this: select replace(lvl, '1', '-') + ' ' + title title documents simply take lvl column, , replace instances of 1 whatever character want, concatenate title end of result.

c++ - Variable dissapears in binary which is available in static lib -

i have problem mentioned. create object inside static lib, there when run nm on static lib, when link lib binary , run nm has disappeared. know problem has been asked before, not find answers. important me able retain variable in binary because trying implement version checks static libs in binary. please help. thank you. example code follows: test.h #ifndef test_h #define test_h class test { public: test(); }; extern test* gptest; #endif test.cpp #include "test.h" test::test() { gptest = this; } test test; main.cpp #include "test.h" #include <iostream> using namespace std; test* gptest = null; int main() { return 0; } build g++ -c test.cpp -o test.o ar cr test.a test.o g++ main.cpp -o app -l/home/duminda/intest/test.a nm -c test.a 0000000000000054 t global constructors keyed _zn4testc2ev 000000000000002b t __static_initialization_and_destruction_0(int, int) 0000000000000016 t test::test() 00000000000...

algorithm - Suggestions for a Data Structure for related features -

we have set of documents , each has set of features. given feature a, need know probability of having feature b in same document. i thought of building probability matrix , s.t: m(i,j) = probability of having feature b in document , given feature there. however , have additional requirement: given feature in document , features have probability > p of being in same document. in mean while think off sparse matrix probability matrix , , after it's computed , each feature run on column , sort p , , keep in linked list somewhere. (so , have each feature , list of corresponding features this space complexity quite big (worst case: n^2, , n large!) , , time complexity each search o(n). any better idea? if number of features comparable number of documents, or greater, consider holding inverted index: each feature hold (e.g. sorted list of) documents in present. can work out probability of b given running merge on sorted lists features , b. for "common ...

c# - Type comparison not returning expected result -

i using following code compare types datacontractserializer re-initialize correct type if necessary. private void initializeserializer(type type) { if (this.serializer == null) { this.serializer = new datacontractserializer(type); this.typetoserialize = type; } else { if (this.typetoserialize != null) { if (this.typetoserialize.gettype() != type.gettype()) { this.serializer = new datacontractserializer(type); this.typetoserialize = type; } } } } for reason when compare 2 types result true , never enter final 'if' statement , re-initialize serialiser. i can set break point @ comparison , see 2 types list<host> (this.typetoserialize.gettype()) , post (type.gettype()) both host , post share common ancestor shouldn't affecting result. you call...

flex - Radio button in datagrid for selecting the entire row -

i have datagrid in flex. need add radio button in first column such when select radio button, entire row should selected. have tried using following code - <mx:datagridcolumn id="selectcolumnradiobutton" sortable="false" textalign="center" editable="false" width="18"> <mx:itemrenderer > <mx:component> <mx:radiobutton selected="false"/> </mx:component> </mx:itemrenderer> </mx:datagridcolumn> but there following problems - 1) allowing me select multiple buttons. 2) if click anywhere else on row, row getting selected. not expected behavior. if should selected when select radio button. please me on this. :) it allowing me select multiple buttons because radio buttons, being drop-in item renderers, ...

What should be the retain Count here + iPhone -

i have following lines of code in program visitwebsitevc *visitwebsite = [[visitwebsitevc alloc] initwithnibname:@"visitwebsitevc" bundle:nil]; nslog(@"retain count :%i",[visitwebsite retaincount]); [self.navigationcontroller pushviewcontroller:visitwebsite animated:yes]; nslog(@"retain count :%i",[visitwebsite retaincount]); [visitwebsite release]; in console see print statement as retain count :1 retain count :5 i not getting why line after pushing viewcontroller returning retaincount of viewcontroller 5, when must 2. you don't want rely on retain count anything. there's sorts of stuff going on behind scenes when push view controller (the view instantiated, may mean loading xib, there bunch of autorelease calls haven't fired yet). it's pretty dangerous way check memory usage. as why it's 5 , not 2, said earlier, it's related unresolved autorelease pools. if check retaincount in viewdidappear,...

postgresql - Grant EXECUTE to many PostGIS functions -

i have web application based on mapserver, uses postgis underlying database extension. want have dedicated database role used mapserver, cause don't want access database via postgres superuser. role should have select permission on public tables (which easy achieve) , execute permissions on public postgis functions. several questions arise: postgis relevant functions stored in public schema of database or there else consider? how can extract functions information - i.e. function name, number , names of arguments - information_schema or pg_catalog of database?! need information grant execute on function(args) mapserveruser statements! thank in advance!!! in postgresql 8.4.x: select n.nspname "schema", p.proname "name", pg_catalog.pg_get_function_result(p.oid) "result data type", pg_catalog.pg_get_function_arguments(p.oid) "argument data types", case when p.proisagg 'agg' when p.proiswindow 'window...

url routing - Zend framework, URL view helper and the layout -

i've been using zend framework time now, i'm facing problem can't solve myself. i'm using zend_layout, zend_view , url view helper create hyperlinks. create seo-friendly url's, use following code in layout.phtml: <?php echo $this->url( array( 'module' => 'default', 'controller' => 'contact' ), 'contact', true ); ?> this works fine. link contact.html (this dealt in bootstrap). when try access different page not routed (backend pages don't need have seo-url's) after visit contact page, zend automatically uses current route. make things clearer, code use create link backend page in layout.phtml: <?php echo $this->url( array( 'module' => 'admin', 'controller' => 'manage' ), null, true ); ?> the second parameter, null, used tell helper no route used link. seems zend automatically uses current route (the contact route). how solve problem? thanks in a...

Android: Animation Position Resets After Complete -

i'm using xml defined animation slide view off screen. problem is, animation completes resets original position. need know how fix this. here's xml: <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator"> <translate android:fromxdelta="0" android:toxdelta="-100%p" android:duration="500"/></set> here's java use call it: homescrn = (view)findviewbyid(r.id.homescreen); slideleftout = animationutils.loadanimation(this, r.anim.slide_left_out); //set click listeners menu btnhelp.setonclicklistener(new onclicklistener() { public void onclick(view v) { layoutinflater.from(getapplicationcontext()).inflate(r.layout.help, (viewgroup)findviewbyid(r.id.subpage), true); homescrn.startanimation(slideleftout); } }); so happens inflate view underneath one. animate view on top off ...

How to resolve mobile data connection(2G/3G/EDGE/GPRS) lost in android after coming out from wifi programatically? -

i need fix strange problem appearing in android. notice have full cellular network, data network lost.(not able connect internet although have set properly). possibly occurs after leave wifi. quick fix make working toggle 2g/3g option in settings --> mobile networks, clears network stack , makes working. application, requires connected internet, need fix programatically. cannot toggle code ? or can ? i read , tried fix rewriting apn settings, not solve issue entirely, move out wifi connectivity. have fix code ? because of way android networking , security work, there's no way toggle 2g/3g-4g without going settings. "rooted" phones once able this, disabled in 2.1 , higher.

Are there any Rails plugins that allow for Excel-like functionality in the views? -

i looking way allow web users view tabular information in view, , interact data in similar way. in other words: tab through cells highlight multiple cells fill multiple cells simultaneously does such plugin exist? have not been able locate 1 via search engines. maybe activescaffold want? http://activescaffold.com/

silverlight - Siliverlight: controls visibility changes alignment? -

the following code <stackpanel orientation="horizontal"> <image source="test.jpg"/> <image source="test2.jpg"/> <textblock text="testblock"/> </stackpanel> if setting visibility of contents of stackpanel in codebehind , lets set visibility of second image collapsed. notice textblock moves image used be. how can keep alignment , turn visibility on or off? use opacity="0" instead.

HTML Vs Markup Validation Service: attributes construct error -

why markup validator says has error in html code below? line 287, column 80: attributes construct error …ion" value="set=1&amp;page=2" /><ul><li><a href="http://campusfaithhub.org/vie… http://validator.w3.org/check?uri=http%3a%2f%2fcampusfaithhub.org%2ffood%2ffood-should&charset=%28detect+automatically%29&doctype=inline&ss=1&outline=1&group=0&no200=1&verbose=1&user-agent=w3c_validator%2f1.1 <div id="pagination"> <!-- add fix ie whitespace bug. ie sees space inside empty div, , applies line-height it. div expanded in ie6 (and older) accommodate space. there's gap. simplest solution make sure ie6 understands empty div _is_ empty, putting comment inside , make sure there's no line-break. --> <input type="hidden" class="last-pagination" value="set=1&amp;page=2" /> <ul> <li><a href="http://campusfai...

xaml - WPF TreeView Nodes becomes unselectable after adding children nodes -

i have huge issue wpf treeview. have setup tree similar this. <treeview datacontext="{binding projects}"> <style targettype="treeviewitem"> <setter property="isexpanded" value="true" /> </style> <treeview.resources> <hierarchicaldatatemplate x:key="loadtemplate"> <grid> <textblock text="{binding name}" /> </grid> </hierarchicaldatatemplate> <hierarchicaldatatemplate x:key="steptemplate" itemssource="{binding loads}" itemtemplate="{staticresource loadtemplate}"> <grid> <textblock text="{binding name}" /> </grid> </hierarchicaldatatemplate> <hierarchicaldatatemplate x:key="projecttemplate" itemsso...

actionscript 3 - Flex Compilier says source-path and package definition mismatch -

here's issue: i have 3 files in same package: com.foobar the directory these files is: c:..\mylibrary\src\com\foobar\ then inside have foo.as , bar.as when try run mxmlc c:..\mylibrary\src\com\foobar\foo.as error: a file found in source-path must have same package structure ' ', definition's package, 'com.foobar'. to say: does. package com.foobar. structure goes ../com/foobar/foo.as i've found few other forum posts on web error, , seemed user had make directory matching package name, have. missing? thanks in advance can give! a co-worker helped me quite time on this. turns out had use following command: (in directory x holds \src\com\foobar\foo.as ) mxmlc -compiler.source-path=.\src -static-link-runtime-shared-libraries=true .\src\com\foobar\foo.as -output .\test.swf for whatever reason, -source-path command tried wasn't satisfactory. i'm not sure why works this, hey works now. hope helps others lost trying com...

Using Views in couchDB -

can "pass" "parameter" view's map function query part of url? if so, show me example? by, parameter mean anyway can access parts of query string within map or reduce function. thanks in advance. that's not quite how views works. view nominates key-value pairs, value whole document. ask key value or between range of values. have bend mind around way of thinking or won't make sense. view independent of parameters, , narrowed down based on key or startkey/endkey parameters.

Emulator For Samsung Galaxy Tab -

is there emulator new samsung galaxy tab? found it!!! http://innovator.samsungmobile.com/down/cnts/toolsdk.detail.view.do?platformid=1&cntsid=9500&listreturnurl=http%3a%2f%2finnovator.samsungmobile.com%3a80%2fdown%2fcnts%2ftoolsdk.list.do%3fplatformid%3d1%26indextype%3d1%26indexdirection%3d1%26sorttype%3d0%26cateid%3d1025%26codetype%3dall%26searchtext%3d%26curpage%3d2%26listlines%3d%26formdata%3dnumber1%26nacode%3d&nacode= googled yesterday no luck today got it.

datagrid - Combox Box withing a Data Grid is not populated with data -

i doing when form loads up datagridviewcomboboxcolumn combotextcol = new datagridviewcomboboxcolumn(); combotextcol.headertext = "some"; combotextcol.datasource = getemployees().select(e => new { name = e.lastname + " ," + e.firstname, id = e.employeeid }).tolist(); combotextcol.valuemember = "id"; combotextcol.displaymember = "name"; datagrid.columns.insert(0,combotextcol) ; i tried datagrid.columns.add(combotextcol) . getemployees gives employee data see column not the data...?? firstly, code propose won't compile - missing capitalisation in 1 area , semi-colon @ end of last line (and not build issue, believe display correctly want white space after last name, not before). secondly, should amend so, there no apparent reason not display members. sure return value of getemployees contains @ least on element? consider following: our employee type... p...

iphone - Push method for core motion and frequency of Accelerometer/Gyroscope Data -

when push method used accelerometer/gyroscope/device motion data, unfortunately gyroscope , device motion maximum frequency cannot exceed 72hz on average (in fact data not periodic @ either). even worse, if gyroscope data recorded (without starting device motion update service: i.e. using [motionmanager startgyroupdatestoqueue:opq withhandler:gyrohandler]), gyroscope data frequency drops 52hz on average. has tried obtain gyroscope data @ 100hz using pull method? can reach maximum 100hz throughput "pull method"? furthermore, did check whether faulty behavior corrected in ios 4.2 (beta)?

e commerce - Magento 1.4 Display Individual Product on Homepage -

does know how display individual product listing (as on product page itself...with buy button) on homepage of magento 1.4 site? in menu system > configuration > web > default pages change default web url catalog/product/view/id/xxx - xxx number in id column on manage products page.

.net - How to Update Data Source in C# -

i working on windows form-based application in visual studio 2008 using c# access database end. added access database project going data->add new data source , able retrieve data database's custom-made dataset perfectly. my next goal save new data access database, creating new row. life of me, however, can't seem figure out how this. looks need either oledbconnection database or tableadapter hooked database, don't seem have either 1 of those. i'd think premade or when added new data source, dataset was, if that's case can't figure out how reference them. what best way add data data source that's been added project? you have (configured) tableadapter, in sub-namespace (generated) dataset. somewhere in code there has adapter.fill(table) , find it. copy , change adapter.update(table) write database. instead of talking through multiple other ways of adding record, have @ videos here

java - data binding to drop down box in Spring MVC -

i have simple spring mvc web application.i want bind list drop down.in case list items bind drop down; if select item , click submit button passing "0" instead of value. this controller. public editemployeecontroller() { setcommandclass(employee.class); setcommandname("employee"); } @override protected map referencedata(httpservletrequest request) throws exception { map referencedata = new hashmap(); list rolelist = roleservice.listroles(); referencedata.put("rolelist", rolelist); return referencedata; } @override protected modelandview onsubmit(httpservletrequest request, httpservletresponse response, object command, bindexception errors) throws exception { employee employee = (employee) command; employeeservice.updateemployee(employee); return new modelandview(getsuccessview()); } this view(jsp) <c:nestedpath path="employee"> <form met...

css - IE 7 / Quirks Mode and Background color? -

this going vague , obscure question, due fact using ie web developer, have no idea going on. i have utility working on. it's javascript, , has small floating div user interface shows on page. far, standard stuff. problem background color of divs in ui. colors assigned css, , (tired refrain:) looks fine in firefox, chrome, , opera, of course ie being difficult. the background not show in ie in quirks mode or ie7 mode, in ie8 mode. life of me, can't seem figure out why ie7 isn't showing background. the page can see offending code here: log hound demo . floating div in upper-right-hand corner - click "v" open up. looking @ page in ie , in [any other browser on planet] show missing background colors enough. swear, lynx renders better... ahem. offending div ids lhplatehead, lhplatectrlpanel,lhplatetagpanel - easy find firebug @ least. should heeding .lhplatecolor class background color of #dfeaf8, color never applied. with ie web developer up, tri...

Does SQL Server 2008 Service Pack 2 Apply to SQL Server 2008 R2? -

i've been using sql server 2008 r2 development. noticed service pack 2 sql server 2008 came out. however, checked here , microsoft not provide link of service packs sql server 2008 r2. not clear me whether or not should apply service pack instance of sql server 2008 r2. do need apply version of service pack 2 instance of sql server 2008 r2? thanks. no, sp2 sql 2008 cannot applied sql 2008 r2, different product versions. here's 2008 sp2 announcement . in addition bug fixes, contain updates make compatible sql 2008 r2 features , patch can't applied r2. the current patch level sql 2008 r2 cumulative update 3 ( announcement , kb article ).

c# - Code generator to create ADO.NET SqlParemeter array from stored procedure inputs? -

i have sql server stored procedures have several inputs. want save time manually creating c# ado.net sqlparameter arrays in sqlparameter[] sqlparameters = { new sqlparameter("customerid", sqldbtype.int, 4, parameterdirection.input, false, 0, 0, string.empty, datarowversion.default, custid) ....... any code generator can , template can this? if mention code generator, please mention template. 1 codesmith . if don't have large number of stored procedures, can write macro in visual studio generate code (see this example). actually, depending on how write macro, can handle large number too. if have no requirement manually crafted dal, should consider using orm (entity framework, linq sql .. etc) generate code you.

objective c - QTMovie setRate problems -

i'm working on program prototype (at current stage) needs able load movie , adjust playback speed. have ui worked out, i've gotten playback work, haven't managed figure out how adjust playback speed. i believed -[qtmovie setrate:(float)] way this, have had no luck. when setting playback speed prior loading movie qtmovieview, movie plays @ 100% speed. have put in textual outputs check @ speed movie "believes" being played, , checks out i've been putting in, movie still displays in view @ 100% speed. here's code controller: @interface srplayercontroller : nsobject { qtmovieview *movieview; } @end @implementation srplayercontroller -(void) playselectedmovie { srmovie *srm = [self selectedmovie]; qtmovie *mov = [self movieforsrmovie:srm]; //set play speed [self setplayspeed:[srm.defaultplayspeed floatvalue] formovie:mov]; //put movie viewer [movieview setmovie:mov]; //play [movieview play:self]; } -(vo...

security - Is it good or bad manner to oversecure? -

if function proper checks inside, should check before calling it, or better not? security redundancy considered practice? example (in sort of c#-like pseudocode by-reference arguments passing): dosomething(vector v) { ...; v.clear; usecleanvector(v) } usecleanvector(vector v) { if(!v.isclean) v.clear; ... } what matters document preconditions, , exceptional conditions in obvious way. seems sensible. /** * precondition : id must id of flarg. * * myfunc return -1 if value outside valid 0-10 range. */ int myfunc( int id, int value ); this lets me code this int flarg_id = ... if (! is_flarg( flarg_id ) ) { printf("bad flarg"); exit(1); } int value = ... int rv = myfunc( flarg_id, value ); if( rv == -1 ) { printf("bad value"); exit(1); }

html - Are there any way to use custom font file in my site? -

i can use @font-face not work in browsers. are there way use custom font file in site ? the @font-face rule should work in modern browsers - ie6+. the trick ensuring have right syntax , font formats each browser caters to. example: @font-face { font-family: 'pt sans'; src: url('fonts/pt_sans-webfont.eot'); src: local('☺'), url('fonts/pt_sans-webfont.woff') format('woff'), url('fonts/pt_sans-webfont.ttf') format('truetype'), url('fonts/pt_sans-webfont.svg#webfonttrshpjcj') format('svg'); font-weight: normal; font-style: normal; } notice have eot, woff, ttf , svg measure. chrome , firefox can use woff , ttf, ie uses svg , eot. also ensure have each font file's location set correctly.

NHibernate Component Mapping VS IUserType -

hi know difference between 2 , why should use 1 on other , when? your object model doesn't map 1 one database model , in cases richer. components way of enriching database model encapsulating functionality in object model. example lets have 2 tables, people , companies . both of these tables have fields required address , database schema, whatever reason, doesn't have third table addresses . in application might want model addresses separate entity though there no logical database table it. here use component allow project database fields address. iusertype way of mapping type column using custom serialization. example if map mongodb objectid (which nothing more guid), write custom iusertype mapping. other examples mapping bit mask array of rich user types or encoding/decoding encrypted field.

Facebook connect for my PHP application -

i make users login through facebook connect on php web application. can please post resources beginners. thanks. regards, mugil. you can check tutorial on using facebook php sdk: http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/ , official facebook documentation: http://developers.facebook.com/docs/guides/web

How to call a procedure or fire a trigger when a new connection is established in SQL Server 2008 -

hi want call stored procedure or fire trigger when new connection established in sql server 2008. thanks would logon trigger trick?

c# - custom paging in gridview -

i looking paging(top,bottom) functionality gridview(or databind controls) i using .net framework 2.0. i have pointers thank you solution: used jquery plugin jquery.tablepagination.0.1.js solution you can asp:repeater this can handle repeater control. this aspx page code <asp:repeater id="rptimages" runat="server" onitemcommand="rptimages_itemcommand"> <itemtemplate > <div class="image"> <a ><asp:image id="image1" runat="server" imageurl=' <%# eval("imageurl") %>' /></a> </div> </itemtemplate> </asp:repeater> <asp:repeater id="rptpages" runat="server" onitemcommand="rptpages_itemcommand"> <headertemplate> ...

objective c - can we have dynamic application icon & splash screen for iPhone OS 4.0/3.0? -

i can make splash screen dynamic... wat icon ? don't think can done app icon cannot changed once app bundled , stored on device. of course can ask badge added app icon when it's shown on home screen; mail app.

c# - What's are the benefits of using Web.config scheduled tasks over for example a Windows scheduled task -

we thinking of ways our scheduled tasks centralized as possible dragging lot of tasks website specific web.config files 1 windows schedules task. can imagine has negative consequences, want list them can make myself explanation of work best. have different types of task have done periodically example: keepalive <- calls page website won't recompiling every 20 minutes (iis setting) imports in different websites run <- imports of example objects have placed in sitecore database. sitecore has it's own scheduler , makes imports easy run using scheduler. on other side, sitecore has it's own "keepalive" setting in web.config makes sure website runs faster. what pro's , con's on issue , advice? keep scheduled tasks centralized? split normal imports keepalive tasks , put 1 of them in centralized environment? sitecore native scheduling executed within sitecore context, means can communicate sitecore way app has alive task execute. pretty...

javascript - How to get to a child of a parent when multiple exist? -

there problem following code. trying increase dollar amount numbers independently (by 0.01 per click). seems work on first "content" class, not on other 2. each of these identical besides amount. layout: <div class="content"> <div class="item"><span class="number">$10.11</span><a href="#" class="incnumber"> increase</a></div> </div> <div class="content"> <div class="item"><span class="number">$5.04</span><a href="#" class="incnumber"> increase</a></div> </div> <div class="content"> <div class="item"><span class="number">$3.45</span><a href="#" class="incnumber"> increase</a></div> </div> script: $(function () { $(".incnumber").click(function() { ...

jquery - Fancybox problem on iPhone -

fancy box seems have problems working on iphone , ipad. go here http://fancybox.net/blog , click "5. display login form try now" on page in iphone or ipad. form not center , when try enter details box moves page , makes unusable. any fixes? thanks, c fancybox attempts auto resize , center everytime browser window resized, , event gets triggered lot on ipads , iphones. fancy box 1.3.4, code controls line 608: $(window).bind("resize.fb", $fancybox.resize); to fix issue, modified part of fancybox js, , added option called "resizeonwindowresize", can set false ipad , iphone users, or disable together. if(currentopts.resizeonwindowresize) { $(window).bind("resize.fb", $fancybox.resize); } you must add default value option in $.fn.fancybox.defaults hash map. then, when calling fancybox can utilize new option: $('#fancybox_link').fancybox(${'scrolling': 'no', wi...

crash - OpenCV crashes trying to read a video with RELEASE build -

using videocapture vcc("somedir/somefile.avi"); as first line in code (opencv 2.x, win7, vs2010), execution release crashes debug works fine .. slow expected though. crashes when trying read video file means passing string constructor. the error looks this: unhandled exception @ 0x00905a4d in somename.exe: 0xc0000005: access violation. what i've tried far: multiple opencv2.x versions svn different computer different video files with or without cuda, tbb, eigen, ... i created new project single line in .. still crashes on release only. alright .. solved own problem after 2 weeks. i changed project option "with debugging information" yes in (sub)project opencv_ffmpeg (in solution opencv) release build. interestingly works "with" , "without debugging" when running .. both didn't work before.

performance - MongoDB's geospatial index: how fast is it? -

i'm doing where in box query on collection of ~40k documents. query takes ~0.3s , fetching documents takes ~0.6 seconds (there ~10k documents in result set). the documents small (~100 bytes each) , limit result return lat/lon only. it seems very slow. right or doing wrong? it seems slow indeed. equivalent search on did on postgresql, example, fast measure (i.e. faster 1ms). i don't know mongodb, geospatial index turned on? (i ask because in rdbmss it's easy define table geometrical/geographical columns yet not define actual indexing appropriately, , same performance describe).

networking - Using HTTP port to evade firewall -

i'm creating client-server application communicates via custom socket protocol. i'd client usable within networks have restrictive firewall (corporate, school, etc.). done connecting via http, since that's available. if want that, have use http or enough use custom protocol via server port 80? the firewall may have more restricted checks restricting ports, , might have proxies along way, , deal in http. still, using well-known port other normal use still far better many schemes inherently non-http stuff on http, , implement rfc 3093 (when people implement april fools rfcs shows combination of humour , technical acumen, rfc 3093 exception). to around proxy issue, use 443 rather 80, https traffic can't proxied in quite same way. indeed, don't need use ssl, proxy assume can't see it. none of needs done application though. application needs have port configurable (that should done server application anyway). default should away well-known ports,...

c# - Change default highlight colour of TabItem in TabControl WPF -

Image
im trying change default highlight colour of tab item in tab control in wpf. in image highlight colour orange, want know if there away change solid colour? here xaml declares tabcontrol , 2 tabitems <tabcontrol> <tabcontrol.background> <lineargradientbrush endpoint="0,1" startpoint="0,0"> <gradientstop color="#ffccccd0"/> <gradientstop color="#ff526593" offset="1"/> </lineargradientbrush> </tabcontrol.background> <tabitem header="test1"> <tabitem.content> <stackpanel orientation="horizontal"> <button content="test" verticalalignment="center" /> <button content="test2" /> </stackpanel> ...

c++ - Customize Title Bar (Colored,Text,icon etc) in dialogBox foe WinCE 6.0 -

hey new bie in wince , working on 6.0 version, there anyway change , feel of dialog title bar in wince , have tried wm_ncpaint message not there in wince.... other way same...?? thanks, mukesh does os include skinnability support? if can skin windows want. see this msdn article more details.

jquery - Javascript Conflict with 2 scripts - Need Help! -

if jscript issue i'd grateful! have 2 scripts different sections of page i'm placing in head, in conflict on same page , can't seem them work together. both follows: <script type="text/javascript"> jquery.noconflict(); function updatesubcat() { $category = $('topcat').options[$('topcat').selectedindex].value; if ($category.match(' redir')) { jquery('#subcategory').html(''); window.location.href='/<%=server.htmlencode(session("publicfranchisename"))%>/' + $category.replace(' redir','') + '.html'; } { pagetodiv("/ajax/home_subcategory.asp?c="+$category,"subcategory"); } } </script> **and:** <script type="text/javascript"> $(document).ready(function() { //execute slideshow, set 4 seconds each images slideshow(4000); }); function slideshow(speed) { //append li item ul list displaying caption $(...

java - How are PNG files defined as drawable objects resized based on the resolution of the Android phone? -

i have png file 32x32 pixels. use 8 of these drawables in row app. these drawables not in hdpi, mdpi, or ldpi folders. i’ve found when starting of 3 standard size emulators, screen view 8 drawables looks pretty same. i note ldpi emulator i’m using (qvga) has resolution of 240x320. 8 x 32 = 256, since can see drawables (and space in-between) i’m betting changing size. i’ve read supporting multiple screens document @ android developers page, still don’t understand happening. put own words explain happening size of drawables , how sdk knows automatically modify them? of course - system automatically resizes images drawable directory correspond dpi of device if don't define own. in fact 'drawable' directory pretty same 'drawable-mdpi' directory, , because don't have ldpi , hdpi versions defined system automatically builds them out of mdpi resources. see (1.) here: http://developer.android.com/guide/practices/screens_support.html#support - ...

javascript - Make .find non case sensitive -

i can using: $results.find('a[href$=".doc"]') to find ending .doc editing reasons. however, seems case sensitive, i.e. if document ends .doc or .doc, not find those. possible make non case sensitive? you have create function match case insensitively. $results.find('a').filter(function(){return /\.doc$/i.test(this.href);}); it possible enumerate 8 cases in selector, won't scale easily. $results.find('a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"]')

c# - WorkItemCollection items too slow to access -

using tfs sdk, querying workitems using workitemstore.query : workitemcollection workitems = workitemstore.query("select id workitems"); foreach(workitem wi in workitems) { string id = wi.id; foreach(attachment attachment in wi.attachments) { console.write(attachment.uri.originalstring); //slow } } accessing items collection slow. talking tfs server everytime access workitem member? there way construct query in such way fields need in 1 go? problem is, tfs server located off-shore, , that's why it's slow. querying stuff en-masse makes lot faster. edit: can't query attachments field. "attachments" not valid field. your query not fetch attachments. each wi.attachments call make query data.

refactoring - How to detect useless Delphi units in the interface and implementation uses clauses? -

possible duplicate: how can identify , rid of unused units in “uses clause” in delphi 7 ? is there wizard/tool automatically detect useless units? if in current unit "use classes" in practice don't need can of course manually remove classes. how can automatically units in project? there way different "delete one, try compile, if succesful save"? of course happens drop component on form, units added, delete component , units not removed. or refactor code, move classes in unit. icarus - uses list analyzer delphi

google street view - Android: using StreetView without starting an intent -

i'm working on simple android app in want to, once user has clicked button on main screen, display streetview of known coordinates. i can create display map so: mapview = (mapview) findviewbyid(r.id.mapview); mapview.setbuiltinzoomcontrols(true); mapcontroller = mapview.getcontroller(); mapcontroller.setzoom(6); // zoom 1 world view geopoint point = new geopoint(...); mapcontroller.setcenter(point); mapcontroller.animateto(point); through method, add own buttons, overlays, etc on map user press actions based on current location on map. i want to, instead of displaying map, display streetview own custom buttons displayed on top of (along standard google ones). way i've found of displaying streetview follows: string uri = "google.streetview:cbll="+ latitude+","+longitude+"&cbp=1,99.56,,1,-5.27&mz=21"; intent streetview = new intent(android.content.intent.action_view,uri.parse(uri)); startactivity(st...