Posts

Showing posts from July, 2011

C# transparent canvas over OpenGL -

i have following layout in c# windowsformhost host opengl window. add transparent canvas on draw 2d stuff. code doesn't work. please help. mc:ignorable="d"> <grid> <dockpanel> <windowsformshost grid.column="0" x:name="scannerviewpanel"/> <canvas background="transparent"/> edit: after add canvas, opengl content not shown, opaque canvas. tried make canvas transparent, set opacity 0, it's still opaque. from msdn : in wpf user interface, can change z-order of elements control overlapping behavior. hosted windows forms control drawn in separate hwnd, drawn on top of wpf elements. you can't that.

problems with errors on SQL SERVER -

i have issue query in sql server, have wrote dynamic query: declare @cont int declare @sqlquery varchar(1000) declare @sqlquery2 varchar(500) declare @sqlquery3 varchar(2000) declare @anho varchar(4) set nocount on drop table ti set @anho = (select year(getdate())) set @cont = 1 set @sqlquery = '' while @cont <= 12 begin set @sqlquery2 = '(a.['+@anho + right('00'+cast(@cont varchar),2)+']+b.['+@anho + right('00'+cast(@cont varchar),2)+']+c.['+@anho + right('00'+cast(@cont varchar),2)+']+d.['+@anho + right('00'+cast(@cont varchar),2)+']) ['+@anho + right('00'+cast(@cont varchar),2)+'],' exec (@sqlquery2) set @sqlquery = @sqlquery + @sqlquery2 exec (@sqlquery) set @cont = @cont + 1 end exec(@sqlquery) set @sqlquery3 = 'select a.gestion,'+@sqlquery+' '+quotename('ges08','''')+' cod_ges ti llamadas_mensual_oro_final inner join llamada...

c# - Store data in LINQ to two tables; Join LINQ -

i using simplemembership mvc4 work great, required add addition user details first , last name, email, country constraints each user can have multiple profiles add id {fk} users table in userprofile table. have seprate form when user register, system call form asking addition details. using code first existing database approach i missing puzzle of how store additional information along saying hock user profile using linq. many in advance .. database: create table [dbo].[userprofile] ( [userid] int identity (1, 1) not null, [username] nvarchar (150) not null, [id] int not null, primary key clustered ([userid] asc), foreign key ([id]) references [dbo].[users] ([id]) ); create table [dbo].[users] ( [id] int identity (1, 1) not null, [email] nvarchar (150) not null, [first_name] nvarchar (150) not null, [last_name] nvarchar (150) not null, [country] nvarchar (150) not null, primary key clustered ([id] asc) ); control...

php - SimpleXMLElement' is not allowed in session_write_close() -

im not sure do. im trying make session string inside of function , parse session outside of , if makes sense.... im getting error "simplexmlelement' not allowed in session_write_close()" suggestions on can solve it? function api_info($form, &$form_state){ $server_url = 'website api url' curl_setopt($ch, curlopt_url, $server_url ); curl_setopt($ch, curlopt_post, 0 ); curl_setopt($ch, curlopt_postfields, ); curl_setopt($ch, curlopt_httpheader, array("expect:") ); curl_setopt($ch, curlopt_failonerror, 1 ); curl_setopt($ch, curlopt_followlocation, ); curl_setopt($ch, curlopt_header, false ); curl_setopt($ch, curlopt_returntransfer, 1 ...

css - are AsciiEffect.js && CSS3DRenderer.js compatible? three.js / WebGL -

i'm trying use asciieffect.js && css3drenderer.js in combination, don't know if that's possible without finagling... here's idea var w = window.innerwidth, h = window.innerheight; renderer = new three.css3drenderer(); effect = new three.asciieffect( renderer ); effect.setsize( w, h ); document.body.appendchild( effect.domelement ); but doesn't work... here's problem, it's understanding asciieffect script uses canvas renderer... i'm not entirely sure how css3drenderer works (beyond skill set)... in theory seems should possible... no? assume involves making changes either or... no, they're not. asciieffect works canvas -based renderers: canvasrenderer , softwarerenderer , webglrenderer .

node.js - How to use partials in Express.js layout? -

i have layout.ejs file contains site's basic boilerplate html markup: doctype declaration, head, body, footer, basics... how go placing navigation in separate partial file , including layout? there particular require() or include() function doing this? i using ejs view engine. yes. <% include path/to/template %> documentation here. https://github.com/visionmedia/ejs#includes

javascript - How do I get compass heading from DeviceOrientation in the Google Glass Browser? -

the web browser built google glass of firmware version xe7 provides deviceoreientation events , values don't seem come expected frame of reference. how can 1 proper compass headings out of this? glass positioned on head: deviceorientationevent beta 90 upright , level -90 inverted , level 0 looking straight or down gamma 90 right ear towards floor 180 looking straight 270/-90 left ear down 0 looking straight down alpha this property not stable when glass horizontal (what should useful orientation using compass direction, determine wearer looking). gives stable readings when glass tilted above or below horizon. above horizontal 90 north 0 east 180 west 270 south below horizontal 270 north 180 east 0 west 90 south may can idea on how control compass newly launched sample

sql server - insert into select from sql query with both query and static values -

i trying perform insert query 1 specific column table plus 2 static values, trying this: insert tablea(policyid, type, used) select id policies, 'a', 1 but getting error near 'a' per ssmse. idea how can tackle task? in advance, laziale you'll need put these static values in select clause: insert tablea(policyid, type, used) select id, 'a', 1 policies

linux - oracle coherence segmentation fault -

i installed oracle coherence 3.6 on rhel 5.5. when execute cache-server.sh lot of gc warnings allocating large blocks , fails segmentation fault. suggestions? here stack: gc warning: repeated allocation of large block (appr. size 1024000): may lead memory leak , poor performance. gc warning: repeated allocation of large block (appr. size 1024000): may lead memory leak , poor performance. ./bin/cache-server.sh: line 24: 6142 segmentation fault $javaexec -server -showversion $java_opts -cp "$coherence_home/lib/coherence.jar" com.tangosol.net.defaultcacheserver $1 [root@localhost coherence_3.6]# swapon -s filename type size used priority /dev/mapper/volgroup00-logvol01 partition 2097144 0 -1 [root@localhost coherence_3.6]# free total used free shared buffers cached mem: 3631880 662792 2969088 0 142636 353244 -/+ buff...

python - Displaying a UserProfile field in Django Admin outside listing -

i have phone field in userprofile . how can have displayed in django admin › auth › users listing outside (list display) - not inside of record? i have: class useradmin(useradmin): list_display = ('email', 'first_name', 'last_name', 'userprofile__phone') inlines = (userprofileinline,) # re-register useradmin admin.site.unregister(user) admin.site.register(user, useradmin) userprofile__phone not recognized. one way be class useradmin(useradmin): list_display = ('email', 'first_name', 'last_name', 'phone') inlines = (userprofileinline,) def phone(self, obj): try: phone = obj.userprofile.phone #or change how access userprofile object - assuming user, profile relationship onetoone return phone except: return "" phone.short_description = 'phone' # re-register useradmin admin.site.unregister(user) admin.site....

php - Routing with modules with codeigniter -

i'm working hmvc wiredesignz plugin , have following url mysite.com/login , views login form. have form post submit method in login controller inside of user module. i'm trying figure out route work because inside of submit method have echoing string testing purposes. first route works beautifully second route presents 404 page not found. thoughts on how correct this. $route['login'] = 'user/login'; $route['login/submit'] = 'user/login/submit'; try 1 $route['login/(:any)'] = 'user/login/$1'; $route['login'] = 'user/login'; or try change action of form submit $route['submit'] = 'user/login/submit'; $route['login'] = 'user/login';

php - mysql query returning null when not should to [SOLVED] -

i use php code value db. my problem got null result. i check !empty($result) , mysql_num_rows($result) still got null result. i tested exactly same query use in code on phpmyadmin , working. the echo $response["sql"] "good". here php code: edit i added line fix it: $row = mysql_fetch_array($result); $result = mysql_query("select * workouts_wall workout_name = 'wo13' , user = 'tomer2'") or die (mysql_error()); // mysql inserting new row if (!empty($result)) { if (mysql_num_rows($result) > 0) { $response["sql"] = "good"; } else { $response["sql"] = "bad"; } } else { $response["sql"] = "bad"; } $response["is null?"] = $result; // echoing ...

powershell - EWS Managed API along with service account -

i have service account is not mail/smtp-enabled. account memberof number groups has full access permissions assigned through emc/ems. question whether possible or not use service account fetch total inbox unread emails accounts has memberof, without having assign impersonate rbac role or adding mail/smtp-adress account. if please provide example or @ least point me in right direction.

alias - Aliased Git Commands: '.;' did not match any files -

i trying create alias pull without having commit first. first tried this: git config --global alias.pulluc 'git add .; git stash; git pull; git stash pop; git reset; when running git pulluc , got complaints 'git' not git command . changed to: git config --global alias.pulluc 'add .; stash; pull; stash pop; reset; now when run git pulluc fatal pathspec: '.;' did not match files how can include git add . in list of commands in alias? from git-config(1) man page: if alias expansion prefixed exclamation point, treated shell command... since you're attempting create alias small shell script (a sequence of commands separated ; ), need prefix alias exclamation point.

regex - 301 Redirect/Rewrites with Patterns -

i know using power of regex, can reduce 301's few lines. however, not have brain power it. basically our links went from: http://www.site.com/collection/womens-active (this can have ?brand=123 queries attached end) to: http://www.site.com/collection/active "womens-" changed part. a simple 301 works perfectly, queries, there 100 lines in htaccess. with regex, can reduce few lines? use redirectmatch instead: redirectmatch 301 ^/collection/([^/-]+)-active/(.*)$ /collection/active/$2 assuming "is changed part", mean there says "womens-". edit: since it's other way around, swap regex grouping , "womens-": redirectmatch 301 ^/collection/womens-([^/-]+)/(.*)$ /collection/$1/$2

android - NullPointerException in onActivityResult after calling camera intent -

here's problem: need save photo default camera location, copy private location, add gps tags copy, , delete original photo. why around? because on devices, when using mediastore.extra_output in request intent photo saved in default location anyway. when application complete, when testing on new device (motorola mb526) crushes after accepting taken picture. same thing happens on emulator. the thing is, in onactivityresult(int requestcode, int resultcode, intent data) data.getdata() returns null. so question - there unified way save picture in given location , else? edit: capture image intent protected void takephotos() { intent imageintent = new intent( android.provider.mediastore.action_image_capture); startactivityforresult(imageintent, capture_image_activity_request_code); } and result protected void onactivityresult(int requestcode, int resultcode, intent data) { if (resultcode == result_ok) { if (requestcode == capture_image_...

php - Laravel 4: Can't get model data with a form macro on edit form -

on edit forms have problem populate form fields data stored in db. when use code snippet doc everything's fine. need append css class form field, , cannot passed argument for: {{ form::text('email') }} so i've created below form::macro form::macro('textclass', function($name, $class = null) { return '<input type="text" name="'.$name.'" id="'.$name.'" class="'.$class.'"/>'; }); so can use on views: {{ form::textclass('email', 'm-wrap span12') }} but field doesn't populated model data. any idea on how fix this? for reference if want check form generates can vendor/laravel/framework/src/illuminate/html/formbuilder . in formbuilder class you'll find methods inputs. method text input looks this public function text($name, $value = null, $options = array()) { return $this->input('text', $name, $value, $options); ...

Bind event to element using pure Javascript -

i'm writing api , unfortunately need avoid jquery or 3rd party libraries. how events bound elements through jquery? jquery example: $('#anchor').click(function(){ console.log('anchor'); }); i'm close writing onclick attribute on element out of frustration, understand link between jquery event , dom element. how element know fire jquery event when markup not changed? how catching dom event , overriding it? i have created own observer handler cant quite understand how link element observer events. here's quick answer: document.getelementbyid('anchor').addeventlistener('click', function() { console.log('anchor'); }); every modern browser supports entire api interacting dom through javascript without having modify html. see here pretty bird's eye view: http://overapi.com/javascript

http - c# Downloading PNG file from website and sending cookies in Request? -

hello trying download .png image website, need headers sent in request download image. end goal image loaded directly stream, rather saving file. this code image's html with: public string request(string type, string page, string data = "", string referer = "") { using(tcpclient tcp = new tcpclient(this.sitename, this.port)) { byte[] headers = encoding.default.getbytes(this.makeheaders(type, page, referer, data)); using (networkstream ns = tcp.getstream()) { ns.write(headers, 0, headers.length); using (streamreader sr = new streamreader(ns, encoding.default)) { string html = sr.readtoend(); return html; } } } } the headers send this: get /image.php http/1.1 host: greymatter.com user-agent: mozilla/5.0 (windows nt 6.1; wow64; rv:22.0) gecko/20100101 firefox/22.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q...

stream - php ziparchive readfile, no such file found error -

i encountering error: [23-jul-2013 16:26:15 america/new_york] php warning: readfile(resumes.zip): failed open stream: no such file or directory in /home/mcaplace/public_html/download.php on line 24 this code: <?php /*foreach($_post['files'] $check) { echo $check;}*/ function zipfilesanddownload($file_names,$archive_file_name,$file_path) { $zip = new ziparchive(); //create file , throw error if unsuccessful if ($zip->open($archive_file_name, ziparchive::create )!==true) { exit("cannot open <$archive_file_name>\n"); } //add each files of $file_name array archive foreach($file_names $files) { $zip->addfile($file_path.$files,$files); /*if(file_exists($file_path.$files)) //." ".$files."<br>"; echo "yes";*/ } $zip->close(); //then send headers foce download zip file ...

java - Why are layout parameters not supported in JavaFX CSS? -

i've been coding gui in javafx , have gotten styling css. however, came learn there no support setting layout parameters such min-width, pref-width, etc. (these show in docs filed under webview only.) instead of getting nicely sized textfield , have 1 that's spread across entire screen. now know solution go hardcode these layout parameters in java (the documentation pointed me javafx script that's been dead since 2009), i'm wondering why have this? what's point? i'm not css pro, seems bad design abstract some of styling. it's in 2 places? there plans change this? the feature request has been implemented in java 8 . see rt-20906 support setting min/pref/max sizes via css . it argued layout , styling separate things , javafx has fxml declarative layout system, perhaps need layout parameters in css less if using scenebuilder , fxml layout (at least experience technology has lead me believe).

css - horizontal jquery menu with subsectons -

Image
i need help. i've looked everywhere think i'm looking little unique. i'm trying make menu when click on menu option group of options. bit got, think. im trying achieve getting allow children of submenu slide in-between line of links directly. kind of horizontal accordion menu, twist of having top menu links in row rather vertically. the action, click on topmenu item , submenu(s) links appear. if submenu link clicked, link appear sub-submenu items corresponding original link , hiding , parents. im not sire if im explaining right. head little brain-dead trying solve issue day , im cave in. this example of im trying achieve: if want go here see have done http://jsfiddle.net/pi_mai/zuu5m/ i'm trying make menu html code ( i've remove many link items shorten code ): <nav> <ul class="topmenu"> <li class="topmenu-item-1"><a href="" class="topmenu-link">top menu</a></l...

.net - Regex to allow only dots, letters and dashes in VB.NET -

i have code, , dimiss words spaces , starts +... have allow dots, letters , dashes... think more simple: imports system.text.regularexpressions public class contactos readonly pattern string = "\s([^+\d\,]+),?" private sub button1_click(sender object, e eventargs) handles button1.click dim cadena string = " " & textbox1.text & "," dim match match = regex.match(cadena, pattern) while match.success frmmain.listbox1.items.add(match.groups(1).tostring) match = match.nextmatch() loop end sub end class what can do? thanks! :) please try following pattern "(?<=(^|,\s))(?<word>[\.a-za-z\-]+)($|,)" , use named group word expected values: while match.success frmmain.listbox1.items.add(match.groups("word").tostring) match = match.nextmatch() loop

c# - Adding footers to existing pdf documents using iTextSharp -

i wondering if knew how add text existing pdf document using itextsharp. know question has been asked before trying add footer pages in bottom right hand corner of document, none of other posts have helped me , cannot find solid info on elsewhere. adding footer done using pdfstamper , getovercontent() method. see twopasses.cs example. more info on example, please read chapter 6 of book. note example assumes pages of size a4 , lower-left corner has coordinate x=0,y=0. have found other answers (tell where), didn't (tell why not). common mistake may have found while searching answer make wrong assumptions mediabox , cropbox of existing pdfs. unfortunately, you're not telling you've tried (and result risk question closed).

google analytics - Record dynamic PHP URL -

i have website visitors requesting php file including variables in url: http://www.mywebsite.com/file.php?somevariable=blabla&othervariable=and on is there way "track" or record dynamic url, maybe ip adress output this: ip: 12.345.33.234 url:http://www.mywebsite.com/file.php?somevariable=blabla ip: 12.345.678.234 url:http://www.mywebsite.com/file.php?somevariable=blabla url:http://www.mywebsite.com/file.php?somevariable=blabla , on i tried google analytics can't make heads or tail out of it. googled lot im not sure im looking for...which makes searching difficult. if don't feel apache's way go reason, can create database table store requests in. save ip , current url can access document.url in javascript. have in mind though many computers may have same ip within given network, if you'll serving punishment kind of abuse, ip not way go. hope helped, luck! :p

c++ - Why "using namespace" directive is accepted coding practice in C#? -

i curious know why "using namespace" directive acceptable in c#, though in c++ not . aware c++ , c# different, guess c++ , c# come same family, , should using same ideas namespace resolution. c++ , c# both have alias keyword around namespace clash. can point me, not reading between lines in c# makes acceptable use "using namespace" directive, , avoid problems c++ cannot. in c++, if write using namespace in header, in effect includes header. makes pretty unusable in headers. @ point, might avoid (at global scope) in .cpp files well, if sake of consistency, , make moving implementations between .h , .cpp easier. (note locally scoped using namespace - i.e. within function - considered fine; it's don't verbosity much) in c#, there nothing #include , , scope of using directive never span beyond single .cs file. it's pretty safe use everywhere. the other reason design of standard library. in c++, have std (well, few more underneath it,...

c++ - Optimal Way to Send Recv to multiple processes in MPI -

my specific problem follows: have 4 workers , 1 master process. want send messages each worker other workers. (from worker 1 2,3,4; process 2 1,3,4, etc.) i don't care order @ messages sent, care performance. data sending big, in gigabytes. i using isend , recv, kept getting segmentation faults. tried use sendrecv, ones seems hang in middle, possibly due deadlock. wondering best way send , receive , multiple processes. here current code: for(int id = 1; id < num_processes; id++) { // computation vector vec // mpi_request request; if(id != myid) mpi_isend(&vec.front(), vec.size(), mpi_bid, id, 1, mpi_comm_world, &request); } then receiving. for(int id = 1; id < num_processes; id++) { mpi_request request2; if(id != myid) mpi_recv(&recvvec.front(), some_large_value, mpi_bid, mpi_any_source, 1, mpi_comm_world, &request2); } any appreciated! if you're getting segfaults, issue other doing data tran...

java - Eclipse Juno and Maven plugin fails with project update -

i having problem long time . have red error image on projects. in problem window displayed project configuration not up-to-date pom.xml. run maven->update project or use quick fix. when right click , click update project , error popup displayed saying, an internal error occurred during: "updating maven project". org/eclipse/m2e/wtp/wtpprojectsutil anybody knows how fix problem, please. from preferences>type 'wtp' > deselect option build , clean again

One pesky blank line in an XSLT transform -

i'm using xslt extract data trademark xml file patent , trademark office. it's okay, except 1 blank line. can rid of moderately ugly workaround, i'd know if there better way. here's subset of xslt: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:tm="http://www.wipo.int/standards/xmlschema/trademarks" xmlns:pto="urn:us:gov:doc:uspto:trademark:status"> <xsl:output method="text" encoding="utf-8" /> <xsl:strip-space elements="*"/> <xsl:template match="tm:transaction"> <xsl:apply-templates select=".//tm:trademark"/> <xsl:apply-templates select=".//tm:applicantdetails"/> <xsl:apply-templates select=".//tm:markevent"/> </xsl:template> <xsl:template match="tm:trademark"> markcurrentstatusdate,...

Java : Serializable not working to save Object's states -

i trying simple program in java save objects state using serializable through follwing code , once writes these objects , make them null when try them gives me null values ,should not give me stored values ? when run program answer null null null , please see , guide me , game.java public class game implements serializable{ public game() { } public int getsize() { return size; } public void setsize(int size) { this.size = size; } public string gettype() { return type; } public void settype(string type) { type = type; } public string[] getname() { return name; } public void setname(string[] name) { this.name = name; } int size; string type ; string [] name; public game (int thesize , string thetype, string[] names ) { this.size = thesize; this.type= thetype; this.name = names; } } gamecharacter.java ...

javascript - IE8 issue with triggering change event -

i have class default on change event added checkboxes. the default change event works in of cases in cases remove change event , add custom change event. however, in ie8, seems if set: ele.checkbox.checkek = true; then change event have set on checkbox triggered. in other browsers have call fireevent('change') in order trigger change event. is possible prevent happening or if there way can determine when there custom change events added? thanks. this because of bubbling onpropertychange , mootools tries normalise , convert change event... see commit 19 days ago: https://github.com/mootools/mootools-core/commit/8c97db6ba4b8a7f3b900f355d972c66b36a636b4 - may have been broken commits daniel buchner , partly myself, reckon. you should able element.fireevent('change') call callback anyway

meteor - How to redirect New User to different page one time only? -

ok when app starts after first time sign want redirect user different page. in server code have this accounts.oncreateuser(function(options, user) { hooks.oncreateuser = function () { meteor.router.to('/newuser'); } }); but want users redirected page if have been on more once have in client code, defaults client, doing wrong? hooks.onloggedin = function () { meteor.router.to('/new'); } if want redirect signed user, set flag within user object denoting whether redirected: hooks.onloggedin = function (){ if(!meteor.user()) return; if(!meteor.user().returning) { meteor.users.update(meteor.userid(), {$set: {returning: true}}); meteor.router.to('/new'); } } make sure publish & subscribe returning field of user collection! if want similar functionality visitors, use cookies. hooks.onloggedin = function (){ if(!cookie.get('returning')) { cookie.set('returning', true); meteor.router.to('/...

java - Importing project into Netbeans -

Image
my client sent me base project development purposes. think zipped project folder , sent me. now when go netbeans, "new project existing sources": first see error " this project contains build folder ". deleted build folder project , error " this project contains netbeans project ". any idea missing. used eclipse , new netbeans. project structure sent me client is: try copying src , web folder in different folder location , create new project existing sources in netbeans. should work. or remove nbproject folder before importing.

asp.net mvc 3 - How to validate textbox in MVC3 that must contain string started with characters "PR" -

i new mvc3 , working mvc3 razor application. need validate textbox on view in such way that, textbox accept strings starting characters "pr" , 4th character of string must "2". great if helps me. in advance well need regex. i'm not sure regex , string contains. if need have 2 matches in there, split , use 2 textboxes , join values on post. viewmodel: public class myviewmodel { [regularexpression("^pr[a-za-z0-9]", errormessage= "invalid text1")] public string mytext1 { get; set; } [regularexpression("^2[a-za-z0-9]", errormessage= "invalid text2")] public string mytext2 { get; set; } } warning, regex may faulty. invite others edit/post comments , can update correct regex view: @model myproject.models.myviewmodel @using (html.beginform()) { @html.textboxfor(m => m.mytext1) @html.textboxfor(m => m.mytext2) <button type="submit">submit</button...

openjdk - Installing 64-bit open jdk on Ubuntu 12.04 LTS -

how can install open jdk 64-bit on ubuntu 12.04 lts? i have installed running command sudo apt-get install openjdk-7-jdk . there way specify 64-bit while installing? sudo apt-get install openjdk-7-jre ?

How to connect Android application to SQL Server through jbdc? -

i have tried connect android app sql server using jtds gives login error. i have use jtds1.2.7-jar in libs folder my code is: public class mainact extends activity{ edittext e; button bt; listview lv; connection connect; simpleadapter sm; public void declere(){ e=(edittext)findviewbyid(r.id.et1); bt=(button)findviewbyid(r.id.bt1); lv=(listview)findviewbyid(r.id.list); } public void initilize(){ declere(); e.settext("select top 10 * form1"); connect=conn("sa","cbo@morc","kuldeep","122.160.255.218:1433"); } @suppresslint("newapi") private connection conn(string user,string pass,string db,string server){ strictmode.threadpolicy policy=new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); connection conn=null; string connurl=null; try{ class.forname("net.sourceforge.jtds.jdbc.driver"); connurl="jdbc:jtds:...

vba - How do I create and email by taking the adresses from word and having the word as an attachment using visual basic? -

i have word document contains table email addresses. want addresses document , and open lotus notes email set default email service having addresses added "to:" field , document attachment. connected lotus notes, want mail start having addresses , attachment in place , not sent automatically. have code gets addresses table: sub send_mail_recipients() 'nimo 08-jun-2013 'send-mail distribution list dim text string dim char string dim rowcount, n_address, n_cells, cell_crt, charno integer dim recipient(100) variant 'with application.activewindow.document 'activate document 'n_address = 0 text = "" activedocument.tables(2).select n_cells = selection.cells.count cell_crt = 1 n_cells if selection.cells(cell_crt).range.text "*@*" 'recipient(n_address) = selection.cells(cell_crt).range.text text = text + selection.cells(cell_crt).range.text + ", " 'n_address = n_address + 1 end i...

drupal 7 - Adding meta tag titles in each page in drupal7 -

in drupal site created pages page--about-us.tpl.php etc. need add metatg <meta name="title" content="about us"> in pages. there way this thanks in advance open xtemplate.engine in /themes/engines/xtemplate around line 53, variables assigned template, you'll have line starts with "content" => just above line, add: "nodewords" => (module_invoke("nodewords", "get", $node->nid)), next, open xtemplate.xtmpl , add standard meta keywords tag head area, {nodeword} keywords go.

java - How to traverse/iterate through a nested JAXB object to display it in JSP page? -

i constructed soap request , received response. unmarshalled response using jaxb context , got object contains response. jaxbcontext jc = jaxbcontext.newinstance(responsemessage.class); unmarshaller um = jc.createunmarshaller(); responsemessage output = (numberresponsemessage)um.unmarshal(soapresponse.getsoapbody().extractcontentasdocument()); now can access data in response object (output) via get..()/..getvalue() methods , print in console. issue arises when try send response object adding modelandview attribute jsp page. model model.addattribute("response", output); the error - jsp don't know how iterate on given items(as try loop). <c:foreach var ="res" items="${output}"> <td>${res.transactionid}</td> </c:foreach> since response object contains hundreds of data , inner jaxb<> arrays, not possible set data user bean , access. can advice me how iterate on response object in jsp page? you'd...

spring - java.lang.NullPointerException at org.apache.ibatis.session.SqlSessionFactoryBuilder.build while running over a karaf -

getting below exception while running sample application in karaf. have placed maven build jar inside servicemix/deploy. please new camel,mybatis , servicemix org.springframework.beans.factory.beandefinitionstoreexception: unexpected exception parsing xml document url [bundle://278.0:0/meta-inf/spring/camelcontext.xml]; nested exception java.lang.nullpointerexception @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:412)[69:org.springframework.beans:3.0.7.release] @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:334)[69:org.springframework.beans:3.0.7.release] @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:302)[69:org.springframework.beans:3.0.7.release] @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreade...

Get XML Response using CURL, FOPEN or FILE_GET_CONTENTS in PHP -

i create php script perform request https site using method. in return, response in xml format. need able contents/save xml. i've tried using curl, file_get_contents, fopen i'm getting bad request (400) response. when try go directly url, receive xml response. here's url i'm trying response with: https://tst.webservices.outsurance.co.za/securehost/lead/leadpostservice.svc/submitaffiliatelead?xml=%3c%3fxml+version%3d%221.0%22+encoding%3d%22utf-8%22+%3f%3e%0d%0a%0d%0a%3clead%3e%0d%0a+++%3cmode%3elive%3c%2fmode%3e%0d%0a%09%3ctitle%3emrs%3c%2ftitle%3e%0d%0a%09%3cfirstname%3ehannah%3c%2ffirstname%3e%0d%0a%09%3clastname%3edwindle%3c%2flastname%3e%0d%0a%09%3cid%3e1723658492165%3c%2fid%3e%0d%0a%09%3chomecode%3e%3c%2fhomecode%3e%0d%0a%09%3chometel%3e%3c%2fhometel%3e%0d%0a%09%3cworkcode%3e011%3c%2fworkcode%3e%0d%0a%09%3cworktel%3e132189%3c%2fworktel%3e%0d%0a%09%3cmobile%3e0824176239%3c%2fmobile%3e%0d%0a%09%3cemail%3ehannahdwindle@gmail.com%3c%2femail%3e%0d%0a%09%3ccomment...

android - Destroy DialogFragment on onCreateDialog() -

i have dialog fragment initializes google plus views, views fail i'd kill dialog @ point, before it's displayed user. how can end dialog creation process? returning null oncreatedialog returns dialog object crushes program. if you'd dismiss dialogfragment within oncreatedialog can following: @override public dialog oncreatedialog(bundle savedinstancestate) { setshowsdialog(false); dismiss(); return null; } no need override onactivitycreated().

functional programming - What is difference between tail recursive and stack recursive functions? -

in pure functional languages, writing factorial function as, fact.0 = 1 fact.n = n*fact.n-1 as function stack recursive, explain difference between stack recursive , tell recursive functions? thanks in advance. the difference between tail recursion , stack recursion (as call it) tail recursive functions can transformed imperative code not use call stack (i.e., while loop), while stack recursion, stack depth proportional recursion depth. mean program overflows stack. note "transformation imperative code" takes commonly takes place in code generation, output language of compilers assembly, c or other low level imperative language. note has nothing functional or pure functional languages, have same problem in every language supports recursion. in functional languages, recursion way of looping.

c# - EWS managed API. IsNew Always return false and can't use TextBody -

i newbie developer , have been stuck ews hours now. need read through recent emails, unread emails , use data them stuff. at moment code looks this. static void main(string[] args) { servicepointmanager.servercertificatevalidationcallback = certificatevalidationcallback; exchangeservice service = new exchangeservice(exchangeversion.exchange2013); service.credentials = new webcredentials("support@mycompany.com", "mysupersuperdupersecretpassword"); service.autodiscoverurl("support@mycompany.com", redirectionurlvalidationcallback); finditemsresults<item> findresults = service.finditems(wellknownfoldername.inbox,new itemview(2)); foreach (item item in findresults.items) { // works until here console.writeline(item.subject); console.writeline('\n'); item.load(); string temp = item.body.text; // can't s...

django: how to make an attribute of a table be count of entries in another table -

continuing django polls tutorial, want entry (i called numchoices) in poll model automatically updates number of choices associated poll. how can that? class poll(models.model): question = models.charfield(max_length=200) pub_date = models.datetimefield('date published') numchoices = models.integerfield() def __unicode__(self): return self.question def was_published_recently(self): now=timezone.now() return now-datetime.timedelta(days=1) <= self.pub_date < was_published_recently.admin_order_field = 'pub_date' was_published_recently.boolean = true was_published_recently.short_description = 'published recently?' class choice(models.model): poll = models.foreignkey(poll) choice_text = models.charfield(max_length=200) votes = models.integerfield(default=0) def __unicode__(self): return self.choice_text clarification, ideal use case such that: if want list polls number of...

python - Show files in tkinter Scrollbar -

i tried modify scrollbar tkdoc ( http://www.tkdocs.com/tutorial/morewidgets.html#scrollbar ) in order show filelist of folder not work. can explain me why? , how fix it. thanks lot. from tkinter import * tkinter import ttk import os def filename(): path="c:\\temp" dir=os.listdir(path) fn in dir: print(fn) root = tk() l = listbox(root, height=5) l.grid(column=0, row=0, sticky=(n,w,e,s)) s = ttk.scrollbar(root, orient=vertical, command=l.yview) s.grid(column=1, row=0, sticky=(n,s)) l['yscrollcommand'] = s.set ttk.sizegrip().grid(column=1, row=1, sticky=(s,e)) root.grid_columnconfigure(0, weight=1) root.grid_rowconfigure(0, weight=1) l.insert(filename) root.mainloop() you should specify insert l.insert(end, filename) in code, insert function filename. insert return value of filename function. i renamed filename get_filename , , modified return filename list. from tkinter import * tkinter import ttk import os def get_filen...

Android:How to change the logo of Up navigation in Actionlayout -

the logo @ left in original actionbar not app icon. actionlayout added button. <item android:id="@+id/action_search" android:orderincategory="100" android:showasaction="collapseactionview|always" android:title="@string/action_search" android:icon="@drawable/ic_search" android:actionlayout="@layout/search_layout"/> but in case of button clicked, actionbar changed, , logo @ left, app icon in navigation. how make logo not changed? through styles.xml following items <style name="apptheme.actionbarstyle" parent="@style/widget.sherlock.actionbar.solid"> <item name="android:homeasupindicator">@drawable/home_up_drawable</item> <item name="homeasupindicator">@drawable/home_up_drawable</item> </style> at runtime seticon() . instance: actionbar bar = getactionbar(); bar.seticon(); seticon ...

javascript - how to remove vertical scroller -

i trying avoid vertical scroll bar splitter. using kendo ui splitter 2 panes, in first pane have grid. depending upon selected record in grid right side content height varying. trying set varying height splitter. i googled right pane content height,but not able exact height properly. var height = $('#splitter').prop('scrollheight'); $('#splitter').height(height); $("#splitter").css({ height: height }) i put code in change event of grid,but not worked out me. have defined splitter like var splitter = $("#splitter").kendosplitter({ panes: [ { collapsible: true, size: "48%" }, { collapsible: false, size: "52%" }], orientation: "horizontal" ] }); can 1 tell me how this. in css (apply appropriate class): overflow-y:hidden; ...