Posts

Showing posts from August, 2013

merge - Vertices not merged (output from Kinect Fusion) -

i have major problem right now. using kinect fusion capture 3d scene , output .obj file. the output of file looks this: v 123 123 123 v 123 123 123 v 123 123 123 vn 321 321 321 vn 321 321 321 vn 321 321 321 f 1//1 2//2 3//3 where v vertice, vn normal, , f face. 3 vertices makes face, number of face exacely 1/3 number of vertices. problem output kinect doesnt merge vertices together. after import maya , merge them together, number of vertice , vertice normals somehow become different! number of vertice after merge: 52837 number of vertice normal after merge: 299997 number of face after merge: 99999 how possible!? shouldn't each vertice have 1 vertice normal? why there more normal vertices? code wrote can work if follows structure. way not merge vertices together, may cause problems me in future. hope can me t_t that's expected behavior. imagine have 2 triangle making quad. unmerged, that's 6 vertices , 6 vertex normals. after merging have 4 vertic...

iphone - Show keyboard with button have symbol "#+=" as default -

i want when touch on textfield, show keyboard has symbol like: "[,],{,}..." delegate , try types doesn't have keyboard type. i have searched can find solution. possible? there no default keyboards show special characters. can have "numbers , punctuation" keyboard close. the best solution have custom input view textfield. create view button have, , set view inputview of textfield. mytextfield.inputview = mycustomview; add ibaction buttons , place below code. - (ibaction)buttonpressed:(uibutton *)btn { [self.currentactivetextfield inserttext:btn.titlelabel.text]; }

java ee - How to generate artifacts from WSDL and XSD using gradle? -

can post sample code generate artifacts wsdl , xsd using gradle? there in built plugins available? how can load custom binding files using gradle? here's similar question has been answered: howto generate classes wsdl , xsd gradle, equivalent maven-jaxb2-plugin a blog article: http://joerglenhard.wordpress.com/2012/01/10/xjc-and-schemagen-with-gradle/ you can specify bindings file binding: 'your-file-here'

sharepoint 2010 - Event Receiver not affecting until refesh the list -

i have sharepoint 2010 list. have written event receiver code update field value in item added event. getting correct result, it's not updating field value until refresh list. why? code: public override void itemadded(spitemeventproperties properties) { base.itemadded(properties); spweb web = properties.openweb(); splist list = properties.list; int highestvalue = 0; spquery query = new spquery(); query.query = @"<orderby> <fieldref name='nextno' ascending='false' /> </orderby><rowlimit>1</rowlimit>"; splistitemcollection itemcollection = list.getitems(query); if (itemcollection.count > 0) { splistitem item = itemcollection[0]; highestvalue = convert.toint32(item["nextno"]); } splistitem curritem = properties.listitem; curritem["nextno"]...

jquery - Number of Page Views - View Counter -

my site done in asp .net mvc , sql server. want add view counter feature details page of each products in e-ccommerce site,that number of total hits page. best way achieve without affecting current performance in loading of page .? if want keep track of hits can mercsen said in second comment, if want display number of hits on product details page can write ajax request fetches counter periodically

javascript - Any way to link JS library in external JS file? -

it may confusing mean have code in main .html file: <!doctype html> <html> <head> <link type="text/css" href="css/fpsgame.css" rel="stylesheet"> <script src="js/fpsgame.js"></script> <script src="js/lib/three.min.js"></script> <script src="js/lib/jquery.js"></script> </head> <body> <div id="container"></div> </body> </html> and want create in 3d (set scene, set camera, create cube) in fpsgame.js , keep script away .html file. however, have if want use three.js methods or methods library inside fpsgame.js file? in other words, how include three.js library fpsgame.js file, not in .html file?

php - Multiple selection of three tables -

i have 3 linked tables - order_tab contains orders, autosorder_tab connects 2 other , auto_tab contains cars in shop. 1 order can contain number of cars. create table order_tab (`id` int, `_phone` varchar(10), `_email` varchar(9), `_date` varchar(10)) ; insert order_tab (`id`, `_phone`, `_email`, `_date`) values (1, '111-111111', 'ok@ok.com', '2013-08-19') ; create table auto_tab (`id` int, `us_id` int, `str_1` varchar(3), `str_2` varchar(8)) ; insert auto_tab (`id`, `us_id`, `str_1`, `str_2`) values (2, 0, 'bmw', '530i e60'), (6, 0, 'bmw', '530i') ; create table autosorder_tab (`id` int, `au_id` int, `or_id` int, `hours` int, `price` decimal(19,2)) ; insert autosorder_tab (`id`, `au_id`, `or_id`, `hours`, `price`) values (1, 2, 1, 3, 2700), (2, 6, 1, 2, 3500) order_tab id - main. or_id autosorder_tab id order_tab . au_id id auto_tab how can select orders cars in each order? if understand correct...

javascript - How to pass Event (e) and variables with event listeners? -

i have event listener this: div.addeventlistener('mouseover',function(){bubble_info.call(data);},false); function bubble_info(e,info){ //get e.pagex etc //do stuff info } this problem in bubble_info variable e holds info of data , info undefined how make sure can e , info correctly? event object has many useful properties , methods . div.addeventlistener('mouseover',function(event){ bubble_info(event, info); // can pass additional params can used in handler },false); function bubble_info(event, info){ // can access type of event event object's properties console.log(event.type); console.log(info); // additional parameter. }; addeventlistener documentation use call if need pass reference of this (current) object. it's syntax ... functionname.call(thisarg, arguments-list, ...); call documentation

c# - Unable to apply style using iTextSharp -

i using following code generate pdf using .itextsharp version 5.4.3. // create document object var document = new document(pagesize.a4, 50, 50, 25, 25); // create new pdfwriter object, specifying output stream var output = new memorystream(); var writer = pdfwriter.getinstance(document, output); // open document writing document.open(); string data = @"<table cellspacing="0" border="0" style="border-collapse:collapse;margin-top:30px;;"> <tr> <td></td><td>visit</td><td></td><td></td><td></td> </tr><tr> <th>datw</th><td>07/01/2013</td><td>07/18/2013</td><td>07/17/2013</td><td>07/09/2013</td> </tr><tr> <th>score</th><td>3.00</td><td>6.33</td><t...

java - Declaring and initializing ints, error when calling constructor -

when try create new int object: int g= new int(); netbeans tells me: incompatible types required: int found: int[] '[' expected illegal start of expresion. i want create new int. for primitive datatypes dont have constructor: int g = 5; or int g; //declaration but keep in mind, there classes contain more functionallity every primitive datatype. datatypes name written first letter upper case: integer g = new integer(5); //but needs parameter where example have function create integer out of string: integer.parseint("5"); but there not need them declaration part.

Android Progressbar not displaying -

in android application want stream url , play. want show progressbar when play button clicked , show pause button. used progressbar because indicate user happening there there delay while playing in mediaplayer .but problem play button displayed 1 seconds small fraction of second progrressbar dispalyed , @ same time changes pause button.how can show progressbar when user clicked paly button.code given below holder.videoplayvoicebtn.setonclicklistener(new onclicklistener() { public void onclick(final view v) { // videoinfo element = (videoinfo) videos.get(position); // element.setplaybutton((button) v); // element.setplaying(true); linearlayout relativelayout = (linearlayout) v.getparent(); relativelayout layout = (relativelayout) relativelayout .getparent(); final progressbar bar = (progressbar) layout ...

JQuery DatePicker in bPopup -

hey using datepicker of jquery in 1 of page. works fine when check page separately, when try open page using bpopup page not display @ all. when checked html source, page loading within class="b-ajax-wrapper" container div, , display set "none". when remove "display:none" of firebug, start displaying page. now, date-picker not working. can please point me doing mistake. including both "jquery.min" , "jquery.ui" in parent html page required, not again in popup page. [credit: @manoj]

module - prestashop/blocklayered - a way to propagate the current page value to all the page components? -

i've found if 1 uses blocklayered module, current page param ($p, frontcontroller) not updated globally when change page. means relative smarty var available in small areas such ul.pagination in pagination.tpl. that's due ajax nature of module. and that's awful. need pagination data outside small chunks , in every point of category tpl components. should in fact this, since there $p var in frontcontroller doesn't updated , cannot read in $_get or $_post, , should. @ least should posted, or there should kind of hook read onchange. is there way achieve this? thank i found way @ least 'expand' scope of $p. in pagination.tpl, wrap ul.pagination in say, div.pagination-box then modify blocklayered.js, expecially in reloadcontent(), in ajax onsuccess callback what's updated div.pagination-box instead of ul.pagination. that lets me updated {$p} in div.pagination-box (and since child, in ul.paginationof course). can add arbitrary things outsi...

sql server 2008 - Need SQL Query to coallate data from two tables in a desired format -

i have table clientdetails of 2 columns clientid , associated branchcode in separate columns. need table distinct branches table in column & clientids associated branch in column ',' seperated. e.g.> table1: branch | clientids b001 | cli001 b001 | cli002 b001 | cli003 result needed: branch | clientids b001 | cli001,cli002,cli003 what best optimized way data record count quite large. need these columns bind 2 comboboxes of win form. regards, ashish in sql server 2008,, select branch, stuff((select ',' + clientids clientdetails a.branch = t.branch xml path('')), 1, 1, '') clientid clientdetails t group branch sql fiddle demo

iphone - Specific Country restriction Appstore -

i have made application visible germany, apple informed include monitoring shape-based regions if user move away after installing germany? how monitor region restrict application if exceed germany area? i have tried following links 1) core location region monitoring 2) apple: location awareness programming guide my doubt how restrict application available germany. should try latitude, longitude. , how monitor regions/territory exception. i uploaded app store, reject following reason : 22.1: apps must comply legal requirements in location made available users. developer's obligation understand , conform local laws.please see monitoring shape-based regions information on how apply geo restriction. my doubt how restrict geo location. by default, app available in countries app store supports, unless select individual countries/stores. can choose individual countries. log itunesconnect , click manage apps. select app , click rights , pricing bu...

django - How to get user Data from LDAP Active directory? -

i new learner use active directory fetch user data , getting difficulty data. have environment set this. how user data ? please me . need account information , organizational data active directory my views.py def getldapdata(request): try: l = ldap.initialize("ldap://192.100.78.45") username = "admin" password = "hxxxxxxx" l.simple_bind(username, password) except ldap.ldaperror, e: print e searchscope = ldap.scope_subtree retrieveattributes = none basedn = "dc=hashed,dc=local" searchfilter = "dc=hashed,dc=local" try: ldap_result_id = l.search(basedn, searchscope, searchfilter, retrieveattributes) print "ldap_result_id : " , ldap_result_id result_set = [] i=1 while 1: print ," ", i=i+1 result_type, result_data = l.result(ldap_result_id, 0) schema_entry=l.search_subschemasubentry_s(basedn) m=l.get_option( ldap_result_...

neo4j - Error when creating geo lat/long properties with cypher -

i started researching use of neo4j in proof of concept may newbie question: it seems can't create string property decimal point in cypher. using neo4j 2.0.0-m03 , cypher code is: create (n:location { id: "102", geo_lat: "34.058349609375", geo_long: "-118.244186401367", lang: "en", title: "los angeles" } ); the response is: ==> unrecognized option '1' am doing wrong or string point not string in neo4j/java ?

python - Set user-agent for http requests for libraries which do not expose this setting? -

i trying oauth authentication using django-social-auth uses oauth2 under hood. adding custom backend vimeo. vimneo api requires api calls use custom user-agent. oauth2 using httplib2 , doesn't have hook point set user agent. there way can "all network requests here on should use custom header". if got question right, can send user-agent alongwith request headers. h = httplib2.http(".cache") resp, content = h.request("https://example.org/chap/2", "put", body="this text", headers={'user-agent':'my user agent'} )

android - ExpandableListView ParentPosition not getting -

hi have searched lot on topic still unable solve this.i pretty new in android.i not getting position of parent in expandablelistview,i getting value of childposition not groupposition. catlist = (expandablelistview) findviewbyid(r.id.category_list); final expandablelistadapter explistadapter = new expandablelistadapter( catergoryactivity.this, grouplist, expandablecategories); catlist.setadapter(explistadapter); catlist.setonchildclicklistener(new onchildclicklistener() { @override public boolean onchildclick(expandablelistview parent, view v, int groupposition, int childposition, long id) { intent nextact = new intent(catergoryactivity.this, mobileactivity.class); string childposition = explistadapter.getchild(groupposition, childposition); ...

java - Cannot invoke function with parameters in JBoss SEAM expression language -

i trying invoke #{expressions.getclass()}, received exception. exception, seems characters ( ) not allowed. please see following exception details: javax.faces.el.referencesyntaxexception: javax.el.elexception: error parsing: #{ org.jboss.seam.core.expressions.getclass()} @ com.sun.faces.application.applicationimpl.createvaluebinding(applicat ionimpl.java:488) @ org.jboss.seam.jsf.seamapplication11.createvaluebinding(seamapplicati on11.java:143) @ org.jboss.seam.jsf.seamapplication11.createvaluebinding(seamapplicati on11.java:143) @ com.successfactors.jsfcore.ui.config.sfapplication.createvaluebinding (sfapplication.java:355) @ org.jboss.seam.core.expressions$1.getfacesvaluebinding(expressions.ja va:119) @ org.jboss.seam.core.expressions$1.getvalue(expressions.java:69) @ org.jboss.seam.core.interpolator.interpolateexpressions(interpolator. java:88) @ org.jboss.seam.core.interpolator.interpolate(interpolator.java:67) ... ... @ ja...

jaxb - jax-rs web service: how to hide some entity fields and use SSL -

recently asked questions here web services how secure database using web services? glassfish: deploy of multiple applications, of them ssl but didn't find answers @ time try more specific hoping find help... i created simple web service in netbeans using wizard creates web service database table. wizard creates persistence unit, entity classes , uses jpa. restful web service created using jax-rs , checked "use jersey default" caused creation of web.xml file. works in database table there fields need filtering don't want reported client: how can hide them in xml/json produced restful web service ? how can force use ssl ? i tried put <transport-guarantee>confidential</transport-guarantee> in web.xml, forces ssl response not same, not xml/json contains concatenation of values of entities ' fields. besides uri path parameters don't work @ all. missing ? thanks filippo update ssl i made more checks , using firefox got valid re...

nitrousio - Copy pasting does not work in nitrous webIDE? -

i cannot paste code webide console. copy pasting works around ide except console. there way fix this? please help, annoying! if you're on windows you'll need hit control + shift + v paste in console on nitrous.io web ide.

ember.js - EmberJS - replacing a partial -

so i'm doing quiz site in emberjs. have 3 partial templates correspond 3 questions. in parent template have following: {{partial question1}} which shows first out of 3 questions. after user answers, want replace with {{partial question2}} i can think of ways replace through jquery ideas in parent controller/question1's template? thanks. if have multiple questions, it's not right way partials. it make more sense to: 1) create questioncontroller 2) create template bound controller , display question. in runtime, change backend model of questioncontroller specific question display.

c# - Inlining some events in BackgroundWorker? -

im not sure, called inlining when in 1 line? i code have backgroundworker. doworker enforce sleep of on sec , runworkercompleted noe bit of code. possible instead of defining function in 1 line like .dowork += ((sender, arg) => { ... }); and .runworkercompleted += ((sender, arg... what right syntax this, , called? nice keep things simple when have simple task @ hand :-) you confusing inlining lambda expressions . inlining replacing calling of method body, example: int timestwo(int x) { return x * 2; } //before inlining: int = timestwo(6) + timestwo(7); //after inlining: int = 6 * 2 + 7 * 2; this compiler optimization technique avoid method call overhead. for backgroundworker example correct syntax be: backgroundworker worker = new backgroundworker(); worker.dowork += (sender, e) => runmymethod(); //or worker.dowork += (sender, e) => { runmymethod(); } for more information see msdn .

c++ - OpenGL problems in virtual machine -

virtualbox , vmware giving me difficulties in trying learn opengl. have linux virtual machine (lubuntu 12.10) , errors when run program: vmware: unable create opengl context virtualbox: opengl warning: glflushvertexarrayrangenv not found in mesa table opengl warning: glvertexarrayrangenv not found in mesa table opengl warning: glcombinerinputnv not found in mesa table opengl warning: glcombineroutputnv not found in mesa table opengl warning: glcombinerparameterfnv not found in mesa table opengl warning: glcombinerparameterfvnv not found in mesa table opengl warning: glcombinerparameterinv not found in mesa table opengl warning: glcombinerparameterivnv not found in mesa table opengl warning: glfinalcombinerinputnv not found in mesa table opengl warning: glgetcombinerinputparameterfvnv not found in mesa table opengl warning: glgetcombinerinputparameterivnv not found in mesa table opengl warning: glgetcombineroutputparameterfvnv not found in mesa table opengl warning: glgetcom...

java - Changing the font of the application title in android -

i have typeface, want change font of action-bar title in android. there way set title typeface that? this.settitle(mytitle.touppercase()); this.settypefaceoftitle(tf); this not copy question, methods on link ( how set custom font in actionbar title? ) not working. when try them, eclipse gives error : java.lang.nosuchmethoderror try this, int actionbartitle = resources.getsystem().getidentifier("action_bar_title", "id", "android"); textview actionbartitleview = (textview) getwindow().findviewbyid(actionbartitle); typeface robotoboldcondenseditalic = typeface.createfromasset(getassets(), "fonts/roboto-boldcondenseditalic.ttf"); if(actionbartitleview != null){ actionbartitleview.settypeface(robotoboldcondenseditalic); } if it's toolbar means try below. <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_height="wrap_content" android:layout_width="match_parent...

haskell - How to set the number of threads at run time (avoiding +RTS -N#) -

i wish run parallel programs as $ myprogram <args> -n 4 <args> instead $ myprogram <args> +rts -n4 -rts <args> the main reason normalize argument format on programs. i know can as $ myprogramwrapper <args> -n 4 <args> $ cat myprogramwrapper #!/bin/bash arg1=parse args arg2=... ncores=.... myprogram $arg1 ... +rts -n$ncores but it's ugly. thanks lot! :) you can use function setnumcapabilities @ runtime.

objective c - iOS UIWebView PDF Not Showing First Time -

i have uiviewcontroller uiwebview i'm placing pdf. the issue i'm facing when click on table cell show pdf not show first time if go table , click on cell again appears. i call pdf loaded using following: if ([indexpath row] == 2) { nsstring *path = [[nsbundle mainbundle] pathforresource:@"myfirstpdf" oftype:@"pdf"]; nsurl *url = [nsurl fileurlwithpath:path]; nsurlrequest *request = [nsurlrequest requestwithurl:url]; [webviewvc.webview loadrequest:request]; webviewvc.parent = _parent; [_parent pushviewcontroller:webviewvc]; } the webviewvc allocate using initwithnib has uiwebview - nothing fancy there, uiwebview iboutlet . any ideas? i think should try 2 things: (1) first, try loading pdf web view controller. standard way this, rather doing load request web view not on screen yet. outlets guaranteed loaded in viewdidload of controller. (2) second, try making use of uiwebviewd...

mysql - Car Park Database Design -

we have 2 number plate reader cameras on entrance , exit of car park generate csv file when detection takes place, gets automatically loaded database, barrier on entrance operated automatically camera's "whitelist", in turn generated , controlled within database , exported text file. initially, thought simple 3-table database per design below, realising not case: my initial designs: tbl_in : id (autonum/pk), plate, date_in, time_in tbl_out: id (autonum/pk), plate, date_out, time_out tblwhitelist: plate(pk), country code, description currently,the relationship can think of be: whitelist plate-plate_in & plate_out 1 plate in whitelist seen many times within in & out tables this has been made more complicated (and brain melting!) queries have been specified (brackets show columns , basic logic thinking of results): "whitelisted vehicles on site today" (if plate on whitelist: plate, description, time_in,time_out [i...

php - Custom Post Types in main index? (wordpress) -

i'm using thematic framework along custom post type ui plug in make custom posts. far can access permalink page of custom posts, don't appear on main index of posts made. wondering if possible make custom post types appear part of main post feed , how done if possible. this wordpress documentation write in theme folders functions.php file: function add_post_type_home_query( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set('post_type', array( 'post', 'your_custom_post_type' ) ); } } add_action( 'pre_get_posts', 'add_post_type_home_query' ); don't forget replace 'your_custom_post_type' actual post_type created.

Eclipse e4 Kepler: IEclipsePreferences read/write -

i using di (dependency injection) access ieclipsepreferences handlers. need access same ieclipsepreferences other code parts save/load these settings. this example how preferences , show em in dialog: import java.lang.reflect.invocationtargetexception; import javax.inject.inject; import javax.inject.named; import org.eclipse.core.runtime.preferences.ieclipsepreferences; import org.eclipse.e4.core.di.annotations.execute; import org.eclipse.e4.core.di.extensions.preference; import org.eclipse.e4.ui.model.application.mapplication; import org.eclipse.e4.ui.services.iserviceconstants; import org.eclipse.jface.dialogs.messagedialog; import org.eclipse.swt.widgets.shell; import org.osgi.service.prefs.backingstoreexception; public class pojoshowpersistencepreferenceshandler { @inject @preference ieclipsepreferences preferences; @inject mapplication application; @execute public void execute(@named(iserviceconstants.active_shell) shell shell ) throws invocationtargetexception, inte...

php - PhpStorm how to refresh folder content or whole project tree -

this may dumb question, can not find option refresh folder content in project tree (phpstorm ide). (really basic) feature missing? i know, content refreshed automatically, in types of folders, files generated , changed not work. right click on folder , synchronize 'nameoffolder' refresh specific folder

c# - Directives and Assembly References -

i've inherited old .net 2.0 c# system in work, sifting way through enormous code base. graduate i'm interested in why existing developers did things, ways. 1 particular habit previous developers had was, instead of importing references @ top of class - using system.io; they did continually throughout - (rather importing reference @ top). system.io.file.exists(); could shed light difference(s) is/are other having type more code? system i'm working on business object orientated system (csla), , no prior experience methodology, recommend way approach learning system i've inherited. appreciate can't see system i've got bit of insight experienced appreciated. regards. it's style choice. people use full names know local type names won't conflict system types. using statements way compiler find referenced types @ compile time, there no difference @ runtime between; using system.io; file.exists(); and system.io.file.exists(); ...

python - Migrating to MongoDB: how to query GROUP BY + WHERE -

i have mysql table records of people's names , time of arrival expresed number. think of marathon. want know how many people arrived gap of time named same, so: select name, count(*) mydb.mytable time>=100 , time<=1000 group name and results get: susan, 1 john, 4 frederick, 1 paul, 2 i'm migrating mongodb now, , using python code (so i'm asking pymongo help). tried looking information group equivalent (even when have read nosql databases worse @ kind of operation sql ones), since released new agreggate api, hjaven't been able find simple example solved group method, map-reduce method or brand new agreggate api. any help? there examples of on documentation, google , site. some references: http://api.mongodb.org/python/current/examples/aggregation.html http://docs.mongodb.org/manual/reference/aggregation/group/ http://docs.mongodb.org/manual/reference/aggregation/sum/ and code: self.db.aggregate( # lets find our records {...

android - Killbackground Process actually killing the Process? -

i trying test answer question here while there no errors, tried see if kill process. did, set device run skype. run app, skype still there. i wondering if there problems function wrote here? thanks. public void removeprocess() { activitymanager = (activitymanager) this.getsystemservice(activity_service); list<runningserviceinfo> taskinfo = am.getrunningservices(100); log.d("total_process", integer.tostring(taskinfo.size())); (int = 0; < taskinfo.size(); i++) { log.d("process_names", taskinfo.get(i).process); am.killbackgroundprocesses(taskinfo.get(i).process); } log.d("total_process", integer.tostring(taskinfo.size())); } you can kill background process : list<applicationinfo> packages; packagemanager pm; pm = getpackagemanager(); packages = pm.getinstalledapplications(0); activitymanager mactivitymanager = (activitymanager)this.getsystemservice(context.activity_service); (appl...

Can Glimpse provide details on ASP.Net 4.5 WebForms model binding? -

the mvc plugin glimpse can supply information on model binding that's taking place within web application. do mvc , webforms share core libraries model binding, , if installing mvc plugin webforms site: kill application? do nothing useful? show lots of lovely debugging information? just trying idea of how i'll spend rest of day unpicking unholy configuration mess if try crazy. unfortunately, model binding in webforms , mvc based on different implementations , aren't related. what means installing glimpse.mvc* package nothing useful. you can/should install glimpse.aspnet package provide amount of lovely debugging information. if have specific you'd glimpse support in webforms, please submit feature request on our github issue tracker .

jquery - My Javascript is not working when having two function? -

i have 2 functions called on $(document).ready() in main.js file: $(document).ready(function () { updatevalue(); locationvalue(); }); updatevalue() works fine, when call locationvalue() , breaks. seems due getwards() function called in locationvalue() . here 2 functions: function updatevalue() { $(document.body).on("change", ".quantity", function () { var proid = $(this).attr("data"); var quatity = $(this).val(); $.ajax({ type: "get", url: "/cart/updatevalue", data: { proid: proid, quantity: quatity }, success: function (data) { $(".cart_box").html(data); } } ); $.ajaxsetup({ cache: false }); }); } function locationvalue() { $("#city").change(function () { var cityid = $("#city").val(); alert(cityid); getwards(cityid); }); } function g...

javascript - How to not upload images / files upon form submit -

i have got simple form , upload images once main submit button pressed not upload images once button pressed? ideas? please see executing different action on form. <form method="post" name="form" id="form" action="upload.php" enctype="multipart/form-data"> <input class="button_date" id="fileinputbox" style="margin-bottom: 5px;" type="file" name="file[]" extension="jpeg|jpg|png|gif|giff|tiff" required/> <input class="button2 cancel" style="border-right:none; font-size:13px;" name="back" id="back" type="submit" value="back" onclick="javascript: form.action='back.php';"/> <input class="button2" style="border-right:none; font-size:13px;" name="list item" id="submit" type="submit" value="list item" oncl...

c# - Is it normal to use many business exceptions if needed? -

is practice define , throw custom exceptions if application needs lots of them? entitynotfoundexception entityalreadyexistsexception entitynotuniqueexception entitynotaddedexception entitynotupdatedexception entitynotdeletedexception quizoverexception quizexpiredexception tablealreadybookedexception enddatemustbegreaterthanstartdateexception i tried name these sample exception names describe purpose could. hope form idea of trying ask. don't limit imagination these exceptions arise during application's life. consider both crud , business exceptions. i know throwing , catching exceptions expensive process in terms of performance don't provide more elegant way develop app? isn't better throw entitynotfoundexception instead of writing if statement check whether entity null? isn't better throw entityalreadyexistsexception instead of writing additional if statement call method check whether entity given id exists? isn't better throw enti...

android - On Click event for Parent and Child view -

i have relativelayout , imageview . layout given below - <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rlmain" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" > <imageview android:id="@+id/ivicon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/ic_launcher" /> </relativelayout> the activity code - public class mainactivity extends activity implements onclicklistener{ private relativelayout rlmain; private imageview ivicon; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); rlmain = (relativelayout) findviewbyid(r.id.r...

c# 4.0 - how to write byte[] to Image with Landscape or Portrait properties? -

i have code converts byte[] image code writes in landscape mode original image portrait. how can detect original image's page orientation , write new image properties? suggestions? public void sendfax(byte[] file, string filename) { try { memorystream ms = new memorystream(file); image imgsave = image.fromstream(ms); bitmap bmsave = new bitmap(imgsave); bitmap bmtemp = new bitmap(bmsave); graphics grsave = graphics.fromimage(bmtemp); grsave.drawimage(imgsave, 0, 0, imgsave.width, imgsave.height) //save image physical path bmtemp.save("c:/..." + filename); imgsave.dispose(); bmsave.dispose(); bmtemp.dispose(); grsave.dispose(); } catch (exception ex) { throw ex; } } try this. check img height , width , based on comparison decide portrait/landscape...

django openshift import error -

i'm having problem moving django project openshift. have cloned openshift app. copied django project openshift app in /wsgi/digrin/ django project:digrin django apps: registration, digrin, stocks. wsgi ├── digrin │ ├── digrin (settings.py here) │ ├── registration │ └── stocks ├── openshift (settings.py here) └── static when run "rhc tail -a digrin" following error: ==> python/logs/error_log-20130718-000000-est <== [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] self.load_middleware() [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/core/handlers/base.py", line 39, in load_middleware [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] middleware_path in settings.middleware_classes: [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/p...

Windows authentication denied asp.net -

i have tried search stack overflow time answer question without success. i have asp.net mvc3 application windows authentication. because of logging have know using application when access it, , therefore users being prompted typical login dialog when enter page can see using application. when user enters his/her nt logging details system accept credentials , lets them use page. getting different information users active directory. the page on intranet , being accessed computer logged on domain webpage denies, how prompting when user first enters page, , user enters his/her nt details mentioned earlier. my problem system sometimes keeps denying users when try login computers. i have checked of different things such anonymous identification , forth , shouldn't problems @ all. i need place can see perhaps events or other log why being denied. this how checking of roles has been made: public class financialreportcontroller : baseemployeecontroller { . [autho...

javascript - Get focus textarea id after click -

i need obtain textarea id focused when clicked element. i use $(':input:focus').attr('id') , after click textarea looses focus immideatly , cann't obtain id of textarea selected. could help? you can use .focusout() method: $('#focuseditem').focusout(function() { var id = $(this).attr('id'); });

deployment - how to deploy rails project with RAILS_GEM_VERSION = '2.3.8' -

i want run rails project having rails_gem_version = '2.3.8' have of running project rails version 3.2.11....how proceede edit gemfile , replace rails gem line : gem "rails", "2.3.8"

object - Javascript datatypes visual -

Image
i'm making visual reference of javascript myself , likes have when it's done, better understanding of core javascript. now i'm not sure if got datatypes part right, i'm basing visual on book "javascript definitive guide" so glad hear if structure right. revised version of visual: your structure right. javascript has 5 primitive data types: string, number, boolean, undefined, , null. object, array , functions compositive datatypes. link might helpful clear thoughts. data types in javascript objects contain properties , methods; arrays contain sequential list of elements; , functions contain collection of statements.a function data type in javascript, not common in many other programming languages. means can treated containing values can changed. makes them composite data types. also, javascript not have class "class" in java or python. prototyped object.

oracle - SQL "Where" syntax for is today -

i need entrys curdate today... curdate of type timestamp . of course searched in google think have used wrong keywords. select * ftt.element fee, ftt.plan p p.id=ftt.p_id , curdate ??? order p_id, curdate desc; could provide me? sysdate returns current datea and time in oracle. date column contains time part in oracle - timestamp column well. in order check "today" must remove time part in both values: select * ftt.element fee join ftt.plan p on p.id=ftt.p_id trunc(curdate) = trunc(sysdate) order p_id, curdate desc; you should used using explicit join s instead of implicit joins in where clause. if need take care of different timezones (e.g. because curdate timestamp time zone ) might want use current_timestamp (which includes time zone) instead of sysdate

How to connect MS SSMS Express to server (Integrated Security) -

Image
i'm trying connect via ssms our ms sql server 2005. first tried connect via visual studio programmatically. worked after found out have put "integrated security=sspi;" connection string, otherwise refused connection "login failed" error. now im trying connect via ssms refuse when try connect. sadly there no option can set "integrated security=sspi" or else. choosing "windows authentication" option in connection dialog ssms equivalent putting "integrated security=sspi" in connection string. this use credentials of ssms process when connecting server. as note can achieve same result using "additional connection parameters" text box. click on "options >>" button @ bottom of connection dialog , select "additional connection parameters" tab. then enter in text "integrated security=sspi" (without quotes) text box. override whatever authentication option chosen in drop-...