I am using the MailDefinition class to create html emails for my site. The only problem I am having is that there is alot of repetition in the string templates. For example the email footer along with all the associated html and css has to be repeated in each template type. Is there a way to have sub-template? or some mechanism for avoiding this…
In my root view controller, in my didReceiveMemoryWarning method, I go through a couple data structures (which I keep in a global singleton called DataManager), and ditch the heaviest things I've got--one or maybe two images associated with possibly twenty or thirty or more data records.
Right now I'm going through and setting those to nil. I'm…
Is there a good way to map vectors? Here's an example of what I mean:
vec0 = [0,0,0,0,0,0,0,0,0,0,0]
vec1 = [1,4,2,7,3,2]
vec2 = [0,0,0,0,0,0,0,0,0]
vec2 = [7,2,7,9,9,6,1,0,4]
vec4 = [0,0,0,0,0,0]
mainvec =
[0,0,0,0,0,0,0,0,0,0,0,1,4,2,7,3,2,0,0,0,0,0,0,0,0,0,7,2,7,9,9,6,1,0,4,0,0,0,0,0,0]
Lets say mainvec doesn't exist (I'm just showing it…
I have a question about how I setup my BO's.
I setup the BO's to contain all of my properties of the object as well as the business logic to satisfy the business rules. I decided to make all of the methods static, but I'm not sure if that was the right decision. Someone told me to split my BO's into an Entity Object of…
Sorry for the vague question title -- not sure how to encapsulate what I'm asking below succinctly. (If someone with editing privileges can think of a more descriptive title, feel free to change it.)
The behavior I need is this. I am envisioning a worker class that accepts a single delegate task in its constructor (for…
I'm running Drupal 6.14 and my back-end complaints that I need to upgrade to 6.16.
How can I do that? Do I just replace my php files with the new ones? Is there an update script?
Hello,
I'm currently developing in GAE and I have to query like this using JDO:
SELECT table1.column1, table2.column2
FROM table1, table2 WHERE
table1.column1 = table2.column1;
I tried this one but it won't work:
String query = "select from "+Assessment.class.getName()+ "a, "+
…
I'm trying to mesh the below mysql query results into a single json object, but not quite sure how to do it properly.
//return data
$sql_result = mysql_query($sql,$connection) or die ("Fail.");
$arr = array();
while($obj = mysql_fetch_object($sql_result)) { $arr[] = $obj; }
echo json_encode($arr); //return json
…
Hi all,
I have a wide char string is L"hao123--??????", and it must be encoded to
"hao123--\u6211\u7684\u4E0A\u7F51\u4E3B\u9875". I was told that the encoded string is a
special “%uNNNN” format for encoding Unicode UTF-16 code points. In this
website(http://rishida.net/tools/conversion/), it tell me…
Hello.
How can I query RowNumber with Entity Framework?
For example:
var result = data.Users
.OrderByDescending("Birthday")
.ThenBy("LastName")
.ThenBy("FirstName")
.Select(u =>
{
RowNumber = ???,
…
I have a SQL statement in C# (.NET Framework 4 running against SQL Server 2k8) that looks like this:
SELECT [Column1] FROM [Table1] WHERE [Column2] = @Column2
The above query works fine with the following ADO.NET code:
DbParameter parm = Factory.CreateDbParameter();
parm.Value = "SomeValue";…
I have a simple Ruby script that looks like this
require 'csv'
while line = STDIN.gets
array = CSV.parse_line(line)
puts array[2]
end
But when I try using this script in a Unix pipeline like this, I get 10 lines of output, followed by an error:
ruby lib/myscript.rb < data.csv | head
…
OK so, let's say I have a Java applet that takes a while to load (~5 secs). It's getting the mysql-connector.jar and it's loading. Well.. instead of the gray box with the coffee logo... can I make it have a simple progress bar with the percent?
Thanks.
I have a page with a hidden <audio> object which is being started and stopped using a custom button via javascript. (The reason being I want to customise the button, and that drawing an audio player seems to destroy rendering performance on iPad anyway). A simplified example (in…
Typical things to worry about when dealing with text are the BOM/signature, encoding, and the end of line (EOL) char/chars.
I know that Windows often favours \r\n (CR+LF) and Mac/Linux favours \n (LF), but how about popular mobile devices such as the iPhone and Android? Do typical…
I'm foolishly saying:
if ([imageCache objectAtIndex:index]) {
Problem is, on my first time through this, I haven't put ANYTHING in my NSMutableArray *imageCache, and this croaks with a range error.
How can I ask an NSMutableArray whether it has anything for a particular index?
I learned how to use the comparable but I'm having difficulty with the Comparator. I am having a error in my code:
Exception in thread "main" java.lang.ClassCastException: New.People cannot be cast to java.lang.Comparable
at java.util.Arrays.mergeSort(Unknown Source)
at…
I am trying to call the API but I keep getting a soap error that can't load the file. I found that the reason is there are about 3 blank lines at the top of the XML file that is returned. I found this by doing wget url.
This use to work just fine, when I debug through…
Does anyone know of or having any good examples of how to use Entity Framework version 2 in the Data Access layer and put an interface on it so the business layer uses the interface rather than knowing about EF? I have found some examples but they are all from 2009 and…
When setting up a source control repository for a Flex Builder workspace, what do you consider to be worth checking in? Do you exclude the workspace .metadata folder but keep the .project and other project specific files? Keep both? Throw away both? Is there a…