Is there any way that I can embed a .exe file in a .pdf, .doc, .xls, .ppt file,
and on opening the containing file, the document processor will run the .exe automatically?
I am creating a multilingual site that will need to support at minimum five different languages, including Korean and Chinese. The site language is ColdFusion, so Java is the native language. I want to make the site as easy as possible for the next programmer to update, and for third-party translators to use tools that will work easier for them than digging through a SQL database.
So far I have come across Resource Bundles, GNU's GetText, and TMX.
Which do you recommend and why?
final Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "this is the test");
emailIntent.putExtra(Intent.EXTRA_TEXT, "testing time");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
I want to represent the following nested array structure in YML:
container
1: N [contained_item]s
where [contained_item] has the following structure
contained_item:
name:
type:
category:
id:
value:
I hope the structure I am trying to describe is clear - I have used a mixture of Pseudo UML and YML.
An aside: YML is a superset of JSON, and is used in the Symfony framework.
I have about 12-15 images that I want to align together in a grid, with text under each image. I thought about using a table, but I hear that tables aren't the best way to go these days.
I tried a few other things, but nothing seemed to work the way I wanted it to.
An example of what I want it to look like would be something like this:
[-----Image-----] [-----Image-----] [-----Image-----] [-----Image-----] --- Row 1
(--Description-) (-Description-) (-Description-) (-Description-)
[-----Image-----] [-----Image-----] [-----Image-----] [-----Image-----] --- Row 2
(--Description-) (-Description-) (-Description-) (-Description-)
and so on...
What are some other methods, besides tables, that I should look into using?
Any suggestions or references would be helpful.
I have a series of times that are coming to me as strings from a web service. The times are formated as HH:MM:SS:000 (3 milisecond digits). I need to compare two times to determine if one is more than twice as long as the other:
if ( timeA / timeB > 2 )
What's the simplest way to work with the time strings?
If I was writing in Python this would be the answer to my question:
Difference between two time intervals in Python
I am preparing a presentation using Google Docs Presentation though I can also work on the presenation within Open Office that will include code snippets.
Is there any easy way to perform basic syntax highlighting on the code snippets with either Google Docs or Open Office Presenter?
Edit: Since I believe that I can find a way to embed HTML any tools that can perform syntax highlighting on HTML would also be welcome suggestions.
I am wanting to use the Google Weather API - by passing lat and long values. However it seems Google is needing these formatted differently to the values I have stored.
i.e. For the town of McTavish I have values of 45.5 and -73.583
This works here: http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=45.5,-73.583
But when I use Google it does not: See: www.google.com/ig/api?weather=,,,45.5,-73.583
Any help appreciated. I would prefer to use the Google Data.
Using clojure, I've been able to successfully setup log4j very simply by using this log4j.properties file, and including log4j in my classpath.
# BEGIN log4j.properties
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%d{MMdd HHmmss SSS} %5p %c [%t] %m\n
log4j.rootLogger=DEBUG, STDOUT
Then after :use'ing clojure.contrib.logging, I'm able to print a statement with the desired formatting as expected like so:
(info "About to print this")
(debug "This is debug-level")
My question is how to achieve a consistent formatting for logging statements made from loggers configured in other libraries. I thought I could find existing loggers using org.apache.log4j.LogManager.getCurrentLoggers() and change the PatternLayouts there, but I'm not able to iterate over that enumeration in clojure, as I get the following error:
Dont know how to create ISeq from: java.util.Vector$1
I assume this is possible somehow, and probably very simply. How?
Thanks much.
I'm getting the following line in the disassembly from objdump -d of an x86 linux program...
4000b0: ba 0e 00 00 00 mov $0xe,%edx
I'm trying to understand how the machine code "ba 0e 00 00 00" maps to "mov $0xe,%edx"
In the manual move immediate 32-bit is:
B8 + rd ... MOV r32, imm32
ie "B8" not "BA"
In fact none of the MOV opcodes are "BA".
If someone could break down "ba 0e 00 00 00" and explain bit-wise how to get to "mov $0xe,%edx" it would be most helpful.
I am using scilab to do some simple simulation. The outcome will a number of plot and graph. What is the easiest way to capture these outputs and publish them into a pdf or ps file?
Hopefully it is simple to do that I can include the boilerplate code into my scilab script itself?
I am creating a report from Ruport and want to be able to take the grouping heading, in this case the ID for the class Email, and wrap a method around it and a link_to to link to the Email view based on the email_id:
@table = ContactEmail.report_table(:all,
:conditions => ['date_sent >= ? and date_sent <= ?', @monday, @friday])
@grouping = Grouping(@table, :by => "email_id")
How do I do that? It feels as if I have little control over the output.
I have have a simple HTML form with say four input widgets (see below)...two lines with two widgets on each line. However, when this renders it is pretty ugly. I want the whole form to be indented from the edge of the left page say 40px and I want the left edge of the widgets to line up with each other and the right edge of the labels to line up. I also want to be able to specify a minimum distance between the right edge of the first widget and the label of the widget next to it. How would I do this using CSS? Basically so it looks something like:
Name: _____________ Common Names: _____________
Version: ____________ Status: ____________
See current un-formatted HTML below:
<form name="detailData">
<div id="dataEntryForm">
<label>
Name: <input type="text" class="input_text" name="ddName"/> Common Names: <input type="text" class="input_text" name="ddCommonNames"><P>
Version: <input type="text" class="input_text" name="ddVer"/> Status: <select name="ddStatus"><option value="A" selected="selected">Active</option><option value="P">Planned</option><option value="D">Deprecated</option>
</label>
</div>
</form>
I need to get a Date from an SQL Server Database (SQL Server 2000), the date is stored as such:
2009-09-30 00:00:00.000
I want to pass this date into a Classic ASP function to use this date in the Database
somewhere else, however when I get the date, it converts in my ASP code to a locale-dependant version, such as:
30/09/2009
I just want the date as-is as formatting the date so it is correct again seems unnecessary, although if this the only way then fine - is there any way to treat it as string data so it stays like that, so it can be inserted back into the database as the same date, without needing conversion?
Hey all,
I'm trying to learn more about library versioning in Linux and how to put it all to work. Here's the context:
-- I have two versions of a dynamic library which expose the same set of interfaces, say libsome1.so and libsome2.so.
-- An application is linked against libsome1.so.
-- This application uses libdl.so to dynamically load another module, say libmagic.so.
-- Now libmagic.so is linked against libsome2.so. Obviously, without using linker scripts to hide symbols in libmagic.so, at run-time all calls to interfaces in libsome2.so are resolved to libsome1.so. This can be confirmed by checking the value returned by libVersion() against the value of the macro LIB_VERSION.
-- So I try next to compile and link libmagic.so with a linker script which hides all symbols except 3 which are defined in libmagic.so and are exported by it. This works... Or at least libVersion() and LIB_VERSION values match (and it reports version 2 not 1).
-- However, when some data structures are serialized to disk, I noticed some corruption. In the application's directory if I delete libsome1.so and create a soft link in its place to point to libsome2.so, everything works as expected and the same corruption does not happen.
I can't help but think that this may be caused due to some conflict in the run-time linker's resolution of symbols. I've tried many things, like trying to link libsome2.so so that all symbols are alised to symbol@@VER_2 (which I am still confused about because the command nm -CD libsome2.so still lists symbols as symbol and not symbol@@VER_2)... Nothing seems to work!!! Help!!!!!!
Edit: I should have mentioned it earlier, but the app in question is Firefox, and libsome1.so is libsqlite3.so shipped with it. I don't quite have the option of recompiling them. Also, using version scripts to hide symbols seems to be the only solution right now. So what really happens when symbols are hidden? Do they become 'local' to the SO? Does rtld have no knowledge of their existence? What happens when an exported function refers to a hidden symbol?
My application keeps all Java Date's in UTC. Parsing them is easy, but when I print them out, the display shows the computer's local time zone, and I want to show it as UTC.
Example code:
String sample = "271210 200157 UTC";
SimpleDateFormat dfmt = new SimpleDateFormat("ddMMyy HHmmss Z");
Date result = dfmt.parse(sample);
System.out.printf("%tc\n", result);
the result is
Mon Dec 27 15:01:57 EST 2010
What I want is
Mon Dec 27 20:01:57 UTC 2010
Clearly I have to set some Locale and TimeZone values, but I don't see where to put them.
Thanks
Pat
Is there an RFC, official standard, or template for creating a User Agent string? The iphone's user-agent string seems strange...
Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16
Hi all
I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error.
I am using FERRET SERARCH IN MODEL.
NameError in CompetitorsController#index
uninitialized constant CompetitorsController::Competitor
/opt/ruby_enterprise/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:102:in `const_missing'
/home/troche/mrecip_tool/releases/20091219131859/app/controllerscompetitors_controller .rb :19:in `index'
My controller is
class CompetitorsController < ApplicationController
include AuthenticatedSystem
layout 'application'
auto_complete_for :proscribed, :competitor
auto_complete_for :fee_earner, :fee_earner
protect_from_forgery :only = [:tag]
before_filter :login_required, :only = [:index, :show, :new, :edit]
@@total_company = 70
def index
@compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINE
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @compet }
end
end
def show
@competitor = Competitor.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @competitor }
end
end
end
My Model is
class Competitor < ActiveRecord::Base
validates_presence_of :fee_earner_id, :notes
belongs_to :fee_earner
belongs_to :country
belongs_to :state
belongs_to :user
acts_as_ferret :fields =[:competitor, :client, :subject_matter],:remote = true
end
I want my image wrapping with text align like this
--------------------
--------------------
_________ ----------
image |----------
|----------
|----------
_________|------<end>
I've tried text text text text .... but the result comes like this
_________
image |----------
|----------
|----------
_________|----------
-------------------
--------------------
What should I do without manual putting and without table ? (like align text first , then image and final , text) because all images and texts of my website will be fetched from the database.
Many thanks !!!
So let's say I have a view that access a date:
<%= Html.TextBoxFor(model => Model.Birthday) %>
How do I have my view dictate how that date is formatted? I'd like to use common formatting options, and it's important that this is 2-way (both for display and data-entry).
I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook.
I found a page on microsoft.com that says there's a 'Remove line breaks' "feature" in Outlook so does this mean there's no solution to get around that other than un-checking that setting?
Thanks
I've found several posts on hubFS of people asking if there is, or will be, offline documentation for F#. These posts haven't been answered. So I want to give it a shot and ask the same question here on SO.
Where I've looked for offline documentation so far:
The April 2010 CTP release of Visual F# (version 2.0) is available for VS 2008, but it doesn't come without an offline help.
There's a question on SO about offline documentation for various programming languages, but F# isn't mentioned there at the time of this writing.
There is of course Microsoft's F# language reference documentation (available on MSDN), which could be downloaded for offline browsing using e.g. wget.
Question:
Does anyone know whether any "official" offline documentation is on the way, anytime soon?
(And related to this, albeit this probably can't be answered objectively: Would it be reasonable to expect that F# likely won't undergo ECMA or ISO standardization, ie. there likely won't be a standards document describing the language?)
I'm using jQuery UI Autocomplete plug-in. Is there a way to highlight search character sequence in drop-down results?
For example, if I have data: "foo bar" it and I search for "foo" I get "foo bar" in drop down.
I have created a forum board app, based on YAML schema found in 'real world examples' of Doctrine Manual, which looks similar to this:
---
Forum_Category:
columns:
root_category_id: integer(10)
parent_category_id: integer(10)
name: string(50)
description: string(99999)
relations:
Subcategory:
class: Forum_Category
local: parent_category_id
foreign: id
Rootcategory:
class: Forum_Category
local: root_category_id
foreign: id
Forum_Board:
columns:
category_id: integer(10)
name: string(100)
description: string(5000)
relations:
Category:
class: Forum_Category
local: category_id
foreign: id
Threads:
class: Forum_Thread
local: id
foreign: board_id
Forum_Entry:
columns:
author: string(50)
topic: string(100)
message: string(99999)
parent_entry_id: integer(10)
thread_id: integer(10)
date: integer(10)
relations:
Parent:
class: Forum_Entry
local: parent_entry_id
foreign: id
Thread:
class: Forum_Thread
local: thread_id
foreign: id
Forum_Thread:
columns:
board_id: integer(10)
updated: integer(10)
closed: integer(1)
relations:
Board:
class: Forum_Board
local: board_id
foreign: id
Entries:
class: Forum_Entry
local: id
foreign: thread_id
How to modify this schema, to use NestedSet (Tree structure of threads and entries)?