i get data from database, in YYYY-mm-dd format, but i want to show just dd.mm (example - i get 2010-05-28, want to show 28.05).
could you help me?
thanks
I'm working with big blobs of JSON. These blobs change slightly over time and a revision history is kept. I'd really like to be able to do a visual diff on them, but my problem is they're being stored without any formatting at all - everything is on one line, so that makes it a little hard to see what changed.
Is there a good way to programatically format them ala http://jsonformat.com/ or http://jsonformatter.curiousconcept.com/?
Hi,
I am developing a list of buttons for a puzzle game where i want to place images on these buttons with good texture on it like what we see just like in twitter format.is it possible to do this? if so how?
Thanks,
Hi
This is my program .when i submit the print button i can print the datas but they are not aligned in the table formatthe format in which i need the print to be...How can i print in the correct format
<html>
<head>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js" > </script>
<script type="text/javascript">
function PrintElem(elem)
{
//alert('ddd');
Popup($(elem).text());
}
function Popup(data)
{
var mywindow = window.open('', 'mydiv', 'height=400,width=600');
mywindow.document.write('<html><head><title>my div</title>');
/*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.document.close();
mywindow.print();
return true;
}
</script>
</head>
<body>
<div id="mydiv">
<table width="200" border="1">
<tr>
<td>sss</td>
<td>sssss;</td>
<td>snssbsp;</td>
</tr>
<tr>
<td>ssss;</td>
<td>sssnbsp;</td>
<td>snbsp;</td>
</tr>
<tr>
<td>snbsp;</td>
<td>snbsp;</td>
<td>snbsp;</td>
</tr>
</table>
</div>
<input type="button" value="Print Div" onClick="PrintElem('#mydiv')" />
</body>
</html>
I have a file format plugin and everytime I attempt to write to the file in DoWriteStart, the callouts fail.
The Photoshop API is using the windows WriteFile callout which is returning a 0 value. when an attempt to write to the file is made
Hi all,
I am using swing framework and applets.
If I take locale as 'en_US',the time shows in AM and PM.
If I take Locale as 'ms_MY',the time shows in Pagi and patang.
I want,
If I take locale as 'ms_MY',the time shows in AM and PM.
How to solve the time format.
please help me
Time.ToString("0.0") shows up as a decimal "1.5" for instead of 1:30 how can I get it to display in a time format.
private void xTripSeventyMilesRadioButton_CheckedChanged(object sender, EventArgs e)
{
//calculation for the estimated time label
Time = Miles / SeventyMph;
this.xTripEstimateLabel.Visible = true;
this.xTripEstimateLabel.Text = "Driving at this speed the estimated travel time in hours is: " + Time.ToString("0.0") + " hrs";
}
Hello.
I have a map in Mapinfo format. To open it I use trial version of Mapinfo, but in several days trial period will pass. Are there some free viewers for mapinfo files, or may be there are some coverters?
I've seen these questions but both involve methods that aren't available in the CellStyle Format value. I only want to show the hours and minutes portion (16:05); not the seconds as well (16:05:13). I tried forcing the seconds value to zero but still got something like 16:05:00. Short of using a kludge like providing a string or a DateTime (and only showing the hour/minutes part) is there any way I can get the formatting to do what I want.
Hi all.., I have number : 1, 2, 3, 4, 10
But I wanna print that number
0001
0002
0003
0004
0010
I have search in google, the keyword is number format. but I've got nothing, I just get, frmat decimal such ass 1,000,000.00. hope you can suggest me a reference or give me some problem solving.
Thanks,
How to easily change the format of URL in a right way:
/comment/10.js?param1=6
to
/comment/10?param1=6
Preferrably with some URL library or so, not with regexps.
How do I retrieve the month from the current date in mm format? (i.e. "05")
This is my current code:
var currentDate = new Date();
var currentMonth = currentDate.getMonth() + 1;
I'm trying to change the value of my checkbox to true based on a another cell's value
if range("A1").value = "green" then
Checkbox1.value= true
end if
How to I change the value property to true for multiple checkbox at the same time
For some reason the code that i've tried doesn't do anything at all.
P.S. I'm using format checkboxes
Hey,
I have two textbox called BIRTH & EMAIL, and I must test in button click if the user has typed a date & email format in those two TextBox.
How can do that ?
I can't for the life of me find out how to get visual studio to keep my source to 100 columns width as part of auto-format.
Ctrl+K+D
Surely this doesn't require an extension? What's the simplest way to set it up?
I will admit that I am new to the tech/dev field. It seems to become a trend that every time I have to work with pdfs a part of me dies.
Why is this format as ubiquitous as it seems to be?
Is it just non-tech people that prefer pdfs?
Is there a easy standards-compliant way to check if a URL string is a valid format? Either through a specific URL-type class or maybe someone could show me how to do a regex validation of it?
Hello
I'd like my dates in the mm/dd/year format in text fields. However, they currently displays as 2010-03-26.
Is there a global setting I can set to change this?
I tried the following, which seems to update the .to_s method, but form fields stay the same.
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%m/%d/%Y')
Thanks
I made a NotePad program. The problem is it doesn't save in .txt format, It save as a file with no format. But it can open .txt files. How can i fix it?
Here is my work.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Scanner;
import java.io.*;
public class NotePad extends JFrame {
private JTextArea noteArea;
public static void main(String[] args) {
NotePad p = new NotePad();
p.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
p.setSize(500,300);
p.setVisible(true);
}
public NotePad() {
super("Java Notepad");
setLayout(new BorderLayout());
noteArea = new JTextArea("",20,20);
noteArea.setWrapStyleWord(true);
noteArea.setLineWrap(true);
Font font = new Font("sanserif", Font.BOLD,14);
noteArea.setFont(font);
JScrollPane scroller = new JScrollPane(noteArea);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
add(scroller,BorderLayout.CENTER);
JMenuBar menuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JMenuItem openMenu = new JMenuItem("Open");
openMenu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
JFileChooser openFile = new JFileChooser();
openFile.showOpenDialog(new NotePad());
loadFile(openFile.getSelectedFile());
}
});
JMenuItem saveMenu = new JMenuItem("Save");
saveMenu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
JFileChooser saveFile = new JFileChooser();
saveFile.showSaveDialog(new NotePad());
fileSaved(saveFile.getSelectedFile());
}
});
JMenuItem exitMenu = new JMenuItem("Close");
exitMenu.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae) {
System.exit(0);
}
});
fileMenu.add(openMenu);
fileMenu.add(saveMenu);
fileMenu.add(exitMenu);
menuBar.add(fileMenu);
this.setJMenuBar(menuBar);
}
public void loadFile(File file) {
noteArea.setText("");
try {
BufferedReader read = new BufferedReader(new FileReader(file));
String line = null;
while((line =read.readLine())!=null) {
noteArea.append(line +"\n");
}
read.close();
}
catch (Exception e) {
System.out.println("Error " + e.toString());
}
}
public void fileSaved(File file) {
try {
PrintWriter writer = new PrintWriter(file);
String[] lines = noteArea.getText().split("\\n");
for (String ) {
writer.println(words);
}
writer.close();
} catch (Exception e) {
System.out.println("Error " + e.toString());
}
}
}
btw I can't post my question because of not explaning the scenario according to the site. So there. Thanks for the help
Hi,
I am trying to format a date as follows using Rails 3; 3rd June 2003.
This is not a standard way of showing the date, so I have looked into a custom way of doing it. Rails 3.0 documentation here suggests that I add a file at config/initializers/time_formats.rb containing the following code:
Time::DATE_FORMATS[:custom_date] = lambda { |time| time.strftime("#{time.day.ordinalize} %B %Y") }
And then call it using something like:
<%= document.publish_date.to_formatted_s(:custom_date) %>
However this isn't working and the date is being formatted as YYYY-MM-YY. Does anyone have any suggestions?
Cheers
I'm trying to use the SmugFig SmugMug API on Android. It was designed for J2SE I would imagine, so I'm not sure it will even work on Android, but I figured it was worth trying as opposed to trying to create my own API.
When I load the project though, I get the following error:
Conversion to Dalvik format failed: Unable to execute dex: null
It doesn't say what package it fails on, just "Android Packaging Problem", but it did not do this before I added SmugFig and it's dependency JARS to the build path.
Where should I look? Or does this mainly me that it just won't work with those libraries?
Have anyone experienced this (org.argouml.model.)XmiException opening a project lastest version of argouml?
XMI format error : org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace
If this file was produced by a tool other than ArgoUML, please
check to make sure that the file is in a supported format, including
both UML and XMI versions.
If you believe that the file is legal UML/XMI and should have loaded
or if it was produced by any version of ArgoUML, please report
the problem as a bug by going to http://argouml.tigris.org/project_bugs.html.
System Info:
ArgoUML version : 0.30
Java Version : 1.6.0_15
Java Vendor : Sun Microsystems Inc.
Java Vendor URL : http://java.sun.com/
Java Home Directory : /usr/lib/jvm/java-6-sun-1.6.0.15/jre
Java Classpath : /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/deploy.jar
Operation System : Linux, Version 2.6.31-20-generic
Architecture : i386
User Name : wellington
User Home Directory : /home/wellington
Current Directory : /home/wellington
JVM Total Memory : 34271232
JVM Free Memory : 10512336
Error occurred at : Thu Apr 01 11:21:10 BRT 2010
Cause : org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace
at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:307)
at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:273)
at org.argouml.persistence.XmiFilePersister.doLoad(XmiFilePersister.java:261)
at org.argouml.ui.ProjectBrowser.loadProject(ProjectBrowser.java:1597)
at org.argouml.ui.LoadSwingWorker.construct(LoadSwingWorker.java:89)
at org.argouml.ui.SwingWorker.doConstruct(SwingWorker.java:153)
at org.argouml.ui.SwingWorker$2.run(SwingWorker.java:281)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace
at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:232)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:136)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:98)
at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:56)
at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:233)
... 7 more
Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace
at org.netbeans.lib.jmi.xmi.XmiElement$Instance.setReferenceValues(XmiElement.java:699)
at org.netbeans.lib.jmi.xmi.XmiElement$Instance.resolveAttributeValue(XmiElement.java:772)
at org.netbeans.lib.jmi.xmi.XmiElement$Instance. (XmiElement.java:496)
at org.netbeans.lib.jmi.xmi.XmiContext.resolveInstanceOrReference(XmiContext.java:688)
at org.netbeans.lib.jmi.xmi.XmiElement$ObjectValues.startSubElement(XmiElement.java:1460)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:219)
... 22 more
-------
Full exception : org.argouml.persistence.XmiFormatException: org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace
at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:298)
at org.argouml.persistence.XmiFilePersister.doLoad(XmiFilePersister.java:261)
at org.argouml.ui.ProjectBrowser.loadProject(ProjectBrowser.java:1597)
at org.argouml.ui.LoadSwingWorker.construct(LoadSwingWorker.java:89)
at org.argouml.ui.SwingWorker.doConstruct(SwingWorker.java:153)
at org.argouml.ui.SwingWorker$2.run(SwingWorker.java:281)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace
at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:307)
at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:273)
... 6 more
Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace
at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:232)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:136)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:98)
at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:56)
at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:233)
... 7 more
Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace
at org.netbeans.lib.jmi.xmi.XmiElement$Instance.setReferenceValues(XmiElement.java:699)
at org.netbeans.lib.jmi.xmi.XmiElement$Instance.resolveAttributeValue(XmiElement.java:772)
at org.netbeans.lib.jmi.xmi.XmiElement$Instance. (XmiElement.java:496)
at org.netbeans.lib.jmi.xmi.XmiContext.resolveInstanceOrReference(XmiContext.java:688)
at org.netbeans.lib.jmi.xmi.XmiElement$ObjectValues.startSubElement(XmiElement.java:1460)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:219)
... 22 more
the original project was created on argo v0.28.1, and (as I remember) have only use case diagrams.
and yes, I'll report at the specified argo website either.. :)
But anyone know anything about this exception?
Hi,
While googling I found two different sets of headers that need to be set when outputting excel generated in different file format.
for e.g.
For Type "Excel5" headers are:
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=$filename");
header("Content-Transfer-Encoding: binary ");
For Type "Excel2007" headers are:
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="myfile.xlsx"');
header('Cache-Control: max-age=0');
My question: is there need to set up different headers for each file type as there are other file types also CSV, HTML and PDF?