Say I have a query like the one below. What would be the best way to put each value into an array if I don't know how many results there will be? Normally I would do this with a loop, but I have no idea how many results there are. Would I need run another query to count the results first?
<CFQUERY name="alllocations" DATASOURCE="#DS#">
SELECT locationID
FROM tblProjectLocations
WHERE projectID = '#ProjectName#'
</CFQUERY>
I'm working on a calendar app and need to get the timestamps for the beginning of each day/month etc:
whats the best method?
//get timestamps for start of (day, month, year)
$ts_now = time();
$ts_today =
$ts_this_month =
$ts_this_year =
I do not want to change a string nor do I want to check if it contains white space. I want to check if the entire string is ONLY white space. What the best way to do that?
What are the best or most useful dev-related PowerShell modules that exist today? Not looking for sys admin management tools for Active Directory/Microsoft Exchange/etc., but more for development utilities.
Please list one module per answer, so they can be voted up accordingly.
I'll provide a few to start off.
I want to create a PDF file based on users' query result (in html table).
What is the best javascript/lib I can use for IE?
I found jsPDF but it does not support IE.
This is a pretty simple question. When I do this:
session.CreateCriteria(typeof(Product)).List();
The resulting list will load as I access it? Let's say, from 100 to 100 elements for example? Or will it load all once?
In the case it's not "virtual" how can I make it so? What's the best pratice about it?
Thanks;
Hi all,
I have designed my DB using the ORM in VS 2008.
What is the best way to export this to an SQL server so it will create the tables and relations on SQL Server?
Thanks,
JD
Hi!
let say i have a string like this "neverMindWhat is upneverMind" and I want to take out the What is up using regexp with JAVA. Someone told me that using matcher will be the best. Can anyone show me how to do it using Matcher?
Other solutions are welcome too!
Thanks!
how to get a Dictionary key by value in C#?
Dictionary<string, string> types = new Dictionary<string, string>()
{
{"1", "one"},
{"2", "two"},
{"3", "three"}
};
I want simething like this:
getByValueKey(string value);
getByValueKey("one") must be return "1".
What is the best way do this? may be HashTable, SortedLists?
I'm deleting selected rows from both table in MYSQL, the two tables have foreign keys.
delete d,b from A as b inner join B as d on b.bid=d.bid where b.name like '%xxxx%';
MYSQL complains about foreign keys even though I'm trying to delete from both tables:
Error: Cannot delete or update a parent row: a foreign key constraint fails (yyy/d, CONSTRAINT fk_d_bid FOREIGN KEY (bid) REFERENCES b (bid) ON DELETE NO ACTION ON UPDATE NO ACTION)
what's the best solution here to delete from both table?
By default you cannot access a file that is uploaded until it has been fully transferred to the server.
What is the best way to get round this and be able to access the 'byte stream' as the file upload is in progress?
I have a tab bar based application.
What is the best way to toggle between 2 different UITableView views?
Should I use a wrapper view and add those 2 views to it and depending on which segment
was chosen I will show the correct view?
Using only one tableView will not work because the layout is different between those
2 tableviews.
Thanks
What is the best way to implement real time updates in ruby on rails using node.js? It would be great to hear either real examples or your thoughts on alternative solutions.
I am thinking of moving my static .JS files to a CDN such as Amazon S3 for performance reasons. As my PHP files and mySQL DB remain on my primary hosting domain what is the best way to manage my JS AJAX requests if they are now cross domain?
Currently they look like this within my .JS file (with relative paths):
$.ajax({
type: "POST",
url: "/myNearbyPhpFile.php",
data: {data:someData},
success: function($r){}
});
Hi I'm new to ASP.NET MVC
and i want to create a class to contain site wide functions for my application
what is the best practice to do this?
where should i create the class ? in what folder?
should i create a new folder?
I'm creating a ASP.NET MVC 2 application that envolve a section like questions here in stackoverflow (mine is with exams is another kind of application but can be extrapolate to same general idea of SO).
OK I'm creating a cache per page, its mean something like this:
[OutputCache(Duration=60, VaryByParam="page")]
ActionResult AllQuestions(int page){...}
But i want to invalidate that cache when a new question is created. What can i do.
I'm open to suggestions, perhaps this is not the best way to solve this problem
Hi All,
I have a select box that gets cloned. I want to remove the user's previous selection from each cloned select box. Here is the method that does the clone() :
function addselect(s){
$('#product_categories > .category_block:last').after(
$('#product_categories > .category_block:last').clone()
); set_add_delete_links(); return false;
}
What's the best way to do this?
i got this SQL query where post_title taken from $_GET
$sql = "SELECT ID FROM $wpdb-posts WHERE $wpdb-posts.post_title = '5-desain-web-colourful'";
What is the best way to sanitize this and make it more safe ?
Hi there!
I have the following date: 2010-04-19 18:31:27. I would like to convert this date to the dd/mm/yyyy format.
Can anyone give me some help?
Thanks in advance for the help,
Best regards!
I need to create a simple Chat system like facebook chat and a twitter-like app.
What is the best concurrent program languages in this case ?
Erlang, Haskell, Scala or anything else ?
Thanks ^_^
I want to convert the db with innodb tables into myisam, all of them. How can I do these? there are some foreign keys exist among tables.
how can I make this in the best way?
Lets say i have a Shape object that has a constructor like this:
Shape( width, height, radius, depth )
Now, I just have a silly rect so i dont need redius and depth... is it okey to do
Shape myRect(50, 50, NULL, NULL) ?
I know its not the best idea and I should use inheritance and stuff but this is the mess im in so can i use NULL like this?
I'd like to do something like this:
def results = Item.findAll("from Item c, Tag b, ItemTag a where c = a.item and b = a.tag and (b.tag like :q or c.uri like :q) " + ob,[q:q])
def items = (Item) results[0..1][0]
but I get
Cannot cast object '[Ljava.lang.Object;@1e224a5' with class '[Ljava.lang.Object;' to class 'org.maflt.ibidem.Item'
I can get what I need with this, but it doesn't seem like it's the best solution:
def items = [] as Set
def cnt = results.size()
for (i=0;i<cnt-1;i++) { items << results[i][0] }
items = items as List