Posts

Showing posts from April, 2011

c# Check Garbage Collection -

this question has answer here: how can write unit test determine whether object can garbage collected? 5 answers is there way check instances classes collected gc , not? 1 option found checking class test described here: how can write unit test determine whether object can garbage collected? is there way check classes collected gc , not? no, because check on object you'd still need reference , prevent collection. you can build administration weakreferences awkward , costly. not feasible objects. more important, shouldn't needing this. if think do, analyze thought train.

CKEditor, how to delete empty paragraphs before and between widgets -

Image
if have empty paragraph before widget, cannot deleted, nor can empty paragraph after, or between widgets deleted, except viewing source. this evident on ckeditor demo page here: http://ckeditor.com/demo#widgets simply clear content start, add paragraph, add widget, , try remove first paragraph. note in configuration not filling empty paragraphs non-breaking space, , same behavior, doesn't seem related. this create problem content management system. this known issue , there's no patch yet. require additional rules delete , backspace, if current paragraph empty should remove instead of focusing widget. code land e.g. here: https://github.com/ckeditor/ckeditor-dev/blob/3a10930/core/selection.js#l339-l365 .

Variadic Macros in OpenCL: Where are they supported? -

i have been trying find information on ( non-standard , cf. 1.0 , 1.1 , 1.2 , 2.0 ) support variadic macros in opencl implementations. i have access following platforms, of support variadic macros: mac os x, intel cpu, opencl 1.2, driver: 1.1 mac os x, intel gpu, opencl 1.2, driver: 1.2(dec 23 2014 00:18:31) mac os x, ati gpu, opencl 1.2, driver: 1.2 (aug 17 2014 20:27:52) mac os x, nvidia gpu, opencl 1.2, driver: 10.2.7 310.41.25f01 could other please check available implementations can have map of implementations supported variadic macros? edit: here self-contained test program makes uses of variadic macro. #include <stdlib.h> #include <stdio.h> #ifdef __apple__ #include <opencl/opencl.h> #else #include <cl/cl.h> #endif const char* source = "#define kernel(name, ...) kernel void name(__va_args__) \n" " \n" "kernel(test, global float* input, global float* outpu

angularjs - Angular merge nested arrays -

i have dataset looks this: [ { 'title' : 'cats', 'names' : [ 'felix', 'tom', ... more names ] }, { 'title' : 'dogs', 'names' : [ 'fido', 'rover', ... more names ] }, { ... more animal types ] and have following: <p ng-repeat='name in names'>{{ name }}</p> but, need @ stage set $scope.names = ['felix', 'tom', 'fido', rover']; my question is: there 'angular' way merge arrays or take content multiple places 1 object? or need use loop concat function create array use? sure, defined names based on data, demo . $scope.names = function() { return array.prototype.concat.apply([], animals.map(function(animal) { return animal.names; })); }; then use method in view <p ng-repeat='name in names()'>{{ name }}</p> or assume list of a

c# - Uploading a file using HTML-FileUpload-Control - Access Denied -

a click on import-button executes following jquery-code: if ($("#fileupload").val()) { $.ajax({ async: false, url: "handler/handler.ashx?op=import", data: json.stringify(mydata), type: 'post', contenttype: 'application/json; charset=utf-8' }); mydata json-object containing filepath , other values of html elements. when statement reached... using (var fs = new filestream(filepath, filemode.open, fileaccess.readwrite)) ...this exception flies: unauthorizedaccessexception - access path xxx denied. i can solve problem giving full-control permissions iuser. however, not option, since our endusers can't expected modify permissions everytime want upload file. there way doesn't involve enduser input? if understood correctly can give permission on fly, before using. private bool grantaccess(string filepath) { fileinfo f

javascript - How to click a save as html link with changing ID's? -

i know how click link using javascript, document.getelementbyid('yourlinkid').click(); but if id changing or not sure id going be? have html link auto generate grid of data excel file once click on give me link "click" , save file. idea's or other way of click html link? here example html: <a href="getyourfile..." id="myidisalwayschanging-1234">click</a> you can use class kind of button, when slect $('.class-name') can cause clicking on multiple links. other solution traverse dom (ie. using jquery) https://api.jquery.com/category/traversing/tree-traversal/ you can use function move between elements: $( "li" ) .closest( "ul" )

android - Gson Deserialization of Mixed Object types -

i have json: "account_representatives": [ { "sales person": 1307, "default_ticket_assignments": [ "" ], "primary account manager": 1307, "secondary support-3": 1151, "relationship mgr": 1307, "authorized_resources": [ "" ], "technical account manager": 164 } ] and have class structure this: public class accountrepresentative { @serializedname("authorized_resources") @expose private list<string> authorizedresources = new arraylist<string>(); @serializedname("default_ticket_assignments") @expose private list<string> defaultticketassignments = new arraylist<string>(); @expose private map<string, string> repfields; /** * @return authorizedresour

php - add image at header & footer on every page of pdf using dompdf -

i trying create pdf file using dompdf. want show header , footer images on every page of pdf, problem in html know that, it's large html code googled other solution used here https://github.com/dompdf/dompdf/issues/807 . this code fine textual header , footer problem @ adding image tried best no use , getting error "call undefined method cpdf_adapter::page_script() in filepathname.php". here code of generating pdf $dompdf = new dompdf(); $dompdf->load_html($message2); $dompdf->set_paper('a4','portrait'); $dompdf->render(); $canvas = $dompdf->get_canvas(); //for header $header = $canvas->open_object(); $font = font_metrics::get_font("helvetica", "bold"); $date = date("y-m-d h:i:s"); $canvas->page_text(35, 25, "hivedesk screenshot report", $font, 8, array(0, 0, 0)); $canvas->page_text(490, 25, "hivedesk.com", $font, 8, array(0, 0, 0)); $canvas->close_object(); $canvas->add

.htaccess - Magento increasing URL rewrites constantly -

i have magento 1.7.0.2 installation , noticed url rewrites have been increasing recently. for example: request path: product-27x27-4804.html target path : product-27x27-4805.html all new rewrites custom ones , i've noticed count increases upon reindex. these new rewrites not valid , junk need clean safely @ same time make them stop appearing again. any idea? thanks! there 2 parts this: cleaning large url rewrite table slow down reindexes. please backup first! delete core_url_rewrite category_id not null , product_id not null; patching magento prevent issue occurring again. see link below this, don't follow part suggests should truncate whole core_url_rewrite table. remove of custom url rewrites system. https://magento.stackexchange.com/questions/17553/magento-core-url-rewrite-table-excessively-large

linux kernel - Where is code refers to /proc/PID/maps? -

i observe kernel code print /proc/pid/maps can't find this. tell me code located the procfs code can found in fs/proc/ subdirectory. if open fs/proc/base.c , can find 2 similar arrays - tgid_base_stuff , tid_base_stuff . both register file operations functions files inside of /proc/pid/ , /proc/pid/tid/ respectivly. you're more interested in first one. find 1 registers "maps" file, looks this: reg("maps", s_irugo, proc_pid_maps_operations), so structure describing file operations on file called proc_pid_maps_operations . function defined in 2 places - fs/proc/task_mmu.c , fs/proc/task_nommu.c . 1 used depends on kernel configuration it's first one. inside of task_mmu.c , can find structure definition: const struct file_operations proc_pid_maps_operations = { .open = pid_maps_open, .read = seq_read, .llseek = seq_lseek, .release = proc_map_release, }; so when /proc/pid/maps opened, ke

c# - Can't open Windows Phone project in Windows 8.1+ Universal App using Visual Studio 2015 RC -

trying open universal app windows 8.1+ in visual studio 2015 rc , aside windows phone project opens fine. error message: "the application project type based on not found." link given message - visual studio 2013 compatibility the project file says vs 12 i'm pretty sure created in vs 2013. there way open project without recreating entire solution? grabbed vs 2015 rc iso , started install. guess 80% of features hadn't been checked last time installed vs 2015. selected , installed. problem solved. edit: mason reminded me below can use programs , features in control panel change or repair installation without need iso. i'd recommend on obtaining fresh copy of installer image.

android - Restore Sms : create thread if not exists -

i'm creating android app able restore sms webservice. i insert sms in existing conversations , works fine. but, if conversation not exists, sms restored don't appears in sms app... i think have create new thread (a new conversation). contentvalues initialvalues; initialvalues = new contentvalues(); initialvalues.put("_id", talk.getid()); initialvalues.put("recipient_ids", talk.getcontact().getid()); context.getcontentresolver().insert(uri.parse("content://mms-sms/conversations?simple=true"), initialvalues); app crashes error : mmssmsprovider not support deletes, inserts, or updates uri.content://mms-sms/conversations?simple=true this example give threadid, create new id if recipient doesn't exist otherwise return existing threadid: public static long getthreadid(context context, string phonenumber) { uri threadiduri = uri.parse("content://mms-sms/threadid"); uri.builder uribuilder = threadiduri.b

php - Array to String Conversion Error while tweaking Simplepie -

i using simplepie library feed generation. made changes desired output. working great till today. here code: <?php header('content-type: text/plain; charset=utf-8'); // include simplepie library // 1.0-1.2: #require_once('simplepie.inc'); // 1.3+: require_once('autoloader.php'); // create new simplepie object $feed = new simplepie(); // instead of passing in 1 feed url, we'll pass in array of 3 $feed->set_feed_url(array( 'http://localhost/full-text-rss/makefulltextfeed.php?url=dynamic.feedsportal.com%2fpf%2f555218%2fhttp%3a%2f%2ftoi.timesofindia.indiatimes.com%2frssfeedstopstories.cms&key=1&hash=759dbac5d2121d4b7bc31ee9119d65a44a73fb6d&max=10&links=preserve&exc=1&format=json' )); //caching enabled $feed->enable_cache(true); //timeout $feed->set_timeout(40); // we'll use favicon caching here (optional) //$feed->set_favicon_handler('handler_image.php'); // initialize feed object $feed-&g

variance - confidence interval for MTTF - Weibull survival curve in R -

i trying implement delta method in r calculate mttf variance of weibull survival curve. shape parameter alpha , scale parameter delta . variance = var ; covariance = cov . the equation is: var(mttf) = var(alpha)*[d(mttf)/d(alpha)]^2 + 2*cov(alpha,delta)*d(mttf)/d(alpha)*d(mttf)/d(delta) + var(delta)*[d(mttf/d(delta)]^2. where: d(mttf)/d(alpha) = gamma(1+1/delta) d(mttf)/d(delta) = -alpha/delta^2 * gamma(1+1/delta) * digamma(1+1/delta) so equation becomes: var(mttf) = var(alpha)*[gamma(1+1/delta)]^2 + 2*cov(alpha,delta)*gamma(1+1/delta)*(-alpha/delta^2 * gamma(1+1/delta) * digamma(1+1/delta)) + var(delta)*[-alpha/delta^2 * gamma(1+1/delta) * digamma(1+1/delta)]^2 i can take var(alpha) , var(delta) , cov(alpha,delta) variance-covariance matrix. the fitted weibull model called ajust . vcov(ajust) a=ajust$var[2,2]*ajust$scale^2 b=ajust$var[1,2]*ajust$scale matriz=matrix(c(ajust$var[1,1],b,b,a),ncol=2,nrow=2) and var(alpha) = matriz[2,2] var(delta) = ma

c# - Does Any() stop on success? -

to more specific: linq extension method any(ienumerable collection, func predicate) stop checking remaining elements of collections once predicate has yielded true item? because don't want spend time on figuring out if need expensive parts @ all: if(lotsofitems.any(x => x.id == target.id)) //do expensive calculation here so if any checking items in source might end being waste of time instead of going with: var candidate = lotsofitems.firstordefault(x => x.id == target.id) if(candicate != null) //do expensive calculation here because i'm pretty sure firstordefault return once got result , keeps going through whole enumerable if not find suitable entry in collection. does anyonehave information internal workings of any , or suggest solution kind of decision? also, colleague suggested along lines of: if(!lotsofitems.all(x => x.id != target.id)) since supposed stop once conditions returns false first time i'm not sure on that, if she

php - Symfony2 changing forms date input class in twig -

i confused on how can overwrite code of forms template match needs.. example when create date input fields long , want change class. reading documentation http://symfony.com/doc/current/cookbook/form/form_customization.html have no clue on how use example needs: did: i added horizontal theme in config.yml: # twig configuration twig: debug: "%kernel.debug%" strict_variables: "%kernel.debug%" form: resources: - 'bootstrap_3_horizontal_layout.html.twig' this how make data field input: >add('dateofbirth', 'date', array( 'label' => 'date of birth * ', 'widget' => 'choice', 'attr' => array('placeholder' => 'date of birth'))) it renders template: <div id="form_dateofbirth" placeholder="date of birth" class="form-inline"> <select id="form_dateofbirth_month"

Subscript out of bounds error when using an adjacency matrix in r -

i error when applying function adjacency matrix in r. the adjacency matrix looks this: s2 1 2 3 4 5 7 8 9 6 1 0 1 2 3 3 0 0 0 0 2 1 0 0 0 1 1 2 2 0 3 2 0 0 0 0 1 0 4 2 4 3 0 0 0 0 0 0 0 0 5 3 1 0 0 0 0 0 0 0 7 0 1 1 0 0 0 0 0 0 8 0 2 0 0 0 0 0 0 0 9 0 2 4 0 0 0 0 0 0 6 0 0 2 0 0 0 0 0 0 the code follows: library(igraph) library(egonet) x<-index.egonet(s2) when apply index.egonet gives me error subscript out of bounds . any or solution problem highly appreciated. your ego subject (parameter ego.name ) not defined. the following, defining first person ego person works: library(igraph) library(egonet) s2 <- c(0,1,2,3,3,0,0,0,0, 1,0,0,0,1,1,2,2,0, 2,0,0,0,0,1,0,4,2, 3,0,0,0,0,0,0,0,0, 3,1,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,0,0, 0,2,0,0,0,0,0,0,0, 0,2,4,0,0,0,0,0,0, 0,0,2,0,0,0,0,

Select max in SQL Server 2008 R2 using C# -

this question has answer here: group / aggregate function confusion in sql 3 answers i'm getting error column invalid in select list because not contained in either aggregate function or group clause. actually code works in mysql database using sql server 2008 r2 now. please me this code: class1.sqlstatement = "select max(tix), dealer, module, uname, dept, prob, pic, recieved, dresolved, stamp, tresoved, aging, typee, status, assigned, stat, root, remarks, deploystat, reply tblhd group tix having max(tix) > 19999"; class1.dbcommand = new sqlcommand(class1.sqlstatement, class1.dbconnection); class1.reader = class1.dbcommand.executereader(); while (class1.reader.read()) { lstitem = listview1.items.add(class1.reader[0].tostring()); lstitem.subitems.add(class1.reader[1].tos

html - Dynamicly centre align elements with css -

is there way dynamically centre 2 objects using css ? dynamically centre mean if size of 1 of objects changes css wouldn't have change. at moment achieve non dynamically im using css below, there way without knowing height dimensions of child element before hand , not being able set top: , left: correctly ? html <div class="box"> <img src="myimageurl" width="100" height="100"> </div> css .box { width: 200px; height: 200px; background: red; } .box img { margin-top: 50%; margin-left: 50%; position:relative; /* these values id dynamically set */ top: -50px; /* being half of image height */ left: -50px; /* being half of image width */ } ive made js fiddle of issue here : http://jsfiddle.net/gnygxbxe/ you don't need calculate percentage position. use pseudo element centering it. need make sure element inside has properties display: inline-block , vertic

c# - The remote server returned an error: (403) Forbidden. while getting the website into stream reader -

i'm getting error @ streamreader stream = new streamreader(request.getresponse().getresponsestream()); saying remote server returned error : 403 forbidden i'm passing http://www.snapdeal.com in url. streamreader reader = objm.urlserverr(address); public streamreader urlserverr(string url) { httpwebrequest request = (httpwebrequest)webrequest.create(url); streamreader stream = new streamreader(request.getresponse().getresponsestream()); return stream; }

ios - Use BWWalkthrough Library without Storyboard, Walkthrough Custom -

Image
i'm using bwwalkthrough library personal walkthrough. simple implement have mistake bwwalkthroughviewcontroller: wont use storyboard create main controller i've created custom view via code , in viewdidload of bwwalkthroughviewcontroller ive setted view , pagecontrol. rest of code same of example in github repository. that viewdidload of bwwalkthroughviewcontroller: override func viewdidload() { super.viewdidload() let welcomeview: welcomeview = welcomeview() // custom view view = welcomeview self.pagecontrol = welcomeview.pagecontrol ... } and, because first view, rootviewcontroller setted bwwalkthroughviewcontroller viewdidload modified. have func setting walkthrough in appdelegate.swift: func showwelcomeview() -> bwwalkthroughviewcontroller{ let storyboard = uistoryboard(name: "welcome", bundle: nil) let walkthrough: bwwalkthroughviewcontroller = bwwalkthroughviewcontroller() let page_zero = storyboard.instantiatevi

mysql - Update data from one table to another -

i have small problem updating rows of 1 table data one, please help. table l columns make model oemnumberlatest oemnumberprevious cstockcode cdescription the 2 columns cstockcode , cdescription blank @ moment , waiting populated, , second table c columns stockcode , description the question how move/copy contents of table c rows of table l ? where c.stockcode = l.oemnumberlatest , or c.stockcode = l.oemnumberprevious you shouldn't move contents of 1 table other. better values when need them, using join: select l.*, c.cstockcode, c.cdescription table1 l join c on c.stockcode = l.oemnumberlatest or c.stockcode = l.oemnumberprevious; this seems strange condition, or because can multiple matches. in case, can convert update easily: update table1 l join c on c.stockcode = l.oemnumberlatest or c.stockcode = l.oemnumberprevious set l.cstockcode = c.cstockcode, l.cdescription = c.cdescription; when both conditi

how can i connect my java swing software (made in eclipse) to fetch data from my website -

i have made java swing software using eclipse , want connect shopify admin dashboard fetch data . please suggest me possible ways code-snippets(if possible). some not shopify admin dashboard data can accessed via shopify api. there's no specific object shopify admin dashboard data.

angularjs - Angular js search input box -

i have below search input box <div id="query-wrap"> <input ng-enter="startsearch('{{queryobj.query}}')" id="query" type="text" ng-model="queryobj.query" placeholder="enter query" autocomplete="off" /> </div> <a class="searchbutton" ng-click='startsearch(queryobj.query)'>search</a> on click of search calling startsearch function $scope.startsearch = function(query) { console.log("query ::" + query); // $location.path("/view"); $location.search({ q:query }); getdata(); } issue is: after submit clicked proper query parameter appended in url query entered in search box getting disappeared because of not able see proper results. below ng-enter directive. app.directive('ngenter', functi

c# - Orchard block content route -

i have myself orchard project, uploaded few files used on site, of these images lets don't want display yet , don't want delete them because else may want use them. however if view goes site example www.mywebsite.com/contents/item/display/1 and attempts find random content item will, maybe provide or not used longer. i'm trying ask inside of routes.cs in orchard project need implemented redirect users content home page? i have answer works me. i editted web.config in orchard.web project, added these lines inside of system.webserver <system.webserver> ... ... <rewrite> <rules> <rule name="redirect users away content" stopprocessing="true"> <match url="^contents/(.*)" /> <action type="redirect" url="/" /> </rule> </rules> </rewrite> </system.webserver> hope helps else out.

c# - Wcf CommunicationException MVC -

Image
when call wcf services on mvc project, throws below exception, how can solve issue? exception : operation not supported in wcf client because uses type helper.methodresponse but there no exception inserting data. mean createuserwcf working. exception : exception of type 'system.servicemodel.communicationexception' occurred in mscorlib.dll not handled in user code

ssl - SSLITE ERROR - using Websphere and calling a webservice with apache client 3.x -

i not understand origin of issue: com.ibm.sslite.d: reason=2; alert=40; exception=null it happens when call: int statuscode = httpclient.executemethod(method); it might related ssl protocol , maybe websphere quite old , incompatible. 12:56:46 [sid=] [uid=] [oid=] - error com.darty.ecom.frontoffice.newespaceclient.core.service.cev.cevproxyconnection - cev > stack trace > com.ibm.sslite.d: reason=2; alert=40; exception=null @ com.ibm.sslite.m.a(m.java:50) @ com.ibm.sslite.t.b(t.java:113) @ com.ibm.sslite.t.a(t.java:43) @ com.ibm.sslite.a.read(a.java:7) @ com.ibm.jsse.a.read(unknown source) @ java.io.bufferedinputstream.fill(bufferedinputstream.java:200) @ java.io.bufferedinputstream.read(bufferedinputstream.java:218) @ org.apache.commons.httpclient.httpparser.readrawline(httpparser.java:77) @ org.apache.commons.httpclient.httpparser.readline(httpparser.java:105) @ org.apache.commons.httpclient.httpconnection.readline(httpconnect

swing - JTextpane does not respect visibleEditorRect with java 8 -

run below code both java 6 , java 8, , see result. line breaks works within bounds of visibleeditorrect on java 6, on java 8 string overflow bounds. there workaround problem. import java.awt.rectangle; import javax.swing.jframe; import javax.swing.jtextpane; import javax.swing.plaf.basic.basictextpaneui; public class textpanebug { public static void main(string[] args) { jframe f = new jframe() ; jtextpane text = new bugtextpane() ; f.add(text); text.settext("mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"); f.setextendedstate(jframe.maximized_both); f.setvisible(true); } static class bugtextpane extends jtextpane { public bugtextpane() { setui(new basictextpaneui(){ @override protected rectangle getvisibleeditorrect() { rectangle r = super.getvisibleeditorrect() ; rectangle newr = new rectangle(r.width / 2 - 300 , r.height/2 - 300 , 60

python - Django: getting NoReverseMatch at / error -

there lot of similar issues on , went through of them, still unable resolve problem. i getting following error: reverse 'category_view' arguments '()' , keyword arguments '{'pk': 'dynamic-programming'}' not found. 0 pattern(s) tried: [] noreversematch @ /articles/ here settings urls.py file: url(r'^category/(?p<pk>[\w-]+)/$', views.categorydetailview.as_view(), name='category_view') and, definition of get_absolute_url() model; def get_absolute_url(self): return reverse('category_view', kwargs={'pk': self.slug}) and caller getting error index.html: <li><a href="{{ category.get_absolute_url }}">{{ category.name }}</a></li> i sure missing obvious, not able figure out past few hours. :( content project's urls.py: url(r'^articles/$', include('blog.urls', namespace="blog")), url(r'^admin/', include(admin.si

c# - Specflow: to call a variable in a class, using a string, without a switch -

this test automation using c# , specflow (cucumber c#) i have class urls this: class paths { public static string google_home = "www.google.com"; public static string another_url = "www.something.com"; public static string facebook_home = "www.facebook.com"; } and have step definition this: [then(@"i navigate ""(.*)""")] public void inavigateto (string url) { configuration.driver.navigate().gotourl(paths.url); } of course scrip doesnt work, want explain idea. using step definition this: i navigate "google_home" i obtain string "google_home", , want use string directly choose option paths.google_home. dont want use switch assignation, since there hundreds of urls. edit: linked solution this: var values = typeof(paths).getfields(); configuration.driver.navigate().gotourl(values[0].getvalue(null).tostring()); i have no idea of knowing number of array

javascript - avoid adding duplicating items in ng-repeat collection, in Angular.js -

i have ng click event : $scope.submitinfo = function myfunction() { var itemtoadd = { id : generateuuid(), name: $scope.name, email: $scope.email, phone: $scope.phone }; $scope.info.push(itemtoadd); } my problem is, want check if same id or name not exist in $scope.info collection. i purly foucs on angular.js, looking best solution kind of scenario you use $filter . something this: $scope.submitinfo = function myfunction() { var itemtoadd = { id : generateuuid(), name: $scope.name, email: $scope.email, phone: $scope.phone }; var foundelement = $filter('filter')($scope.info, {name: $scope.name}, true); if (foundelement.length === 0) { $scope.info.push(itemtoadd); } }; of course, you'll need inject $filter in controller/factory/whatever

wpf - Binding TextBlock color to Button IsEnabled from Style -

i trying define style used button holds textblock content , when button has isenabled =false want set textblock 's foregroung color. <button style="{staticresource transparentbuttonstyle}" isenabled="{binding isallowed}"> <textblock text="click me" style="{staticresource hyperlinkstyle}"> </textblock> </button> <style x:key="transparentbuttonstyle" targettype="{x:type button}"> <setter property="template"> <setter.value> <controltemplate targettype="button"> <border background="transparent"> <contentpresenter/> </border> </controltemplate> </setter.value> </setter> </style> <style x:key="hyperlinkstyle" targettype="textblock&quo

sql server - In Visual Studio 2013 I simply want to pass data to a sql table using VB? -

i designing application forte have code end. using visual studio 2013 devexpress , sql server 2014. may simple question have struggled find straight answer anywhere. have asp.net book still cant find answer. think have connected whole solution connection string in can populate tables , stored procedures dataclass. want add user input table on sql server using button onclick event. surely cant difficult remember bit of newbie appreciated. if there questions need answered assist let me know. writing in vb script struggling work. advice appreciated. in advance! protected sub btnaddnewsource_click(sender system.object, e eventargs) handles btnaddnewsource.click 'errdetails.text = "" 'errdetails.visible = false 'focusset = false 'errcount = 0 'errdetails.text = "" 'if txtsourcefunding.text = "" ' errdetails.text = errdetails.text + "did enter funding source?" + vbnewline '

gwt + jetty + spring + log4j ERROR: "DOMConfigurator object is not assignable to a Configurator" -

this problem mentioned in several sources around web unable solve solutions provided there. problem: following error thrown log4j when issuing mvn gwt:run : [error] log4j:error "org.apache.log4j.xml.domconfigurator" object not assignable "org.apache.log4j.spi.configurator" variable. [error] log4j:error class "org.apache.log4j.spi.configurator" loaded [error] log4j:error [sun.misc.launcher$appclassloader@23137792] whereas object of type [error] log4j:error "org.apache.log4j.xml.domconfigurator" loaded [webappclassloader=demo@3d1665ac]. [error] log4j:error not instantiate configurator [org.apache.log4j.xml.domconfigurator]. description of project: use default jetty server provided gwt , run on exploded war. <gwt.version>2.6.1</gwt.version> <spring.version>3.2.6.release</spring.version> <log4j.version>1.2.17</log4j.version> <slf4j.version>1.7.5</slf4j.version> <dependency> <gr

android - Is it impossible to start a Activity in UncaughtExceptionHandler -

i found not works when start new activity in uncaughtexceptionhandler. mean not show annoying android crash dialog. on other hand, want start new activity indicate user encounter serious error, u wanna quit or continue use app still possibility weird may happen. i try restart app in uncaughtexceptionhandler final intent intent = getpackagemanager().getlaunchintentforpackage(getpackagename()); intent.addflags(intent.flag_activity_clear_top); startactivity(intent); but, i'm in bad luck again. not work either... i tried restart app after crashed happens. catched uncaught exceptions in application extension class. in exception handler exception , try set alarmmanager restart app. here example how in app, log exception db. public class myapplication extends application { // uncaught exception handler variable private uncaughtexceptionhandler defaultueh; // handler listener private thread.uncaughtexceptionhandler _uncaughtexceptionhandle

c# - Barcode scanner in Windows Phone 8 -

i have problem development of application in c#. teng 1 phablet panasonic fz-e1 reader integrated barcode. need access it. searched , searched internet have not found can help. wired usb barcode scanners problem many phones. phones not implement usb-on-the-go enables them hosts or master in usb transaction. phones typically devices connect hosts/pcs. ones don't have power drive usb barcode scanner. best option find bluetooth barcode reader, ... problem windows phone didn't put driver in stack (at least few versions when looked.

jquery - Collapse effect toogle -

i have little toggle script navbar. how can add animate effect? this script. $(document).ready(function(){ $("button").click(function(){ $(".collapse").toggleclass(".collapse in"); }); }); and css .collapse { display: none; visibility: hidden; } .collapse.in { display: block; visibility: visible; } you use opacity of element css: .collapse { opacity:0; transition: opacity 1s linear; } .collapse.in { opacity:1; } see this jsfiddle

datacontractserializer - How to resolve an error with WCF data contract -Message = "There was an error while trying to serialize parameter -

i have 2 data contracts of same contents in 2 different namespaces. have copied 1 datacontract and passed particular method. giving below error , throwing exception. not going method. please let me know ideas /suggestions on how resolve this.appreciate help: exception errror: {"type 'system.collections.generic.list`1[[globalwcfservicelib.topicdetailsinfo, globalwcfcontracts, version=1.2.2.0, culture=neutral, publickeytoken=17c64733a9775004]]' data contract name 'arrayoftopicdetailsinfo: http://cname.globalservice/11.1/2010/11 ' not expected. consider using datacontractresolver or add types not known statically list of known types - example, using knowntypeattribute attribute or adding them list of known types passed datacontractserializer."} message = "there error while trying serialize parameter http://cname.sharedservices.dbservicelib:subscriptiondatacontract . innerexception message 'type 'system.collections.generic.list`

android - Posting data to server with jQuery -

so have basic cordova app created. added jquery , trying make request url. target post data, i'm testing method. problem response "failed load resource: server responded status of 404 (not found)", when open url browser, response displayed. i've been @ day , half, i've gone through alot topics on internet , tried different things, couldn't job done. if have ideas great! my goal create android app, in fill several fields text, save them on device, , when connected wifi tap button push data in file server. if have suggestions on other can use instead of cordova, i`d appreciate it. edit - here code: said, plain app created cordova. index.html , default index.js @ end added ajax: $.ajax({ type: 'get', url: 'url', headers: { 'access-control-allow-origin': '*' }, success: function(response) { console.log(response); }, error: function(req, err) { console.log(req); console.log(er

html - Scale panels one below other in one container -

Image
i have these widgets in html, using bootstrap panels: why second line left widget scales accordingly first line right widget height, , not below first left widget height? in same container. is there solution this, solution hold them in same container? or can use jquery , set class .same-height jquery(document).ready(function($) { var heights = $(".same-height").map(function() { return $(this).height(); }).get(), maxheight = math.max.apply(null, heights); $(".same-height").height(maxheight); }); demo here

Query Syntax for linked sql server -

Image
please help: i'm new linked servers & in ms sql have added 1 (from ms access file) shown: i'm having trouble querying database here. syntax? thanks. okay, using management studio in ms sql ran select query on table through "script table as" (right-click) , query results sure format: select * [rxpipedb]...[product] furthermore, can run updates using syntax: update [rxpipedb]...[product] set x = ..something.. of-course update query, must have set linked server properties > server options "rpc" & "rpc out" true. thank all.

mysql - Ratio Calculation in SQL based on different date fields -

i want calculate number of contacts made/number of orders placed per day how sample looks like: orderid orderdate contactid contact date 1 11-may 12-may 2 12-may b 12-may 3 12-may null null 4 12-may c 13-may 5 13-may d 14-may ex: ratio 12thmay 2/3(1,2,3 , a,b) need without joins. can please me sql or hive query this this should give ratio you're looking for: select isnull(orderdate, contactdate), concat(cast(isnull(contacts,0) char),'/',cast(isnull(orders,0) char)) ratio (select orderdate, count(orderdate) orders tbl orderdate not null group orderdate) o left join (select contactdate, count(contactdate) contacts tbl contactdate not null group contactdate) c on o.orderdate = c.contactdate union select isnull(orderdate, contactdate), cast(isnull(contacts,0) varchar) + '/' + cast(isnull(orders,0) varchar) (select orderdate, count(orderdate)

AngularJS how to get and edit calculated input ng-model value related to other input value -

i trying make currency exchange system spa based on angularjs. there should several inputs currency data json (with ng-repeat) , convert currency rate depending on active input value. { "currencies": [ { "name":"eur", "rate": 1, "active": "no" },{ "name": "pln", "rate": 4.1028, "active": "no" }, { "name": "usd", "rate": 1.1239, "active": "no" } ] } <div ng-repeat='cur in main.currencies'> <label>{{cur.name}}</label> <input type="number" min="0" ng-model="cur.result" ng-init='cur.result = &qu