Posts

Showing posts from June, 2012

app store - regarding iphone app download count -

how can know iphone application download count of mine in itunesconnect..? for that, have login in itunesconnect.apple.com site. go "sales , trends" module. here, can find how many applications downloaded.

c# - visual studio: what is sourcesafe? -

what sourcesafe? i trying download see if work c# because told me download job, don't understand is? is built visual studio ide or what? sourcesafe poor , obsolete source control system . can store application's source code , show revision history, , allow multiple developers work on same project efficiently. it has been replaced team foundation server .

ruby - Rails not booting, nothing in the logs -

i moved working copy of rails 3 app test server staging server. i'm getting standard error screen "we're sorry, went wrong." however, development.log file has nothing added (the migration logs went in fine). i've doubled checked settings, everything's fine. if make dummy rails application works should. edit: i'm using passenger on ubuntu 10.10 i under impression "we're sorry, went wrong." used in default production environment. messages being logged production.log? as note, believe passenger launch application in production environment default (as opposed development environment).

.net - How to store audio, images, and binary files as XML? -

i'm reading book on .net, , says "xml can used store type of data including documents (the latest version of microsoft office stores documents using xml), pictures, music, binary files, , database information." huh? how can types of data stored xml? you can convert them base64 , store in xml: storing base64 data in xml?

android - Parent - child application model -

iam building system includes couple of applications, know if there way design "main" application include inside several applications, in case share same proccess thanks, ray. there 2 ways it. 1) application couple of activities . in android activity screen. 2) create different applications , main 1 launch intent . here have tutorial of how it.

java - iBATIS - Defining 'javaType' and 'jdbcType' -

while defining resultmap in ibatis, provides option set javatype , jdbctype each property column mapping. e.g. <resultmap id="employee" class="com.mycompany.employee"> <result property="firstname" column="first_name" javatype="?" jdbctype="?"/> </resultmap> wanted know when should defining javatype , jdbctype ? have seen mapping just works without defining these properties , in others have define them. edit: see selected answer below above question. also, have exhaustive list out of javatype , jdbctype should defined? edit: javatype should 1 of well-known types e.g. java.lang.string , java.util.date , jdbctype should coming out of java.sql.types thanks in advance! for jdbctype documentation (for ibatis 3) states: the jdbc type required nullable columns upon insert, update or delete. on page 33 in document list of supported jdbc types. for javatype attrib...

Asp.Net Routing - No DB access at application Start -

i have custom http-handler , vs2010 thinking switching ms routing instead. problem have route definitions in database , don't know connection string until user logs on! luckily, start page/log in page use routing 1 can access. however, examples have seen far means setting routes in application_start point in time don't have access mu route definitions. would possible create route handler when invoked first time loads routes? or have add routes @ application start?

coding style - how to write clean code in c# language and improve quality of code -

how can improve our code quality , write clean code. if write unclean ugly code how can migrate code (beautiful , clean). everyone finds it's own way of clean code means, there few things might want know, reach level/others understand code (because in world practically have it's own standards). each class/method should responsible 1 thing/task ( oop ). use best-practices : coding techniques , programming practices , design guidelines, managed code , .net framework , design guidelines class library developers comment code, not much, make simple understand. use readable variable names, no more x1s, tempc.. etc... do "big image" optimizations first, others latter. read open source projects code. use unit testing or in best case tdd . learn , use design patterns , c# implementations .

iphone - Can I connect to a remote sqlite binary dump file? -

i try connect remote sqlite file , when try open file error: if (sqlite3_open([databasepath utf8string], &database) == sqlite_ok) { ... }else { // though open failed, call close clean resources. sqlite3_close(database); nsassert1(0, @"failed open database message '%s'.", sqlite3_errmsg(database)); // additional error handling, appropriate... } when try output database path, gives correct url ( it's local network setup , app connects static ip, searching binary sqlite dump ) 2010-04-27 12:47:43.017 bbc_v1[4904:207] loading db path: http://192.168.2.10:8888/bbc.sqlite tested , file exists.. is possible connect remote sqlite file? or possible when it's inside app bundle? greets, thomas sqlite3_open take file name, not url. i don't think sqlite provide remote access explicitly designed embedded use. you should download file , save on device, open it.

c# - working with two combo boxes -

im using c# .net windows form application. have 2 comboboxes , b .i have pouplated values. if select 1 value a, should able populate b items of except selected item . maybe want : (int = 0; < combobox1.items.count;i++) { if ((combobox1.selectedindex)!=i) { combobox2.items.add(combobox2.items[i]); } } you have clear combobox2 before adding new items

javascript - Prototype.js shortcut for getting value of an element? -

i didn't use prototype.js before, when use jquery, can element value $("#inputa").val(); there equivalent method in prototype this? use $("inputa").getattribute('value'); , verbose. use getvalue or $f(element) construct

how to set an adobe Air application initial window to full screen -

i have air app created 1 of adobe's examples using javascript / html. possible change descriptor file application launches full screen or maximized? or call maximize(); function in application creation complete function.

certificate - How can I enable strong private key protection programmatically in C#? -

how can achieve equivalent of setting "strong private key protection" checkbox in certmgr.msc when adding x509certificate2 programmatically using c#? you have setup x509keystorageflags accordingly when importing certificate (i.e. machinekeyset , userprotected ).

performance - Computing Rotation Speed In C++ -

basically, in c++, how compute how long take car wheel rotate 360 degrees while moving @ speed of 10 mph? i've tried googling nothing showed up. ideas? as usual, i've searched site answer nothing showed - unless missed one. thanks. if know speed of object , radius of circle moves on, time needed 1 rotation is rotation_time = 2*pi*radius/speed the number of rotations per time unit is rotation_speed = 1/rotation_time the angular speed is angular_speed = full_circle/rotation_time, with value of full_circle depending on angular unit, e.g. 360 or 2*pi.

c# - Editing an item in a list<T> -

how edit item in list in code below: list<class1> list = new list<class1>(); int count = 0 , index = -1; foreach (class1 s in list) { if (s.number == textbox6.text) index = count; // found match , want edit item @ index count++; } list.removeat(index); list.insert(index, new class1(...)); after adding item list, can replace writing list[someindex] = new myclass(); you can modify existing item in list writing list[someindex].someproperty = somevalue; edit : can write var index = list.findindex(c => c.number == sometextbox.text); list[index] = new someclass(...);

php - Getting text between quotes using regular expression -

i'm having issues regular expression i'm creating. i need regex match against following examples , sub match on first quoted string: input strings ("lorem ipsum dolor sit amet, consectetur adipiscing elit.") ('lorem ipsum dolor sit amet, consectetur adipiscing elit. ') ('lorem ipsum dolor sit amet, consectetur adipiscing elit. ', 'arg1', "arg2") must sub match lorem ipsum dolor sit amet, consectetur adipiscing elit. regex far: \((["'])([^"']+)\1,?.*\) the regex sub match on text between first set of quotes , returns sub match displayed above. this working perfectly, problem have if quoted string contains quotes in text sub match stops @ first instance, see below: failing input strings ("lorem ipsum dolor \"sit\" amet, consectetur adipiscing elit.") only sub matches: lorem ipsum dolor ("lorem ipsum dolor 'sit' amet, consectetur adipiscing elit.") ...

c# - Drawing squares in WPF -

i want achieve following wpf application (in area/defined area): when clicking , holding on app, can draw square you can many times, not overlap squares you can drag squares around application what need achieve this, assume bunch of onclick/onmove's. there easier way, such using canvas? insight great. you have use canvas if want squares appear user clicks , drags. the mouse down event define 1 corner , mouse second. you'd have constrain movement of cursor x , y dimensions of rectangle same. on each mouse move event you'd have check if cursor on 1 of existing squares , prevent square growing further. for dragging of existing squares modify mouse down event check what's under cursor. if it's canvas start square drawing mode, if it's rectangle (square) start dragging mode. again you'd need use mouse move event check square doesn't intersect existing squares.

c# - Barcode with Text Under using ItextSharp -

Image
i using itextsharp in application generate barcode. though working wanted, need display value of barcode under barcode 1 showin in attached image. below c# code use: barcode39 barcodeimg = new barcode39(); barcodeimg.code = barcodevalue.tostring(); barcodeimg.createdrawingimage(system.drawing.color.black, system.drawing.color.white).save(stream, imageformat.png); this code found while searching net. hope solves problem: string prodcode = context.request.querystring.get("code"); context.response.contenttype = "image/gif"; if (prodcode.length > 0) { barcode128 code128 = new barcode128(); code128.codetype = barcode.code128; code128.checksumtext = true; code128.generatechecksum = true; code128.startstoptext = true; code128.code = prodcode; system.drawing.bitmap bm = new system.drawing.bitmap(code128.createdrawingimage(system.drawing.color.black, system.drawing.color.white)); bm.s...

java - Add timeout in receiving message - socket -

i have method sending message on socket , receiving answer. how put timer, if there no answer example 1 sec put information timeout ? public boolean sendforcemessage(final forcemessagetcp message) { boolean result = true; system.out.println("******************sendforcemessage**********************************"); new thread() { public void run() { try { system.out.println("ipaddress="+ipaddress); system.out.println("port="+port); system.out.println("is reachable="+ping()); for(int i=0;i<message.tobytes().length;i++) system.out.println("fragment["+i+"]="+message.tobytes()[i]); socket = new socket(ipaddress, port); outputstream socketoutputstream = (outputstream) socket .getoutputstream(); socketoutputstream.write(message.tobytes()); ...

wpf - mvvm - prismv2 - INotifyPropertyChanged -

since long , prolapsed , doesnt ask coherent question: 1: proper way implement subproperties of primary object in viewmodel? 2: has found way fix delegatecommand.raisecanexecutechanged issue? or need fix myself until ms does? for rest of story...continue on. in viewmodel have doctor object property tied model.doctor, ef poco object. have onpropertychanged("doctor") in setter such: private property doctor() model.doctor return _objdoctor end set(byval value model.doctor) _objdoctor = value onpropertychanged("doctor") end set end property the time onpropertychanged fires if whole object changes. wouldnt problem except need know when properties of doctor changes, can enable other controls on form(save button example). have tried implement in way: public property firstname() string return _objdoctor.firstname end ...

reflection - How to know the classes of a package in java? -

possible duplicate: can find classes in package using reflection? suppose i've package name string: string pkgname = "com.forat.web.servlets"; how know types in package? that's not possible in full generality. if classes stored in directory or jar file, can @ contents, classloader mechanism flexible question "what classes in package" not make sense - it's possible write classloader returns class any classname ask for.

jquery - Is there a way to highlight specific words or numbers without inserting a span tag? -

i've got blocks of text various specs in them , want have jquery highlight whatever matches specific pattern without inserting html. the following kind of text i've got work with. intel® core™ i7 processor 920 (2.66ghz, 8mb cache, 4.8gt/sec)/ genuine windows® 7 home premium 64bit- english/ 640 gb serial ata non raid (7200 rpm)/ 6gb 1333mhz (3x2gb) tri channel memory/ display not included/ 16x dvd+/- rw optical drive (dvd & cd read , write)/ 1.8gb nvidia® geforce™ gtx260 graphics card/ integrated hda 7.1 dolby digital audio what i'm hoping jquery can highlight of basic specs without inserting html. maybe working off list of values matching spec format using wildcards neededed? the css select correct tag #list div div div+p or give p class rather not. is kind of thing possible? if mean "without inserting html" in server side html, no. but, can achieve wrapping keyword jquery. take jquery highligth plugin , wrap span keywords, you...

php - Curl hidden field with randomly generated value -

i'm attempting access value of hidden field in form i'm trying log using curl. realise childs play curl but headache here have use same curling to: (1) unique randomly generated session value (2) log form the problem (2) requires (1) in order proceed. can both in 1 curl? i think short answer is, can't. you'll have fetch form, extract hidden serial , make curl request it.

java - Android: Changing LinearLayout in a widget -

i have annoying problem: in widget, change background code. noticed on google doc can change background of imageview: remoteviews.setimageviewresource(r.id.my_iv, r.drawable.my_bg); ok, easy, want change linear layout.. read remoteview id can change bitmap, int, bool, string, etc... not drawable. guess cannot use: remoteviews.setbitmap(r.id.my_ll,"setbackgrounddrawable",bitmapfactory.decoderesource(context.getresources(), r.drawablemy_bg)); i totally disapointed , tried last idea: views.setint(r.id.my_ll,"setbackgroundresource",r.drawable.my_bg); but logcat told me: android.widget.remoteviews$actionexception:view: android.widget.linearlayout can't use method remoteviews: setbackgroundresource(int) i totally lost , don't know do... i appreciate help. thank lot! you cannot modify background way, due limitations in remoteviews api. what can choose different layout -- 1 background want -- when create remoteviews i...

android - How to handle a webview confirm dialog? -

i'm displaying webpage in webview , on webpage, there button. when click button, confirmation dialog supposed popup, doesn't show in webview. popup if go same webpage in android browser. know how handle popup dialogs coming webpage inside webview? ok, found answer , here is! in order handle popup confirmation coming webpage in webview, need override onjsconfirm method in webchromeclient display popup android alert dialog. here code so. final context myapp = this; final class mywebchromeclient extends webchromeclient { @override public boolean onjsconfirm(webview view, string url, string message, final jsresult result) { new alertdialog.builder(myapp) .settitle("app titler") .setmessage(message) .setpositivebutton(android.r.string.ok, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { result.confirm(...

django - Writing to the Apache error.log file from Mod_Wsgi -

i having issues setting wsgi file wanted output messages log file. found page http://code.google.com/p/modwsgi/wiki/debuggingtechniques , when try use code: print >> sys.stderr, "application debug #3" in project.wsgi file, message not pushed error.log on apache restart. site being served correctly. need make logging work? p.s. on ubuntu 10.10 serving django site. the wsgi script file loaded when first request arrives specific application , not automatically when processes start, ie., not when apache restarted. can force loaded on process start if mod_wsgi configured appropriately, isn't default. nothing in wsgi script file executed on process shutdown. have happen need register atexit callback. see 'code.google.com/p/modwsgi/wiki/…;. – graham dumpleton graham dumpleton genius!

How do you use Java 1.6 Annotation Processing to perform compile time weaving? -

i have created annotation, applied dto , written java 1.6 style annotationprocessor. can see how have annotationprocessor write new source file, isn't want do, cannot see or find out how have modify existing class (ideally modify byte code). modification trivial, want processor insert new getter , setter name comes value of annotation being processed. my annotation processor looks this; @supportedsourceversion(sourceversion.release_6) @supportedannotationtypes({ "com.kn.salog.annotation.aggregatefield" }) public class salogdtoannotationprocessor extends abstractprocessor { @override public boolean process(final set<? extends typeelement> annotations, final roundenvironment roundenv) { //do stuff } } you looking "instrumentation", frameworks aspectj do. in case have specify jar in command line "-agent" option, , have possibility filter loaded classes. during filter step can check annotations, , modify byteco...

linq - How can I do an OrderBy with a dynamic string parameter? -

i want this: var orderby = "nome, cognome desc"; var timb = time.timbratures.include("anagrafica_dipendente") .where(p => p.coddipendente == 1); if(orderby != "") timb = timb.orderby(orderby); is there orderby overload available accepts string parameter? absolutely. can use linq dynamic query library, found on scott guthrie's blog . there's updated version available on codeplex . it lets create orderby clauses, where clauses, , else passing in string parameters. works great creating generic code sorting/filtering grids, etc. var result = data .where(/* ... */) .select(/* ... */) .orderby("foo asc"); var query = dbcontext.data .where(/* ... */) .select(/* ... */) .orderby("foo ascending");

Crash Reporting Utility for Windows 7, MFC Application -

i'm having mfc application (vs 2008) going deployed on windows 7 machine. need distribute application debugging information, debugable core generated in case of application crash event. can please let me know how can achieve purpose ? have read minidump utility, whether there better way of generating coredump on windows 7 machine thank you by default, both debug , release msvc builds contain debug information. don't need distribute program .pdb files, necessary keep .pdb files every released version. necessary debug minidump files. program must generate dump files when crashes. generally, working minidumps looks this: program crashes on client site , produces minidump file. minidump sent developer. developer restores source code , .pdb files according program version, , debugs minidump file. finally, short introdunction post-mortem debugging: http://www.codeproject.com/kb/debug/postmortemdebug_standalone1.aspx afaik, same windows versions.

c# - StringTemplate bad performance -

i'm using stringtemplate generate xml files datasets. have more 100,000 records in dataset enumerated loop in template. goes slow (15-20 secs per operation) performance not me. this example how use st render report: using (var sw = new stringwriter()) { st.write(new stringtemplatewriter(sw)); return sw.tostring(); } stringtemplatewriter simple writer-class derived istringtemplatewriter without indentation. by way, in debug screen see lot of such weird message: "a first chance exception of type 'antlr.noviablealtexception' occurred in stringtemplate.dll" in deep of debug found parses template recursively , if failed (don't know exactly) throws noviablealtexception exception return deep of stack surface, guess problem in using of try-catch-throw's. google found nothing useful on this. main question: how decrease number of exceptions (except rewriting code of st) , improve performance of template rendering? st parses st templates...

c# - Membership.ValidateUser always returns false after upgrade to VS 2010 / .NET 4.0 -

not sure whether pertains vs 2010 or upgraded framework, but... using oracle membership provider authenticate users. prior upgrade worked fine, membership.validateuser(user, password) returns false despite valid credentials. there no exception thrown, it's hard determine problem might be. website administration tool in vs 2010 still able manage users , roles (more or less), have no reason question connectivity. might problem be? the answer (according this post ) specify hashalgorithmtype="sha1" in web.config: <membership defaultprovider="oraclemembershipprovider" hashalgorithmtype="sha1"/> this did not solve problem existing users, newly created users can log in now.

symfony - What is Form Context in Symfony2 -

i getting started symfony2 , trying understand form component. looking @ page http://docs.symfony-reloaded.org/guides/forms/overview.html and can understand how create form classes confusing how use forms in our controller. $form = contactform::create($this->get('form.context')); does have more in depth explanation of form.context portion of code, , actual process behind using forms within controllers? thanks. form.context service symfony\component\form\formcontext object default. here's full definition of service: <service id="form.context" class="%form.context.class%"> <argument type="collection"> <argument key="validator" type="service" id="validator" /> <argument key="validation_groups">%form.validation_groups%</argument> <argument key="field_factory" type="service" id=...

jquery - Root element in html method -

in jquery .html() method somehow not return root element, example: var test = $('<root><val>hello world</val></root>'); var str = test.html(); // '<val>hello world</val>' how can string root tag included? you want outerhtml property. firefox doesn't support it, you'll need include fix: var str = test[0].outerhtml || $('<div>').append(test).html(); working example: http://jsfiddle.net/ub244/

.net - SoapHttpClientProtocol disable ssl certificate validation -

i need tell c# soap web service consumer not validate certificate , accept it. possible? why: publish https-only web service. client needs consume has kind of firewall/proxy (websense?) certificate make fail validation. @ point don't know details of what does, customer appears ok forfeiting benefits of ssl, i'm looking workaround. http://blog.jameshiggs.com/2008/05/01/c-how-to-accept-an-invalid-ssl-certificate-programmatically uses servicepointmanager.servercertificatevalidationcallback disable certificate validation. see "the remote certificate invalid according validation procedure." using gmail smtp server similiar question same answer.

What are the client requirements for a .NET Outlook-AddIn (VSTO 2010)? -

we planning implement outlook-addin (2007/2010). our first attempt vsto 2010, wonder if there special requirements on client in case. vsto 2010 required office 2010 if want support both office versions 1 add-in you'll have use version 12 of pias , not 14. required is: vsto 2010 pias 12 .net framework (4.0 gives more vsto stuff: http://blogs.msdn.com/b/vsto/archive/2010/04/23/why-should-i-upgrade-from-net-framework-3-5-to-net-framework-4.aspx ) outlook (you should develop 2007 on machine , keep 2010 off of it)

.net - Converting avi to divx, are there any c# libraries for divx? -

i have problem (or maybe discussion). i've been surfing internet in search of program can convert (dv) avi files in batches divx. i'm not avid person on subject of codecs , videoformats have straightforward wish able convert video files divx. i sitting 100 gb (i have lot more, still on tape...) of raw dv material had transferred computer, found hard time find program based on schedule or more job-like. hoping find program take files based on filename @ given time start converting , joining files. since quite time consuming process hoping done @ nightime... but after i've searching , trying out bunch of programs, more or less useful, started thinking in terms of making simple(?) commandline application doing wanted do. next step find sort of libraries me this, had hard time find (hopefully in c#). due licensing or other misconduct between microsoft products , more open source people of video codecs...? or maybe there exist use? i don't know of managed...

ruby on rails - How to change validation messages on forms -

the website i'm developing in spanish. therefore, i'll need error messages in language. i created file under configuration directory called 'en.yml' in order accomplish this. , added following code in it: es: activerecord: errors: models: announcement: attributes: title: blank: "el título no puede estar vacío." "el título no puede estar vacío" means "the title cannot blank". when go , run code see message following: "title el título no puede estar vacío." where "title" field's name. don't want displayed. want display error message created. you have specify translation after attribute es: activerecord: models: announcement: "anuncio" attributes: announcement: title: "título" # <= here errors: models: announcement: attributes: ...

Reducing the memory footprint of multiple Java processes on Solaris (UNIX) -

is there way have java process either fork or launch java process , use shared memory in order minimize ram usage? there many processes in order allow 1 safely killed without affecting others. allow simple detection of threads using more memory or cpu if in separate processes. should allow process have crash or outofmemoryerror without affecting other processes. it nice if have 100-300 java processes running @ same time,, each own purpose. realize may have limit number , require processes take on multiple roles if keep robbing memory database , filesystem. edit: think hit incorrect meaning when said shared memory. mean memory can used among multiple processes java classes (not variables). java packages , libraries can reused if possible. @george baily - caught comment above. yes, newer jvms share class text, understand in client (non-server) jvms. benefit of reduced io , startup time has added benefit in helping smaller footprint. you can read more here: http...

wpf - Accelerated response of TextBox control -

i use in wpf textbox control chat window -> use typing chat messages textbox control. problem user typing little faster textbox reacts slowly. somehow accelerated response of textbox if possible. any idead. difficult describe behevior, if have time try it, type in control. edited: here original part of textbox’s code: <textbox text="{binding path=rptext,mode=twoway, updatesourcetrigger=propertychanged}" textwrapping="wrap" verticalscrollbarvisibility="auto" fontsize="14" margin="2,2,2,2" grid.row="3" minheight="70" micro:message.attach="[previewkeydown]=[action sendrp($eventargs)]"/> i omitted 2 way binding , previewkeydown , same opinion. here modified code of textbox’s <textbox textwrapping="wrap" verticalscrollbarvisibility="auto...

Flex vs. Flash - which one? -

possible duplicate: flash versus flex depending on project size, 1 most--flex or flash? why more other? advantages have on other? it depends on type of project , coding style. if come designer background or project highly visual (image processing, effects, timeframe manipulation) flash gives more control. on other hand, if prefer programming ide, flex better choice. it's designed programmers, not designers, while visual side more limited, you'll better coding experience. in end, can both. should choose based on style.

html - How to convert a DOM node list to an array in Javascript? -

i have javascript function accepts list of html nodes, expects javascript array (it runs array methods on that) , want feed output of document.getelementsbytagname returns dom node list. initially thought of using simple like: array.prototype.slice.call(list,0) and works fine in browsers, except of course internet explorer returns error "jscript object expected", apparently dom node list returned document.getelement* methods not jscript object enough target of function call. caveats: don't mind writing internet explorer specific code, i'm not allowed use javascript libraries such jquery because i'm writing widget embedded 3rd party web site, , cannot load external libraries create conflict clients. my last ditch effort iterate on dom node list , create array myself, there nicer way that? nodelists host objects , using array.prototype.slice method on host objects not guaranteed work, ecmascript specification states: whether slice func...

html - How do I clear my floats? -

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us"> <head> <style type="text/css"> body {width:100%;overflow-x:hidden;} *{margin:0; padding:0; border:0;} .wrap{float:left;width:100%;background-color:#ccc;} .content{width:1000px;margin:0 auto;background-color:#efefef;} .left{float:left;width:760px;} .right{float:left;width:240px;} </style> </head> <body> <div class="wrap"> <div class="content"> <div class="left"> 111<br /> 222<br /> <!-- there still have lines --> </div> <div class="right"> </div> </div> </div> </body> </html> the div height zero, background color ha...

mysql - Combine multiple room availability queries into one -

i'm trying optimize database combining queries. keep hitting dead ends while optimizing room availability query. i have room availability table each records states available number of rooms per date. it's formatted so: room_availability_id (pk) room_availability_rid (fk_room_id) room_availability_date (2011-02-11) room_availability_number (number of rooms available) the trouble getting list of rooms available each of provided days. when use in() so: where room_availability_date in('2011-02-13','2011-02-14','2011-02-15') , room_availability_number > 0 if 14th has availability 0 still gives me other 2 dates. want room_id when available on 3 dates. please tell me there way in mysql other querying each date/room/availability combination separately (that done :-( ) i tried sorts of combinations, tried use room_availability_date = (...), tried dirty repeating subqueries no avail. thank in advance thoughts! i think can impro...

c - Cuda code #define error, expected a ")" -

in following code, if bring #define n 65536 above #if fsize, following error: #if fsize==1 __global__ void compute_sum1(float *a, float *b, float *c, int n) { #define n 65536 int majoridx = blockidx.x; int subidx = threadidx.x; int idx=majoridx*32+subidx ; float sum=0; int t=4*idx; if(t<n) { c[t]= a[t]+b[t]; c[t+1]= a[t+1]+b[t+1]; c[t+2]= a[t+2]+b[t+2]; c[t+3]= a[t+3]+b[t+3]; } return; } #elif fsize==2 __global__ void compute_sum2(float2 *a, float2 *b, float2 *c, int n) #define n 65536 { int majoridx = blockidx.x; int subidx = threadidx.x; int idx=majoridx*32+subidx ; float sum=0; int t=2*idx; if(t<n) { c[t].x= a[t].x+b[t].x; c[t].y= a[t].y+b[t].y; c[t+1].x= a[t+1].x+b[t+1].x; c[t+1].y= a[t+1].y+b[t+1].y; } ...

java - Is there any way to connect to Rational Team Concert with Perl? -

i'm using perl environment , trying connect rational team concert server manage items , files. right alternative have seen java pseudo api connect services. this last option , solution involves mid layer (java console application) call console commands using perl , reaching rtc server way. any appreciated. rational team concert, @ core, bunch of rest based web services. every single action on work items, source code, builds, or series of web service calls. beauty web service call not language specific! if go out jazz.net can read on how access these web services , access them perl. feel free asks questions in jazz.net/forums of course, command line interfaces can well! check out scm , repotools.

Getting windbg without the whole WDK? -

does know how ahold of windbg without having download entire 620mb wdk iso? all can find on net download debugger link, says have whole wdk: http://www.microsoft.com/whdc/devtools/debugging/default.mspx . actually, microsoft has made debugging tools downloadable separately sdk. section "standalone debugging tools windows (windbg)" mid-page: for windows 8.1 for windows 10

What is the '^' in Objective-C -

what '^' mean in code below? @implementation appcontroller - (ibaction) loadcomposition:(id)sender { void (^handler)(nsinteger); nsopenpanel *panel = [nsopenpanel openpanel]; [panel setallowedfiletypes:[nsarray arraywithobjects: @"qtz", nil]]; handler = ^(nsinteger result) { if (result == nsfilehandlingpanelokbutton) { nsstring *filepath = [[[panel urls] objectatindex:0] path]; if (![qcview loadcompositionfromfile:filepath]) { nslog(@"could not load composition"); } } }; [panel beginsheetmodalforwindow:qcwindow completionhandler:handler]; } @end === i've searched , searched - sort of particular reference memory? read on here . it's "block object", lambda form, , introduced support snow leopard's gcd (grand central dispatch).

java - Cannot find tld file, tld is in shared lib -

i trying publish applications onto portal server, pu8blication fails unable find .tld file in web-inf dir. the tld file not there in web-inf dir, use tld file 20 more applications, put in shared lib other jars. how tell rad check shared lib when trying publish server ? or how can tell ignore tld file, because application loads tld files when starts up. any appreciated. you should put .tld files in folder named tlds under meta-inf folder of java project. project should checked in web libraries tab of java ee module dependencies of web app project.

java - HttpURLConnection, skip a file download -

i writing java performance test program fires httpurlconnection.openconnection method within each thread , downloads file web server, not save locally. here code: httpurlconnection conn = null; inputstream = null; try { url prs = new url(url); conn = (httpurlconnection)prs.openconnection(); if (conn.getresponsecode() == httpstatus.sc_ok && conn.getcontentlength() > 0 ) { = conn.getinputstream(); while (is.read() != -1) { } } else { system.err.println(url+" returned response code : "+conn.getresponsecode()+" , content lengh = "+conn.getcontentlength()); } } catch (exception e) { e.printstacktrace(); } { try { is.close(); } catch (ioexception e) { e.printstacktrace(); } conn.disconnect(); } the purpose of test see how long take download file (without s...

html - jQuery or CSS to display thumbnail of external page -

i'm trying display thumbnails of external webpages, similar how chrome shows recent favorites when new tab opened. use object element this: <object class="page-thumbnail" type="text/html" src="http://www.foo.com/endpoint.html"> <p>page 1</p> </object> is there jquery/jquery plugin or css example of how accomplish this? i've looked @ -webkit-transform, example, can't seem work. it possible create looks thumbnail, catch can't control them via javascript. also, run on firefox , webkit. http://jsfiddle.net/duopixel/vftan/ it's css scale transform applied on iframe.

c# - Type or namespace name could not be found -

i use this: public class constructionrepository { private crdatacontext db = new crdatacontext(); public iqueryable<material> findallmaterials() { //return db.materials; var materials = m in db.materials join mt in db.measurementtypes on m.measurementtypeid equals mt.id select new material { mat_name = m.mat_name, measurementtypeid = mt.name, mat_type = m.mat_type }; return materials.asqueryable(); } } it gives me error 'crmvc.models.material' not contain definition 'matid','mesname','mestype' edit: 'matid','mesname','mestype' fake names gave wrong.. the material class must have settable properties same names used in select new materi...

.net - How to I define/change the mappings for Linq To Sql in code -

i wish able change table class mapped @ run time, can’t if mappings defined attributes. therefore there way define mappings @ runtime in code. (i rather not have maintain xml mapping files.) say have 2 tables: olddata newdata and wished query olddata , other times wished query newdata. want use same code build queries in both cases. see " how map entity framework model table name dynamically " in order make transparent, have jump through pretty crazy hoops, can done overriding meta*** classes own derived types. this straightforward proxy/method interception library castle, assuming lowest common denominator here, it's long , boring ordeal of implementing every single meta method wrap original type, because can't derive directly of attribute mapping classes. i'll try stick important overrides here; if don't see particular method/property in code below, means implementation literally one-liner wraps "inner" method/...

javascript - Using Jquery in UserControl with MasterPage -

i can't seem javascript work on usercontrol. want count characters in mulitline textbox (which adds level of complexity). want count characters , display them in label. i have javascript in .js file included in masterpage: function textcounter(field, countfield, maxlimit) { var output = document.getelementbyid(countfield); if (output == null) { return; } if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit); else output.value = maxlimit - field.value.length; } my usercontrol has little code: <script type="text/javascript" language="javascript"> if (typeof contentpageload == 'function') { var outputfield = $("[id$='lblcharactercount']"); } </script> <asp:textbox id="txtmytest" runat="server" height="75px" cssclass="form-field full" textmode="multiline" maxlength="140...

visual studio 2010 - vcxproj file won't load into solution -

we've switched vs 2010 , had solution working fine. moring when try load solution error: "an item same key has been added." this occurs when trying load 1 of our main projects , not loaded. i assumed problem solution created brand new empty solution , tried load same vcxproj , got same error. when revert project file previous version works, apparently it's in vcxproj file. appears i'm 1 in office affected. combination of vcxproj file , computer seems issue. has seen before? ideas on solution? thanks still not sure caused issue deleting temporary files: <proj>.vcxproj.user <proj>.vcxproj.filters <proj>.vcproj.<domainname???>.<username>.user <proj>.suo has fixed problem. i suspect just <proj>.vcxproj.user <proj>.vcxproj.filters or both fixed did delete 4 have been of them. the change vcxproj file casued break renaming files , adding files, guess 1 of generated files had stale refe...

python - What causes the Openid error: Received "invalidate_handle" from server -

i'm new openid, , getting "invalidate_handle" , have no idea fix it. i'm using django_authopenid [thu apr 29 14:13:28 2010] [error] generated checkid_setup request https://www.google.com/accounts/o8/ud assocication aoxxxxxxxxox5-v9odc3-bthhfxzacccccccccc2rthgh [thu apr 29 14:13:29 2010] [error] error attempting use stored discovery information: <openid.consumer.consumer.typeurimismatch: required type http://specs.openid.net/auth/2.0/signon not found in ['http://specs.openid.net/auth/2.0/server', 'http://openid.net/srv/ax/1.0', 'http://specs.openid.net/extensions/ui/1.0/mode/popup', 'http://specs.openid.net/extensions/ui/1.0/icon', 'http://specs.openid.net/extensions/pape/1.0'] endpoint <openid.consumer.discover.openidserviceendpoint server_url='https://www.google.com/accounts/o8/ud' claimed_id=none local_id=none canonicalid=none used_yadis=true >> [thu apr 29 14:13:29 2010] [error] attempting dis...

jetty - CruiseControl: Does not start - how to determine reason? -

cruisecontrol not start more (only known change adding new memory machine.) ok, seems start: calling web gui brings: http error: 404 not_found requesturi=/ powered jetty:// there 2 exceptions in log file: 2011-02-14 10:22:50.800::warn: fatal@jar:file:/srv/cruisecontrol-bin-2.8.2/lib/jsp-2.1.jar!/meta-inf/fmt-1_0.tld line:1 col:14 : org.xml.sax.saxparseexception: pseudo attribute name expected. 2011-02-14 10:22:50.801::warn: exception org.xml.sax.saxparseexception: pseudo attribute name expected. @ org.apache.xerces.util.errorhandlerwrapper.createsaxparseexception(unknown source) @ org.apache.xerces.util.errorhandlerwrapper.fatalerror(unknown source) @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source) @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source) @ org.apache.xerces.impl.xmlscanner.reportfatalerror(unknown source) @ org.apache.xerces.impl.xmlscanner.scanpseudoattribute(unknown source) @ or...

How to get the app a Django model is from? -

i have model generic relation: trackeditem --- genericrelation ---> model i able generically get, initial model, tracked item. i should able on model without modifying it. to need content type , object id. getting object id easy since have model instance, getting content type not: contenttype.object.filter requires model (which content_object.__class__.__name__ ) , app_label. i have no idea of how in reliable way app in model is. for app = content_object.__module__.split(".")[0] , doesn't work django contrib apps. you don't need app or model contenttype - there's handy method that: contenttype.objects.get_for_model(myobject) despite name, works both model classes , instances.

SQL Server 2008: performance cost for a single sql statement -

Image
i have 2 stored procedures want compare , identify of them requires less resources , performs better. second procedure modification of first procedure , contains changed sql statements of first procedure. goal understand impact of changes in terms of query cost. in order so, execute each procedure separately option "include actual execution plan" , analyse both execution plans. problem cannot sql query performs better in simple manner. for example consider following execution plan of query of first stored procedure: the plan shows query cost 0% relative batch , clustered index seek operator 100% relative query. have same numbers corresponding query of second procedure unfortunately not enough understand query has minimal cost. therefore, question: there way determine cost of whole query. best table query , particular cost, e.g. cpu cost or i/o cost. you can use set statistics io on (http://msdn.microsoft.com/en-us/library/ms184361.aspx) , set statis...

visual studio 2010 - Is there a way to suppress SQL03006 error in VS2010 database project? -

first of all, know error getting can resolved creating reference project (of type database server) , referencing in database project ... however, find overkill, small teams there no specific role separation between developers , db admins..but, let's leave discussion time... same goes dacs...can't use dac b/c of limited objects supported... question now, question is: can (and how), disable sql03006 error when building database project. in case error generated because creating users logins "unresolved"...i think should possible hope, since "know" logins exist on server before deploy script...i don't want maintain database server project can keep refs resolved (i have nothing besides logins @ server level)... workaround using pre/post deployment scripts, trivial secript working... workaround issue have comment out user scripts (which use login references) workaround... that, .sqlpermissions bomb out, saying there no referenced users...and have ...

Is it possible to have MSpec & NUnit tests in a single project? -

i've got unit test project using nunit. when add mspec (machine.specifications) assembly references, both resharper , testdriven.net stop running nunit tests , run mspec tests. is there way or setting allows both nunit & mspec tests co-exist , run in same project using r# & td.net test runners? i've tested on vs 2008 resharper 5.0 , testdriven.net 3.0 rc2 , following code. using machine.specifications; using nunit.framework; namespace classlibrary1 { [testfixture] public class footests { [test] public void bar() { assert.istrue(true); } } public class when_tests_are_run { should_succeed = () => true.shouldbetrue(); } } i cannot reproduce behavior describe resharper. first off, resharper detects both test classes indicated green-and-yellow gutter marks. right-clicking on project , selecting "run unit tests" runs both tests successfully. running them individu...

c# - How to implement a-form-inside-a-form with runtime embedded forms switching? -

i need implement tabcontrol-like behaviour manual (on event, on button click example) pages switching , having pages designed , implemented separate forms. form incorporated (as panel control) inside main form , replaced form needed. how achieve this? ps: reason why don't want use tabcontrol instead because there going many tabs - i'd prefer present list of them treeview , instantiate on demand. reason comes project of mine - there going implement plug-ins, panel inside main window provided class loaded dynamically , runtime-switchable. i did similar thing once, , reason, have replacecontrol method, paste below: static public void replacecontrol(control toreplace, form replacewith) { replacewith.toplevel=false; replacewith.formborderstyle=formborderstyle.none; replacewith.show(); replacewith.anchor=toreplace.anchor; replacewith.dock=toreplace.dock; replacewith.font=toreplace.font; replacewith.size=to...

chrome sets cursor to text while dragging, why? -

my application has many drag , drop features. while dragging want cursor change grab cursor. internet explorer , firefox work fine this, chrome changes cursor text cursor. none of these solutions worked me because it's code. i use custom jquery implementation drag, , adding line in mousedown handler did trick me in chrome. e.originalevent.preventdefault();

if statement - Test for a dot in bash -

how can test if string dot in bash? i've tried this: if [ "$var" = "." ] and this: if [ "$var" = "\." ] but doesn't work. works me: $ d=. $ if [ $d = '.' ];then echo 'yes'; else echo 'no'; fi yes $ d=foo $ if [ $d = '.' ];then echo 'yes'; else echo 'no'; fi no

What are the differences between "git commit" and "git push"? -

Image
in git tutorial i'm going through, git commit used store changes you've made. what git push used then? basically git commit " records changes repository " while git push " updates remote refs along associated objects ". first 1 used in connection local repository, while latter 1 used interact remote repository. here nice picture oliver steele , explains git model , commands: read more git push , git pull on gitready.com (the article referred first)

c++ - Avoiding double inclusion: Preprocessor directive vs. makefiles -

i'm working on moving frankenstein , one-file thousands-of-lines programs structured , organized, multi-file programs. right seems natural (naively) make love-triangle of header inclusions 3 of files: file_1 includes file_2, file_4 file_2 includes file_3, file_4 file_3 includes file_1 .... etc etc these files have variables, methods, structs, etc need between other files. and of course i'm getting double inclusion errors. my question: should avoid these problems using preprocessor directives in headers (e.g. including structs, methods, etc. entirely in header), or should compiling using makefile (which hear can used resolve problem---but i've never made one)? preprocessor directives , headers containing declaration , shared structures etc way go. makefiles helps compile sources , link object files external libraries form final binary, won't resolve multiple-inclusion issue. in nutshell, declare following in header file: structs shared variabl...

java - How to list TODO: in Ant build output -

related: how use ant check tags (todo: etc) in java source how can ant list todo: tags found in code in build output when run it. build failure optional (ie: setting) if found. i've tried checkstyle suggested in related post, doesn't display text of todo: . ie: [checkstyle] .../src/game.java:36: warning: comment matches to-do format 'todo:'. [checkstyle] .../src/game.java:41: warning: comment matches to-do format 'todo:'. [checkstyle] .../src/gamethread.java:25: warning: comment matches to-do format 'todo:'. [checkstyle] .../src/gamethread.java:30: warning: comment matches to-do format 'todo:'. [checkstyle] .../src/gamethread.java:44: warning: comment matches to-do format 'todo:'. i not sure if provides ability fail build if todo found may usefull http://code.google.com/p/ant-todo/

Whats the proper way to do explicit transactions with linq to sql? -

i have scenarios need have multiple calls .submitchanges() on datacontext, want explicitly control transaction myself make atomic. while have been doing creating connection, creating transaction on connection, creating datacontext , passing both. lets assume dont want use transactionscope instead. code looks this: using conn new sqlconnection("connection string...") conn.open() using trans = conn.begintransaction() dim dc new datacontext(conn) dc.transaction = trans ' work trans.commit() end using end using i began using linq sql profiler , breaks code. reason require use .connection property on datacontext create transaction. fails if use connection variable directly (which think silly). question is, more appropriate way: using conn new sqlconnection("connection string...") conn.open() dim dc new datacontext(conn) using trans = dc.connection.begintransaction() dc.transaction = trans ' work ...

python - need help regarding the following regular expression -

i using python re module regular expressions want remove characters string except numbers , characters. achieve using sub function code snippet:- >>> text="foo.bar" >>> re.sub("[^a-z][^a-z]","",text) 'fobar' i wanted know why above expression removes "o."? i not able understand why removes "o" can please explain me going on behind this? i know correct solution of problem >>> re.sub("[^a-z ^a-z]","",text) 'foobar' thanks in advance because o matches [^a-z] , . matches [^a-z] . and correct solution [^a-za-z0-9] .

iphone - application crash in device -

i have made 1 application. in application have load 1 tableview text , select row in tableview load tableview @ time of select row application crashed in device. working in simulator. in device crashed. sample code @ didselectedrowatindexpath - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { nslog(@"%d",indexpath.row); int k,i=0 ; (k = 1; k<=indexpath.row; k=k++) { = k * [appdeleg.tabledata count]; } nsmutablearray *temparray = [[nsmutablearray alloc] init]; appdeleg.finaldeptpayment = temparray; [temparray release]; (int j=0; j<[appdeleg.tabledata count]; j++) { finalcalculationvalue *objfinalvalue = [[finalcalculationvalue alloc] init]; nsdecimalnumber *dec = [[nsdecimalnumber alloc] initwithdouble:[[appdeleg.arrrowpayments2 objectatindex:i+j] doublevalue]]; objfinalvalue.deptpayment = dec; nslog(@"%@",dec); ...