question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,222,255
6,222,288
Form validation, php and javascript
I have a form, as such I want to make sure the data is valid, so I have a php file I can make an ajax request to access a database, which returns xml as such If there is a matching name. There should be no name conflicts. "HTTP/1.1 404 File Not Found" is printed otherwise. After this is done, I want to reach search.php...
your scenario is similar to the followings, which im sure, you can churn to your own flavors. [1] http://www.the-art-of-web.com/javascript/ajax-validate/ [2] http://www.dev102.com/2008/05/21/create-interactive-form-validation-using-ajax/
Form validation, php and javascript I have a form, as such I want to make sure the data is valid, so I have a php file I can make an ajax request to access a database, which returns xml as such If there is a matching name. There should be no name conflicts. "HTTP/1.1 404 File Not Found" is printed otherwise. After this...
TITLE: Form validation, php and javascript QUESTION: I have a form, as such I want to make sure the data is valid, so I have a php file I can make an ajax request to access a database, which returns xml as such If there is a matching name. There should be no name conflicts. "HTTP/1.1 404 File Not Found" is printed oth...
[ "php", "javascript", "xml", "ajax" ]
1
0
180
1
0
2011-06-03T01:58:05.813000
2011-06-03T02:03:04.220000
6,222,276
6,222,418
what is this "QuartzCore... CA::Transaction::observer_callback.." in my Instruments Leaked Blocks History table?
what is this "QuartzCore... CA::Transaction::observer_callback.." in my Instruments Leaked Blocks History table? Note that I was creating some hardware memory warnings using the simulator when I was profiling this. QuartzCore CA::Transaction::observer_callback(__CFRunLoopObserver", unsigned long, void") from main:14 =>...
The function is from Core Animation. Usually when the mainloop completes a full pump and finally paints to the screen with Core Animation, the top level NSAutoreleasePool is flushed at that point. I'm not to date on the specific details of when it's supposed to happen, but in the UIApplicationMain function, a nested NS...
what is this "QuartzCore... CA::Transaction::observer_callback.." in my Instruments Leaked Blocks History table? what is this "QuartzCore... CA::Transaction::observer_callback.." in my Instruments Leaked Blocks History table? Note that I was creating some hardware memory warnings using the simulator when I was profilin...
TITLE: what is this "QuartzCore... CA::Transaction::observer_callback.." in my Instruments Leaked Blocks History table? QUESTION: what is this "QuartzCore... CA::Transaction::observer_callback.." in my Instruments Leaked Blocks History table? Note that I was creating some hardware memory warnings using the simulator w...
[ "iphone", "xcode", "memory-leaks", "xcode4", "instruments" ]
1
1
2,448
1
0
2011-06-03T02:00:21.163000
2011-06-03T02:30:05.300000
6,222,281
6,231,202
exception when calling ToList()
As continue to this question, I have this method: public IEnumerable Get(Guid companyId, long customerId) { CustomerRepository customersRep = new CustomerRepository(); var customers = customersRep.Get(companyId); return GetQuery().Join(customers, s => s.CustomerId, c => c.Id, (s, c) => new { s, c }). Where(sc => sc.c.I...
I think that the problem is your customers collection which you pass into the Join method. This collection isn't an IQueryable but an in-memory collection which EF will pull from the database first when your Join gets executed. It's an in-memory collection because you are using AsEnumerable() in your IEnumerable Get(Gu...
exception when calling ToList() As continue to this question, I have this method: public IEnumerable Get(Guid companyId, long customerId) { CustomerRepository customersRep = new CustomerRepository(); var customers = customersRep.Get(companyId); return GetQuery().Join(customers, s => s.CustomerId, c => c.Id, (s, c) => n...
TITLE: exception when calling ToList() QUESTION: As continue to this question, I have this method: public IEnumerable Get(Guid companyId, long customerId) { CustomerRepository customersRep = new CustomerRepository(); var customers = customersRep.Get(companyId); return GetQuery().Join(customers, s => s.CustomerId, c =>...
[ "c#", ".net", "entity-framework" ]
1
2
4,150
2
0
2011-06-03T02:01:20.413000
2011-06-03T18:32:59.490000
6,222,293
6,222,410
How can I run untrusted code on behalf of third parties?
I want to create a Java-based website that will execute completely untrusted code from third parties. This third-party code will need to be able to access websites on the Internet, but not, for example, attempt a DoS on them. I can choose the language, but if its obscure it will hurt adoption of the service I'm buildin...
Wait you all. There is no reason for @sanity to look for 3rd party solutions, because Java already has a policy mechanism which allows untrusted code to access only a given subset of the Java API. See package java.security and SecurityManager. It allows you to say the JVM, "this app must have permission to access this ...
How can I run untrusted code on behalf of third parties? I want to create a Java-based website that will execute completely untrusted code from third parties. This third-party code will need to be able to access websites on the Internet, but not, for example, attempt a DoS on them. I can choose the language, but if its...
TITLE: How can I run untrusted code on behalf of third parties? QUESTION: I want to create a Java-based website that will execute completely untrusted code from third parties. This third-party code will need to be able to access websites on the Internet, but not, for example, attempt a DoS on them. I can choose the la...
[ "java" ]
3
0
2,152
5
0
2011-06-03T02:04:17.940000
2011-06-03T02:28:33.910000
6,222,302
6,223,326
Changing the position of the thumb of the SeekBar using a different Button
I'm trying to move the position of the seekbar using a button. Basically I have a seekbar from 0 to 100. and I have button presents set up at arbitrary values (40,50,60 etc). When I try to set the progress on the seekbar via button, I get a fault.. I've already initialized the seekBar in the onCreate() method. SeekBar ...
You shouldn't need to put up another Seekbar. The initial one should be fine. Without the exception message and stack trace I'm not sure what is causing the crash. However, I just coded an example and works as you would expect. Perhaps by looking at my example you can identify your issue. SeekbarTest.java: package com....
Changing the position of the thumb of the SeekBar using a different Button I'm trying to move the position of the seekbar using a button. Basically I have a seekbar from 0 to 100. and I have button presents set up at arbitrary values (40,50,60 etc). When I try to set the progress on the seekbar via button, I get a faul...
TITLE: Changing the position of the thumb of the SeekBar using a different Button QUESTION: I'm trying to move the position of the seekbar using a button. Basically I have a seekbar from 0 to 100. and I have button presents set up at arbitrary values (40,50,60 etc). When I try to set the progress on the seekbar via bu...
[ "java", "android", "seekbar" ]
2
3
6,622
1
0
2011-06-03T02:05:46.737000
2011-06-03T05:29:48.673000
6,222,308
6,222,344
Java MouseListener Not Working
I am trying to get the console to print when the mouse is pressed within an object of class RenderCanvas which extends JPanel. However, I am getting no feedback when I press the mouse down in the window. Any suggestions as to what I might be able to change to make the MouseListener work? Here is my code: RenderCanvas C...
public void renderCanvas() is NOT a constructor. Change public void renderCanvas() to public RenderCanvas() Notice the upper-case "R" and the absence of the "void" return type
Java MouseListener Not Working I am trying to get the console to print when the mouse is pressed within an object of class RenderCanvas which extends JPanel. However, I am getting no feedback when I press the mouse down in the window. Any suggestions as to what I might be able to change to make the MouseListener work? ...
TITLE: Java MouseListener Not Working QUESTION: I am trying to get the console to print when the mouse is pressed within an object of class RenderCanvas which extends JPanel. However, I am getting no feedback when I press the mouse down in the window. Any suggestions as to what I might be able to change to make the Mo...
[ "java", "swing", "mouseevent", "jpanel", "mouselistener" ]
0
2
1,592
3
0
2011-06-03T02:06:54.117000
2011-06-03T02:13:57.380000
6,222,309
6,222,315
Why am I being told my mySQLi object is a 'non-object'?
I'm trying to build a website using object-oriented functionality, and running into some issues. The one that is currently vexing me is an error message that I can't solve: Fatal error: Call to a member function real_escape_string() on a non-object in /home/rilbur5/public_html/tutor/login.php on line 41 function get_us...
I think you need to use $this->db_link, since you're trying to access the MySQLi object within the class.
Why am I being told my mySQLi object is a 'non-object'? I'm trying to build a website using object-oriented functionality, and running into some issues. The one that is currently vexing me is an error message that I can't solve: Fatal error: Call to a member function real_escape_string() on a non-object in /home/rilbur...
TITLE: Why am I being told my mySQLi object is a 'non-object'? QUESTION: I'm trying to build a website using object-oriented functionality, and running into some issues. The one that is currently vexing me is an error message that I can't solve: Fatal error: Call to a member function real_escape_string() on a non-obje...
[ "mysqli", "php" ]
0
1
112
1
0
2011-06-03T02:07:08.633000
2011-06-03T02:08:58.043000
6,222,312
6,222,369
How do I convert a generically cached object into a specific one in android
I have an object caching class that can save an object in memory, the problem arises when I try to retreive it later. How do I output a generic Object and then put it into a defined object on the other end. Here is the class public class ObjectCache implements Serializable{ private static final long serialVersionUID =...
If you are sure that the object that the ObjectCache will return is a Session object all you have to do is cast it: //get object back Session session = (Session) objectCache.getObject(); This will throw a ClassCastException (unchecked) if the getObject() method does not return a Session object.
How do I convert a generically cached object into a specific one in android I have an object caching class that can save an object in memory, the problem arises when I try to retreive it later. How do I output a generic Object and then put it into a defined object on the other end. Here is the class public class Object...
TITLE: How do I convert a generically cached object into a specific one in android QUESTION: I have an object caching class that can save an object in memory, the problem arises when I try to retreive it later. How do I output a generic Object and then put it into a defined object on the other end. Here is the class p...
[ "android", "caching", "object", "objectcache" ]
0
2
508
1
0
2011-06-03T02:07:25.403000
2011-06-03T02:19:33.303000
6,222,316
6,222,379
Navigation application with UIWebView and UITableView
I'm trying to create an application with a UITableView and when selection a row going to another view that containing a UIWebView that will load some website(passing in the row). but i still got this log: Unknown scheme, doing nothing: My code is below: // RootViewController.h #import @interface RootViewController: UI...
You will need to add http:// to those urls. They aren't automatically prepended with it.
Navigation application with UIWebView and UITableView I'm trying to create an application with a UITableView and when selection a row going to another view that containing a UIWebView that will load some website(passing in the row). but i still got this log: Unknown scheme, doing nothing: My code is below: // RootViewC...
TITLE: Navigation application with UIWebView and UITableView QUESTION: I'm trying to create an application with a UITableView and when selection a row going to another view that containing a UIWebView that will load some website(passing in the row). but i still got this log: Unknown scheme, doing nothing: My code is b...
[ "iphone", "uitableview", "uiwebview", "uinavigationcontroller" ]
1
1
853
1
0
2011-06-03T02:09:00.320000
2011-06-03T02:22:15.390000
6,222,320
6,222,666
How to know list of Mondays dates in a month using NSCalendar?
I would like to know the dates of all Monday's in a month using NSCalendar in Objective-C. So Please help me. Thanks in advance
From https://discussions.apple.com/thread/1700102?start=0&tstart=0 and the Apple NSCalendar reference: How about using something like this - NSDateComponents *comps = [[NSDateComponents alloc] init]; [comps setYear:1965]; // Year of the calendar month [comps setMonth:1]; // Month [comps setDay:6]; // Any day NSDate *da...
How to know list of Mondays dates in a month using NSCalendar? I would like to know the dates of all Monday's in a month using NSCalendar in Objective-C. So Please help me. Thanks in advance
TITLE: How to know list of Mondays dates in a month using NSCalendar? QUESTION: I would like to know the dates of all Monday's in a month using NSCalendar in Objective-C. So Please help me. Thanks in advance ANSWER: From https://discussions.apple.com/thread/1700102?start=0&tstart=0 and the Apple NSCalendar reference:...
[ "objective-c" ]
0
0
147
2
0
2011-06-03T02:09:26.107000
2011-06-03T03:25:48.477000
6,222,323
6,222,324
LINQ to Objects - NOT IN query
I have two string arrays (let call them “AllEmployees”, and “ActiveEmployees”) that I’d like to compare with LINQ to find all inactive employees (basically all those in AllEmployees that aren’t in ActiveEmployees. How can I do that using LinQ? Thanks!
How about?: var inactiveEmployees = AllEmployees.Except(ActiveEmployees); System.Linq.Enumerable.Except
LINQ to Objects - NOT IN query I have two string arrays (let call them “AllEmployees”, and “ActiveEmployees”) that I’d like to compare with LINQ to find all inactive employees (basically all those in AllEmployees that aren’t in ActiveEmployees. How can I do that using LinQ? Thanks!
TITLE: LINQ to Objects - NOT IN query QUESTION: I have two string arrays (let call them “AllEmployees”, and “ActiveEmployees”) that I’d like to compare with LINQ to find all inactive employees (basically all those in AllEmployees that aren’t in ActiveEmployees. How can I do that using LinQ? Thanks! ANSWER: How about?...
[ "linq" ]
1
10
668
1
0
2011-06-02T19:31:16.947000
2011-06-02T20:05:25.050000
6,222,326
6,222,514
How to find Scope for ManagementScope?
Anyone know how to find Scope? Microsoft say ManagementScope scope = new ManagementScope("\\\\FullComputerName\\root\\cimv2"); I work in localhost. I already test "\\HOSTNAME\root\cimv2" and "\\HOSTNAME\MY_ACCOUNT_NAME\cimv2" but they doesn't work. I'm on Windows 7 Pro, I use Visual Studio 2010 and it's.NET 4 # Update ...
I've been developing an application that uses Management Scopes for quite some time now. I think you just have to omit the Host Name. This works for me: ManagementScope scope = new ManagementScope("\\root\\cimv2"); scope.Connect();
How to find Scope for ManagementScope? Anyone know how to find Scope? Microsoft say ManagementScope scope = new ManagementScope("\\\\FullComputerName\\root\\cimv2"); I work in localhost. I already test "\\HOSTNAME\root\cimv2" and "\\HOSTNAME\MY_ACCOUNT_NAME\cimv2" but they doesn't work. I'm on Windows 7 Pro, I use Visu...
TITLE: How to find Scope for ManagementScope? QUESTION: Anyone know how to find Scope? Microsoft say ManagementScope scope = new ManagementScope("\\\\FullComputerName\\root\\cimv2"); I work in localhost. I already test "\\HOSTNAME\root\cimv2" and "\\HOSTNAME\MY_ACCOUNT_NAME\cimv2" but they doesn't work. I'm on Windows...
[ "c#", "scope" ]
0
2
4,016
1
0
2011-06-03T02:10:49.530000
2011-06-03T02:54:33.020000
6,222,327
6,222,354
How to tell EF4 to load specific related objects?
For example, i have a class Unit it has one object City. Unit also has Category object. How to tell EF4 to load City object using this similar linq query, but not Category? from u in db.Units orderby u.Name select u
You can indicate that those should be included, like so: from u in db.Units.Include("City") orderby u.Name select u I believe this can also be done like this: db.Units.Include(u => u.City).OrderBy(u => u.Name);
How to tell EF4 to load specific related objects? For example, i have a class Unit it has one object City. Unit also has Category object. How to tell EF4 to load City object using this similar linq query, but not Category? from u in db.Units orderby u.Name select u
TITLE: How to tell EF4 to load specific related objects? QUESTION: For example, i have a class Unit it has one object City. Unit also has Category object. How to tell EF4 to load City object using this similar linq query, but not Category? from u in db.Units orderby u.Name select u ANSWER: You can indicate that those...
[ "entity-framework", "linq-to-sql", "entity-framework-4" ]
2
3
61
1
0
2011-06-03T02:10:55.187000
2011-06-03T02:16:08.650000
6,222,345
6,254,210
Symfony project with models stored in multiple databases
I am writing Symfony project (using symfony 1.4 ver. with Propel as its ORM) where some data is stored in MySQL database and some other data is stored on another server in PostgreSQL database. To be more precise I want to store some models in MySQL database and other models in PostgreSQL database at the same time and d...
i work with symfony every day and in fact you can have 2 databases in order to store unrelated parts of the model. You need to set up both connection in you database.yml (i'm unfamiliar with posgress so you will have to figure out how to set it up correclty): mysql_connection: class: sfPropelDatabase param: phptype: my...
Symfony project with models stored in multiple databases I am writing Symfony project (using symfony 1.4 ver. with Propel as its ORM) where some data is stored in MySQL database and some other data is stored on another server in PostgreSQL database. To be more precise I want to store some models in MySQL database and o...
TITLE: Symfony project with models stored in multiple databases QUESTION: I am writing Symfony project (using symfony 1.4 ver. with Propel as its ORM) where some data is stored in MySQL database and some other data is stored on another server in PostgreSQL database. To be more precise I want to store some models in My...
[ "symfony1", "symfony-1.4", "propel", "multiple-databases" ]
2
2
923
2
0
2011-06-03T02:14:05.143000
2011-06-06T15:18:55.957000
6,222,360
6,222,465
ASP.NET Get Web Response when HTTP Status is NOT 200 OK
I need to read the response from an HTTP GET in situations where the Response Status code is not 200 OK. Sometimes it is 401, other 403, however there will be a Response content. If I try to use the HttpWebResponse and HttpWebRequest classes, it throws an exception when the response status is not 200 OK. Any suggestion...
var request = (HttpWebRequest)WebRequest.Create("http://stackoverflow.com/1"); try { using (WebResponse response = request.GetResponse()) { // Success } } catch (WebException e) { using (WebResponse response = e.Response) { HttpWebResponse httpResponse = (HttpWebResponse)response; Console.WriteLine("Error code: {0}", h...
ASP.NET Get Web Response when HTTP Status is NOT 200 OK I need to read the response from an HTTP GET in situations where the Response Status code is not 200 OK. Sometimes it is 401, other 403, however there will be a Response content. If I try to use the HttpWebResponse and HttpWebRequest classes, it throws an exceptio...
TITLE: ASP.NET Get Web Response when HTTP Status is NOT 200 OK QUESTION: I need to read the response from an HTTP GET in situations where the Response Status code is not 200 OK. Sometimes it is 401, other 403, however there will be a Response content. If I try to use the HttpWebResponse and HttpWebRequest classes, it ...
[ "c#", ".net", "asp.net", "http", "httpwebrequest" ]
16
40
19,726
1
0
2011-06-03T02:18:06.677000
2011-06-03T02:42:22.333000
6,222,365
6,222,742
use Logger.getLogger() every time I need it or create once per class
I am using Java util Logger. According to the documentation for Logger.getLogger method, it says, "Find or create a logger for a named subsystem. If a logger has already been created with the given name it is returned. Otherwise a new logger is created.". Would there still be any benefit in calling it only once per cla...
There are two not-very-important reasons why having a single static (probably final) instance is better than calling getLogger all the time. It makes the code slightly easier to read (in my opinion). There is a very small performance penalty you pay if you call Logger.getLogger all the time. It's not something to worry...
use Logger.getLogger() every time I need it or create once per class I am using Java util Logger. According to the documentation for Logger.getLogger method, it says, "Find or create a logger for a named subsystem. If a logger has already been created with the given name it is returned. Otherwise a new logger is create...
TITLE: use Logger.getLogger() every time I need it or create once per class QUESTION: I am using Java util Logger. According to the documentation for Logger.getLogger method, it says, "Find or create a logger for a named subsystem. If a logger has already been created with the given name it is returned. Otherwise a ne...
[ "java", "java.util.logging" ]
9
6
26,338
2
0
2011-06-03T02:18:57.333000
2011-06-03T03:42:30.887000
6,222,372
6,222,453
Calculation problem in Java
I'm having slight difficulty in performing a calculation in Java. Here is what I'm trying to do - ((0.053800 * (500000/1000)) + 4) * 0.85 In my java application, it returns 26.264999999999997, which if you round up to 2 decimal places, becomes 26.26. But in MS Excel, the same formula returns 26.265000.. and therefore t...
The following is a much better approximation, which results in the same value in this case: import java.math.BigDecimal; import java.math.MathContext; public class Test { public static void main(String[] args) { //double d = ((0.053800 * (500000/1000)) + 4) * 0.85; BigDecimal d = ((new BigDecimal(0.053800).multiply(ne...
Calculation problem in Java I'm having slight difficulty in performing a calculation in Java. Here is what I'm trying to do - ((0.053800 * (500000/1000)) + 4) * 0.85 In my java application, it returns 26.264999999999997, which if you round up to 2 decimal places, becomes 26.26. But in MS Excel, the same formula returns...
TITLE: Calculation problem in Java QUESTION: I'm having slight difficulty in performing a calculation in Java. Here is what I'm trying to do - ((0.053800 * (500000/1000)) + 4) * 0.85 In my java application, it returns 26.264999999999997, which if you round up to 2 decimal places, becomes 26.26. But in MS Excel, the sa...
[ "java", "floating-point", "double" ]
7
4
7,264
2
0
2011-06-03T02:20:24.937000
2011-06-03T02:40:32.367000
6,222,373
6,222,406
Scraping html table with images using XML R package
I want to scrape html tables using the XML package of R, in a similar way to discussed on this thread: Scraping html tables into R data frames using the XML package The main difference with the data I want to extract, is that I also want text relating to an image in the html table. For example the table at http://www.t...
I was able to find the Xpath query to the image name using SelectorGadeget library(XML) library(RCurl) d = htmlParse(getURL("http://www.theplantlist.org/tpl/record/kew-422570")) path = '//*[contains(concat( " ", @class, " " ), concat( " ", "synonyms", " " ))]//img' xpathSApply(d, path, xmlAttrs)["src",] [1] "/img/H.p...
Scraping html table with images using XML R package I want to scrape html tables using the XML package of R, in a similar way to discussed on this thread: Scraping html tables into R data frames using the XML package The main difference with the data I want to extract, is that I also want text relating to an image in t...
TITLE: Scraping html table with images using XML R package QUESTION: I want to scrape html tables using the XML package of R, in a similar way to discussed on this thread: Scraping html tables into R data frames using the XML package The main difference with the data I want to extract, is that I also want text relatin...
[ "r", "xml", "web-scraping", "html-table" ]
3
4
2,011
3
0
2011-06-03T02:20:57.010000
2011-06-03T02:27:52.953000
6,222,381
6,224,703
The best way to store a python list to a database?
What would be the best way of storing a python list of numbers (such as [4, 7, 10, 39, 91]) to a database? I am using the Pyramid framework with SQLAlchemy to communicate to a database. Thanks!
Well conceptually you can store a list as a bunch of rows in a table using a one-to-many relation, or you can focus on how to store a list in a particular database backend. For example postgres can store an array in a particular cell using the sqlalchemy.dialects.postgres.ARRAY data type which can serialize a python ar...
The best way to store a python list to a database? What would be the best way of storing a python list of numbers (such as [4, 7, 10, 39, 91]) to a database? I am using the Pyramid framework with SQLAlchemy to communicate to a database. Thanks!
TITLE: The best way to store a python list to a database? QUESTION: What would be the best way of storing a python list of numbers (such as [4, 7, 10, 39, 91]) to a database? I am using the Pyramid framework with SQLAlchemy to communicate to a database. Thanks! ANSWER: Well conceptually you can store a list as a bunc...
[ "python", "database", "sqlalchemy", "pyramid" ]
8
8
18,481
4
0
2011-06-03T02:22:34.780000
2011-06-03T08:25:04.103000
6,222,383
6,222,416
Convert 1D vector to 2D vector
I got a compiling error when using std::copy to convert a 1D vector to a 2D vector. int main() { std::vector< std::vector > v2D(10, std::vector (10, 0.0)); std::vector v1D(100, 0.0); for (int i = 0; i < 100; ++i) v1D.push_back(i); for (unsigned int j = 0; j < 10; j++) { std::copy(v1D.begin() + j * 10, v1D.begin() + (...
std::back_inserter takes a container, not an iterator. Change std::back_inserter(v2D[j].begin()) to std::back_inserter(v2D[j]). Note that this will be calling.push_back() on the std::vector at v2D[j], so you probably also want to change std::vector< std::vector > v2D(10, std::vector (10, 0.0)); to std::vector< std::vec...
Convert 1D vector to 2D vector I got a compiling error when using std::copy to convert a 1D vector to a 2D vector. int main() { std::vector< std::vector > v2D(10, std::vector (10, 0.0)); std::vector v1D(100, 0.0); for (int i = 0; i < 100; ++i) v1D.push_back(i); for (unsigned int j = 0; j < 10; j++) { std::copy(v1D.be...
TITLE: Convert 1D vector to 2D vector QUESTION: I got a compiling error when using std::copy to convert a 1D vector to a 2D vector. int main() { std::vector< std::vector > v2D(10, std::vector (10, 0.0)); std::vector v1D(100, 0.0); for (int i = 0; i < 100; ++i) v1D.push_back(i); for (unsigned int j = 0; j < 10; j++) ...
[ "c++", "vector", "copy" ]
0
4
1,222
1
0
2011-06-03T02:23:06.340000
2011-06-03T02:29:30.097000
6,222,384
6,222,757
Possible to get "Owner" contact info in Android?
I haven't been able to find a straight answer on this. Can anyone tell me if it's possible to get the contact info of the phone's owner in an Android App?
So the answer is technically no. The only way I've found so far to get owner's data is through the account manager. Here's an example of how to use it: final AccountManager manager = AccountManager.get(this); final Account[] accounts = manager.getAccountsByType("com.google"); final int size = accounts.length; String[] ...
Possible to get "Owner" contact info in Android? I haven't been able to find a straight answer on this. Can anyone tell me if it's possible to get the contact info of the phone's owner in an Android App?
TITLE: Possible to get "Owner" contact info in Android? QUESTION: I haven't been able to find a straight answer on this. Can anyone tell me if it's possible to get the contact info of the phone's owner in an Android App? ANSWER: So the answer is technically no. The only way I've found so far to get owner's data is th...
[ "android", "android-contacts" ]
9
12
13,341
5
0
2011-06-03T02:23:23.280000
2011-06-03T03:45:40.903000
6,222,385
6,222,439
Binary File Input,Output and Append C++
I'm trying a basic input,output(and append) in C++ here is my code #include #include #include #include using namespace std; void escribir(const char *); void leer(const char *); int main () { escribir("example.bin"); leer("example.bin"); system("pause"); return 0; } void escribir(const char *archivo) { ofstream file...
The problem doesn't seem to be with writing the file but rather with reading and displaying it, namely here: memblock = new char [size]; file.seekg (0, ios::beg); file.read (memblock, size); file.close(); cout<< memblock< Displaying with cout expects the string to be null terminated. But you only allocated enough space...
Binary File Input,Output and Append C++ I'm trying a basic input,output(and append) in C++ here is my code #include #include #include #include using namespace std; void escribir(const char *); void leer(const char *); int main () { escribir("example.bin"); leer("example.bin"); system("pause"); return 0; } void escri...
TITLE: Binary File Input,Output and Append C++ QUESTION: I'm trying a basic input,output(and append) in C++ here is my code #include #include #include #include using namespace std; void escribir(const char *); void leer(const char *); int main () { escribir("example.bin"); leer("example.bin"); system("pause"); retur...
[ "c++", "input", "stream", "append" ]
2
5
5,164
2
0
2011-06-03T02:23:28.710000
2011-06-03T02:37:07.860000
6,222,387
6,222,429
Facebook PHP SDK/Graph API - Returning MY name/info, but not anyone elses?
I'm trying to use the Graph API and the PHP SDK for Facebook to try and return the current users name, but I'm only having luck with it displaying my name. This is pretty straight forward and someone that knows the Graph API shouldn't have any problem helping me out just by looking at the code I'm using. require 'faceb...
For security and privacy as well, Facebook users must login and allow the current application to have access to their account information. You can accomplish this using different SDK. Most people use Javascript but I persoally prefer PHP. As simple implementation in HTML is shown below: 'email,read_stream,publish_strea...
Facebook PHP SDK/Graph API - Returning MY name/info, but not anyone elses? I'm trying to use the Graph API and the PHP SDK for Facebook to try and return the current users name, but I'm only having luck with it displaying my name. This is pretty straight forward and someone that knows the Graph API shouldn't have any p...
TITLE: Facebook PHP SDK/Graph API - Returning MY name/info, but not anyone elses? QUESTION: I'm trying to use the Graph API and the PHP SDK for Facebook to try and return the current users name, but I'm only having luck with it displaying my name. This is pretty straight forward and someone that knows the Graph API sh...
[ "php", "facebook-graph-api", "facebook-php-sdk" ]
1
4
8,615
3
0
2011-06-03T02:23:55.700000
2011-06-03T02:33:36.530000
6,222,389
6,222,541
Append DOM issue when new objects loaded
I have a function that is live on click and it gets a bunch of messages and loads them in. The problem is, after that I would like to append a link at the bottom box, after the messages are loaded into that box but after the messages load, it appends the link before them. Does anyone see anything wrong with my code? I ...
The issue is that $.getJSON is not a synchronous request, so what is happening is that you are sending off the ajax request, then appending the link straight away, and then when the AJAX request returns, the messages are loaded after the link. Move your link append into the AJAX callback to fix this.
Append DOM issue when new objects loaded I have a function that is live on click and it gets a bunch of messages and loads them in. The problem is, after that I would like to append a link at the bottom box, after the messages are loaded into that box but after the messages load, it appends the link before them. Does a...
TITLE: Append DOM issue when new objects loaded QUESTION: I have a function that is live on click and it gets a bunch of messages and loads them in. The problem is, after that I would like to append a link at the bottom box, after the messages are loaded into that box but after the messages load, it appends the link b...
[ "jquery" ]
0
1
50
1
0
2011-06-03T02:24:14.920000
2011-06-03T02:59:10.517000
6,222,392
6,235,063
Is there a way for mongoid to use integer(number) as a default id rather than long hash value?
I just want to have default characteristic of ActiveRecord which uses incremental integers as id to reduce the length of the url. For example, first article created will have url like "app.com/articles/1" which is default in ActiveRecord. Is there any gem that supports this in mongoid?
You could always generate shorter, unique tokens to identify each of your records (as an alternative to slugging), since your goal is just to reduce the length of the URL. I've recently (today) written a gem - mongoid_token which should take any of the hard work out of creating unique tokens for your mongoid documents....
Is there a way for mongoid to use integer(number) as a default id rather than long hash value? I just want to have default characteristic of ActiveRecord which uses incremental integers as id to reduce the length of the url. For example, first article created will have url like "app.com/articles/1" which is default in ...
TITLE: Is there a way for mongoid to use integer(number) as a default id rather than long hash value? QUESTION: I just want to have default characteristic of ActiveRecord which uses incremental integers as id to reduce the length of the url. For example, first article created will have url like "app.com/articles/1" wh...
[ "ruby-on-rails", "ruby", "mongoid" ]
7
6
4,176
3
0
2011-06-03T02:24:39.723000
2011-06-04T06:00:49.493000
6,222,401
6,223,506
Getting only 1 record from each category for each page in pagination
My table structure is as follows id int name varchar 50 catid int Sample data id name catid --------------------------------------------------------- 1 AAA 1 2 BBB 1 3 CCC 1 4 DDD 2 5 EEE 2 6 FFF 1 7 GGG 2 8 HHH 2 9 III 1 I want query such as it get me 1 row from each category for each page in pagination Now for 1st Pa...
This worked for me (MySQL 5.1 on Linux) SELECT id, name, catid FROM (SELECT id, name, catid FROM t WHERE catid=1 LIMIT 2,1) AS t1 UNION (SELECT id, name, catid FROM t WHERE catid=2 LIMIT 2,1) ORDER BY catid The 2 in the limit is the page number. Hence the output of this one is for the second page.
Getting only 1 record from each category for each page in pagination My table structure is as follows id int name varchar 50 catid int Sample data id name catid --------------------------------------------------------- 1 AAA 1 2 BBB 1 3 CCC 1 4 DDD 2 5 EEE 2 6 FFF 1 7 GGG 2 8 HHH 2 9 III 1 I want query such as it get m...
TITLE: Getting only 1 record from each category for each page in pagination QUESTION: My table structure is as follows id int name varchar 50 catid int Sample data id name catid --------------------------------------------------------- 1 AAA 1 2 BBB 1 3 CCC 1 4 DDD 2 5 EEE 2 6 FFF 1 7 GGG 2 8 HHH 2 9 III 1 I want quer...
[ "mysql" ]
1
0
195
3
0
2011-06-03T02:25:57.173000
2011-06-03T05:59:26.733000
6,222,402
6,231,875
What is the correct way to rebrand an iPhone app within a single xCode project?
I've been asked to write scope the effort for rebranding a significant iPhone/iPad application for multiple customers, locale, languages, etc. Each incarnation of the rebrand might include different look and feel, possibly different behavior, or subsets of functionality. My initial impression is it should be possible t...
The feature I've been looking for is called "Targets" in xCode. I'm going to use these as described here to deploy my single project into multiple binaries.
What is the correct way to rebrand an iPhone app within a single xCode project? I've been asked to write scope the effort for rebranding a significant iPhone/iPad application for multiple customers, locale, languages, etc. Each incarnation of the rebrand might include different look and feel, possibly different behavio...
TITLE: What is the correct way to rebrand an iPhone app within a single xCode project? QUESTION: I've been asked to write scope the effort for rebranding a significant iPhone/iPad application for multiple customers, locale, languages, etc. Each incarnation of the rebrand might include different look and feel, possibly...
[ "iphone", "objective-c", "xcode", "ipad", "ios4" ]
0
1
575
3
0
2011-06-03T02:26:46.510000
2011-06-03T19:41:08.497000
6,222,409
6,222,826
Constructing Borders Around Adjacent Elements
Is it possible to have a continuous border around adjacent html elements that have different heights? I have tried overlapping the elements by the border width and setting the left border of the second element to white, but this creates a black/white bevel on the corner ( http://jsfiddle.net/h4FwJ/ ). I would like to a...
Change the div1 style to this border-left-width:0px; margin-left: -10px; background-color:White;
Constructing Borders Around Adjacent Elements Is it possible to have a continuous border around adjacent html elements that have different heights? I have tried overlapping the elements by the border width and setting the left border of the second element to white, but this creates a black/white bevel on the corner ( h...
TITLE: Constructing Borders Around Adjacent Elements QUESTION: Is it possible to have a continuous border around adjacent html elements that have different heights? I have tried overlapping the elements by the border width and setting the left border of the second element to white, but this creates a black/white bevel...
[ "html", "css", "border" ]
0
3
210
1
0
2011-06-03T02:28:16.573000
2011-06-03T04:00:26.890000
6,222,411
6,224,824
Higher half kernel initialization
When initializing my kernel, I have a few things that need to happen: 1) paging needs to be enabled, 2) the physical memory manager needs to parse the memory map from grub, and 3) assorted startup code needs to access data that needs to stay there for later (e.g. the GDT, IDT, memory management structures). The depende...
This is how I tackled this problem: My kernel image is loaded by GRUB at (physical) address 0x01000000 (16MB, just above the ISA DMA region). This image basically consists of two parts: An "early init" section. This section contains code that is executed to prepare to jump to the higher half kernel. I also reserve some...
Higher half kernel initialization When initializing my kernel, I have a few things that need to happen: 1) paging needs to be enabled, 2) the physical memory manager needs to parse the memory map from grub, and 3) assorted startup code needs to access data that needs to stay there for later (e.g. the GDT, IDT, memory m...
TITLE: Higher half kernel initialization QUESTION: When initializing my kernel, I have a few things that need to happen: 1) paging needs to be enabled, 2) the physical memory manager needs to parse the memory map from grub, and 3) assorted startup code needs to access data that needs to stay there for later (e.g. the ...
[ "kernel", "bootstrapping", "virtual-memory", "osdev" ]
7
7
3,345
1
0
2011-06-03T02:28:46.917000
2011-06-03T08:39:34.127000
6,222,414
6,222,763
Oracle ALTER SESSION ADVISE COMMIT?
My app to recovers automatically from failures. I test it as follows: Start app In the middle of processing, kill the application server host (shutdown -r -f) On host reboot, application server restarts (as a windows service) Application restarts Application tries to process, but is blocked by incomplete 2-phase commit...
Can you clarify the role of the 'local' and 'remote' databases in your scenario. Generally a multi-db transaction does the following Starts the transaction Makes a change on on database Makes a change on the other database Gets the other database to 'promise to commit' Commits locally Gets the remote db to commit In do...
Oracle ALTER SESSION ADVISE COMMIT? My app to recovers automatically from failures. I test it as follows: Start app In the middle of processing, kill the application server host (shutdown -r -f) On host reboot, application server restarts (as a windows service) Application restarts Application tries to process, but is ...
TITLE: Oracle ALTER SESSION ADVISE COMMIT? QUESTION: My app to recovers automatically from failures. I test it as follows: Start app In the middle of processing, kill the application server host (shutdown -r -f) On host reboot, application server restarts (as a windows service) Application restarts Application tries t...
[ "oracle", "2phase-commit" ]
1
3
3,496
1
0
2011-06-03T02:29:16.353000
2011-06-03T03:46:14.053000
6,222,427
6,222,723
htaccess redirect subfolders also
I am new to htaccess rules. I have tried to search about my questionm but couldn't get the answer, so I am writing the question here. I have the following htaccess file in my root folder of my php application RewriteCond %{HTTP_HOST} www.mydomain.com RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L] RewriteCond %{...
Your rewrite condition is applying every url to your domain. What you can do exclude image files from this. I think using this will help RewriteCond %{REQUEST_URI}!^(images)
htaccess redirect subfolders also I am new to htaccess rules. I have tried to search about my questionm but couldn't get the answer, so I am writing the question here. I have the following htaccess file in my root folder of my php application RewriteCond %{HTTP_HOST} www.mydomain.com RewriteRule (.*) http://www.mydomai...
TITLE: htaccess redirect subfolders also QUESTION: I am new to htaccess rules. I have tried to search about my questionm but couldn't get the answer, so I am writing the question here. I have the following htaccess file in my root folder of my php application RewriteCond %{HTTP_HOST} www.mydomain.com RewriteRule (.*) ...
[ "php", "apache", ".htaccess", "redirect", "url-rewriting" ]
0
0
288
1
0
2011-06-03T02:33:05.167000
2011-06-03T03:38:09.140000
6,222,441
6,222,471
<FORM> posting to <IFRAME> causes pop up window in IE7 only
I'm construction a iframe and form with jQuery as such: iframe = $(" ", {name: "foo"}); form = $(" ", { target: $iframe.attr("name"), action: "/foobar", method: "POST" }).append($(" ", { type: "submit", name: "amifully", value: "dressed" }).hide()); $("body").append(iframe).append(form); form.submit(); For some reason,...
Ahhh! I figured it out! Basically, IE7 freaks out when you try to add name attributes to elements with jQuery... you have to create the name in the raw string as such: iframe = $(" "); It was such a subtle thing! Hope this helps prevent someone else from spending 5 hours scouring the internet for an answer.
<FORM> posting to <IFRAME> causes pop up window in IE7 only I'm construction a iframe and form with jQuery as such: iframe = $(" ", {name: "foo"}); form = $(" ", { target: $iframe.attr("name"), action: "/foobar", method: "POST" }).append($(" ", { type: "submit", name: "amifully", value: "dressed" }).hide()); $("body")....
TITLE: <FORM> posting to <IFRAME> causes pop up window in IE7 only QUESTION: I'm construction a iframe and form with jQuery as such: iframe = $(" ", {name: "foo"}); form = $(" ", { target: $iframe.attr("name"), action: "/foobar", method: "POST" }).append($(" ", { type: "submit", name: "amifully", value: "dressed" }).h...
[ "jquery", "html", "iframe", "internet-explorer-7" ]
2
6
2,386
1
0
2011-06-03T02:37:20.210000
2011-06-03T02:44:25.917000
6,222,442
6,222,801
Overlay images on a GridLayout in Java
Is it possible to have one set of images be the "background image" of a gridlayout and other images be the "content" of the gridlayout? If not, what's the best way to do it?
Is it possible to have the background image resize with the rest? Yes, drawImage() can scale to the full size of the container, as shown here. Is it possible to set the background image of each cell? Yes, getSubimage() is helpful in this context, as shown here.
Overlay images on a GridLayout in Java Is it possible to have one set of images be the "background image" of a gridlayout and other images be the "content" of the gridlayout? If not, what's the best way to do it?
TITLE: Overlay images on a GridLayout in Java QUESTION: Is it possible to have one set of images be the "background image" of a gridlayout and other images be the "content" of the gridlayout? If not, what's the best way to do it? ANSWER: Is it possible to have the background image resize with the rest? Yes, drawImage...
[ "java", "image", "swing", "grid-layout" ]
3
4
6,018
2
0
2011-06-03T02:37:40.410000
2011-06-03T03:54:54.443000
6,222,443
6,222,496
PHP get information if the network isn't in service
I use gravatar for images in my website, but if the network is bad, I would like to know that and use images in other ways. So how can I know if a particular website is not in service?
No need for complex socket and other remote processing. You can verify if the returned image is indeed an image using the PHP GD library: if(!$size = getimagesize($filename) ) { $image = 'images/default.jpg'; }
PHP get information if the network isn't in service I use gravatar for images in my website, but if the network is bad, I would like to know that and use images in other ways. So how can I know if a particular website is not in service?
TITLE: PHP get information if the network isn't in service QUESTION: I use gravatar for images in my website, but if the network is bad, I would like to know that and use images in other ways. So how can I know if a particular website is not in service? ANSWER: No need for complex socket and other remote processing. ...
[ "php", "gravatar" ]
1
1
99
4
0
2011-06-03T02:37:41.690000
2011-06-03T02:50:55.727000
6,222,456
6,231,165
Opening BBMaps from browser on BlackBerry OS 5+
I have been totally unable to open BBMaps from the BlackBerry browser from BBOS5 devices using the approach their documentation indicates. Is this functionality really broken - is the documentation really that wrong? Or am I doing something wrong? Support for doing just this was added in BBOS 4.5 and allegedly exists t...
So! The answer lies in disregarding all of that and using the BlackBerry Javascript API. Just create the address as a json object according to the spec, and call blackberry.launch.newMap like so: I knew there had to be a reasonable way to do it! I'm a little concerned that this seems to be little-used, but it works on ...
Opening BBMaps from browser on BlackBerry OS 5+ I have been totally unable to open BBMaps from the BlackBerry browser from BBOS5 devices using the approach their documentation indicates. Is this functionality really broken - is the documentation really that wrong? Or am I doing something wrong? Support for doing just t...
TITLE: Opening BBMaps from browser on BlackBerry OS 5+ QUESTION: I have been totally unable to open BBMaps from the BlackBerry browser from BBOS5 devices using the approach their documentation indicates. Is this functionality really broken - is the documentation really that wrong? Or am I doing something wrong? Suppor...
[ "web-applications", "kml", "blackberry-storm", "blackberry-maps" ]
0
1
650
1
0
2011-06-03T02:40:47.407000
2011-06-03T18:29:15.193000
6,222,461
6,222,626
Ruby on Rails 3 simple grouping and counting
Say I have a 'Car' object which contains a 'color' column. I want in my view a listing of color with the number of times it has appeared. ---Car----Color--- Explorer Black Charger Yellow Prius Black Jetta Black Ferrari Red Pinto Yellow In my view, I want: --Color--Count-- Black 3 Yellow 2 Red 1 In my controller I tried...
@groups = Car.count(:group=>:color) <% @groups.each do |color,count| %> <%= "#{color}, #{count}" %> <% end %>
Ruby on Rails 3 simple grouping and counting Say I have a 'Car' object which contains a 'color' column. I want in my view a listing of color with the number of times it has appeared. ---Car----Color--- Explorer Black Charger Yellow Prius Black Jetta Black Ferrari Red Pinto Yellow In my view, I want: --Color--Count-- Bl...
TITLE: Ruby on Rails 3 simple grouping and counting QUESTION: Say I have a 'Car' object which contains a 'color' column. I want in my view a listing of color with the number of times it has appeared. ---Car----Color--- Explorer Black Charger Yellow Prius Black Jetta Black Ferrari Red Pinto Yellow In my view, I want: -...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "count", "grouping" ]
2
9
3,546
1
0
2011-06-03T02:41:52.220000
2011-06-03T03:17:57.640000
6,222,483
6,222,629
How to determine when removal of a spot on a grid creates 2 distinct unconnected areas
I am dealing with what amounts to squares on a grid. The grid if of a more or less infinite size. Grid squares can have one of two states, either claimed or unclaimed. The coordinates of the squares are stored as squares in an R tree for fast access. Before a square is unclaimed however, I want to iterate through the n...
Do breadth-first searches on the neighbors of the removed grid point and see that the searches all meet each other. Search on the components without the removed grid point until either you exhaust it (the original claimed territory) or meet the other breadth first searches in another location. For example, if you have ...
How to determine when removal of a spot on a grid creates 2 distinct unconnected areas I am dealing with what amounts to squares on a grid. The grid if of a more or less infinite size. Grid squares can have one of two states, either claimed or unclaimed. The coordinates of the squares are stored as squares in an R tree...
TITLE: How to determine when removal of a spot on a grid creates 2 distinct unconnected areas QUESTION: I am dealing with what amounts to squares on a grid. The grid if of a more or less infinite size. Grid squares can have one of two states, either claimed or unclaimed. The coordinates of the squares are stored as sq...
[ "java", "algorithm", "graph", "graph-theory" ]
1
0
72
2
0
2011-06-03T02:47:14.497000
2011-06-03T03:18:11.703000
6,222,484
6,222,497
Textarea width in Chrome not being applied properly
Contact box in the footer the textarea and input boxes are in a div 310px wide. http://www.bantros.net They have been set to be 308px wide with 1px border. In IE9, Firefox and Opera everything is the same width but in Chrome (my default browser) the textarea overflows unless the width is set to 304px. Using Inspect Ele...
There is a browser-applied padding: 2px. Apply padding: 0..form1 textarea,.form1 input { padding: 0; } This sort of issue can be solved using a CSS reset, btw.
Textarea width in Chrome not being applied properly Contact box in the footer the textarea and input boxes are in a div 310px wide. http://www.bantros.net They have been set to be 308px wide with 1px border. In IE9, Firefox and Opera everything is the same width but in Chrome (my default browser) the textarea overflows...
TITLE: Textarea width in Chrome not being applied properly QUESTION: Contact box in the footer the textarea and input boxes are in a div 310px wide. http://www.bantros.net They have been set to be 308px wide with 1px border. In IE9, Firefox and Opera everything is the same width but in Chrome (my default browser) the ...
[ "google-chrome", "textarea", "width" ]
4
8
4,118
2
0
2011-06-03T02:47:15.010000
2011-06-03T02:51:18.893000
6,222,487
6,222,495
Direct comparisons of C# Value types
I have read the following statement regarding to the comparison of C# value types in C# in Depth, Second Edition several times. page 77, When a type parameter is unconstrained (no constraints are applied to it), you can use == and!= operators, but only to compare a value of that type with null. You can’t compare two va...
It simply means this when constraining to a value type (second paragraph) static bool TryToCompare (T first, T second) where T: struct { return first == second; // not legal return first.Equals(second); // legal } Without the value-type constraint on the generic, it also says this (first paragraph) static bool TryToCom...
Direct comparisons of C# Value types I have read the following statement regarding to the comparison of C# value types in C# in Depth, Second Edition several times. page 77, When a type parameter is unconstrained (no constraints are applied to it), you can use == and!= operators, but only to compare a value of that typ...
TITLE: Direct comparisons of C# Value types QUESTION: I have read the following statement regarding to the comparison of C# value types in C# in Depth, Second Edition several times. page 77, When a type parameter is unconstrained (no constraints are applied to it), you can use == and!= operators, but only to compare a...
[ "c#", "generics", "comparison", "operators" ]
5
7
1,237
2
0
2011-06-03T02:48:15.900000
2011-06-03T02:50:48.537000
6,222,492
6,222,542
Do I have to include my db connector file each time I run a query with PDO?
I've got the following saved into my dbConnect.php file $host = 'localhost'; $username = 'root'; $pass = 'mypass'; try { $dbh = new PDO("mysql:host=$host;dbname=horh_new", $username, $pass); } catch (PDOException $e) { echo $e->getMessage(); } What is the best method to include this into my script? Right now, I've got...
Every time you include that, you are opening a new connection in the scope of that function. Simply include it on your front-facing web file and global your db connection for each function. Do not include this file more than once, otherwise you will be opening that many more connections, which causes unnecessary slowdo...
Do I have to include my db connector file each time I run a query with PDO? I've got the following saved into my dbConnect.php file $host = 'localhost'; $username = 'root'; $pass = 'mypass'; try { $dbh = new PDO("mysql:host=$host;dbname=horh_new", $username, $pass); } catch (PDOException $e) { echo $e->getMessage(); }...
TITLE: Do I have to include my db connector file each time I run a query with PDO? QUESTION: I've got the following saved into my dbConnect.php file $host = 'localhost'; $username = 'root'; $pass = 'mypass'; try { $dbh = new PDO("mysql:host=$host;dbname=horh_new", $username, $pass); } catch (PDOException $e) { echo $...
[ "php", "mysql", "pdo" ]
0
1
857
1
0
2011-06-03T02:49:29.407000
2011-06-03T02:59:21.983000
6,222,498
6,223,474
A new xml file in drawable_hdpi
I want to create one new xml file in the drawable_hdpi folder, but the new file doesn't appears in the drawable_hdpi folder, it appears in the layout folder. Can you tell me why? In SDK 1.6 it is OK, but in SDK 2.2 it is not. edit:for example in the app res/drawable_hdpi choice the drawable_hdpi folder,then right-hand ...
My guess is that you are trying to create a new "Android XML" file in Eclipse by right-clicking on your drawable_hdpi folder. I am able to duplicate the problem you are having. The dialog that pops up when you try to do this can dictate where the file gets created based on various setting within. I tried to embed and i...
A new xml file in drawable_hdpi I want to create one new xml file in the drawable_hdpi folder, but the new file doesn't appears in the drawable_hdpi folder, it appears in the layout folder. Can you tell me why? In SDK 1.6 it is OK, but in SDK 2.2 it is not. edit:for example in the app res/drawable_hdpi choice the drawa...
TITLE: A new xml file in drawable_hdpi QUESTION: I want to create one new xml file in the drawable_hdpi folder, but the new file doesn't appears in the drawable_hdpi folder, it appears in the layout folder. Can you tell me why? In SDK 1.6 it is OK, but in SDK 2.2 it is not. edit:for example in the app res/drawable_hdp...
[ "android" ]
0
2
204
1
0
2011-06-03T02:51:20.680000
2011-06-03T05:53:47.843000
6,222,499
6,222,589
Why is Flash demanding a crossdomain.xml file when the .swf and http target are both on localhost?
I've got a small client/server test application where I have a Flex app that makes an HTTP request of a server app. The server app is a script running on my local machine, listening on port 8001. The client is a swf that I am running locally, and uses mx.rpc.http.HTTPService to make the page request. The HTTPService is...
It may be that although you have the same host and protocol between the client page and server, the different port causes Flash to fail the same-origin test and request the crossdomain.xml to see what it's allowed to do. I'm assuming the page hosting your Flash content is running on port 80? If that's the case, check o...
Why is Flash demanding a crossdomain.xml file when the .swf and http target are both on localhost? I've got a small client/server test application where I have a Flex app that makes an HTTP request of a server app. The server app is a script running on my local machine, listening on port 8001. The client is a swf that ...
TITLE: Why is Flash demanding a crossdomain.xml file when the .swf and http target are both on localhost? QUESTION: I've got a small client/server test application where I have a Flex app that makes an HTTP request of a server app. The server app is a script running on my local machine, listening on port 8001. The cli...
[ "flash", "apache-flex", "actionscript-3", "crossdomain.xml" ]
10
11
13,784
2
0
2011-06-03T02:51:25.137000
2011-06-03T03:11:35.303000
6,222,503
6,222,533
Ruby assignment methods
Possible Duplicate: Ruby Assignment Syntax I don't get the concept of an assignment method in Ruby: def current_user=(user) @user = user end If the method is declared like that, then how can you put a space before the equals sign? def some_method(user) self.current_user = user end
Assignment methods are a special case of the ruby parser. There are others like [](..) and []=(..).
Ruby assignment methods Possible Duplicate: Ruby Assignment Syntax I don't get the concept of an assignment method in Ruby: def current_user=(user) @user = user end If the method is declared like that, then how can you put a space before the equals sign? def some_method(user) self.current_user = user end
TITLE: Ruby assignment methods QUESTION: Possible Duplicate: Ruby Assignment Syntax I don't get the concept of an assignment method in Ruby: def current_user=(user) @user = user end If the method is declared like that, then how can you put a space before the equals sign? def some_method(user) self.current_user = user ...
[ "ruby" ]
5
6
4,369
1
0
2011-06-03T02:52:08.227000
2011-06-03T02:58:11.610000
6,222,504
6,222,633
Get date when two things appear at the same time (mysql query)
Is there a sql query that can generate the date when 2 things appear together? I mean, let's say I have a table consists of bus schedule. Then, I have bus A and B. Bus A will operate on 22 May, 24 May, and 25 May while B operates on 22 May, 24 May and 26 May. I want to get the most recent date that 2 buses appear toget...
To see those that both buses share: SELECT t.date FROM YOUR_TABLE t WHERE t.bus IN ('A', 'B') GROUP BY t.date HAVING COUNT(DISTINCT t.bus) = 2 To see the most recent date that both buses share: SELECT t.date FROM YOUR_TABLE t WHERE t.bus IN ('A', 'B') GROUP BY t.date HAVING COUNT(DISTINCT t.bus) = 2 ORDER BY t.date DES...
Get date when two things appear at the same time (mysql query) Is there a sql query that can generate the date when 2 things appear together? I mean, let's say I have a table consists of bus schedule. Then, I have bus A and B. Bus A will operate on 22 May, 24 May, and 25 May while B operates on 22 May, 24 May and 26 Ma...
TITLE: Get date when two things appear at the same time (mysql query) QUESTION: Is there a sql query that can generate the date when 2 things appear together? I mean, let's say I have a table consists of bus schedule. Then, I have bus A and B. Bus A will operate on 22 May, 24 May, and 25 May while B operates on 22 May...
[ "mysql", "sql", "aggregate-functions" ]
1
2
141
2
0
2011-06-03T02:52:10.487000
2011-06-03T03:19:37.317000
6,222,509
6,222,888
Getting many OpenGL Errors
I'm trying to compile someone else's project, and I'm getting about 850 errors all related to OpenGL. I'm using Visual Studio 2008, on 64-bit Windows 7, but the project is a Win32 project. As you can see, the errors below are from gl.h in the Windows SDK include folder under Program Files, not Program Files (x86) so I'...
you need to include "windows.h" before "gl.h" #include "windows.h" #include "gl.h"
Getting many OpenGL Errors I'm trying to compile someone else's project, and I'm getting about 850 errors all related to OpenGL. I'm using Visual Studio 2008, on 64-bit Windows 7, but the project is a Win32 project. As you can see, the errors below are from gl.h in the Windows SDK include folder under Program Files, no...
TITLE: Getting many OpenGL Errors QUESTION: I'm trying to compile someone else's project, and I'm getting about 850 errors all related to OpenGL. I'm using Visual Studio 2008, on 64-bit Windows 7, but the project is a Win32 project. As you can see, the errors below are from gl.h in the Windows SDK include folder under...
[ "visual-studio-2008", "opengl" ]
8
17
9,831
1
0
2011-06-03T02:52:57.213000
2011-06-03T04:14:07.040000
6,222,513
6,222,706
F# chart control change legend text
when using F# chart control library, how can I specify the text of the legend? for instance: FSharpChart.Line [ for f in 0.0.. 0.1.. 10.0 -> cos f ] |> FSharpChart.WithLegend() shows a legend with text "GenericChart_Series_1". How can I change the text?
You can specify the legend using the Name property of the chart object. The property can be set when calling the Line member: FSharpChart.Line([ for f in 0.0.. 0.1.. 10.0 -> cos f ], Name = "Cos") |> FSharpChart.WithLegend()
F# chart control change legend text when using F# chart control library, how can I specify the text of the legend? for instance: FSharpChart.Line [ for f in 0.0.. 0.1.. 10.0 -> cos f ] |> FSharpChart.WithLegend() shows a legend with text "GenericChart_Series_1". How can I change the text?
TITLE: F# chart control change legend text QUESTION: when using F# chart control library, how can I specify the text of the legend? for instance: FSharpChart.Line [ for f in 0.0.. 0.1.. 10.0 -> cos f ] |> FSharpChart.WithLegend() shows a legend with text "GenericChart_Series_1". How can I change the text? ANSWER: You...
[ ".net", "f#", "mschart" ]
5
5
627
1
0
2011-06-03T02:54:30.187000
2011-06-03T03:34:39.370000
6,222,518
6,222,871
Android: Resuming an activity without reloading
I have two activities, say Activity A and Activity B. Activity A is created when the application starts and then Activity B is being called from Activity A as follows: Intent i = new Intent(A.this, B.class); startActivity(i); Activity B loads a Thread on its onCreate() and then when you click on Back, it will return to...
Create a singleton class which loads the images and caches them. Every time you launch Activity B check this singleton class for images. If not loaded then load them otherwise read from the cache
Android: Resuming an activity without reloading I have two activities, say Activity A and Activity B. Activity A is created when the application starts and then Activity B is being called from Activity A as follows: Intent i = new Intent(A.this, B.class); startActivity(i); Activity B loads a Thread on its onCreate() an...
TITLE: Android: Resuming an activity without reloading QUESTION: I have two activities, say Activity A and Activity B. Activity A is created when the application starts and then Activity B is being called from Activity A as follows: Intent i = new Intent(A.this, B.class); startActivity(i); Activity B loads a Thread on...
[ "android", "android-activity" ]
0
0
408
3
0
2011-06-03T02:55:00.660000
2011-06-03T04:09:55.447000
6,222,519
6,224,542
Limiting choices to an Generic Inline FK field dependant on the object that the Inline is being related to
I'm trying to limit the choices of a FK field found in a generic inline, depending on what the inline is attached to. For example I have Article, with a Generic relation Publishing, edited inline with the Article. I'd like for the PublishingInline to 'know', somehow, that it is currently being edited inline to an Artic...
If i understand you correctly formfield_for_foreignkey on your GenericInlineModelAdmin is your friend. Something along these lines should do it: def formfield_for_foreignkey(self, db_field, request, **kwargs): print self.parent_model # should give you the model the inline is attached to if db_field.name == "publishing_...
Limiting choices to an Generic Inline FK field dependant on the object that the Inline is being related to I'm trying to limit the choices of a FK field found in a generic inline, depending on what the inline is attached to. For example I have Article, with a Generic relation Publishing, edited inline with the Article....
TITLE: Limiting choices to an Generic Inline FK field dependant on the object that the Inline is being related to QUESTION: I'm trying to limit the choices of a FK field found in a generic inline, depending on what the inline is attached to. For example I have Article, with a Generic relation Publishing, edited inline...
[ "django", "django-models", "django-admin" ]
3
2
485
1
0
2011-06-03T02:55:08.933000
2011-06-03T08:06:54.133000
6,222,520
6,258,640
How to post html data using jquery?
I need to grab a table's html and post it to a page where the table will be exported as xls, but I can't get it to work, I tried to pass the data as object, no luck, then I tried to pass it as string, still no luck (is it because the table too large?) //var tblReportResultData= "id=tblReportResult&name=tblReportResult&...
I found out the problem, it's because post html code could be dangerous and the system automatically blocked it, after I used escape(), it worked.
How to post html data using jquery? I need to grab a table's html and post it to a page where the table will be exported as xls, but I can't get it to work, I tried to pass the data as object, no luck, then I tried to pass it as string, still no luck (is it because the table too large?) //var tblReportResultData= "id=t...
TITLE: How to post html data using jquery? QUESTION: I need to grab a table's html and post it to a page where the table will be exported as xls, but I can't get it to work, I tried to pass the data as object, no luck, then I tried to pass it as string, still no luck (is it because the table too large?) //var tblRepor...
[ "javascript", "jquery", "html", "http-post" ]
0
0
1,800
1
0
2011-06-03T02:55:12.137000
2011-06-06T22:13:30.660000
6,222,521
6,222,597
Haskell do syntax and I/O
I was playing around with a simple program in Haskell: hello:: String -> String hello s = "Hello, " ++ (trim s) ++ "!\n" trim:: String -> String trim [] = [] trim s = head $ words s main:: IO() main = do putStr "\nPlease enter your name: " name <- getLine hstring <- return $ hello name putStr hstring This is the outp...
This is something of an FAQ. Your lines are being buffered. Use: import System.IO main = do hSetBuffering stdout NoBuffering... Also, your code is a bit... unique. For example, you say: hstring <- return $ hello name putStr hstring When you could do: let hstring = hello name putStr hstring or just: putStr $ hello name
Haskell do syntax and I/O I was playing around with a simple program in Haskell: hello:: String -> String hello s = "Hello, " ++ (trim s) ++ "!\n" trim:: String -> String trim [] = [] trim s = head $ words s main:: IO() main = do putStr "\nPlease enter your name: " name <- getLine hstring <- return $ hello name putSt...
TITLE: Haskell do syntax and I/O QUESTION: I was playing around with a simple program in Haskell: hello:: String -> String hello s = "Hello, " ++ (trim s) ++ "!\n" trim:: String -> String trim [] = [] trim s = head $ words s main:: IO() main = do putStr "\nPlease enter your name: " name <- getLine hstring <- return ...
[ "haskell", "ghc", "ghci" ]
4
8
464
1
0
2011-06-03T02:55:33.620000
2011-06-03T03:13:33.497000
6,222,522
6,222,862
How to use Dialog OnClick Listner in Android?
I am new to Android development. Please excuse me If my question is very simple. I have tried to create a button on my Android Layout view using XML. Now within the Activity class I am trying to get the button and add a on click listner to it. This is working fine without any issues. On similar lines on the button clic...
Most probably you are trying to retrieve the button from the Activity class. It returns null because this method will only retrieve resources attached to the Activity (by using the method setContentView ). You have two options: You can inflate the dialog layout using a LayoutInflater If you are extending the Dialog cla...
How to use Dialog OnClick Listner in Android? I am new to Android development. Please excuse me If my question is very simple. I have tried to create a button on my Android Layout view using XML. Now within the Activity class I am trying to get the button and add a on click listner to it. This is working fine without a...
TITLE: How to use Dialog OnClick Listner in Android? QUESTION: I am new to Android development. Please excuse me If my question is very simple. I have tried to create a button on my Android Layout view using XML. Now within the Activity class I am trying to get the button and add a on click listner to it. This is work...
[ "android", "android-layout", "android-lifecycle" ]
0
3
968
1
0
2011-06-03T02:55:56.120000
2011-06-03T04:08:30.313000
6,222,531
6,222,543
Why int[] a = new int[1] instead of just int a?
Is there some hidden meaning in this code which I don't see in java? How can it be useful? int[] a = new int[1]; than just int a; because from my point of view it's the same?
int a defines a primitive int. int[] a = new int[1]; defines an array that has space to hold 1 int. They are two very different things. The primitive has no methods/properites on it, but an array has properties on it (length), and methods (specifically its on clone method, and all the methods of Object). Arrays are a b...
Why int[] a = new int[1] instead of just int a? Is there some hidden meaning in this code which I don't see in java? How can it be useful? int[] a = new int[1]; than just int a; because from my point of view it's the same?
TITLE: Why int[] a = new int[1] instead of just int a? QUESTION: Is there some hidden meaning in this code which I don't see in java? How can it be useful? int[] a = new int[1]; than just int a; because from my point of view it's the same? ANSWER: int a defines a primitive int. int[] a = new int[1]; defines an array ...
[ "java", "integer" ]
8
19
107,961
6
0
2011-06-03T02:57:37.473000
2011-06-03T03:00:01.613000
6,222,559
6,222,576
How to change rendered selected option in select box with jquery
I have tried many ways to select an option with jquery including.val("0").attr('selected', 'selected') and.attr('selected', 'true') and the TexoTela plugin. They all seem to update the html but the browser still shows the last item selected by the user. Try out this fiddle... Select the dropdown value 1 and then click ...
You mean change which item is selected? $('select').val('0'); There are other ways, but this is the basic, following your example. jsfiddle You can read up on the documenation for.val() here, and the snippet: checks, or selects, all the radio buttons, checkboxes, and select options that match the set of values. EDIT fo...
How to change rendered selected option in select box with jquery I have tried many ways to select an option with jquery including.val("0").attr('selected', 'selected') and.attr('selected', 'true') and the TexoTela plugin. They all seem to update the html but the browser still shows the last item selected by the user. T...
TITLE: How to change rendered selected option in select box with jquery QUESTION: I have tried many ways to select an option with jquery including.val("0").attr('selected', 'selected') and.attr('selected', 'true') and the TexoTela plugin. They all seem to update the html but the browser still shows the last item selec...
[ "javascript", "jquery", "html", "jquery-mobile", "drop-down-menu" ]
1
8
17,060
3
0
2011-06-03T03:03:42.403000
2011-06-03T03:09:09.453000
6,222,561
6,222,632
C# Paste A Picture (In Graphics)
The thing I want to do is simple. I want to take a picture I already have and paste it into a blank graphics/picture at a certain point, thus expanding my picture's bounds. To clarify: private static Image PasteImage(Image startimage) //start image is a square of Size(30,30) { //Create a new picture/graphics with size ...
private static Image PasteImage(Image startimage) { int width = Math.Max(900, 400 + startimage.Width); int height = Math.Max(900, 450 + startimage.Height); var bmp = new Bitmap(width, height); using (Graphics g = Graphics.FromImage(bmp)) { g.DrawImage(startimage, 400, 450); } return bmp; } It's better to get rid of con...
C# Paste A Picture (In Graphics) The thing I want to do is simple. I want to take a picture I already have and paste it into a blank graphics/picture at a certain point, thus expanding my picture's bounds. To clarify: private static Image PasteImage(Image startimage) //start image is a square of Size(30,30) { //Create ...
TITLE: C# Paste A Picture (In Graphics) QUESTION: The thing I want to do is simple. I want to take a picture I already have and paste it into a blank graphics/picture at a certain point, thus expanding my picture's bounds. To clarify: private static Image PasteImage(Image startimage) //start image is a square of Size(...
[ "c#", "graphics", "image-processing" ]
1
2
2,057
2
0
2011-06-03T03:04:06.693000
2011-06-03T03:19:15.693000
6,222,563
6,246,643
Locomotive with mysql
I am planning to use Locomotive for a project...But as the official website says it cannot work with MySQL. However my requirement is to use it with MySQL. Has any one used it with mySQL? Any pointers or advises would be great. Thanks. Cheers, Abi
Locomotive uses Mongoid - which is an ORM for MongoDB. As such, you cannot use it with MySQL at all, since it leverages some features (dynamic attributes), which traditional RDBMS databases (such as MySQL) do not support. That being said, MongoDB is pretty easy to install, so if you can get around your requirement of M...
Locomotive with mysql I am planning to use Locomotive for a project...But as the official website says it cannot work with MySQL. However my requirement is to use it with MySQL. Has any one used it with mySQL? Any pointers or advises would be great. Thanks. Cheers, Abi
TITLE: Locomotive with mysql QUESTION: I am planning to use Locomotive for a project...But as the official website says it cannot work with MySQL. However my requirement is to use it with MySQL. Has any one used it with mySQL? Any pointers or advises would be great. Thanks. Cheers, Abi ANSWER: Locomotive uses Mongoid...
[ "mysql", "ruby-on-rails-3", "locomotivecms" ]
2
6
1,092
3
0
2011-06-03T03:04:45.040000
2011-06-05T23:35:14.153000
6,222,565
6,222,935
How can I save text to a file in R?
I have a R function which can generate the LaTeX code (the output is the LaTex code) by using cat(), while now I want to save these LaTeX code, but I don't know which function can save these LaTeX code...
I like to use the sink() function: latex.code <- function(){ cat("\\begin{align}\n") cat("[X'X]^{-1}X'y\n") cat("\\end{align}\n") } sink(file='ols.txt') latex.code() sink() Edit: Obviously, you can choose the file path where the file will be saved by changing the sink argument such as: sink(file='c:/Users/Eva/Desktop/o...
How can I save text to a file in R? I have a R function which can generate the LaTeX code (the output is the LaTex code) by using cat(), while now I want to save these LaTeX code, but I don't know which function can save these LaTeX code...
TITLE: How can I save text to a file in R? QUESTION: I have a R function which can generate the LaTeX code (the output is the LaTex code) by using cat(), while now I want to save these LaTeX code, but I don't know which function can save these LaTeX code... ANSWER: I like to use the sink() function: latex.code <- fun...
[ "r", "text", "save" ]
4
5
3,270
3
0
2011-06-03T03:05:20.093000
2011-06-03T04:22:12.943000
6,222,568
6,222,613
Vertically center input field
I have a text input field on a page, however, I'm finding it difficult trying to vertically center the field in webkit (Chrome + Safari). It is fine in FireFox. Here's the code: And the CSS:.schbtn {background:url(/wp-content/themes/shamil/images/search_icon.png) no-repeat scroll 50% 50% #7BA60D;height:26px; width:26px...
Put a vertical-align:middle; on both of the input elements, and that will center it
Vertically center input field I have a text input field on a page, however, I'm finding it difficult trying to vertically center the field in webkit (Chrome + Safari). It is fine in FireFox. Here's the code: And the CSS:.schbtn {background:url(/wp-content/themes/shamil/images/search_icon.png) no-repeat scroll 50% 50% #...
TITLE: Vertically center input field QUESTION: I have a text input field on a page, however, I'm finding it difficult trying to vertically center the field in webkit (Chrome + Safari). It is fine in FireFox. Here's the code: And the CSS:.schbtn {background:url(/wp-content/themes/shamil/images/search_icon.png) no-repea...
[ "html", "css", "center" ]
3
3
10,662
1
0
2011-06-03T03:06:48.190000
2011-06-03T03:16:09.293000
6,222,577
6,222,593
ObservableCollection w/ .net 4.0
I have a project that was being compiled in.net 3.5, when I converted it to.net 4.0 I receive a compile error saying: "The base class or interface of 'MyApplication.ClassName' could not be resolved or in invalid." This class implements ObservableCollection but other than that there is nothing special about it. Has anyo...
ObservableCollection class was defined in WindowsBase.dll in v3.0 and was moved to System.dll in v4.0. Maybe you should check your project's references.
ObservableCollection w/ .net 4.0 I have a project that was being compiled in.net 3.5, when I converted it to.net 4.0 I receive a compile error saying: "The base class or interface of 'MyApplication.ClassName' could not be resolved or in invalid." This class implements ObservableCollection but other than that there is n...
TITLE: ObservableCollection w/ .net 4.0 QUESTION: I have a project that was being compiled in.net 3.5, when I converted it to.net 4.0 I receive a compile error saying: "The base class or interface of 'MyApplication.ClassName' could not be resolved or in invalid." This class implements ObservableCollection but other th...
[ "c#", ".net", ".net-4.0", "compiler-errors", "observablecollection" ]
2
4
967
1
0
2011-06-03T03:09:14.127000
2011-06-03T03:12:57.550000
6,222,583
6,222,602
How to check if a string is equal to a string literal
I wanted to compare a string to a string literal; something like this: if (string == "add") Do I have to declare "add" as a string or is it possible to compare in a similar way?
In C++ the std::string class implements the comparison operators, so you can perform the comparison using == just as you would expect: if (string == "add") {... } When used properly, operator overloading is an excellent C++ feature.
How to check if a string is equal to a string literal I wanted to compare a string to a string literal; something like this: if (string == "add") Do I have to declare "add" as a string or is it possible to compare in a similar way?
TITLE: How to check if a string is equal to a string literal QUESTION: I wanted to compare a string to a string literal; something like this: if (string == "add") Do I have to declare "add" as a string or is it possible to compare in a similar way? ANSWER: In C++ the std::string class implements the comparison operat...
[ "c++", "string", "compare", "string-literals" ]
29
66
145,474
5
0
2011-06-03T03:10:37.637000
2011-06-03T03:14:28.217000
6,222,586
6,222,696
C# .NET Singleton life of app pool
I want to create a singleton that remains alive for the life of the app pool using HttpContent.Current.Cache. Where would I create the class and how should it be implemented? I understand how to implement a singleton but am not too familiar with threading and httpcontent.current.cache. Thanks!
Perhaps you are over-complicating the issue? i'm not sure why you need to use the cache. Could you not just add a file to the App_Code folder to house your class e.g "mSingleton.cs" public sealed class mSingleton { static readonly mSingleton _instance = new mSingleton(); public int MyVal { get; set; } public static m...
C# .NET Singleton life of app pool I want to create a singleton that remains alive for the life of the app pool using HttpContent.Current.Cache. Where would I create the class and how should it be implemented? I understand how to implement a singleton but am not too familiar with threading and httpcontent.current.cache...
TITLE: C# .NET Singleton life of app pool QUESTION: I want to create a singleton that remains alive for the life of the app pool using HttpContent.Current.Cache. Where would I create the class and how should it be implemented? I understand how to implement a singleton but am not too familiar with threading and httpcon...
[ "c#", "asp.net", "singleton", "application-pool" ]
2
0
2,012
3
0
2011-06-03T03:11:07.380000
2011-06-03T03:32:52.903000
6,222,592
6,222,607
Align Integer using cout in C++
I need C++ to use cout to print: Header 1 2 3 4 5 10 11 12 instead of Header 1 2 3 4 5 10 11 12 How should I format this using cout?
use the IO manipulator setw #include #include int main() { std::cout << "Header\n"; for(int i=1; i<13; ++i) std::cout << std::setw(6) << i << '\n'; }
Align Integer using cout in C++ I need C++ to use cout to print: Header 1 2 3 4 5 10 11 12 instead of Header 1 2 3 4 5 10 11 12 How should I format this using cout?
TITLE: Align Integer using cout in C++ QUESTION: I need C++ to use cout to print: Header 1 2 3 4 5 10 11 12 instead of Header 1 2 3 4 5 10 11 12 How should I format this using cout? ANSWER: use the IO manipulator setw #include #include int main() { std::cout << "Header\n"; for(int i=1; i<13; ++i) std::cout << std::se...
[ "c++", "formatting", "cout" ]
4
8
1,715
1
0
2011-06-03T03:12:29.257000
2011-06-03T03:15:16.130000
6,222,599
6,223,339
control the tab in focus in a nested jQuery-UI Tab
I have a nested jQuery-UI Tab. for example Tab-Day1 -- Tab-Lunch -- Tab-Dinner Tab-Day2 -- Tab-Lunch -- Tab-Dinner Tab-Day3... Is there a way to synchronize the sub-tab when I change the upper tab? Say the default tab is "Day1"-"Lunch", Step 1) click on "Dinner" on "Day1" -> "Day1"-"Dinner" will be in focus Step 2) cli...
You could do something like this: Use data-* attributes to associate tabs with the same "category." Tap into the select event on the tabs widget: var selectingSiblings = false; $(".tabs").tabs({ select: function(event, ui) { if (!selectingSiblings) { var category = $(ui.tab).data("category"), hash; selectingSiblings ...
control the tab in focus in a nested jQuery-UI Tab I have a nested jQuery-UI Tab. for example Tab-Day1 -- Tab-Lunch -- Tab-Dinner Tab-Day2 -- Tab-Lunch -- Tab-Dinner Tab-Day3... Is there a way to synchronize the sub-tab when I change the upper tab? Say the default tab is "Day1"-"Lunch", Step 1) click on "Dinner" on "Da...
TITLE: control the tab in focus in a nested jQuery-UI Tab QUESTION: I have a nested jQuery-UI Tab. for example Tab-Day1 -- Tab-Lunch -- Tab-Dinner Tab-Day2 -- Tab-Lunch -- Tab-Dinner Tab-Day3... Is there a way to synchronize the sub-tab when I change the upper tab? Say the default tab is "Day1"-"Lunch", Step 1) click ...
[ "jquery", "jquery-ui", "jquery-ui-tabs" ]
1
1
509
1
0
2011-06-03T03:13:55.690000
2011-06-03T05:31:07.680000
6,222,601
6,222,646
C# WinForms numericUpDown control (removing the spin box)
After a ton of googling, I couldn't come up with anything.. Is there any way to get a numericUpDown control that does not have the spin box? I need a textbox that only accepts integers, and a numericUpDown has the perfect behavior that I am looking for. However, I need to hide the numeric spinbox for space constraints....
You can inherit from NumericUpDown. The trick is to hide control when the control is created. public class NumericUpDownWitoutButtons: NumericUpDown { public NumericUpDownWitoutButtons() { Controls[0].Visible = false; } protected override void OnPaint(PaintEventArgs e) { e.Graphics.Clear(SystemColors.Window); base.OnP...
C# WinForms numericUpDown control (removing the spin box) After a ton of googling, I couldn't come up with anything.. Is there any way to get a numericUpDown control that does not have the spin box? I need a textbox that only accepts integers, and a numericUpDown has the perfect behavior that I am looking for. However,...
TITLE: C# WinForms numericUpDown control (removing the spin box) QUESTION: After a ton of googling, I couldn't come up with anything.. Is there any way to get a numericUpDown control that does not have the spin box? I need a textbox that only accepts integers, and a numericUpDown has the perfect behavior that I am loo...
[ "c#", "winforms" ]
11
11
19,004
2
0
2011-06-03T03:14:26.070000
2011-06-03T03:21:42.767000
6,222,615
6,233,050
what analzyer is good for my situation? hibernate search case
We are running a search app for book. It is implemented by hibernate search. Book entity is defined as following: @Entity @Indexed public class Book{ @DocumentId private Integer UID; @Field private String title; @Field private String description;...} If a user search book name, say, they input Microsoft access 2007, b...
Lucene should already discount terms that occur frequently and thus don't discriminate well among documents. If you want to increase that effect, you have a few choices: Change the similarity function from the default, and use the new function to weight terms differently Boost low-df (high idf) terms in the query by fi...
what analzyer is good for my situation? hibernate search case We are running a search app for book. It is implemented by hibernate search. Book entity is defined as following: @Entity @Indexed public class Book{ @DocumentId private Integer UID; @Field private String title; @Field private String description;...} If a u...
TITLE: what analzyer is good for my situation? hibernate search case QUESTION: We are running a search app for book. It is implemented by hibernate search. Book entity is defined as following: @Entity @Indexed public class Book{ @DocumentId private Integer UID; @Field private String title; @Field private String descr...
[ "hibernate", "lucene", "hibernate-search", "analyzer" ]
2
0
836
2
0
2011-06-03T03:16:27.737000
2011-06-03T21:55:35.663000
6,222,616
6,223,277
With CSS, use "..." for overflowed block of multi-lines
with overflow: hidden; text-overflow: ellipsis; white-space: nowrap; "..." will be shown in the end of the line if overflowed. However, this will be shown only in one line. But I would like it to be shown in multi-lines. It may looks like: +--------------------+ |abcde feg hij dkjd| |dsji jdia js ajid s| |jdis ajid dhe...
There are also several jquery plugins that deal with this issue, but many do not handle multiple lines of text. Following works: http://pvdspek.github.com/jquery.autoellipsis/ http://dotdotdot.frebsite.nl/ http://keith-wood.name/more.html http://github.com/tbasse/jquery-truncate There also some preformance tests.
With CSS, use "..." for overflowed block of multi-lines with overflow: hidden; text-overflow: ellipsis; white-space: nowrap; "..." will be shown in the end of the line if overflowed. However, this will be shown only in one line. But I would like it to be shown in multi-lines. It may looks like: +--------------------+ |...
TITLE: With CSS, use "..." for overflowed block of multi-lines QUESTION: with overflow: hidden; text-overflow: ellipsis; white-space: nowrap; "..." will be shown in the end of the line if overflowed. However, this will be shown only in one line. But I would like it to be shown in multi-lines. It may looks like: +-----...
[ "html", "ellipsis", "css" ]
315
86
210,897
16
0
2011-06-03T03:16:33.713000
2011-06-03T05:22:08.677000
6,222,630
6,233,648
Secure Remote mySQL Connection
Since our shared hosting server doesn't allow us to setup Tomcat I decided to install it on our local machine. The local Tomcat server allows us to listen to a certain port for Bancnet transactions which will then be processed and written to the remote site. Question: Is it safe for me to set the local PHP application ...
You could create a ssh tunnel between MySQL server and client. For more resiliency, use autossh.
Secure Remote mySQL Connection Since our shared hosting server doesn't allow us to setup Tomcat I decided to install it on our local machine. The local Tomcat server allows us to listen to a certain port for Bancnet transactions which will then be processed and written to the remote site. Question: Is it safe for me to...
TITLE: Secure Remote mySQL Connection QUESTION: Since our shared hosting server doesn't allow us to setup Tomcat I decided to install it on our local machine. The local Tomcat server allows us to listen to a certain port for Bancnet transactions which will then be processed and written to the remote site. Question: Is...
[ "mysql", "security", "apache", "tomcat" ]
5
5
5,026
3
0
2011-06-03T03:18:12.607000
2011-06-03T23:36:41.343000
6,222,634
6,223,292
Playing audio is too slow in Android
I'm having a problem with Android's MediaPlayer in that it is too slow when calling the prepare method. I've tried to simply keep a Vector of the few MediaPlayer objects (with their preloaded data sources) but calling.start() multiple times results in weird issues. The first issue is it will skip every other play, and ...
You should use SoundPool instead: http://developer.android.com/reference/android/media/SoundPool.html
Playing audio is too slow in Android I'm having a problem with Android's MediaPlayer in that it is too slow when calling the prepare method. I've tried to simply keep a Vector of the few MediaPlayer objects (with their preloaded data sources) but calling.start() multiple times results in weird issues. The first issue i...
TITLE: Playing audio is too slow in Android QUESTION: I'm having a problem with Android's MediaPlayer in that it is too slow when calling the prepare method. I've tried to simply keep a Vector of the few MediaPlayer objects (with their preloaded data sources) but calling.start() multiple times results in weird issues....
[ "android", "performance", "media-player", "delay" ]
4
2
3,657
2
0
2011-06-03T03:19:43.250000
2011-06-03T05:24:49.653000
6,222,635
6,222,971
PeekMessage not getting the message?
I've created a custom message type for use in resizing my Window, called WM_NEED_RESIZE. I've defined it in my.h file, and initialized in my.cpp file. I have also registered my WindowProc function to accept messages. Here is the code for these items: const uint32 WindowsGLWindow::WM_NEED_RESIZE = WM_USER + 100; LONG WI...
Dont use std::cout expecting to see that output in your debugger, insted use OutputDebugString();. You need to pass your class pointer to the last parameter of your call to CreateWindowEx, then retrieve that pointer from the LPCREATESTRUCT passed to you in the LPARAM of WM_CREATE, your class pointer will be in the lpCr...
PeekMessage not getting the message? I've created a custom message type for use in resizing my Window, called WM_NEED_RESIZE. I've defined it in my.h file, and initialized in my.cpp file. I have also registered my WindowProc function to accept messages. Here is the code for these items: const uint32 WindowsGLWindow::WM...
TITLE: PeekMessage not getting the message? QUESTION: I've created a custom message type for use in resizing my Window, called WM_NEED_RESIZE. I've defined it in my.h file, and initialized in my.cpp file. I have also registered my WindowProc function to accept messages. Here is the code for these items: const uint32 W...
[ "c++", "window", "message", "postmessage", "peekmessage" ]
3
2
5,323
2
0
2011-06-03T03:19:48.813000
2011-06-03T04:29:36.540000
6,222,638
6,222,899
TFS 2010: Seeing and comparing changes after getting latest
When I get latest from TFS source control, I don't see the changes made to my workspace. I know I can go to the Output window and see the changes, but this is just a text list with no context actions. What I really want is to see a list of changes, with the ability to right-click a file and see differences straight awa...
Sounds like using the command line tool tf.exe with folderdiff command would achieve what you need. Use the folderdiff command to display and compare a visual representation of the differences between files in two server folders, in a server folder and a local folder, or in two local folders.
TFS 2010: Seeing and comparing changes after getting latest When I get latest from TFS source control, I don't see the changes made to my workspace. I know I can go to the Output window and see the changes, but this is just a text list with no context actions. What I really want is to see a list of changes, with the ab...
TITLE: TFS 2010: Seeing and comparing changes after getting latest QUESTION: When I get latest from TFS source control, I don't see the changes made to my workspace. I know I can go to the Output window and see the changes, but this is just a text list with no context actions. What I really want is to see a list of ch...
[ "visual-studio-2010" ]
3
1
600
2
0
2011-06-03T03:20:22.443000
2011-06-03T04:16:30.233000
6,222,641
6,222,836
How to PHP ldap_search() to get user OU if I don't know the OU for base DN
I have an Active-Directory structure where User objects reside in OU for example, IT, Technical, HR, Accounts etc.. I want to write a PHP script that authenticates the user with AD and depending on their Group to provide the aproperiate web services. ldap_search() requires base DN. I tried to search with ldap_search($l...
If you try to perform the searches on Windows 2003 Server Active Directory or above, it seems that you have to set the LDAP_OPT_REFERRALS option to 0: ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); Without this, you will get "Operations error" if you try to search t...
How to PHP ldap_search() to get user OU if I don't know the OU for base DN I have an Active-Directory structure where User objects reside in OU for example, IT, Technical, HR, Accounts etc.. I want to write a PHP script that authenticates the user with AD and depending on their Group to provide the aproperiate web serv...
TITLE: How to PHP ldap_search() to get user OU if I don't know the OU for base DN QUESTION: I have an Active-Directory structure where User objects reside in OU for example, IT, Technical, HR, Accounts etc.. I want to write a PHP script that authenticates the user with AD and depending on their Group to provide the ap...
[ "php", "active-directory", "ldap" ]
34
31
69,391
1
0
2011-06-03T03:20:50.890000
2011-06-03T04:02:05.813000
6,222,642
6,224,118
NSTask and Git -- Permissions issues
In my Cocoa application I'm trying to use NSTask to run some basic Git commands. Whenever I run a command that requires permissions (SSH keys) to access a remote (e.g. git push, git pull ), it fails with the following error: Permission denied (publickey). The remote end hung up unexpectedly Running the same commands fr...
You could try and follow the tutorial " Wrapping rsync or SSH in an NSTask " (from Ira ), which does mention SSH_AUTH_SOCK variable: Since writing this post I've realised that I omitted an important additional step in setting up the environment variables for the NSTask. In order to make passwordless key-based authentic...
NSTask and Git -- Permissions issues In my Cocoa application I'm trying to use NSTask to run some basic Git commands. Whenever I run a command that requires permissions (SSH keys) to access a remote (e.g. git push, git pull ), it fails with the following error: Permission denied (publickey). The remote end hung up unex...
TITLE: NSTask and Git -- Permissions issues QUESTION: In my Cocoa application I'm trying to use NSTask to run some basic Git commands. Whenever I run a command that requires permissions (SSH keys) to access a remote (e.g. git push, git pull ), it fails with the following error: Permission denied (publickey). The remot...
[ "objective-c", "cocoa", "git", "environment-variables", "nstask" ]
9
4
1,622
1
0
2011-06-03T03:20:52.683000
2011-06-03T07:16:19.337000
6,222,645
6,222,774
Using several bufferedImages in java
I'm making a game in a java applet and I'm trying to optimise my code to reduce flickering. I've already implemented double buffering, so I'm trying to use another BufferedImage in order to store a picture of the elements of the game's background that don't change. Here's the relevant portion of my code... public class...
I'd extend JApplet and use JPanel, which is double buffered by default, for the content. If you're trying to limit the update area, you might look into getSubimage(), shown here.
Using several bufferedImages in java I'm making a game in a java applet and I'm trying to optimise my code to reduce flickering. I've already implemented double buffering, so I'm trying to use another BufferedImage in order to store a picture of the elements of the game's background that don't change. Here's the releva...
TITLE: Using several bufferedImages in java QUESTION: I'm making a game in a java applet and I'm trying to optimise my code to reduce flickering. I've already implemented double buffering, so I'm trying to use another BufferedImage in order to store a picture of the elements of the game's background that don't change....
[ "java", "graphics", "bufferedimage" ]
5
3
483
1
0
2011-06-03T03:21:36.180000
2011-06-03T03:47:57.877000
6,222,648
6,223,554
Using -rpath and $ORIGIN with libtool-based projects?
I am trying to incorporate a libtool-based package into a project of my own, perhaps in a non-standard way. Here is my goal: Build external project:./configure --prefix=$HOME/blah --etcetera && make && make install Build my own project which depends upon the external project's shared libraries and executables at runtim...
Among the options presented here on Rpathissue on the debian Wiki, using chrpath in your 'install' step or some post-processing script sounds like a viable option. (It's available on a bunch of distros via your favorite package manager.) It doesn't require patching libtool which is a plus IMO. Note that it has some lim...
Using -rpath and $ORIGIN with libtool-based projects? I am trying to incorporate a libtool-based package into a project of my own, perhaps in a non-standard way. Here is my goal: Build external project:./configure --prefix=$HOME/blah --etcetera && make && make install Build my own project which depends upon the externa...
TITLE: Using -rpath and $ORIGIN with libtool-based projects? QUESTION: I am trying to incorporate a libtool-based package into a project of my own, perhaps in a non-standard way. Here is my goal: Build external project:./configure --prefix=$HOME/blah --etcetera && make && make install Build my own project which depend...
[ "c++", "c", "libtool", "rpath" ]
4
1
2,586
1
0
2011-06-03T03:22:21.793000
2011-06-03T06:04:46.030000
6,222,651
6,222,680
Getting a resultCode from a PendingIntent that starts an Activity?
Is there any possible way to get the resultCode from an activity that's launched from a pendingIntent? The onFinished listener for PendingIntent.send() is only called immediately with a resultCode of RESULT_CANCELED, which doesn't help me at all.
No. The nature of the PendingIntent is such that you can never tell WHEN it will be invoked: the calling Ativity may be completely shutdown or possibly even uninstalled by the time it is started. Therefore there can be no reliable way to receive the response with startActivityForResult.
Getting a resultCode from a PendingIntent that starts an Activity? Is there any possible way to get the resultCode from an activity that's launched from a pendingIntent? The onFinished listener for PendingIntent.send() is only called immediately with a resultCode of RESULT_CANCELED, which doesn't help me at all.
TITLE: Getting a resultCode from a PendingIntent that starts an Activity? QUESTION: Is there any possible way to get the resultCode from an activity that's launched from a pendingIntent? The onFinished listener for PendingIntent.send() is only called immediately with a resultCode of RESULT_CANCELED, which doesn't help...
[ "android", "android-pendingintent" ]
0
0
480
1
0
2011-06-03T03:23:07.153000
2011-06-03T03:28:31.363000
6,222,655
6,223,658
C++: How to pass a generic function name?
I am building a program in c++ where the user can set a function to be called when user defined conditions are reached. I am only a little experienced with c++. I know how to do this in python. You would simply define functions and put the names of said functions into a structure (I always used a dictionary). When you ...
Your Python code actually translates to C++ pretty much directly: # Python: # Create a dictionary mapping strings to functions methods = { "foo": foo, "bar": bar } // C++: // create a map, mapping strings to functions (function pointers, specifically) std::map methods; methods["foo"] = foo; methods["bar"] = bar; # Pyt...
C++: How to pass a generic function name? I am building a program in c++ where the user can set a function to be called when user defined conditions are reached. I am only a little experienced with c++. I know how to do this in python. You would simply define functions and put the names of said functions into a structu...
TITLE: C++: How to pass a generic function name? QUESTION: I am building a program in c++ where the user can set a function to be called when user defined conditions are reached. I am only a little experienced with c++. I know how to do this in python. You would simply define functions and put the names of said functi...
[ "c++", "function" ]
13
8
897
4
0
2011-06-03T03:23:29.937000
2011-06-03T06:20:51.647000
6,222,656
6,224,115
Auto log-in and re-send email
I have a django-registration up and working. I would like to add two additional features to it and am having a bit of difficulty understanding the inner-workings of the log-in process. 1) When a user clicks the activation email, it makes the account active but does not log the user in, how would I make it so clicking t...
1). from django.contrib.auth import login from registration import signals def login_on_activation(user, request, **kwargs): user.backend='django.contrib.auth.backends.ModelBackend' login(request, user) signals.user_activated.connect(login_on_activation) 2). registration.models.RegistrationProfile.send_activation_ema...
Auto log-in and re-send email I have a django-registration up and working. I would like to add two additional features to it and am having a bit of difficulty understanding the inner-workings of the log-in process. 1) When a user clicks the activation email, it makes the account active but does not log the user in, how...
TITLE: Auto log-in and re-send email QUESTION: I have a django-registration up and working. I would like to add two additional features to it and am having a bit of difficulty understanding the inner-workings of the log-in process. 1) When a user clicks the activation email, it makes the account active but does not lo...
[ "django", "django-views", "django-registration" ]
6
14
1,526
1
0
2011-06-03T03:23:29.977000
2011-06-03T07:15:46.367000
6,222,658
6,223,728
.NET WindowService, AppDomain.CurrentDomain.DomainUnload is not getting called when Stoping the Service
I have a.NET window Service which extend a custom base class, this serves as base for many windows services i have written so far, now i want to do add some monitor (hearbeat) on this base class, on the initialized of the base class i start a thread that will notify a database and sleep for 40 sec, this is not perfect ...
Is the "CurrentDomain" the default app domain? I would guess so, unless you create custom domains. If so, then note that DomainUnload is not raised for the default domain. As for ProcessExit, I'm not sure, but note that a Windows Service's lifetime is not necessarily bound to the process' lifetime that hosts it. If a p...
.NET WindowService, AppDomain.CurrentDomain.DomainUnload is not getting called when Stoping the Service I have a.NET window Service which extend a custom base class, this serves as base for many windows services i have written so far, now i want to do add some monitor (hearbeat) on this base class, on the initialized o...
TITLE: .NET WindowService, AppDomain.CurrentDomain.DomainUnload is not getting called when Stoping the Service QUESTION: I have a.NET window Service which extend a custom base class, this serves as base for many windows services i have written so far, now i want to do add some monitor (hearbeat) on this base class, on...
[ ".net", "windows-services", "window", "c#-2.0" ]
1
4
827
1
0
2011-06-03T03:23:51.223000
2011-06-03T06:30:21.223000
6,222,659
6,223,598
Java Grep Library
Is there any good, simple Java Grep Library? I'm not opposed to native code, or scripting, and I'll do it, but for my purposes, throughput is not a huge deal, and it would be nice to have it all in one tidy package. UPDATE: Sorry. I know about java.regex, I just happen to be fairly busy and tired right now. What I'm lo...
I'm not aware of a sophisticated grep library strong text, but you are right: it's not hard to write. I suggest a combination of commons-io and String.matches(someRegex): public class Grep extends DirectoryWalker { public Grep(){ super(); } public List clean(File startDirectory){ List results = new ArrayList(); walk(s...
Java Grep Library Is there any good, simple Java Grep Library? I'm not opposed to native code, or scripting, and I'll do it, but for my purposes, throughput is not a huge deal, and it would be nice to have it all in one tidy package. UPDATE: Sorry. I know about java.regex, I just happen to be fairly busy and tired righ...
TITLE: Java Grep Library QUESTION: Is there any good, simple Java Grep Library? I'm not opposed to native code, or scripting, and I'll do it, but for my purposes, throughput is not a huge deal, and it would be nice to have it all in one tidy package. UPDATE: Sorry. I know about java.regex, I just happen to be fairly b...
[ "java", "grep" ]
22
15
28,592
4
0
2011-06-03T03:24:07.520000
2011-06-03T06:10:09.643000
6,222,662
6,226,868
Navigation within pages in Wordpress
Some friends of mine am starting an art blog and am aiming to use WordPress for usability reasons as their PHP/HTML/CSS experience is minimal. However, we are running into a roadblock in that we are finding it difficult to accomplish multi-level navigation within Wordpress: that is; for each WordPress 'page', there mus...
I normally use categories to do that. What I suggest you to do is to create a category for each person and then create sub-categories, sub-pages or posts under each one. You can then create template that will target different type of pages, you can also target some keywords.
Navigation within pages in Wordpress Some friends of mine am starting an art blog and am aiming to use WordPress for usability reasons as their PHP/HTML/CSS experience is minimal. However, we are running into a roadblock in that we are finding it difficult to accomplish multi-level navigation within Wordpress: that is;...
TITLE: Navigation within pages in Wordpress QUESTION: Some friends of mine am starting an art blog and am aiming to use WordPress for usability reasons as their PHP/HTML/CSS experience is minimal. However, we are running into a roadblock in that we are finding it difficult to accomplish multi-level navigation within W...
[ "wordpress", "plugins", "navigation", "gallery" ]
0
2
286
1
0
2011-06-03T03:24:25.273000
2011-06-03T12:05:15.913000
6,222,664
6,222,755
getting the value of an object node - javascript
newbie here.. wondering why in the table i get something called '[object node]' and not the actual value? Untitled Document Players
To answer your comment: In IE8 atleast you can use the.text property of a node like so: var myNodes = xmlDoc.getElementsByTagName('node'); document.getElementById('result').innerHTML = myNodes[0].text; Some good articles are alistapart AJAX and a MS blog with some good examples too. Here is a jsfiddle that works fine i...
getting the value of an object node - javascript newbie here.. wondering why in the table i get something called '[object node]' and not the actual value? Untitled Document Players
TITLE: getting the value of an object node - javascript QUESTION: newbie here.. wondering why in the table i get something called '[object node]' and not the actual value? Untitled Document Players ANSWER: To answer your comment: In IE8 atleast you can use the.text property of a node like so: var myNodes = xmlDoc.get...
[ "javascript" ]
1
0
279
1
0
2011-06-03T03:24:36.917000
2011-06-03T03:45:34.210000
6,222,668
6,223,035
HDMI Output for App On IPad 2
Im just wondering if there is any code needed in application to utilize the new HDMI output ability with the iPad 2? Or is it the fact that you just plug it in and it will just replicate what is on the iPad screen? Thanks
I wrote this game: http://itunes.apple.com/us/app/blaster-through-asteroid-field/id414827482?mt=8 before the iPad2 came out, without any specific code to output the display. When my iPad2 came in I was able to plug it into a projector as-is and display it live on both the iPad and the projector simultaneously (no notic...
HDMI Output for App On IPad 2 Im just wondering if there is any code needed in application to utilize the new HDMI output ability with the iPad 2? Or is it the fact that you just plug it in and it will just replicate what is on the iPad screen? Thanks
TITLE: HDMI Output for App On IPad 2 QUESTION: Im just wondering if there is any code needed in application to utilize the new HDMI output ability with the iPad 2? Or is it the fact that you just plug it in and it will just replicate what is on the iPad screen? Thanks ANSWER: I wrote this game: http://itunes.apple.co...
[ "iphone", "ipad", "ipad-2" ]
0
0
300
1
0
2011-06-03T03:26:19.180000
2011-06-03T04:43:50.977000
6,222,669
6,224,221
Bash or PHP Cron Script To Clear Out Email
In cPanel on Linux hosting, they let you create email forwarders, but the original emails still reside on the server. Because of spam filtering, however, some of that mail may be kept back and I may be called to debug the email. So, leaving the mail on the mail server for awhile seems a good idea. Okay, but then once e...
4 months ~ 120 days You can use find to delete files older than a certain number of days. Place this in your crontab to run on the first day of every month, say at 9am: 00 09 1 * * find /path/to/mail -type f -mtime +120 -print -exec rm {} \; > /var/tmp/mailDelete.log 2>&1 Cron format is: [min] [hour] [day_of_month] [mo...
Bash or PHP Cron Script To Clear Out Email In cPanel on Linux hosting, they let you create email forwarders, but the original emails still reside on the server. Because of spam filtering, however, some of that mail may be kept back and I may be called to debug the email. So, leaving the mail on the mail server for awhi...
TITLE: Bash or PHP Cron Script To Clear Out Email QUESTION: In cPanel on Linux hosting, they let you create email forwarders, but the original emails still reside on the server. Because of spam filtering, however, some of that mail may be kept back and I may be called to debug the email. So, leaving the mail on the ma...
[ "bash", "email" ]
2
2
387
1
0
2011-06-03T03:26:21.433000
2011-06-03T07:28:22.453000
6,222,670
6,226,160
Apostrophe got through filter in C#
I'm really sorry to do this, but this problem represents a possibly exploitable security issue on a site I work on, so I'm posting this with a new account. We have a script that takes in user comments (all comments are in English). We have amassed approximately 3,000,000 comments in two years. I was checking the commen...
This sounds like your storage inside the DBMS is using a non-unicode column type whilst.net is using unicode. You could within.net initially convert the unicode to your dbms' collation and then back to unicode to remove any unsupported characters at the application level rather than leaving that to the dbms/connector. ...
Apostrophe got through filter in C# I'm really sorry to do this, but this problem represents a possibly exploitable security issue on a site I work on, so I'm posting this with a new account. We have a script that takes in user comments (all comments are in English). We have amassed approximately 3,000,000 comments in ...
TITLE: Apostrophe got through filter in C# QUESTION: I'm really sorry to do this, but this problem represents a possibly exploitable security issue on a site I work on, so I'm posting this with a new account. We have a script that takes in user comments (all comments are in English). We have amassed approximately 3,00...
[ "c#", "security", "character-encoding", "xss" ]
10
1
1,302
3
0
2011-06-03T03:26:33.237000
2011-06-03T10:53:02.753000
6,222,671
6,222,714
Angle from vector
Say I have point A (20,20) and point B (60,60). The resulting vector would be 40, 40. How could I get the angle of this vector? By this I mean, imagine there is an imaginary circle around the origin. I guess sort of what atan2 does but without atan2. Thank
I'm not sure what you mean by angle, since you only give one vector in your example. But, given two vectors, you can find the angle between them like so: Given vectors a and b, normalize both of them. Then, dot( a, b ) = cos(θ), where θ is the angle between the two vectors. Use arccos to find θ.
Angle from vector Say I have point A (20,20) and point B (60,60). The resulting vector would be 40, 40. How could I get the angle of this vector? By this I mean, imagine there is an imaginary circle around the origin. I guess sort of what atan2 does but without atan2. Thank
TITLE: Angle from vector QUESTION: Say I have point A (20,20) and point B (60,60). The resulting vector would be 40, 40. How could I get the angle of this vector? By this I mean, imagine there is an imaginary circle around the origin. I guess sort of what atan2 does but without atan2. Thank ANSWER: I'm not sure what ...
[ "algorithm", "vector" ]
1
1
1,828
3
0
2011-06-03T03:26:39.897000
2011-06-03T03:36:06.267000
6,222,673
6,234,816
Rails 3.1 Deployment to Heroku Error
I'm trying to deploy my app to Heroku, I've done this before on my Windows machine, and now I am currently using a mac. I'm trying to use Postgresql for the first time. I have the following in my Gemfile: gem 'pg' EDIT: AndrewDavis-OSX:lunchbox ardavis$ rvm list rvm rubies => ruby-1.9.2-p180 [ x86_64 ] AndrewDavis-O...
The Heroku stack needs to be migrated, you can run this command to do so: heroku stack:migrate bamboo-mri-1.9.2 I was running 1.9.2 locally, which is why it was working locally. But on Heroku, it was running 1.8.7.
Rails 3.1 Deployment to Heroku Error I'm trying to deploy my app to Heroku, I've done this before on my Windows machine, and now I am currently using a mac. I'm trying to use Postgresql for the first time. I have the following in my Gemfile: gem 'pg' EDIT: AndrewDavis-OSX:lunchbox ardavis$ rvm list rvm rubies => ruby...
TITLE: Rails 3.1 Deployment to Heroku Error QUESTION: I'm trying to deploy my app to Heroku, I've done this before on my Windows machine, and now I am currently using a mac. I'm trying to use Postgresql for the first time. I have the following in my Gemfile: gem 'pg' EDIT: AndrewDavis-OSX:lunchbox ardavis$ rvm list r...
[ "ruby-on-rails", "deployment", "heroku", "initializer", "ruby-on-rails-3.1" ]
13
11
9,017
3
0
2011-06-03T03:26:48.657000
2011-06-04T05:02:46.667000
6,222,686
6,222,922
access data from json_encode
Below is the code generated by json_encode() at the ajax page. Now, I want to retrieve the data (Title, ISBN, Authors...). Can anyone give me a hand? I've looked at jQuery.parseJSON function but get confused. { "9780077225957": { "Items_Data": { "Title": "Developing Management Skills: What Great Managers Know and Do", ...
Just assigning in a JavaScript variable will work though I think you need to change 9780077225957 as key at the very first because you wont be access it using (.) operator. I have changed that to Book9780077225957 and working fine. Here is the code I have used var book = { "Book9780077225957": { "Items_Data": { "Title"...
access data from json_encode Below is the code generated by json_encode() at the ajax page. Now, I want to retrieve the data (Title, ISBN, Authors...). Can anyone give me a hand? I've looked at jQuery.parseJSON function but get confused. { "9780077225957": { "Items_Data": { "Title": "Developing Management Skills: What ...
TITLE: access data from json_encode QUESTION: Below is the code generated by json_encode() at the ajax page. Now, I want to retrieve the data (Title, ISBN, Authors...). Can anyone give me a hand? I've looked at jQuery.parseJSON function but get confused. { "9780077225957": { "Items_Data": { "Title": "Developing Manage...
[ "javascript", "ajax", "json" ]
0
0
406
2
0
2011-06-03T03:29:35.553000
2011-06-03T04:20:23.110000
6,222,690
6,261,657
Prevent a scrollviewer from refocusing to the left after expanding a child in a treeview
I have a customized TreeView inside a ScrollViewer (I needed to overwrite the template for this application). The treeviewitems have two columns. One for the togglebutton and the other for the content. The toggle button column width has been set to 0 to hide the toggle button and align all the elements. The items data ...
Well the suggestion I received from a colleague was to catch the event. I tried a few different events and found the one that bubbled up to the ScrollViewer. I caught the MouseDown event on the rectangle, marked it as handled and traversed up the event.Source.Parent until I got to the control to expand the child. Hope ...
Prevent a scrollviewer from refocusing to the left after expanding a child in a treeview I have a customized TreeView inside a ScrollViewer (I needed to overwrite the template for this application). The treeviewitems have two columns. One for the togglebutton and the other for the content. The toggle button column widt...
TITLE: Prevent a scrollviewer from refocusing to the left after expanding a child in a treeview QUESTION: I have a customized TreeView inside a ScrollViewer (I needed to overwrite the template for this application). The treeviewitems have two columns. One for the togglebutton and the other for the content. The toggle ...
[ "wpf", "treeview", "scrollviewer" ]
0
0
231
1
0
2011-06-03T03:30:56.693000
2011-06-07T07:01:03.817000
6,222,693
6,222,722
How is this binary string being used?
Im studying some ruby code and I see this "varx" variable being used with [0x140,4] <- What does that means? I couldn't find any ruby doc showing that. The varx is something like a binary string. varx[0x140, 4] = [0x4a8acb38 - 0x1c].pack('V')
It is replacing 4 "things" in varx starting at index 0x140 in varx with the data returned from the RHS side. Example: s="my name is prince"; s[11,6] = "John"; s => "my name is John"
How is this binary string being used? Im studying some ruby code and I see this "varx" variable being used with [0x140,4] <- What does that means? I couldn't find any ruby doc showing that. The varx is something like a binary string. varx[0x140, 4] = [0x4a8acb38 - 0x1c].pack('V')
TITLE: How is this binary string being used? QUESTION: Im studying some ruby code and I see this "varx" variable being used with [0x140,4] <- What does that means? I couldn't find any ruby doc showing that. The varx is something like a binary string. varx[0x140, 4] = [0x4a8acb38 - 0x1c].pack('V') ANSWER: It is replac...
[ "ruby", "string", "binary", "pack" ]
1
0
123
1
0
2011-06-03T03:31:30.403000
2011-06-03T03:38:06.317000
6,222,695
6,222,741
Works perfectly in jsfiddle, but not in live website. Why?
Website test page: http://www.lantiis.com/indexold.html jsFiddle: http://jsfiddle.net/Guhb4/7/ I received help with the jQuery and it works perfect in jsFiddle. (temp sign-in as Lantiis here: Can independently show/hide. How do I hide on show? ) When I transfered the code, everything worked except the images. The backg...
You need to include the jQuery library in your HTML. http://docs.jquery.com/Downloading_jQuery And wrap your jQuery code in the following: http://docs.jquery.com/How_jQuery_Works#Launching_Code_on_Document_Ready
Works perfectly in jsfiddle, but not in live website. Why? Website test page: http://www.lantiis.com/indexold.html jsFiddle: http://jsfiddle.net/Guhb4/7/ I received help with the jQuery and it works perfect in jsFiddle. (temp sign-in as Lantiis here: Can independently show/hide. How do I hide on show? ) When I transfer...
TITLE: Works perfectly in jsfiddle, but not in live website. Why? QUESTION: Website test page: http://www.lantiis.com/indexold.html jsFiddle: http://jsfiddle.net/Guhb4/7/ I received help with the jQuery and it works perfect in jsFiddle. (temp sign-in as Lantiis here: Can independently show/hide. How do I hide on show?...
[ "javascript", "jquery", "jsfiddle" ]
1
1
776
2
0
2011-06-03T03:32:41.860000
2011-06-03T03:42:26.283000
6,222,705
6,222,919
Slightly-transparent white line around UIImage after adding overlays?
I have a function that will overlay images over another image and return as a UIImage. However, a white line-ish thing comes up on it. Here's what I have - (UIImage * ) romanticFilterImage: (UIImage *) imageA { UIImage *vintageOne = [UIImage imageNamed:@"filter_vintage_1.png"]; UIImage *vintageTwo= [UIImage imageNamed...
Aren't you stroking the image white in these lines? CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 5.0, 5.0, 5.0, 5.0); CGContextStrokeRect(context, rect); UIImage *testImg = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); Although I am not sure if yo...
Slightly-transparent white line around UIImage after adding overlays? I have a function that will overlay images over another image and return as a UIImage. However, a white line-ish thing comes up on it. Here's what I have - (UIImage * ) romanticFilterImage: (UIImage *) imageA { UIImage *vintageOne = [UIImage imageNa...
TITLE: Slightly-transparent white line around UIImage after adding overlays? QUESTION: I have a function that will overlay images over another image and return as a UIImage. However, a white line-ish thing comes up on it. Here's what I have - (UIImage * ) romanticFilterImage: (UIImage *) imageA { UIImage *vintageOne ...
[ "objective-c", "uiimage" ]
3
3
1,232
1
0
2011-06-03T03:34:26.333000
2011-06-03T04:19:58.833000
6,222,711
6,222,916
Super Rails (aka using sudo with rails)
Whenever I try to create a new rails app I get a permission denied error. Yet when I try running rails as sudo it says rails is not a command. How would I use rails in a protected directory? Thanks.
If the Rails binary is not in a path that sudo can see, it won't run as sudo. This happens a lot on Ubuntu systems where the sudo environment is locked down. I have no idea why you're having this type of problem though - the 'rails' command is meant to be run during development, and you'd usually not be working in a lo...
Super Rails (aka using sudo with rails) Whenever I try to create a new rails app I get a permission denied error. Yet when I try running rails as sudo it says rails is not a command. How would I use rails in a protected directory? Thanks.
TITLE: Super Rails (aka using sudo with rails) QUESTION: Whenever I try to create a new rails app I get a permission denied error. Yet when I try running rails as sudo it says rails is not a command. How would I use rails in a protected directory? Thanks. ANSWER: If the Rails binary is not in a path that sudo can see...
[ "ruby-on-rails", "ruby-on-rails-3" ]
1
1
123
1
0
2011-06-03T03:35:27.953000
2011-06-03T04:19:13.183000
6,222,713
6,226,298
Creating multiple read-only properties dynamically in AS3
I have a class which at the moment is quite messy/repetitive: public class AvFramework extends Object { // vars private var _handler:AvHandler; private var _keyboard:AvKeyboard; private var _manager:AvManager; /** * Constructor */ public function AvFramework() { _handler = new AvHandler(); _keyboard = new AvKeyboard()...
You can use Proxy class to control get/set call and complete Eugeny89 answer. Look at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/Proxy.html or http://blog.joa-ebert.com/2007/05/25/as3-proxy-example/ var required:Object = { keyboard: "avian.framework.background.AvKeyboard", manager: "...
Creating multiple read-only properties dynamically in AS3 I have a class which at the moment is quite messy/repetitive: public class AvFramework extends Object { // vars private var _handler:AvHandler; private var _keyboard:AvKeyboard; private var _manager:AvManager; /** * Constructor */ public function AvFramework() ...
TITLE: Creating multiple read-only properties dynamically in AS3 QUESTION: I have a class which at the moment is quite messy/repetitive: public class AvFramework extends Object { // vars private var _handler:AvHandler; private var _keyboard:AvKeyboard; private var _manager:AvManager; /** * Constructor */ public funct...
[ "flash", "actionscript-3", "private", "dynamically-generated" ]
5
4
566
2
0
2011-06-03T03:36:00.143000
2011-06-03T11:06:28.080000
6,222,718
6,222,751
Android: LinearLayout Weight
I am trying to make my layout a bit more uniform. I have a linear layout that looks like this: So I've switched to this: Upon doing that my layout goes blank in the emulator. Please advise. I do not want to switch to Relative layout I just want to know what I'm doing wrong with this bit of code. Thanks. # Edit 6/3/2011...
In the second version, your first nested LinearLayout has a layout_height of fill_parent. That pushes everything else down off the screen. Whenever you see yourself using layout_weight when you are also using fill_parent for both width and height, then you know that you are doing something wrong. What are you trying to...
Android: LinearLayout Weight I am trying to make my layout a bit more uniform. I have a linear layout that looks like this: So I've switched to this: Upon doing that my layout goes blank in the emulator. Please advise. I do not want to switch to Relative layout I just want to know what I'm doing wrong with this bit of ...
TITLE: Android: LinearLayout Weight QUESTION: I am trying to make my layout a bit more uniform. I have a linear layout that looks like this: So I've switched to this: Upon doing that my layout goes blank in the emulator. Please advise. I do not want to switch to Relative layout I just want to know what I'm doing wrong...
[ "java", "android", "android-layout" ]
1
4
2,353
1
0
2011-06-03T03:37:17.703000
2011-06-03T03:44:08.517000
6,222,725
6,222,781
Fast 2D convolution implementation?
I've made a CUDA program for 2D convolution and now want to compare it to some non-CUDA implementation to measure the speedup. I could compare to my own implementation in plain C using the classical multiple loop approach or matlab's conv2 but it doesn't feel like a legit/fair comparison, since they're not the fastest ...
The fastest general 2D convolution algorithm is going to perform the FFT on the source first, then correlate, then FFT back to get the result (which is what conv2 does in matlab) so your multiple loop approach probably isn't the best. The GSL is going to give you a standard, and fast implementation of the FFT if you wa...
Fast 2D convolution implementation? I've made a CUDA program for 2D convolution and now want to compare it to some non-CUDA implementation to measure the speedup. I could compare to my own implementation in plain C using the classical multiple loop approach or matlab's conv2 but it doesn't feel like a legit/fair compar...
TITLE: Fast 2D convolution implementation? QUESTION: I've made a CUDA program for 2D convolution and now want to compare it to some non-CUDA implementation to measure the speedup. I could compare to my own implementation in plain C using the classical multiple loop approach or matlab's conv2 but it doesn't feel like a...
[ "optimization", "image-processing", "implementation", "signal-processing", "convolution" ]
3
5
5,552
1
0
2011-06-03T03:38:16.397000
2011-06-03T03:48:57.180000
6,222,730
6,222,795
how to retrieve path as link in asp.net which is saved in mysql?
I m saving path of images, audio and video files that path is of folder saved at server. Now I want that path as link in c# for the purpose of download. Is there any way how to do that? I'm not suppose to use gridview to show link. EDIT:- ServerFileName = System.IO.Path.Combine(ServerSavePathI, ClientFileName); string ...
Normally if you have images in folder named images under root folder of your site and you save path for an image named image1.jpg as images/image1.jpg you can get link as follows: var path="images/image1.jpg";//you get this from db var link=Page.ResolveUrl("~/"+path);//gives /images/image1.jpg ~/ specified path relativ...
how to retrieve path as link in asp.net which is saved in mysql? I m saving path of images, audio and video files that path is of folder saved at server. Now I want that path as link in c# for the purpose of download. Is there any way how to do that? I'm not suppose to use gridview to show link. EDIT:- ServerFileName =...
TITLE: how to retrieve path as link in asp.net which is saved in mysql? QUESTION: I m saving path of images, audio and video files that path is of folder saved at server. Now I want that path as link in c# for the purpose of download. Is there any way how to do that? I'm not suppose to use gridview to show link. EDIT:...
[ "c#", "asp.net", "mysql" ]
1
0
1,307
1
0
2011-06-03T03:40:06.733000
2011-06-03T03:53:13.933000
6,222,731
6,222,812
Should css class names like 'floatleft' that directly describe the attached style be avoided?
Lots of websites use class names like floatleft, clearfloat, alignright, small, center etc that describe the style that is attached to the class. This seems to make sense so when writing new content you can easily wrap (for example)... around your element to make it behave the way you want. My question is, doesn't this...
It's great until you re-design, and narrow is highlighted yellow, center converts better left-justified, and the image you called floatleft now belongs on the right. I'll admit to the sin of using floatleft and clear as CSS class names, but it is much easier to maintain your CSS if you choose names that relate to the s...
Should css class names like 'floatleft' that directly describe the attached style be avoided? Lots of websites use class names like floatleft, clearfloat, alignright, small, center etc that describe the style that is attached to the class. This seems to make sense so when writing new content you can easily wrap (for ex...
TITLE: Should css class names like 'floatleft' that directly describe the attached style be avoided? QUESTION: Lots of websites use class names like floatleft, clearfloat, alignright, small, center etc that describe the style that is attached to the class. This seems to make sense so when writing new content you can e...
[ "html", "css", "presentation" ]
51
42
7,215
20
0
2011-06-03T03:40:22.900000
2011-06-03T03:57:06.893000
6,222,735
6,226,501
Ruby on Rails Databases - how to organize a CMS?
I've a couple of questions. I'm making a rudimentary CMS with Rails to get a hang of it. It's going to have pages, blog posts that belong to certain categories (think wordpress) which admins can add/edit from admin area. I'm a bit shaky on databases and relationships between them, though. I want admins to have full acc...
think about it in terms of relations: a page belongs_to a category a category has_many pages if you want to add more categories to a page, you can think about tags (check for acts_as_taggable_on gem), it's simpler and clearer to manage;) finally, add indexes on columns where you'll need faster/frequent lookups
Ruby on Rails Databases - how to organize a CMS? I've a couple of questions. I'm making a rudimentary CMS with Rails to get a hang of it. It's going to have pages, blog posts that belong to certain categories (think wordpress) which admins can add/edit from admin area. I'm a bit shaky on databases and relationships bet...
TITLE: Ruby on Rails Databases - how to organize a CMS? QUESTION: I've a couple of questions. I'm making a rudimentary CMS with Rails to get a hang of it. It's going to have pages, blog posts that belong to certain categories (think wordpress) which admins can add/edit from admin area. I'm a bit shaky on databases and...
[ "ruby-on-rails", "ruby", "database", "content-management-system" ]
4
2
283
2
0
2011-06-03T03:40:58.890000
2011-06-03T11:24:46.813000
6,222,752
6,222,788
How can I make search result to be in a shortened url?
Rails guides show the following example as a generic search form. <%= form_tag(search_path,:method => "get") do %> <%= label_tag(:q, "Search for:") %> <%= text_field_tag(:q) %> <%= submit_tag("Search") %> <% end %> Things work fine but, if I want to find something that has "251", the resulting url from the above looks ...
How about redirecting from the search action if the param[:keywords] exists like this: redirect_to(:action => "searches",:id => params[:keywords] ) and return Depending on how your routes are setup.
How can I make search result to be in a shortened url? Rails guides show the following example as a generic search form. <%= form_tag(search_path,:method => "get") do %> <%= label_tag(:q, "Search for:") %> <%= text_field_tag(:q) %> <%= submit_tag("Search") %> <% end %> Things work fine but, if I want to find something ...
TITLE: How can I make search result to be in a shortened url? QUESTION: Rails guides show the following example as a generic search form. <%= form_tag(search_path,:method => "get") do %> <%= label_tag(:q, "Search for:") %> <%= text_field_tag(:q) %> <%= submit_tag("Search") %> <% end %> Things work fine but, if I want ...
[ "ruby-on-rails" ]
2
1
52
1
0
2011-06-03T03:44:37.407000
2011-06-03T03:50:35.537000
6,222,758
6,222,819
How to dynamically generate the raw resource identifier in android?
I am working on a mobile library app. I have a 3-4 db files of books stored in raw folder. If I know the name of the book then I first copy this file to /databases/book_name.db and then access them as required. I use InputStream fileInputStream = getResources().openRawResource(R.raw.book_name); for accessing these file...
Use Resources.getIdentifier() method: int resId = getResources().getIdentifier("raw/book_name", null, this.getPackageName()); If your code not in activity or application, you need to get Context first. Context context = getContext(); // or getBaseContext(), or getApplicationContext() int resId = context.getResources()....
How to dynamically generate the raw resource identifier in android? I am working on a mobile library app. I have a 3-4 db files of books stored in raw folder. If I know the name of the book then I first copy this file to /databases/book_name.db and then access them as required. I use InputStream fileInputStream = getRe...
TITLE: How to dynamically generate the raw resource identifier in android? QUESTION: I am working on a mobile library app. I have a 3-4 db files of books stored in raw folder. If I know the name of the book then I first copy this file to /databases/book_name.db and then access them as required. I use InputStream fileI...
[ "android" ]
14
24
11,412
3
0
2011-06-03T03:45:47.197000
2011-06-03T03:58:01.637000
6,222,764
6,222,905
CodeIgniter dynamic URI routing possible?
My application is designed to provide a single profile page for each user, with the 3rd segment being the user's ID. example.com/profile/page/1 Assuming user 1 is "Jon Jovi", using CI's routing I would like to generate this URI example.com/jon_jovi Is it possible to send this user's ID to config/routes.php, run a funct...
If you want to the "client" url to be in format base_url/[username], you will probrably need to grab the username some regex routing, like $route['([a-zA-z_]+)'] = "profile/page/$1";, and look on your database for that user. Another solution would be appending the id to the url, like base_url/[username]/[id]. For this,...
CodeIgniter dynamic URI routing possible? My application is designed to provide a single profile page for each user, with the 3rd segment being the user's ID. example.com/profile/page/1 Assuming user 1 is "Jon Jovi", using CI's routing I would like to generate this URI example.com/jon_jovi Is it possible to send this u...
TITLE: CodeIgniter dynamic URI routing possible? QUESTION: My application is designed to provide a single profile page for each user, with the 3rd segment being the user's ID. example.com/profile/page/1 Assuming user 1 is "Jon Jovi", using CI's routing I would like to generate this URI example.com/jon_jovi Is it possi...
[ "php", "codeigniter", "routes", "uri" ]
2
4
7,970
3
0
2011-06-03T03:46:41.230000
2011-06-03T04:17:29.190000