I use NSCoreData , I want to store this formatted date to db, field type is date, how can I do this?
date formatted: 2010-10-31
I hope I explained my scenario. Sorry for my English. Greetings.
The format is similar to below text:
1. I need to create the bullet like this which would be helpful to me in my application and
need someone to you to share the code with me.
2. Can you help me out and remember the UIwebview is not preferable because i dont have
to execute the webviewwillload method.
3. Please find the best and easy way to approach this.
4. Also remember there should be indent spacing.
Thanks in advance and its urgent for me.
I've a table field consists of 10 digits expresses the date and the time.. I want to extract a report where the date/time field can be readable from this field
How can i concate this string in mysql
desc=desc+$desct
what i want is each time i insert a variable from PHP that the string is added to the string which was already in db and seperated with ||
the field desc should look like this
desc
10||30||90||710
say i want to add the value 20
desc
10||30||90||710||20
then the desc field should look like this
How can i implement this?
Hello,
i think the fullcalendar jquery-plugin is a really great solution.
i saw does the string for the title in the fullcalender plugin is escaped (htmlEscape). But i need to format some strings in the title for example bold text or colors, or small images?
the solution with another plugin (for example qTip, like in the examples) will not the right way for me.
is there anyway to format the title text?
Regards
flauschi
Hello all,
How do I remove numbers from a string using Javascript?
I am not very good with regex at all but I think I can use with replace to achieve the above?
It would actually be great if there was something JQuery offered already to do this?
//Something Like this??
var string = 'All23';
string.replace('REGEX', '');
I appreciate any help on this.
Should I declare an attribute in a javabean that holds a date value a user types in on an HTML form as a String or Date?
I feel I should declare as a Date, however, since I do server validation on all form data, if the date doesn't validate, when I pass the form bean back to the jsp view for correcting, I lose the date value that the user tried to type in.
If I declare as a String, if the date doesn't validate, I'm able to set the string value in the bean and pass the bean back to the view and the user can see what they incorrectly typed.
But with a String declaration for Date inputs I forsee problems down the road with my DAO. I want to be able to use a DAO utility which generates a prepare statement using setObject.
In my html form I request dates to be mm/dd/yyyy and in DAO i'm using Oracle Date. I can not use hibernate or such, since this is a corporate intranet.
What is the best practice "pattern" I should be following??
Hi all,
I noticed the function Object.factory(char[] className) in D.
But it does not work like I hoped it would work; it does not work ;)
An example:
import std.stdio;
class TestClass
{
override string toString()
{
return typeof(this).stringof; // TestClass
}
};
void main(string[] args)
{
auto i = Object.factory("TestClass");
if (i is null)
{
writeln("Class not found");
}
else
{
writeln("Class string: " ~ i);
}
}
I think this should result in the message: "Class string: TestClass" but it says "Class not found".
Does anybody know why this happens and how I could fix it ?
Or do I need to make my own class factory. For example by make a class with a static array Object[string] classes; with class instances. When I want a new instance I do this:
auto i = (className in classes);
if (i is null)
{
return null;
}
return i.classinfo.create();
In my Android app, I want to use a single variable for the log name in multiple files. At the moment, I'm specifying it separately in each file, e.g.
public final String LOG_NAME = "LogName";
Log.d(LOG_NAME, "Logged output);
I've tried this:
public final String LOG_NAME = (String) getText(R.string.app_name_nospaces);
And while this works in generally most of my files, Eclipse complains about one of them:
The method getText(int) is undefined
for the type DatabaseManager
I've made sure I'm definitely importing android.content.Context in that file. If I tell it exactly where to find getText:
Multiple markers at this line
- Cannot make a static reference to the non-static method getText(int)
from the type Context
- The method getText(int) is undefined for the type DatabaseManager
I'm sure I've committed a glaringly obvious n00b error, but I just can't see it! Thanks for all help: if any other code snippets would help, let me know.
I have 1 function that I want to return the address of an assigned string to the main function and assign an new string pointer with the same address so that the new string will have the contents of the old string.
For example:
unknown_datatype function()
{
char *old = "THE STRING";
return old;
}
int main()
{
char *snew = "";
snew = function();
return 0;
}
*unknown_datatype means I don't know that to put there...
*How can I approach this without changing anything in the main() method
validates_format_of :email,
:with => /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/,
:message => "is missing or invalid"
Please let me know where is the problem? Is regular expression is wrong?
I have to following code. I want this to return an array e.g. arg[] that contains at arg[0] the number of the rows of my cursor and at arg[1] String(0) of my cursor. Since one is integer and the other is string I have a problem. Any ideas how to fix this?
public String[] getSubcategoriesRow(String id){
this.openDataBase();
String[] asColumnsToReturn = new String[] {SECOND_COLUMN_ID,SECOND_COLUMN_SUBCATEGORIES,};
Cursor cursor = this.dbSqlite.query(SECOND_TABLE_NAME, asColumnsToReturn, SECOND_COLUMN_SUBCATEGORIES + "= \"" + id + "\"", null, null, null, null);
String string = cursor.getString(0);
int count = cursor.getCount();
String arg[] = new String[]{count, string};
cursor.close();
return arg;
}
The cursor and the results and correct i just need to compine them to an array in order to return that.
Hey all,
I want to use \ in a string, like
string str="abc\xyz";
But this is giving me error.
I have also tried
string str="abc\\xyz";
But still it isnt working.
Can anyone help me out?
In a twitter RSS feed the pubDate is published as
Sat, Jun 5, 2010 19:20
Using PHP, whats the best way to convert this into the time lasped since published. For eaxmple,
posted 4 minutes ago
posted 1 hour ago
posted 4 hours ago
posted 1 day ago
posted 2 days ago
posted 1 month ago
posted 2 months ago
You help much appreciated
I am going to be writing documentation for two web services that I developed, and I started wondering what people on here do for documentation.
Do you create it in an HTML file so it can be viewed in the browser? Word document? Wiki? What do you guys/gals use?
I was originally leaning towards creating an HTML page since it seems a little more open and friendly than a word document. Plus I can use the prettify javascript to make code samples look nice. Our company has a Sharepoint though, so an HTML file may not be the best choice given that most documentation is put up in spreadsheets and word documents.
Let's say I have the following array (which is the returned value of a database query):
Array ( [0] => PHP [1] => Webdesign [2] => Wordpress [3] => Drupal [4])
And the following string:
Working With Wordpress Shortcodes
How can I compare the array with the string to see if the string contains any word stored in the array? (hopefully that made sense to you :d )
When he finds a match (eg: Wordpress) it should create a hashtag like so:
Working With #Wordpress Shortcodes
So I have this array, and I want to delete strings that are 2 or 4 characters in length (strings that contain 2 or 4 characters). I am doing this method, and it doesn't work, even though logically, it SHOULD work.
public static void main(String[] args)
{
ArrayList<String> list = new ArrayList<String>();
list.add("This");
list.add("is");
list.add("a");
list.add("test");
for (int i=0; i<list.size(); i++)
{
if(list.get(i).length()==2 || list.get(i).length()==4)
{
list.remove(i);
}
}
}
I'd like to stick to this method of doing it. Can you please give me some suggestions as to how to correct this code?
The output of this code when I run it is:
[is, a]
Even though I want the output to be
[a]
because "is" is 2 characters long.
My code tries to replace "," with "/" in a string. Should I escape "," in the regex string? Both of the two code snippets generated the same results, so I am confused.
Code snippet 1:
String test = "a,bc,def";
System.out.println(test.replaceAll("\\,", "/"));
Code snippet 2:
String test = "a,bc,def";
System.out.println(test.replaceAll(",", "/"));
Should I use "," or "\,"? Which is safer?
Thanks.
Hello,
I'll begin this question with the claim that I have read the java networking guide before asking you.
I do not understand how to READ the socket and get all the info summed up into a string.
the socket might contains more than 1 line [trying to make a chat].
Please do no refer me to any other site unless it clearly states "this exact line does this.."
because I failed to understand what this code part does
BufferedReader stdIn = new BufferedReader(
new InputStreamReader(System.in));
String userInput;
while ((userInput = stdIn.readLine()) != null) {
out.println(userInput);
System.out.println("echo: " + in.readLine());
}
Please, I just want to make a loop that will receive information from a socket, get all the content together into one string [I also want it to know where to add another line].
Thanks allot for anyone who helps, I have been trying to get an answer from tuts for hours and just failed to understand!
I want to write an windows application in c#.net in which I have to save hindi language fonts to the databases and reading them straight away.I have searched lots of websites and read about localization but couldn't make it through.Please help me.
Thanks
OK, I've got the code to allow me to index through the string resources. Now, how do I get the value of a specific resource item without knowing its name?
Here's the index loop:
Field[] fLst = R.string.class.getFields();
for(Field f : fLst){
Log.i(dbgTag, "Field Entry: R.string." + f.getName());
}
Thanks for your efforts ...
Hi everyone,i created an application that takes the excell output of a table.There are long numbers in table cell.When i took the output the cells that have long numbers are seen like that 1234+E34.how can i fix that?Thanks for advance...
I have a decimal variable which represents a donation amount. Currently I am displaying it on screen as a currency like so-
DonationAmount.ToString("C");
This gives the following output (given a US locale)
1 -> $1.00
2 -> $2.00
0.5 -> $0.50
I am happy with the first two example, but want to have "0.5" show as "50c".
My current solution is with a conditional-
if (DonationAmount > 1)
return (DonationAmount * 100m).ToString() + "c";
else
return DonationAmount.ToString("C");
Is there a better way?
Hi,
I've had to write an application that lists and plays tutorial videos along with accompanying text. It works well but since the videos are added by the user I need a way of checking to see whether or not a video can be played on the machine.
I'm not sure whether or not there is an easy way to try test the file (and catch errors) or if I need to start looking at codecs installed.
Does anybody have any experience with this?
I have an array of array in which each array is like:
clusterA gene1 1
clusterA gene2 0
clusterB gene1 1
clusterB gene2 0
I want to produce a file like:
name gene1 gene2
clusterA 1 0
clusterB 1 0
Current attempt:
if (condition) {
@array = ($cluster, $genes, "1");
}
elsif (not condition) {
@array = ($cluster, $genes, "0");
}
push @AoA, [ @array ];
@A0A is my array of array.