Tony Wiseman

0

votes
0

answer
9

views

Blogspot post content : How to get second image src using javascript

I'm working on a blogspot template and I need to get the second image from post content I've tried: var postcontent = entry.content.$t; var images = postcontent.getElementsByTagName('img'); document.write(images[1]);
wiseman
1

votes
0

answer
21

views

Philosophically speaking, should I call a method from within a getter or setter?

During a recent merry development team get together, we set out with an agenda of five things to talk about, which then soons descended into a vigorous debate about something not on the agenda. We were reading through some code, when one of the more seasoned developers on our team raised a concern a...
James Wiseman
1

votes
1

answer
28

views

Blogspot Template: pass widget output to javascript

I want to replace YOUR_LABEL_HERE with widget output value '< data:content/ >' simply i want to pass widget output to my javascript This is my code: Label
wiseman
1

votes
1

answer
988

views

Selecting Oracle Stored Procedure in SSRS Crashes Visual Studio 2005 IDE

Problem Conditions I have a very simple Oracle (11g) Stored Procedure that is declared like so: CREATE OR REPLACE PROCEDURE pr_myproc(L_CURSOR out SYS_REFCURSOR) is BEGIN OPEN L_CURSOR FOR SELECT * FROM MyTable; END; This compiles correctly. The cursor contains col1, col2 and col3. In SSRS, i have a...
James Wiseman
1

votes
1

answer
1.1k

views

Memory Leak When Using jQuery UI Tabs (ver 1.8.9)

I'm getting a memory leak when using the jQuery 1.8.9 UI tabs, and am a little baffled as to what might be causing it. The issue only seems to present in IE. I'm using IE8, (haven't tested in on 7 or 6). Firefox and Chrome are ok. The tabs are initialised like so: $('#tabContent').tabs({ cache: fals...
James Wiseman
1

votes
1

answer
393

views

Datetime conversion error when deploying a SQL script through NANT

Right, this is winding me up and has baffled the finest minds in our organisation, so I thought I'd put it to the community here. He have a NANT build script which performs a build of a local development environment. This includes file copying dll registering and (SQL Server 2000) database building....
James Wiseman
1

votes
2

answer
262

views

redirect to action which send request

I have a controller 'Contracts' and 3 GET methods: 'All', 'Focus', which contains grid, and 'Edit' for editing, and one POST method: 'Edit'. Users can access to Edit from any grid by using button. But after POST executed, i want to redirect them to action that send request. For example: open 'Focus'...
WISEMAN
1

votes
1

answer
1.1k

views

Does setConnectTimeout not affect the gateway timeout?

I'm opening an HttpUrlConnection and am setting the connection timeout using its inherited setConnectTimeout method, but for one particular URL I'm getting a gateway timeout (a 504). I don't mind getting a gateway timeout as such, but I do object to it taking far longer than the connection timeout...
Richard Wiseman
1

votes
1

answer
54

views

Why is .. (the parent directory) shown in my svn status -u output?

I have checked out a Subversion repository on two different (Windows) machines. On one, I run svn status -u and it correctly shows only the two files that I've modified on that machine. On the other machine, one line of the output is: ? .. presumably indicating that the parent d...
Richard Wiseman
1

votes
1

answer
365

views

Why doesn't Angular.element/jqlite find top-level elements?

When writing a Mocha/Chai test for an angular view, I've discovered that jqlite (since I'm not using jQuery), won't find top-level elements. I've boiled this down to a simple example: /* jshint expr:true */ describe( 'View', function() { 'use strict'; var $compile, $rootScope; beforeEach( inject( fu...
Geoffrey Wiseman
1

votes
1

answer
77

views

Finding Key-Value Coding Paths

Key-value coding paths are useful in UIKit. They often allow you to configure elements that aren't specified in the public API of a view, or in the Interface Builder inspector for that view. For instance, you can configure the text color of UIDatePicker using textColor key path, but there doesn't se...
Geoffrey Wiseman
1

votes
1

answer
204

views

Does clipboard.js support copying anchor text?

We are looking for a solution to having single-click copy to clipboard of anchor text + link that will work across chrome, safari, and IE, hopefully firefox as well.
Jiro Wiseman
1

votes
5

answer
32

views

Unable to bring uploaded images into uploads file using php

After creating a form and typing the php code, i have a form where i am able to input a file, specifically an image, and without reciving any error messages, as well as getting the success message in my url, the image uploaded still can not be found in its destination folder. Here is the HTML Search...
Nick Wiseman
1

votes
2

answer
0

views

SQL Agent Job - Connection may not be configured correctly or you may not have the right permissions on this connection?

I'm getting this error when running an SSIS package through SQL Agent Failed to acquire connection 'ORACLE ADO.NET'. Connection may not be configured correctly or you may not have the right permissions on this connection. When I log on as the SQL Agent User and run the ssis package directly it is fi...
James Wiseman
1

votes
1

answer
0

views

Django foreign keys cascade deleting and “related_name” parameter (bug?)

In this topic I found a good way to prevent cascade deleting of relating objects, when it's not neccessary. class Factures(models.Model): idFacture = models.IntegerField(primary_key=True) idLettrage = models.ForeignKey('Lettrage', db_column='idLettrage', null=True, blank=True) class Paiements(model...
Wiseman
1

votes
1

answer
0

views

SQL Agent Logon - What is going on?

I have a DTSX package that is called from a SQL Agent Job. The DTSX package references a file at a fixed location (e.g. e:\mssql\myfile.txt). On most machines, this location exists, but on some I have to manually map this (which is not a problem - I know a better solution would be to use package co...
James Wiseman
1

votes
1

answer
3.5k

views

how find fields of all member variables contained in java bean

I want to make a GUI using Java in which a user can select a bean, edit its fields, and then add an instance of the created bean to a queue. My question though is about accessing the fields. I have a class MyCompositeObject that inherits from MyParentObject. The MyParentObject is composed of multipl...
Justin Wiseman
1

votes
1

answer
15

views

Multipanel plot - how to omit a graphy from a specific position in a matrix layout

I cannot get the layout command to work. I want a multi-panel plot with a gap in a specific position, as given by this matrix: mat
Stewart Wiseman
1

votes
2

answer
101

views

Capturing errors when installing NServicebus service in Powershell

So, I have a powershell script to install an NServiceBus service as a Windows Service. Invoke-Expression '$fullNsbHostPath $arguments' For completeness, I've tried both Invoke-Expression and Start-Process: Start-Process -Wait -NoNewWindow -FilePath $fullNsbHostPath -ArgumentList $arguments -Redirec...
James Wiseman
1

votes
1

answer
189

views

Guaranteed way to associate speech recognition result with an utterance?

I'm using Microsoft's C# API for the Cognitive Services (Project Oxford) Bing Speech Recognition service. Specifically, I am using Microsoft.ProjectOxford.SpeechRecognition-x64 version 0.4.10.2. I send audio to the DataRecognitionClient using the SendAudio and EndAudio methods, and wait for the fina...
John Wiseman
1

votes
1

answer
460

views

Do you need an “output” to express a dependency on a resource in a terraform module?

Can you depend on a resource id within a module without first defining it as an output of that module? I have a terraform project with a bunch of elements defined at the top level for now. I've put security groups into a module, as they're pretty verbose (when using aws_security_group_rule), and sin...
Geoffrey Wiseman
1

votes
3

answer
263

views

What are the arguments against the inclusion of server side scripting in JavaScript code blocks?

I've been arguing for some time against embedding server-side tags in JavaScript code, but was put on the spot today by a developer who seemed unconvinced The code in question was a legacy ASP application, although this is largely unimportant as it could equally apply to ASP.NET or PHP (for example)...
James Wiseman
1

votes
1

answer
701

views

Iterating Through a List and Conditionally Setting a Member - Comparison Of Approaches

I have a requirement to iterate through a list, and conditionally set a data item against each item in the collection: Using the standard foreach iterator, this is trivial: //standard iteration foreach (LogFileDataItem lfd in logFileData) { if (lfd.FileName.Equals(currentLine, StringComparison.Ordin...
James Wiseman
1

votes
1

answer
42

views

Meeting every logical condition in a dataframe

I have a data.frame with 6,000 obs SubjectID : int 1,2,3,4... Arthritis : logi FALSE FALSE TRUE FALSE FALSE Stroke : logi TRUE FALSE FALSE FALSE FALSE Diabetes : logi TRUE FALSE FALSE FALSE FALSE Cancer : logi FALSE FALSE FALSE FALSE TRUE I am trying to find rows where every diseas...
Stewart Wiseman
1

votes
2

answer
399

views

Swift NSSound plays silently?

I've done a bit of Swift and a fair amount of Objective-C on iOS, but basically no real OS X programming, so I haven't used NSSound. I was trying to help someone on a Swift forum, and ... it's not working. I'm not sure why. In a playground, Swift REPL or even a script (#!/usr/bin/env swift), I can i...
Geoffrey Wiseman
2

votes
1

answer
1.5k

views

Associative Arrays vs UDT Tables for .NET/Oracle Data Interchange

I have a requirement to pass bulk data between a .NET (c#) application and an Oracle Database. So far, two alternatives have presented themselves, namely Associative Arrays and Tables of User Defined Data Types (UDTs) So far, I have set up an example for UDT tables, which works quite nicely. It perf...
James Wiseman
2

votes
2

answer
94

views

What is the correct way of getting the value of a selected drop down item using JavaScript?

I thought i knew this, and now I'm quite embarassed becuase I don't :-/ This JSFiddle demonstrates two ways of getting the value of a selected drop down item in JavaScript. Code reproduced here: var obj = document.getElementById('test'); alert(obj.options[obj.selectedIndex].value); //like this aler...
James Wiseman
16

votes
4

answer
3.9k

views

Is there a preferred way of formatting jQuery chains to make them more readable?

Given this following sample code which clones a table row, sets some properties and then appends it to a table: $('#FundTable').append( objButton.parents('tr').clone() .find('.RowTitle').text('Row ' + nAddCount).end() .find('.FundManagerSelect').attr('id', 'FundManager' + nAddCount) .change(function...
James Wiseman
18

votes
2

answer
15.3k

views

What is the advantage of using varbinary over varchar here?

A while ago I asked a question about hierarchy/version number sorting in SQL Server. ( How Can I Sort A 'Version Number' Column Generically Using a SQL Server Query). Among the answers that were submitted was this link to a TSQL Coding challenge with much the same puzzle. In the SQL2000 solution th...
James Wiseman
18

votes
7

answer
2.1k

views

Is Subtracting Zero some sort of JavaScript performance trick?

Looking in the jQuery core I found the following code convention: nth: function(elem, i, match){ return match[3] - 0 === i; }, And I was really curious about the snippet match[3] - 0 Hunting around for '-0' on google isn't too productive, and a search for 'minus zero' brings back a reference to a Bo...
James Wiseman
1

votes
1

answer
3.4k

views

How do I make a JSlider background transparent? or How do I properly overlay JComponents in JLayeredPane?

I am trying to overlay a JSlider on top of a JProgressBar. I am using a JLayeredPane to hold the two components. I am adding the JProgressBar to the JLayeredPane and then adding the JSlider. So far, I have attempted to make the JSlider transparent by setting opaque to false and overriding the paintC...
Justin Wiseman
2

votes
2

answer
280

views

Regex and JavaScript String With a Dollar ($) at the end

In answering this PHP question: regex - preg_replace string, I came across something in Javascript I didn't understand. Given the following: var s = 'abc1!?d$'; alert(s.replace(/\W+/, ' ')); I am alerted: abc d$ Why is it not stripping out the last dollar?
James Wiseman
6

votes
2

answer
124

views

Information on Casted C# Reference Types in Memory

If I have two classes, A and B where B derives from A: class A {} class B : A { } I can upcast quite happily an instance of B to A. B b = new B(); A a = b; Now, I can understand how the runtime can determine that the underlying type is B, as page 132 of the ECMA-335 (Common Language Infrastructure (...
James Wiseman
6

votes
2

answer
8.5k

views

! grep in R - finding items that do not match [duplicate]

This question already has an answer here: Using grep in R to delete rows from a data.frame 4 answers I want to find rows in a dataframe that do not match a pattern. Key = c(1,2,3,4,5) Code = c('X348','I605','B777','I609','F123') df1
Stewart Wiseman
2

votes
2

answer
258

views

C# Partial Class and COM Interface

I'm creating a C# library and am going to expose a COM interface to it. I understand the steps requried to do this, i.e. Ensure assumbly GUID is assigned, e.g: [assembly: Guid('dde7717b-2b75-4972-a4eb-b3d040c0a182')] Ensure COMVibile attribute is True Put a GUID attribute on the class, e.g. [GuidAt...
James Wiseman
5

votes
1

answer
92

views

Why do Google not optimize Date/Time construction in their front-page Javascript [closed]

In JavaScript, we can get a number representing the current date/time like so: var dt = new Date(); var e = dt.getTime(); A slightly shorter hand way of doing this might be: var f = (new Date()).getTime(); The most compact way of doing this is reflected in the following code: var g = +new Date; //1...
James Wiseman
4

votes
3

answer
1.2k

views

Excluding a job from the Jenkins Job Queue when a build is in progress

I have a long-running job (10 hours) scheduled to run twice a day (at 11am/11pm). I generally only want to commence the build at 11am/11pm. If the previous build fails, I sometimes want to start the next build early (e.g. 9am). How do I do it? If I manually kick off the build at 9am, the scheduled...
Peter Wiseman
21

votes
3

answer
1.4k

views

What useful custom jQuery selectors have you written?

For me, one of the best, yet under-utilised feature of jQuery is the custom selector. I have a fairly trivial example of this, to pick out all text boxes that are empty: $(document).ready(function() { $.extend($.expr[':'], { textboxEmpty: function(el) { var $el = $(el); return ($el.val() == '') && (...
James Wiseman
2

votes
1

answer
217

views

Symfony2 form - Many to Many as text causing errors

I have tried looking around for a possible solution to this but with no luck. What I have is a Many to many relationship between properties and postcodes, I can't display the postcodes in a select for example due to the amount of possible entries. My solution was to have it as a text field in the fo...
Harry Wiseman
11

votes
4

answer
5.5k

views

How Can I Sort A 'Version Number' Column Generically Using a SQL Server Query

I wonder if the SQL geniuses amongst us could lend me a helping hand. I have a column VersionNo in a table Versions that contains 'version number' values like VersionNo --------- 1.2.3.1 1.10.3.1 1.4.7.2 etc. I am looking to sort this, but unfortunately, when I do a standard order by, it is treated...
James Wiseman

View additional