Posts

Showing posts from March, 2013

javascript - Uncaught TypeError: Cannot call method 'menuAim' of null -

i'm using 3 level dropdown works fine on it's own conflicts when added magento template. have added $.noconflict(true); fixed problems i'm still getting uncaught typeerror, plus 3rd level of dropdown isn't displaying. <div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <div class="nav-collapse collapse"> <ul class="nav"> <li class="active"> <a id="dropdown-toggle" data-toggle="dropdown" href="#">shop a-z</a> <!-- jquery-menu-aim: <ul> defines dropdown main menu , contents. 1 of many possible examples defining menu's html. jquery-menu-aim agnostic html structure, fires events used please. --> <ul class="dropdown-men

bash - Why does tee wait for all subshells to finish? -

i have server script runs mysqld , forks continue running. example: ./mysqld <parameters> & echo "parent runs next line in script." <do more stuff> why tee wait child process end before ends itself? edit: for example, following hangs: ./myscript | tee -a logfile.log because can't sure has tee'd output if child process still running.

google app engine - How to send email from noreply@mydomain.com with GAE? -

mydomain.com google apps linked gae application (and verified). 1 user allowed @ custom domains, i've registered admin@mydomain.com . now, send emails noreply@mydomain.com . try add user developer in permissions section of gae application, sends message (which receive @ admin@mydomain.com ), accept invitation admin@mydomain.com , doesn't help. so, how send emails noreply@mydomain.com ? you can enable trial (lasts 30 days) , add many users want. can send emails them accept invitations in gae , after accepting them can delete these users fall in free version 1 user.

c# - WebApi receiving model with references (Not attached to Context) -

i trying pass complex type webapi having on apicontroller : [httppost] public void dosomecrud(jobject data) { complexmodel item = data.toobject<complexmodel>(); // logic here } my issue 1 of properties have inside complexmodel entity framework entity. don't have problems passing entity if detached, entity dbcontext model cannot passed webapi expected. my question is.. : there anyway detach entity preserving references foreign keys ? because need references on webapi side. thanks it not best practice use model entity framework data transfer object (dto) web api because can problem serialization since models ef proxies supports lazy loading , navigation properties (if don't detach it). the best practice is, separation of concern, should define own dto objects instead of using entity models directly ef. simple example, if have customer entity, should have customerdto entity projects property customer want.

objective c - @synchronized or serial dispatch queues -

this question has answer here: what advantage(s) dispatch_sync have on @synchronized? 4 answers is there performance gain when using serial dispatch queue (assuming high or default priority) on @synchronized blocks serialize access resource. gain, mean difference in overhead due synchronization mechanism itself. certainly. there's differences in semantics though. @synchronized block uses recursive, exception-safe mutex in side-table. of properties lead additional overhead. dispatch_queue_t extremely light weight (especially when using dispatch_*_f avoid block_copy()), non-recursive, doesn't handle exceptions, , doesn't guarantee particular thread. personally, think recursive locks bad idea, , exceptions shouldn't caught in cocoa apps, @synchronized has little appeal.

android - java.lang.RuntimeException: Unable to resume activity -

what trying achieve on click of button should open camera ..the use clicks snap , returns app tubnail of clicked pic in image view package com.example.waterbill; import java.io.bytearrayoutputstream; import java.io.file; import java.io.fileoutputstream; import java.io.ioexception; import android.app.activity; import android.content.intent; import android.content.pm.activityinfo; import android.graphics.bitmap; import android.os.bundle; import android.os.environment; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.imageview; import android.widget.toast; public class bill_meter_satus extends activity { @override protected void onresume() { // todo auto-generated method stub super.onresume(); } @override protected void onpause() { // todo auto-generated method stub super.onpause(); } button b1, b2; edittext edt1; imageview mimage; private stati

r - How to change confidence interval display format? -

i have dataset this: row b1 b2 b3 g1 g2 g3 1 6.19 0.69 0.30 0 0 0 2 100 100 100 94.87 98.73 90.56 3 100 90.24 100 40 78.94 87.5 4 93.90 96.15 95.29 98.82 100 100 5 100 98.38 100 88.88 95.87 83.56 6 93.90 96.15 95.29 98.82 100 100 and on, 25000 rows. each row, need calculate difference between b columns , g columns, , confidence interval. have far: data=read.table("1.txt", header=t, sep="\t") boys=data[,grep('b',names(data))] girls=data[,grep('g',names(data))] ci= sapply(1:nrow(data),function(i){wilcox.test(as.numeric(boys[i,]),as.numeric(girls[i,]),exact=false,correct=false,conf.int=true,conf.level=0.95)$conf.int}) my problem is, every time this, confidence intervals display 2 numbers of interval 1 above other. example, this: 5 15 (for row 1, say) how ci each row display in single row, t

php - If content exists in database, provide form to update it - else provide form to add new row -

it's going wrong. need output form onto website 1 of 2 things: if user has content in database, provide form posts self update existing content. if user not have content in database, provide form let user add information database. the forms should submit keep coding tidy. i'm getting right mess. i'll show have far, i'm getting in muddle. //look in db see if content exists, if set variable $result = mysql_query( "select * tbl_profiles user_id = $who "); while($row = mysql_fetch_array($result)) { $profiletext = $row['text']; } // check if user has content in db $result = mysql_query( "select * tbl_profiles user_id='$who'"); if(mysql_fetch_array($result) !== false){ echo '<form action="../edit/indexupdate.php" method="post" name="edit"> comments:<br /&

google app engine - Execute formatted time in a slice with html/template -

i'm making simple webserver can host blog, whatever do; can not execute proper formatted time html/template. here's do: i've created struct: type blogpost struct { title string content string date time.time } next i've created little func retrieves blogposts corresponding title/dates appengine datastore , return slice: func getblogs(r *http.request, max int) []blogpost { c := appengine.newcontext(r) q := datastore.newquery("blogpost").order("-date").limit(max) bp := make([]blogpost, 0, max) q.getall(c, &bp) return bp } finally, in bloghandler create slice based on retrieved data appengine datastore using: blogs := getblogs(r, 10) now when execute template called blog this, dates of blogs being parsed default dates: blog.execute(w, blogs) // gives dates like: 2013-09-03 16:06:48 +0000 utc so, me, being golang n00b am, function following give me result want blogs[0].date = blogs[0].date

rally - How to create a combobox of possible values -

Image
is there way dynamically populate combobox attributes property of artifact can take on? e.g. i have custom field set on user stories. want able populate combobox possible values custom field without hard-coding in. in code below combobox automatically populated allowed values of custom field of dropdown type: ext.define('customapp', { extend: 'rally.app.app', componentcls: 'app', items: [ { xtype: 'container', itemid: 'kbfilter' }, { xtype: 'container', itemid: 'grid', width: 800 } ], launch: function() { this.down('#kbfilter').add({ xtype: 'checkbox',

java - Eclipse(STS) break breakpoint not hit using maven surefire plugin and scala ide -

i wondering whether shed light on peculiar problem. using sts 3.2 (i.e. eclipse 4.3 kepler) scala ide , eclipse maven plugin. version of maven using maven 3.0.5. using maven surefire plugin version 2.4.3 , scala version 2.10.2 . have followed instructions such provided here http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html , maven build debug in eclipse however, when set break points in junit scala tests, break points not being hit. not sure why happening. there problem eclipse scala maven , maven surefire?? thanks if have flexibility in choice of ides i'd switch intellij http://www.jetbrains.com/idea/ i've had issues in past maven-eclipse , while solvable, intellij supports maven natively.

linux - Install APC on centos - /etc/php.d/apc.ini: No such file or directory -

i trying install apc on vps. followed these instructions seemed found on several websites: yum install php-pear php-devel httpd-devel pcre-devel gcc make pecl install apc next there following command failed: echo "extension=apc.so" > /etc/php.d/apc.ini this because there no php.d directory. did 2 things 1) created php.d directory , added apc.ini file 1 line: extension=apc.so and added line php.ini file in /usr/local/lib i restarted apache: /sbin/service httpd restart and apc configuration info still not show in php.ini file. i added extension website's local php.ini file. missing here? thanks. you need find php.ini file , add config apc.ini file it. copy apc.ini file in w3-total-cache extension = apc.so apc.enabled = 1 apc.shm_segments = 1 apc.shm_size = 32m apc.optimization = 0 apc.num_files_hint = 4096 apc.ttl = 7200 apc.user_ttl = 7200 apc.gc_ttl = 0 apc.cache_by_default = 1 apc.filters = "" apc.mmap_file_mask = &quo

actionscript 3 - flash professional cs 6 include XML file in published swf -

i making game flash professional , action-script 3.0, uses xml files levels. code reads , makes level accordingly, every thing works fine, except when publish external source, code can no longer see xml files. in flash pro cs6 there way "attatch" xml files published .swf when moves location, can see them. instead of using external xml files create xml variables inside game code. see first 2 examples here creating xml object xml: initializing xml variables

How to make SOLR grouping/field collapsing case insensitive -

in our solr implementation, using grouping/field collapsing make sure type-ahead results unique. have content have same display term, difference codes behind them (multiple fields involved). for part, works fine. field grouping on standard strfield. however, falls apart when display term in different cases (ie: solr vs solr). how can make grouping case insensitive? other catch don't want tokenize string multiple words. example: the terms "solr rocks", "solr rocks", , "solr awesome". results should "solr rocks" , "solr awesome" searches solr. if stream tokenized, 3 grouped together. thanks use non tokenized, lower case string field grouping. should ensure grouping case insensitive. e.g. field type configuration <fieldtype name="lowercase" class="solr.textfield" positionincrementgap="100"> <analyzer> <tokenizer class="solr.keywordtokenizerfactory&q

asp.net mvc - MVC2 Active Directory Authentication -

i'm trying add active directory authentication desk system built years ago. gradually, we'll upgrading whole system. i'm starting creating mvc2 application host login, , plan bring current functionality mvc add new features. but login base of whole thing. need auditing, need know who's in system. i've read articles, other stackoverflow posts, , followed couple ms walkthroughs letter. able working asp website, when it's mvc application, can't seem it. asp application required adding extensive methods, , read makes sound mvc should simpler. here iis settings , mods i've made web.config: iis authentication anonymous: disabled asp.net impersonation: disabled forms: enabled windows: disabled ... ... i keep getting following error: http error 401.2 - unauthorized not authorized view page due invalid authentication headers. end goal authenticate user @ home page. if can't authenticated, force login. edit: enabl

c++ - Debugging multiple executions of a same project in ms visual studio -

i need run visual c++ (2012 pro) remote debugger multiple processes of windows driver application. in solution property page there’s option select multiple startup projects. there similar option run remote debugger on multiple executions of same project?

c# - multi-threaded increment and skip 0 without a lock? -

i have ushort counter (that rolls over). messaging protocol uses value disallows 0. need thread-safe way increment counter (stored in class field) every time read it, isn't hard if store int , use interlocked.increment. however, i'm not sure how incorporate skipping 0 that. it's okay if skip few numbers; output sequence doesn't have perfect. cannot ever reuse same number in block of 4000. avoid using lock. this one: given: static int value = ushort.maxvalue; and in code: int temp, temp2; { temp = value; temp2 = temp == ushort.maxvalue ? 1 : temp + 1; } while (interlocked.compareexchange(ref value, temp2, temp) != temp); you'll have use int , cast (for example in get property), because interlocked aren't basic types. we make little faster in highly threaded contexts this: int temp = value; while (true) { int temp2 = temp == ushort.maxvalue ? 1 : temp + 1; int temp3 = interlocked.compareexchange(ref value, temp2, te

python - PATH error in Bash -

i using centos6 bash , trying use python & cx_freeze. not familiar path , path modifications , being server, little apprehensive try myself (but have to). when try $cx_f/freeze, -bash: cx_freeze: command not found -- same goes cx_freeze setup.py, etc, ... attempts (including module not found ). goal use cx_freeze (a python bundling tool). o/p bash follows. $ python /usr/bin/python $ sudo locate -b python | fgrep -w bin [sudo] password xyz: /usr/bin/abrt-action-analyze-python /usr/bin/pip-python /usr/bin/python /usr/bin/python-config /usr/bin/python-pip /usr/bin/python2 /usr/bin/python2.6 /usr/bin/python2.6-config /usr/local/cpanel/3rdparty/bin/python /usr/local/cpanel/bin/ispythonversion2 /usr/local/cpanel/bin/ispythonversion2inbin cx_freeze apparently located @ /usr/lib/python2.6/site-packages evidenced o/p [xyz@server ~]$ ls cpu perl5 usr xyz [xyz@server ~]$ cd usr [xyz@server usr]$ cd lib [xyz@server lib]$ ls python2.6 [xyz@server lib]$ cd python2.6 [xyz@serv

java - Why is it illegal to assign a class variable that was just declared? -

class { public int somevar; somevar = 123; /* cannot find symbol */ } why cant language see variable declared? , unique java or true in classful oop languages? in java, can declare instance variables inside class outside method, statements such somevar = 123; must within method (or constructor, static initializer, or instance initializer).

Getting list of actors from dbpedia using SPARQL -

i have trying solve task have retrieve list of actors given film name. new both sparql , dbpedia. after reading tutorials, far have following: prefix dbpo: <http://dbpedia.org/ontology/> select ?actor_name { service <http://dbpedia.org/sparql> { "total recall" dbpo:movietitle ?moviename . ?moviename dbpo:actor ?actor. ?actor dbpo:actor_name ?actor_name. } } perhaps getting names wrong. on general note, how should go finding specific service points dbpedia, such 1 described in question. i'm not sure getting properties using in query, don't appear used on relevant resources. additional problem that, although sparql allows triple pattern, literals can't subjects of rdf triples, you'd need in order match "total recall" dbpo:movietitle ?moviename . this triple, if legal, assertion string "total recall" has movie title, , bind variable ?moviename title. string isn't movie though, wou

How to create Nested tables in MS word using XWPFTable -

i need create table within table cell in ms word using java. using code public class helloworldtable { public static void main(string[] args) throws ioexception { file file = new file("webcontent/mswordtemplates/welcomelettertable.doc"); poifsfilesystem fs = new poifsfilesystem(new fileinputstream(file)); string name="gaurav"; string letterbody="congratulations "; xwpfdocument document = new xwpfdocument(); xwpftable tableone = document.createtable(); xwpftable table2 = document.createtable(); xwpftablerow tableonerowone = tableone.getrow(0); xwpftablerow tableonerow2 = tableone.createrow(); xwpftablerow tableonerow3 = tableone.createrow(); xwpftablerow tableonerow4 = tableone.createrow(); xwpftablerow tableonerow5 = tableone.createrow(); xwpftablerow tableonerow6 = tableone.createrow(); xwpftablerow tableonerow7 = t

java - Replace String values with value in Hash Map -

i'm new java programming. have created hash map contains key value pairs utilize in replacing user input value corresponding respective key. i.e. hashmap<string,string> questionkey = new hashmap<>(); (item : itemset()) { questionkey.put(string.valueof(item.getorder()+1), item.getkey()); } string list = commandobject.getobjectitem().getlist(); if (list.contains("q")){ list.replaceall("q01", questionkey.get("1")); commandobject.getobjectitem().setlist(list); } i using in formula evaluation note : users given formula specific way of entry (value1 + value2 + value3) i'm taking (value1 value2 value3) , converting (value1key value2key value3key) update: the question understand better meant to better understand how utilize hashma

c# - How do I write a Dynamic LINQ query and have Orderby [Sort Direction] -

i write linq query similar sql query: select id, title, description, date sometable and add 'orderby' , 'ascending/descending' dynamically. i need add sort functionality on gridview, datasource linq query. you write own sortby extension method takes sortdirection . public enum sortdirection { ascending, descending } public static class extensions { public static ienumerable<tsource> sortby<tsource, tkey>( ienumerable<tsource> source, sortdirection sortdirection, func<tsource, tkey> keyselector) { switch (sortdirection) { case sortdirection.ascending: return source.orderby(keyselector); case sortdirection.descending: return source.orderbydescending(keyselector); default: throw new argumentoutofrangeexception(); } } usage var sortdirection = sort.descending; // set dynamically @ run

build javascript array from another function -

i have translation function call : _("my text"). i trying build array : var data = { _("region"):[ {"id": "vignoble","name": _("vineyard") }, {"id": "sousvignoble","name": _("sub vineyard") }, {"id": "soussousvignoble","name": _("sub sub vineyard") }, {"id": "appellation","name": _("appellation") }, {"id": "denomination","name": _("denomination") } ]}; it works great translating property "name" : _("my text") throws "syntax error : missing : after property id" first level _("region"). i've tried replace : 1. function(){_("

licensing - Does Apple allow Qt on iOS as dynamic library? -

with technology preview of android/ios support in qt 5.1, there news on deploying apple's app store yet? since non-commercial version of qt lgpl-licensed, , dylibs not permitted app store rules, there not exception either on digia's or apple's side, licensing talk doesn't provide up-to-date information on matter. so, did try push dynamically linked qt app store, or have official statement of either party? so, did try push qt app store, or have official statement of either party? yes, there qt demo applications in there. see following examples: https://itunes.apple.com/us/app/subattack/id659283830 and https://itunes.apple.com/us/app/qtquicksand/id666273528 this answers question , concern believe. further information, qt 5.2 come more support mobile platform. although, not working on port in qt project, see developer 5.2 seems support lot more. for instance, v8 has got replaced new shiny v4 engine allow proper qtquick2 delivery platform. that

php - MySQLi creating random string, but checking it doesn't already exist -

below code have written create random string. works well. checks make sure generated string doesn't exist, , if does, makes one. haven't yet worked out way make code generated if 1 exists checked see if 1 exists. best doing elseif statement? php <?php require_once('dbconfig.php'); $randomstring = ''; $characters = '0123456789abcdefghijklmnopqrstuvwxyz'; ($i = 0; $i < 12; $i++) { $randomstring .= $characters[rand(0, strlen($characters) - 1)]; } //$generatedid = "spi-e7hn2sbiif5w"; $generatedid = 'spi-'.$randomstring; //prepare select query $statement = $db->prepare("select client_unique_id clients client_unique_id = ? limit 1"); //determine variable , bind variable parameter select query ? $id = $generatedid; $statement->bind_param('s', $id); //execute , store result num_rows returns value , not 0 $statement->execute(); $statement->store_result(); //bind result variable easy management

Will upgrading Azure VM wipe out vm? -

we'd upgrade azure vm we're running our sql instance on larger server. when upgrade vm wipe out installed on server sql server? your vhd stored in blob (a page blob, exact). separate virtual machine resources ("compute") running os within vhd. if upgrade, won't have issue os disk, nor attached disks (up 2 per core). do run risk of losing temporary storage (typically on d drive), that's local storage , not considered durable . and... when increase instance size, there's chance current host box doesn't have enough resources larger vm size, resulting in being moved host os box (and lose temporary storage, still... no loss os disk).

javascript - jQuery: Add Sibling of Parent to Current Matched Elements -

i'm trying - in 1 line - remove parent element of clicked element , parent's lone sibling element. two-liner solution here: $(document).ready(function() { $('.close').click(function() { $(this).parent().siblings('.sibling').remove(); $(this).parent().remove(); }); }); here's working fiddle. i'm looking avoid navigating dom twice since i've found parent of clicked element when remove sibling, there's no reason should doing again. i'm aware wrap both parent , sibling in element , remove super element, @ point i'd avoid well. i've looked using jquery's .add() function, can't seem work. help! you're looking .addback() : $(this).parent().siblings('.sibling').addback().remove(); demo andself equivalent .addback() jquery < 1.8 with .add() , have store parent in variable avoid traversing twice: var $father = $(this).parent(); $father.siblings('.sibling'

language agnostic - Do all programs have to have a return value? -

i writing own programming language, educational purposes. when writing simple hello world example, realised many programming languages take following form: write "hello world" console return 0 do programs have return integer somehow? do don't explicitly require state return value implicitly return 0 anyway? does change between popular operating systems based upon windows nt, linux kernel or mac os xs kernel? if so, why? i unsure tag question as, appreciated of course. it's os specific question, no-one can answer if it's true os . said, i believe that, in reasonable os, yes - program has have return value. why? chain programs execution , therefore report problems, relaunch , on. there aren't programs don't return value, it's compiler hides programmer. is case on major operating systems? probably. 0 means means success shouldn't make such assumptions when writing programs; use language constants. if write own language

arrays - PHP: Getting sqlite_escape_string to work correctly. Allow apostrophes to be saved -

the problem: when editing language, cannot add apostrophe text field. if do, record not saved new edits. the goal: upon editing, allow these edits include apostrophes , save correctly. currently: can use numbers, letters, , symbols, not apostrophes. i tried thinking work, no avail: $val = (isset($airport_info[$airport_key])) ? sqlite_escape_string($airport_info[$airport_key]) : ""; below original code. <div class="inline_div_right"> <table> <?php $j=1; $some_langs_hidden = 0; foreach(array_keys($fields) $airport_key) { if(is_numeric($airport_key)) continue; if(preg_match("/name_/", $airport_key)) { $lang_iso = substr($airport_key, -2); $val = (isset($airport_info[$airport_key])) ? $airport_info[$airport_key] : ""; $row_visibility = ""; if(!in_array($lang_iso, $used_languages)) { $row_visibility =

c# - Adding aTabPanel dynamically and making its ContentTemplate from ASPX -

context: an ajax control toolkit tabcontainer , each tabpanel generated code behind, , contenttemplate custom control. the custom control corresponds goes directly in tabpanel 's contenttemplate : <%@ control language="c#" autoeventwireup="true" codebehind="tabcontenttemplatetest.ascx.cs" inherits="webgui.controls.tabcontenttemplatetest" %> <asp:label runat="server" id="tabtext" /> and code behind: public partial class tabcontenttemplatetest : usercontrol, itemplate { public string number { get; set; } protected void page_load(object sender, eventargs e) { tabtext.text = number; } public void instantiatein(control container) { container.controls.add(this); } } creation (code behind of tabcontainertest , having tabcontainer named samplestabcontainer ): public string[] numbers = { "zero", "one", "two", "three&quo

c# - AppDomainName customization with Enterprise Library on an ASP.Net MVC App -

i been using microsoft’s enterprise library logging. want able query log table based on appdomainname, not problem on executables log assemblyname appdomainname. however, when comes mvc application, arbitrary name, session id think in form such /lm/w3svc/2/root/appnamehere-1-130227215731585214 does have direction how can configure constant name regardless of session, ie. “appnamehere” thank you the logging application block not control appdomain name, , in asp.net running on iis app domain names. you create custom listener perhaps strip stuff off app domain name or configure arbitrary "app id" use instead of app domain name. we've done latter slab's sinks (that's in latest entlib v6 - can download source , take here ). for tutorial on how build custom listener, see these hands-on labs .

django - Create Facebook Event with python's urllib2 library -

i'm trying create event facebook external application. i've read this con events, states can create event via post, have following- data = dict() data['access_token'] = self.access_token data['name'] = 'fb event python!' data['start_time'] = datetime.datetime.now().isoformat() data = urllib.urlencode(data) url = 'https://graph.facebook.com/me/events' request = urllib2.request(url=url, data=data) response = urllib2.urlopen(request) where have access token , fb permissions set app can create events , forth. error 400 = bad request , if i'd more happy in advance well should think using facebook-sdk. error i.e http 400 know doing wrong how sending http request itself. request requires parameters in form not giving. if @ request function in here it makes request in form path id( not sure me valid here, perhaps can use me resource access-token using) i think args access token . file = urllib2.urlopen("https://

sql - Rails complex joins query -

here basic model heirarchy: class product has_many :inventories end class inventory belongs_to :product has_many :inventory_events end class inventoryevent belongs_to :inventory end inventoryevent instances store state change + timestamps changes, inventory.inventory_events.last shows current state. i'm running problems creating query on product model give me inventories current state received . what have right is: p = product.first p.inventories.joins(:inventory_events).where(inventory_events: {state: 'received'}).all => # here inventory ever had state 'received' may not 'received'. my sql knowledge pretty limited, seems kind of limit inventory_events: {} option might work, haven't found way that. edit: here workaround @ moment show end goal. there way model query this. class inventory def self.received_items includes(:inventory_events).select {|i| i.current_state == 'received'} end def current_stat

reporting services - SSRS 2008 R2 Calculated Series (Median) ignores custom formatting -

Image
i have created a range chart in visual studio ssrs 2008 r2, , added median line. however, ssrs happily ignore formatting set median line unless same setting range formatting set none/automatic. inherit range's color, marker, , size. reference: note faint, long line along top (very hard see) same color range. added moving average (dark blue) line show it's not using calculated series problem. here i've set range "automatic", means line takes red color set to, still doesn't take on desired thickness. (i set median line red here better contrast.) and i'm trying accomplish. (not desired final color/width, shows difference between settings , created.) is there way calculated line stop inheriting range's settings? did find this , work-around listed there not working me. if not, there way can calculate median using own line, rather calculated series? talking boss today, need have avg(), not median. such life. but had figured out

How to create separated XML nodes with "set" in Puppet using Augeas? -

i using augeas tool puppet 3.2 , trying create xml file. want able add multiple fields same name xml doc. instance, want separate node2/location2 node1/location1 placing in own "node" field. code: augeas { "update template": lens => "xml.lns", require => file["${buildpath}/tempfile.xml"], incl => "${buildpath}/tempfile.xml", changes => [ "set member/acceptors[#attribute]/node[#attribute]/nodeidentity[#attribute]/#text node2", "set member/acceptors/node/nodelocation[#attribute]/#text location2", "set member/acceptors/node/nodeidentity[#attribute]/#text node1", "set member/acceptors/node/nodelocation[#attribute]/#text location1" ], } this xml output get: <member> <acceptors> <node> <nodeidentity>node2</nodeidentity&

java - Exception Conditions: Incorrect Exception thrown -

i'm having issue homework assignment of mine. have our assignments graded website online , keep receiving following error code have displayed below. error: exception conditions. incorrect exception thrown null a.java.lang.nullpointerexception public static int[] nearestk(int[] a, int val, int k) { int x = 0; if (k < x || a.length == 0 || == null) { throw new illegalargumentexception("k not invalid"); } if (k == 0 || k > a.length) { int[] incorrect = new int[0]; return incorrect ; } final int value = val; integer[] copy = new integer[a.length]; (int = 0; < a.length; i++) { copy[i] = a[i]; } arrays.sort(copy, new comparator<integer>() { @override public int compare(integer o1, integer o2) { int distance1 = math.abs(value - o1); int distance2 = math.abs(value - o2); return integer.compare(distance1, dist

python - flask sqlalchemy unknown database error -

i'm trying create web application using flask , flask-sqlalchemy, have following code flask.ext.sqlalchemy import sqlalchemy flask import flask app= flask(__name__) app.config['sqlalchemy_database_uri']= 'mysql+mysqldb://root:presario@127.0.0.1/testdb' db = sqlalchemy(app) when run db.create_all() command line, unknown database 'testdb' error i'm working on ubuntu code above works on windows machine. i've tried adding port number, removing python connector nothing works. below stack trace file "/usr/lib/python2.7/dist-packages/mysqldb/__init__.py", line 81, in connect return connection(*args, **kwargs) file "/usr/lib/python2.7/dist-packages/mysqldb/connections.py", line 187, in __init__ super(connection, self).__init__(*args, **kwargs2) sqlalchemy.exc.operationalerror: (operationalerror) (1049, "unknown database 'testdb'") none none i suggest data

lookahead regex in nginx location -

i'm trying match /category/anything , except /category/paid in nginx location. i have following regex, it's not working. google tells me can use lookahead in nginx. doing wrong? location ^/category(?!/paid)/ { } you either need slash before or escaped slash. location ~ (category/(?!paid)) { .. } location ~ (category\/(?!paid)) { .. }

javascript - AngularJS orderby with empty field -

i ordering data , working correcty except fields empty or have no value. when ordered these empty field come first. example when ordering numbers huge empty list before getting "0"-values. i doing thise: ng-click="predicate = 'name'; reverse=!reverse" and ng-repeat="name in names | orderby:predicate:reverse" jsfiddle: http://jsfiddle.net/jzucx/1/ is there easy elegant way fix this? want empty fields come last, no matter what. i'd write filter takes items empty name ordered array , places them @ end: <li ng-repeat="item in (items|orderby:'name'|emptytoend:'name')">{{item.name}}</li> code might this: .filter("emptytoend", function () { return function (array, key) { if(!angular.isarray(array)) return; var present = array.filter(function (item) { return item[key]; }); var empty = array.filter(function (item) {

I am trying to create a link on an HTML page using information that a user inputs via JavaScript alert box -

basically have far page has 2 pop-up/alert boxes. first asks user input name of favorite website. second asks user input url favorite website. outcome supposed display in hyperlink on homepage name user entered directs url entered when clicked on. here code looks like: <!doctype html> <html> <head> <title>untitled</title> </head> <body> <script type="text/javascript"> var favoritesite; favoritesite = prompt ("what favorite web site?") favoritesite = prompt ("what url of site?") document.write('<a href="' + favoritesite + '"></a>') </script> <h1>link favorite site.</h1> <h2>this favorite web site</h2> </body> </html> ps. very beginner javascript, assistance appreciated. thanks. this ended

c# - Update Database from Dataset -

my goal update qty each sku. using sqldataadapter accomplish this. program runs fine. no result happens. question: why no result happening? database remains unchanged. code below public static void updateinventoryfromamz(datatable datatable) { int index = 0; string connstring = system.configuration.configurationmanager.connectionstrings["myconnectionstring"].tostring(); dataset amzinventorydataset = new dataset("amzinvdataset"); amzinventorydataset.tables.add(datatable); // each row - perform update // using (sqlconnection connection = new sqlconnection(connstring)) { sqldataadapter adapter = new sqldataadapter(); foreach (datarow row in amzinventorydataset.tables[index].rows) { string sku = datatable.rows[index]["seller-sku"].tostring(); string qty = datatable.rows[index]["quantity"].tostring();

how to set schema in ado.net after open the connection -

i connecting db2 database in database different schemas there. want connect connect particular schema only, tried in connection string cant give schema, after connection opening have set schema, have code i.e using connect active data object(ado) only, in ado.net how give dont know below code ado connection db.open dbcon_string db.execute ("set schema=" & appschema) db.execute ("set path=""sysibm"",""sysfun"",""sysproc"",""sysibmadm"",""" & appschema & """") note: db adodb.connection replace appschema ‘etwrms’ the below link may prove helpful- http://msdn.microsoft.com/en-us/library/ms971481.aspx

Vaadin 7.1 + Spring-Security Integration running in Tomcat Server -

im new on vaadin , spring security, want know if had complete project example of vaadin 7.1 + spring-security integration running in tomcat server (not in jetty). vaadin 7 easy integrate spring security. should configure 2 files. first - web.xml , second 1 spring-security.xml (user credentials , security settings). small example how use base form authentification. web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>vaadin7springsecurity</display-name> <context-param> <param-name>contextconfiglocation</param-name> <param-value> /web-inf/spring/spring-security.xml </param-value> </

jsp - How do i change image src using jquery? -

i want change image src jsp page through jquery. code right below $('#image').attr("src","file:///d:/vow/themes/multiflex/webapp/multiflex/images/chart.png"); in jsp file have <table> <tr style="padding-bottom:5px;"> <td>&nbsp;&nbsp;image &nbsp;&nbsp;</td> <td>&nbsp;<img id="image"/></td> <td>&nbsp;</td> </tr> </table> but see no display on jsp page after run.i have source code , image in different directories. i think because d seen d drive on client pc, wont let you. , if this, big security hole. see below link src absolute path problem try relative path like $("#image").attr("src", "/images/chart.png");

sharepoint - Powershell to list all pages with their layout across the rootweb and all subwebs? -

This summary is not available. Please click here to view the post.

How to set Position of alert messege in asp.net -

page.clientscript.registerstartupscript(this.gettype(), "alert", "javascript:alert('my message')", true); above code shows message box on top of page , want center of page. alert boxes default open @ center. @ @tomzan's comment, getting @ top chrome. as far know it's not possible make modifications that. if want custom alert box using jquery ui. it'll allow put messagebox wherever want. jquery ui dialog box

java - Hibernate: could not read column value from result set:Fail to convert to internal representation -

i trying fetch values db. have configured hibernate successfully. below hbm file , pojo class. <class name="usermasterbean" table="employee_master"> <id name="id" type="long"> <column name="emp_id" length="10" /> <generator class="assigned" /> </id> <property name="firstname" type="string"> <column name="emp_first_name" length="30" not-null="true" /> </property> <property name="secondname" type="string"> <column name="emp_second_name" length="30" /> </property> <property name="lastname" type="string"> <column name="emp_last_name" length="30" /> </property> <property name="empdob" type="date">