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,212,436 | 6,212,588 | c# constructor injection and constructor overloads | I'm using constructor injection for the first time and wish to write my code defensively. Therefore if I have a class with a constructor and a save method as below: public SomeConstructor(string name, Object someObject) { _name= name; _someObject= someObject; }
public void Save() { // Does a database save } But then n... | Use the friction you are experiencing as a warning system. It's really telling you that you're likely moving towards low cohesion and violation of the Single Responsibility Principle. If this is the case, refactor the class into two separate classes. | c# constructor injection and constructor overloads I'm using constructor injection for the first time and wish to write my code defensively. Therefore if I have a class with a constructor and a save method as below: public SomeConstructor(string name, Object someObject) { _name= name; _someObject= someObject; }
public... | TITLE:
c# constructor injection and constructor overloads
QUESTION:
I'm using constructor injection for the first time and wish to write my code defensively. Therefore if I have a class with a constructor and a save method as below: public SomeConstructor(string name, Object someObject) { _name= name; _someObject= som... | [
"c#",
"dependency-injection",
"constructor",
"inversion-of-control"
] | 2 | 4 | 2,208 | 4 | 0 | 2011-06-02T09:01:48.920000 | 2011-06-02T09:17:26.883000 |
6,212,438 | 6,224,391 | CruiseControl.NET parameter passing | I have a CruiseControl.NET ccnet.config file, which monitors two different projects in the same project scope. If one of them changes, it has to trigger a build. But I wanted to know which project has been changed among the two. I have to pass them as a commandline parameter. Is there any built-in property? | Splitting the project to two projects seems like the right thing to do. Specifically, split to to projects and add a Project trigger for the DML project. This way if the table scripts are to be changed, both projects will be triggered and if only some DML statement changes, only the second project will be triggered. In... | CruiseControl.NET parameter passing I have a CruiseControl.NET ccnet.config file, which monitors two different projects in the same project scope. If one of them changes, it has to trigger a build. But I wanted to know which project has been changed among the two. I have to pass them as a commandline parameter. Is ther... | TITLE:
CruiseControl.NET parameter passing
QUESTION:
I have a CruiseControl.NET ccnet.config file, which monitors two different projects in the same project scope. If one of them changes, it has to trigger a build. But I wanted to know which project has been changed among the two. I have to pass them as a commandline ... | [
"cruisecontrol.net",
"nant"
] | 1 | 3 | 324 | 1 | 0 | 2011-06-02T09:02:09.490000 | 2011-06-03T07:49:59.427000 |
6,212,441 | 6,214,607 | how to send Camera video using flash socket | this is my flash as3 code: var cam:Camera;
cam= Camera.getCamera();
var video:Video=new Video(200,200); video.attachCamera(cam); addChild(video); use this code, i can see my Camera in this swf file, now i want to send/get this video to my friend using flash socket, so, i would create a client file and a server file u... | Are you sure you want to user flash.net.Socket instead of simple flash.net.NetStream? Why? I would recommend NetStream, see NetStream.attachCamera() You can use server publishing (FMS, Wowza, Red5), P2P direct connection or P2P NetGroup (with Adobe Cirrus), or just LAN P2P with NetGroup IP multicast (works without inte... | how to send Camera video using flash socket this is my flash as3 code: var cam:Camera;
cam= Camera.getCamera();
var video:Video=new Video(200,200); video.attachCamera(cam); addChild(video); use this code, i can see my Camera in this swf file, now i want to send/get this video to my friend using flash socket, so, i wo... | TITLE:
how to send Camera video using flash socket
QUESTION:
this is my flash as3 code: var cam:Camera;
cam= Camera.getCamera();
var video:Video=new Video(200,200); video.attachCamera(cam); addChild(video); use this code, i can see my Camera in this swf file, now i want to send/get this video to my friend using flas... | [
"flash",
"sockets",
"video"
] | 0 | 0 | 807 | 1 | 0 | 2011-06-02T09:02:45.203000 | 2011-06-02T12:38:26.490000 |
6,212,445 | 6,224,858 | Stretching element to contain all children | How is it possible in QML to automatically stretch element so that all its childs fit in it? And how to specify spacing? For example, I would like to have a rectangle around a text. The rectangle should have some internal spacing. If I write the following then the rectangle has a size of 0,0. Rectangle { color: "gray" ... | You can use the childrenRect property for this: import QtQuick 2.0
Rectangle { width: 320 height: 200
Rectangle { color: "BurlyWood" anchors.centerIn: parent width: childrenRect.width + 20 height: childrenRect.height + 20
Text { id: hello x: 10 y: 10 text: "Hello" }
Text { anchors.left: hello.right anchors.leftMarg... | Stretching element to contain all children How is it possible in QML to automatically stretch element so that all its childs fit in it? And how to specify spacing? For example, I would like to have a rectangle around a text. The rectangle should have some internal spacing. If I write the following then the rectangle ha... | TITLE:
Stretching element to contain all children
QUESTION:
How is it possible in QML to automatically stretch element so that all its childs fit in it? And how to specify spacing? For example, I would like to have a rectangle around a text. The rectangle should have some internal spacing. If I write the following the... | [
"qt",
"qml"
] | 32 | 51 | 24,950 | 3 | 0 | 2011-06-02T09:03:04.373000 | 2011-06-03T08:42:34.960000 |
6,212,447 | 6,212,549 | SQL Server: How to check if a windows user exists in the database but under a different user name | I am trying to create a user via a T-SQL script in SQL Server 2005/2008. I run the following SQL to check if the user exists and create the user if it does not: IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'MyDomain\MyUser') BEGIN CREATE USER [MyDomain\MyUser] FOR LOGIN [MyDomain\MyUser] WITH defa... | Do the testing for windows user vs sys.database_principals using the SID rather than the name/user_id: select * from sys.database_principals where sid = SUSER_SID(N'MyDomain\MyUser') Since this uses the SID of the login ID, it doesn't matter what name it was mapped to in the database. | SQL Server: How to check if a windows user exists in the database but under a different user name I am trying to create a user via a T-SQL script in SQL Server 2005/2008. I run the following SQL to check if the user exists and create the user if it does not: IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE na... | TITLE:
SQL Server: How to check if a windows user exists in the database but under a different user name
QUESTION:
I am trying to create a user via a T-SQL script in SQL Server 2005/2008. I run the following SQL to check if the user exists and create the user if it does not: IF NOT EXISTS (SELECT * FROM sys.database_p... | [
"sql",
"sql-server",
"sql-server-2005",
"t-sql",
"sql-server-2008"
] | 7 | 14 | 10,738 | 1 | 0 | 2011-06-02T09:03:12.297000 | 2011-06-02T09:14:16.587000 |
6,212,453 | 6,212,611 | How to send a Get request in iOS? | I am making a library to get response from a particular URL with specified data and method type. For this, I am making a request with url. But when I set its method type, it shows an exception of unrecognized selector send in [NSURLRequest setHTTPMethod:] I am setting it as [requestObject setHTTPMethod:@"GET"]; Tell me... | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:serverAddress] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10 ];
[request setHTTPMethod: @"GET"];
NSError *requestError = nil; NSURLResponse *urlResponse = nil;
NSData *response1 = [NSURLConnecti... | How to send a Get request in iOS? I am making a library to get response from a particular URL with specified data and method type. For this, I am making a request with url. But when I set its method type, it shows an exception of unrecognized selector send in [NSURLRequest setHTTPMethod:] I am setting it as [requestObj... | TITLE:
How to send a Get request in iOS?
QUESTION:
I am making a library to get response from a particular URL with specified data and method type. For this, I am making a request with url. But when I set its method type, it shows an exception of unrecognized selector send in [NSURLRequest setHTTPMethod:] I am setting... | [
"iphone",
"objective-c",
"url",
"get",
"nsurl"
] | 26 | 82 | 66,323 | 4 | 0 | 2011-06-02T09:03:59.633000 | 2011-06-02T09:19:40.487000 |
6,212,457 | 6,212,569 | How to do reverse for get_absolute_url with many to many field? | I have a model with many-to-many fields and I need to get an ID selected from a many to many field. I decorated a get_absolute_url method with permaling decorator. And it doesn't work. So I understand that I need to reverse the relation, it is obvious from the trace, but I do not really understand what should I do? Mod... | without seeing the url pattern. self.filter_ids does not return a list of ids, something like. self.filter_ids.all().values_list('id', flat=True) would return [1,2,3] | How to do reverse for get_absolute_url with many to many field? I have a model with many-to-many fields and I need to get an ID selected from a many to many field. I decorated a get_absolute_url method with permaling decorator. And it doesn't work. So I understand that I need to reverse the relation, it is obvious from... | TITLE:
How to do reverse for get_absolute_url with many to many field?
QUESTION:
I have a model with many-to-many fields and I need to get an ID selected from a many to many field. I decorated a get_absolute_url method with permaling decorator. And it doesn't work. So I understand that I need to reverse the relation, ... | [
"python",
"django",
"django-models",
"django-urls"
] | 1 | 1 | 1,703 | 3 | 0 | 2011-06-02T09:04:17.693000 | 2011-06-02T09:15:34.367000 |
6,212,459 | 6,212,531 | Why this handler (runnable) is slowing down my app if it is launched on a service? | i am using a background service that it is retrieving data and inserting data on a remote server. OK, i puted it on a background service because i wanted to get that done in background without slowing down my app, but it is slowing down my app! as you will see in the code, it haves a sleep of 60 seconds, and my app is ... | Even if you created a service it doesn't mean it will run on a separate thread. Take a look http://developer.android.com/reference/android/app/Service.html Note that services, like other application objects, run in the main thread of their hosting process. This means that, if your service is going to do any CPU intensi... | Why this handler (runnable) is slowing down my app if it is launched on a service? i am using a background service that it is retrieving data and inserting data on a remote server. OK, i puted it on a background service because i wanted to get that done in background without slowing down my app, but it is slowing down ... | TITLE:
Why this handler (runnable) is slowing down my app if it is launched on a service?
QUESTION:
i am using a background service that it is retrieving data and inserting data on a remote server. OK, i puted it on a background service because i wanted to get that done in background without slowing down my app, but i... | [
"android",
"handler",
"runnable"
] | 1 | 2 | 1,496 | 1 | 0 | 2011-06-02T09:04:23.747000 | 2011-06-02T09:12:43.060000 |
6,212,461 | 6,215,382 | Adding data to createTableViewRow() in appcelerator | How can i add custom data to a TableViewRow? I'm using createTableViewRow() to setup a TableRow which I'm then added labels and images to it, then finally putting all these TableRows in a TableView. This works fine, but the rows need to have a "date" attribute attached to them, as I'm sorted these rows by dates before ... | var row = Ti.UI.createTableViewRow({height:50, _date_var: date}); it can just be attached as a property and retrieved like this row._date_var | Adding data to createTableViewRow() in appcelerator How can i add custom data to a TableViewRow? I'm using createTableViewRow() to setup a TableRow which I'm then added labels and images to it, then finally putting all these TableRows in a TableView. This works fine, but the rows need to have a "date" attribute attache... | TITLE:
Adding data to createTableViewRow() in appcelerator
QUESTION:
How can i add custom data to a TableViewRow? I'm using createTableViewRow() to setup a TableRow which I'm then added labels and images to it, then finally putting all these TableRows in a TableView. This works fine, but the rows need to have a "date"... | [
"javascript",
"date",
"titanium",
"appcelerator"
] | 0 | 3 | 978 | 3 | 0 | 2011-06-02T09:04:31.050000 | 2011-06-02T13:45:40.263000 |
6,212,463 | 6,212,750 | Assistance needed with join query | I have two very simple tables in Oracle 9G: Customer userid | firstName | lastName | email -------+-----------+----------+--------------------- 1 user1 User1 user1@mail.in 2 user2 User2 user2@mail.in Order orderiD | userId | OrderType | Order_Date | Amount --------+--------+-----------+------------+------- 1 1 0 12/12/... | SELECT * FROM order o WHERE o.orderType ='0' AND o.order_date = ( SELECT MAX(o2.order_date) FROM order o2 WHERE o2.userid = o.userid AND o2.orderType = '0' ) or SELECT o.* FROM order o JOIN ( SELECT userid, MAX(order_date) AS lastPurchaseDate FROM order WHERE o.orderType ='0' GROUP BY userid ) AS grp ON grp.userid = o.... | Assistance needed with join query I have two very simple tables in Oracle 9G: Customer userid | firstName | lastName | email -------+-----------+----------+--------------------- 1 user1 User1 user1@mail.in 2 user2 User2 user2@mail.in Order orderiD | userId | OrderType | Order_Date | Amount --------+--------+-----------... | TITLE:
Assistance needed with join query
QUESTION:
I have two very simple tables in Oracle 9G: Customer userid | firstName | lastName | email -------+-----------+----------+--------------------- 1 user1 User1 user1@mail.in 2 user2 User2 user2@mail.in Order orderiD | userId | OrderType | Order_Date | Amount --------+--... | [
"sql",
"oracle",
"plsql"
] | 0 | 3 | 87 | 4 | 0 | 2011-06-02T09:04:42.423000 | 2011-06-02T09:35:59.133000 |
6,212,465 | 6,212,490 | How can I select the next div using jQuery? | I am quite a noob when it comes to jQuery and I'm trying to select the next element using the next() selector but having a little trouble in getting it to work! What I'm trying to do is to activate slideDown() once the user has finished making their selection on a ui slider. Here is my code: $('.slider').slider({ stop:... | nextAll only gets siblings. Based on your HTML structure, you could do: $(this).parent().next() To make it more independent from the structure, you could also do: $(this).closest('.slidewrap').nextAll('.secondq:first') | How can I select the next div using jQuery? I am quite a noob when it comes to jQuery and I'm trying to select the next element using the next() selector but having a little trouble in getting it to work! What I'm trying to do is to activate slideDown() once the user has finished making their selection on a ui slider. ... | TITLE:
How can I select the next div using jQuery?
QUESTION:
I am quite a noob when it comes to jQuery and I'm trying to select the next element using the next() selector but having a little trouble in getting it to work! What I'm trying to do is to activate slideDown() once the user has finished making their selectio... | [
"javascript",
"html",
"jquery",
"jquery-selectors",
"uislider"
] | 0 | 3 | 1,500 | 1 | 0 | 2011-06-02T09:04:58.897000 | 2011-06-02T09:08:18.303000 |
6,212,475 | 6,213,074 | How to use TScrollbar to richedit; | How to use Tscrollbar to Richedit. My purpose is to separate the scrollbar in a deferent panel. is it possible? | You can try this: procedure TForm1.ScrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); var WParam: longint;
begin case ScrollCode of scLineUp: WParam:= SB_LINEUP; scLineDown: WParam:= SB_LINEDOWN; scPageUp: WParam:= SB_PAGEUP; scPageDown: WParam:= SB_PAGEDOWN; scEndScroll: WParam:= SB_E... | How to use TScrollbar to richedit; How to use Tscrollbar to Richedit. My purpose is to separate the scrollbar in a deferent panel. is it possible? | TITLE:
How to use TScrollbar to richedit;
QUESTION:
How to use Tscrollbar to Richedit. My purpose is to separate the scrollbar in a deferent panel. is it possible?
ANSWER:
You can try this: procedure TForm1.ScrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); var WParam: longint;
begin... | [
"delphi",
"richedit",
"scrollbars"
] | 1 | 1 | 3,448 | 2 | 0 | 2011-06-02T09:06:17.163000 | 2011-06-02T10:06:30.157000 |
6,212,476 | 6,212,493 | What does #define macro() <...> do? | What does this line do? I doubt its a template or expression. (doing those divies and naming a member hpp is a bad idea) # define BOOST_PP_UPDATE_COUNTER() Full file # /* ************************************************************************** # * * # * (C) Copyright Paul Mensonides 2005. * # * Distributed under the ... | Apparently it does some auto-incrementing magic. Here's the documentation. I have no idea how it works. What I do know is that the magic is in counter.hpp itself; that the definition you posted has brackets in it is just so that you can write the vaguely user-friendly: #include BOOST_PP_UPDATE_COUNTER() to invoke said ... | What does #define macro() <...> do? What does this line do? I doubt its a template or expression. (doing those divies and naming a member hpp is a bad idea) # define BOOST_PP_UPDATE_COUNTER() Full file # /* ************************************************************************** # * * # * (C) Copyright Paul Mensonide... | TITLE:
What does #define macro() <...> do?
QUESTION:
What does this line do? I doubt its a template or expression. (doing those divies and naming a member hpp is a bad idea) # define BOOST_PP_UPDATE_COUNTER() Full file # /* ************************************************************************** # * * # * (C) Copyri... | [
"c++",
"boost",
"macros",
"c-preprocessor"
] | 3 | 6 | 575 | 2 | 0 | 2011-06-02T09:06:22.520000 | 2011-06-02T09:08:26.967000 |
6,212,482 | 6,212,529 | How to load multiple controls in a view | I am still clueless how to start preparing a form like this on MVC 3. I am a beginner and all I have learned till now is to bind data from controller to the strongly typed view. But as I know that we can return only one varibale from the return statment public ActionResult(int id) { // Do some logic return View(role); ... | You would write a view model: public class MyViewModel { public SomeModel1 Section1 { get; set; } public SomeModel2 Section2 { get; set; } public SomeModel3 Section3 { get; set; } } and in your controller action you will return this view model to the view: public class HomeController: Controller { public ActionResult I... | How to load multiple controls in a view I am still clueless how to start preparing a form like this on MVC 3. I am a beginner and all I have learned till now is to bind data from controller to the strongly typed view. But as I know that we can return only one varibale from the return statment public ActionResult(int id... | TITLE:
How to load multiple controls in a view
QUESTION:
I am still clueless how to start preparing a form like this on MVC 3. I am a beginner and all I have learned till now is to bind data from controller to the strongly typed view. But as I know that we can return only one varibale from the return statment public A... | [
"asp.net-mvc-3",
"view",
"controller",
"razor"
] | 1 | 1 | 826 | 1 | 0 | 2011-06-02T09:07:16.353000 | 2011-06-02T09:12:22.047000 |
6,212,486 | 6,212,919 | Show legend in chart | I am using Microsoft Chart, and I have top Legend displayed at the top in a pie chart. Which property is used to show or hide the legend of a pie chart? | Just do the following. Legend leg = new Legend(); Chart1.Legends.Add(leg);// This will show all legends. Actually you have to create a legend object, set its different or desired properties like font, etc., and then add it to the chart. | Show legend in chart I am using Microsoft Chart, and I have top Legend displayed at the top in a pie chart. Which property is used to show or hide the legend of a pie chart? | TITLE:
Show legend in chart
QUESTION:
I am using Microsoft Chart, and I have top Legend displayed at the top in a pie chart. Which property is used to show or hide the legend of a pie chart?
ANSWER:
Just do the following. Legend leg = new Legend(); Chart1.Legends.Add(leg);// This will show all legends. Actually you h... | [
"asp.net",
"charts",
"mschart",
"legend"
] | 4 | 11 | 12,605 | 1 | 0 | 2011-06-02T09:07:58.833000 | 2011-06-02T09:52:34.197000 |
6,212,500 | 6,213,374 | Forward locking a downloaded file | I am interested in forward locking a downloaded file (an image, or a video, etc.). Is there any way to do this? As far as I can tell packages can be forward locked, but their resources remain public. Is there a way to forward lock a specific file I've downloaded to the Android? | This depends. In order to do that, you need to use a DRM forward lock. http://en.wikipedia.org/wiki/OMA_DRM http://answers.yahoo.com/question/index?qid=20091231141343AAx7cVS But doing so isn't quite simple. Also, if you are an app developer you can download files to a private folder. This should be reasonably safe but ... | Forward locking a downloaded file I am interested in forward locking a downloaded file (an image, or a video, etc.). Is there any way to do this? As far as I can tell packages can be forward locked, but their resources remain public. Is there a way to forward lock a specific file I've downloaded to the Android? | TITLE:
Forward locking a downloaded file
QUESTION:
I am interested in forward locking a downloaded file (an image, or a video, etc.). Is there any way to do this? As far as I can tell packages can be forward locked, but their resources remain public. Is there a way to forward lock a specific file I've downloaded to th... | [
"android"
] | 2 | 1 | 1,861 | 1 | 0 | 2011-06-02T09:09:36.570000 | 2011-06-02T10:34:10.027000 |
6,212,511 | 6,212,539 | how can i use from methods in other pages? | HI, i have 2 php pages.first page has some functions like Connect(),....i want to use from Connect() function in second page but when use from Connect() can not recognize it.i use from header("first.php") but have same error. how can i solve that problem? | You need to include the PHP file which contains your function(s). In this case, if you're "index" page is called index.php and your function, Connect() is stored in functions.php then you would do: index.php: include "functions.php"; Connect(); | how can i use from methods in other pages? HI, i have 2 php pages.first page has some functions like Connect(),....i want to use from Connect() function in second page but when use from Connect() can not recognize it.i use from header("first.php") but have same error. how can i solve that problem? | TITLE:
how can i use from methods in other pages?
QUESTION:
HI, i have 2 php pages.first page has some functions like Connect(),....i want to use from Connect() function in second page but when use from Connect() can not recognize it.i use from header("first.php") but have same error. how can i solve that problem?
AN... | [
"php"
] | 0 | 3 | 55 | 3 | 0 | 2011-06-02T09:10:51.373000 | 2011-06-02T09:13:25.670000 |
6,212,530 | 6,212,603 | Array Holding an another Object | options: ['Unknown', 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE'] This is my Options Array and there are 47 states in all. i don't want to add it like this. Instead can i add something like this options: [StateValue] Which would read all the values from the Object.
var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3... | You can loop through an object like so var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3, AR: 4, CA: 5, CO: 6, CT: 7, DE: 8, FL: 9 };
for(var i in StateValue) console.log(i + ":: " + StateValue[i]); so you could populate your UI in that way | Array Holding an another Object options: ['Unknown', 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE'] This is my Options Array and there are 47 states in all. i don't want to add it like this. Instead can i add something like this options: [StateValue] Which would read all the values from the Object.
var StateValue = {... | TITLE:
Array Holding an another Object
QUESTION:
options: ['Unknown', 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE'] This is my Options Array and there are 47 states in all. i don't want to add it like this. Instead can i add something like this options: [StateValue] Which would read all the values from the Object.
... | [
"javascript"
] | 0 | 3 | 97 | 1 | 0 | 2011-06-02T09:12:41.860000 | 2011-06-02T09:18:43.950000 |
6,212,532 | 6,212,649 | How can I extend the div content of my page to fit the screen? | take a look at it -> the page (simulated). BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA B... | #content { min-height: 100% } (short and simple) Edit + explanation: The above code works when you want to make sure the length of content div is always longer than the page. Yes, that always pushes the footer to the next visible page, but there is nothing wrong with it as long as you accept that. For me the better sol... | How can I extend the div content of my page to fit the screen? take a look at it -> the page (simulated). BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BL... | TITLE:
How can I extend the div content of my page to fit the screen?
QUESTION:
take a look at it -> the page (simulated). BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA ... | [
"html",
"css",
"overflow"
] | 1 | 2 | 353 | 2 | 0 | 2011-06-02T09:12:52.627000 | 2011-06-02T09:24:22.497000 |
6,212,538 | 6,213,066 | Javascript current location in all browser code? | I want to create application to fetch the current location data using Java script. I want to use this code in any of the browser Firefox,IE,Safari,Chrome,Opera mini along with any version.(1.x,2.x,3.x,.4.x).... I have tried but it is running with some of the browser and with limited version. can any body help me out to... | Here is the solution which abstracts from platform http://code.google.com/p/geo-location-javascript/ if you talk about geolocation. | Javascript current location in all browser code? I want to create application to fetch the current location data using Java script. I want to use this code in any of the browser Firefox,IE,Safari,Chrome,Opera mini along with any version.(1.x,2.x,3.x,.4.x).... I have tried but it is running with some of the browser and ... | TITLE:
Javascript current location in all browser code?
QUESTION:
I want to create application to fetch the current location data using Java script. I want to use this code in any of the browser Firefox,IE,Safari,Chrome,Opera mini along with any version.(1.x,2.x,3.x,.4.x).... I have tried but it is running with some o... | [
"javascript",
"location"
] | 0 | 4 | 2,914 | 2 | 0 | 2011-06-02T09:13:22.020000 | 2011-06-02T10:05:32.983000 |
6,212,540 | 6,214,666 | Setting up multiple test folders in a SBT project | We'd like to set up our SBT project so that we have multiple test folders as opposed to one. So we'd like to see: root src test scala unit functional How would we configure our SBT project file paths to do this? | SBT 0.9.x: (sourceDirectories in Test):= Seq(new File("src/test/scala/unit"), new File("src/test/scala/functional")) SBT 0.7.x: override def testSourceRoots = ("src" / "test") +++ "scala" +++ ("unit" / "functional") | Setting up multiple test folders in a SBT project We'd like to set up our SBT project so that we have multiple test folders as opposed to one. So we'd like to see: root src test scala unit functional How would we configure our SBT project file paths to do this? | TITLE:
Setting up multiple test folders in a SBT project
QUESTION:
We'd like to set up our SBT project so that we have multiple test folders as opposed to one. So we'd like to see: root src test scala unit functional How would we configure our SBT project file paths to do this?
ANSWER:
SBT 0.9.x: (sourceDirectories i... | [
"scala",
"sbt",
"scalatest"
] | 9 | 6 | 1,961 | 1 | 0 | 2011-06-02T09:13:25.557000 | 2011-06-02T12:44:08.160000 |
6,212,541 | 6,212,868 | socket send part down but receive part Up , possible? | I am wondering if it is possible to have a socket with send which doens't work (because buffer of peer is full maybe) while receive part still working? EDIT: In case of a peer which doesn't perform a half close connection, and which it is too long to process its receive buffer (so its receive buffer is full), can I hav... | Short answer: yes. If remote peer receives data at a slow rate (possibly due to slow data processing between recv calls) it will slow down transmission at a sending side: ACKs will be coming slowly and sending buffer will quickly get full which will cause your socket send operation to block or return error. On the othe... | socket send part down but receive part Up , possible? I am wondering if it is possible to have a socket with send which doens't work (because buffer of peer is full maybe) while receive part still working? EDIT: In case of a peer which doesn't perform a half close connection, and which it is too long to process its rec... | TITLE:
socket send part down but receive part Up , possible?
QUESTION:
I am wondering if it is possible to have a socket with send which doens't work (because buffer of peer is full maybe) while receive part still working? EDIT: In case of a peer which doesn't perform a half close connection, and which it is too long ... | [
"c++",
"sockets"
] | 0 | 1 | 85 | 3 | 0 | 2011-06-02T09:13:32.217000 | 2011-06-02T09:48:06.563000 |
6,212,545 | 6,212,669 | Migration trobules upgrading from vb6 to vb.net | I want to upgrade Vb5 code to Vb.net but I don't know how to upgrade this command strMsgDtl and vbCrLf are string: strMsgDtl = strMsgDtl & String(75, "-") & vbCrLf What does the following command mean?? String(75, "-") | String(75,"-") creates a string 75 characters long, made of the "-" character. VB.Net equivalent would be New String("-", 75) | Migration trobules upgrading from vb6 to vb.net I want to upgrade Vb5 code to Vb.net but I don't know how to upgrade this command strMsgDtl and vbCrLf are string: strMsgDtl = strMsgDtl & String(75, "-") & vbCrLf What does the following command mean?? String(75, "-") | TITLE:
Migration trobules upgrading from vb6 to vb.net
QUESTION:
I want to upgrade Vb5 code to Vb.net but I don't know how to upgrade this command strMsgDtl and vbCrLf are string: strMsgDtl = strMsgDtl & String(75, "-") & vbCrLf What does the following command mean?? String(75, "-")
ANSWER:
String(75,"-") creates a s... | [
"vb6-migration"
] | 0 | 1 | 116 | 1 | 0 | 2011-06-02T09:13:57.303000 | 2011-06-02T09:26:37.927000 |
6,212,559 | 6,212,661 | Stuck in the middle | When should I use margin-left:auto; margin-right:auto to center and when should I use margin-left:50%; margin-right:50%? Maybe "auto" when I am centering something contained in another element & 50% when I am centering on the page? Or I am I just hopelessly confused? | Or I am I just hopelessly confused? Maybe:) margin-left: 50%; margin-right: 50% is not generally useful: http://jsfiddle.net/VcDYr/ Where you might use margin-left: 50% is if you're centering like this: http://jsfiddle.net/VcDYr/1/ To "center the page", you invariably want margin-left: auto; margin-right: auto. A short... | Stuck in the middle When should I use margin-left:auto; margin-right:auto to center and when should I use margin-left:50%; margin-right:50%? Maybe "auto" when I am centering something contained in another element & 50% when I am centering on the page? Or I am I just hopelessly confused? | TITLE:
Stuck in the middle
QUESTION:
When should I use margin-left:auto; margin-right:auto to center and when should I use margin-left:50%; margin-right:50%? Maybe "auto" when I am centering something contained in another element & 50% when I am centering on the page? Or I am I just hopelessly confused?
ANSWER:
Or I ... | [
"css"
] | 0 | 3 | 416 | 3 | 0 | 2011-06-02T09:14:48.603000 | 2011-06-02T09:25:46.163000 |
6,212,567 | 6,212,870 | What is the right way to send a watch dog request to an ASP.NET web server? | I have an ASP.NET web server and I wish to have a watchdog sending it periodic requests. Currently, I am planning to add an EmptyPage.aspx and then request it periodically from a locally running watchdog application. Is there a better way to implement the watchdog facility? P.S. The server may be deployed in an intrane... | What exactly is the purpose of WatchDog here? Do you want to make sure that your site is always running (in case of application-pool/machine restarts) or you want to do some health check? Your approach is more than sufficient for the former whilst for later, you may want to do more than Empty Page. Few things that can ... | What is the right way to send a watch dog request to an ASP.NET web server? I have an ASP.NET web server and I wish to have a watchdog sending it periodic requests. Currently, I am planning to add an EmptyPage.aspx and then request it periodically from a locally running watchdog application. Is there a better way to im... | TITLE:
What is the right way to send a watch dog request to an ASP.NET web server?
QUESTION:
I have an ASP.NET web server and I wish to have a watchdog sending it periodic requests. Currently, I am planning to add an EmptyPage.aspx and then request it periodically from a locally running watchdog application. Is there ... | [
"asp.net"
] | 1 | 2 | 604 | 1 | 0 | 2011-06-02T09:15:27.853000 | 2011-06-02T09:48:24.380000 |
6,212,570 | 6,212,657 | Reference to all JSP files in web.xml | I have all the jsp files used by a webapp in a separate folder named jsp. I tried reference all the jsp files in the web.xml by the following way. But doesn't work. What could be the problem? ** Jsps /jsp/path/ Jsps /*.jsp ** | You cannot group jsps together under one servlet. If jsp is to be declared as a servlet, Each jsp should be defined as one servlet. For ex: Jsp1 /jsp/path/myjsp.jsp Jsp1 /myjsp.jsp Jsp2 /jsp/path/myjsp2.jsp Jsp2 /myjsp2.jsp If your requirement if just to access jsps, you do not need any servlet definitions or servlet m... | Reference to all JSP files in web.xml I have all the jsp files used by a webapp in a separate folder named jsp. I tried reference all the jsp files in the web.xml by the following way. But doesn't work. What could be the problem? ** Jsps /jsp/path/ Jsps /*.jsp ** | TITLE:
Reference to all JSP files in web.xml
QUESTION:
I have all the jsp files used by a webapp in a separate folder named jsp. I tried reference all the jsp files in the web.xml by the following way. But doesn't work. What could be the problem? ** Jsps /jsp/path/ Jsps /*.jsp **
ANSWER:
You cannot group jsps togethe... | [
"apache",
"jsp",
"servlets",
"web.xml"
] | 1 | 3 | 2,942 | 1 | 0 | 2011-06-02T09:15:37.990000 | 2011-06-02T09:25:18.567000 |
6,212,572 | 6,212,683 | What's the status of std::vector::data()? | I just realized that I've been using std::vector::data() out of similarity with std::string, but a colleague pointed out that it's not standard. Apparently Gcc implements it, but looking at its include files, I found this comment: // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 464. Suggestion for new member functions in standar... | I can't comment on current compiler implementations but by looking at the c++0x standard n3290.pdf it is listed at 23.3.6.4. | What's the status of std::vector::data()? I just realized that I've been using std::vector::data() out of similarity with std::string, but a colleague pointed out that it's not standard. Apparently Gcc implements it, but looking at its include files, I found this comment: // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 464. Sugg... | TITLE:
What's the status of std::vector::data()?
QUESTION:
I just realized that I've been using std::vector::data() out of similarity with std::string, but a colleague pointed out that it's not standard. Apparently Gcc implements it, but looking at its include files, I found this comment: // _GLIBCXX_RESOLVE_LIB_DEFEC... | [
"stl",
"standards-compliance",
"stdvector"
] | 2 | 4 | 1,945 | 1 | 0 | 2011-06-02T09:15:53.280000 | 2011-06-02T09:28:09.097000 |
6,212,575 | 6,213,159 | Why the semicolon couldn't place in the CommandText of a OracleCommand when C# | Why the semicolon(';') couldn't place in the CommandText of a OracleCommand when C# Just like below: string sql = "select * from table1;"; OracleCommand oc = new OracleCommand(sql, con); oc.CommandType = CommandType.Text; oc.ExecuteNonQuery(); The result would turn out to be a error. Why? Can any one tell me the reason... | In the comments, we've worked out the answer for you. Just so you get an official "answer", here it is from the OracleOverflow site (see below): An OracleCommmand can run only 1 sql or plsql statement at a time. There is no need of separating multiple statements. The semicolon is part of documentation to divide multipl... | Why the semicolon couldn't place in the CommandText of a OracleCommand when C# Why the semicolon(';') couldn't place in the CommandText of a OracleCommand when C# Just like below: string sql = "select * from table1;"; OracleCommand oc = new OracleCommand(sql, con); oc.CommandType = CommandType.Text; oc.ExecuteNonQuery(... | TITLE:
Why the semicolon couldn't place in the CommandText of a OracleCommand when C#
QUESTION:
Why the semicolon(';') couldn't place in the CommandText of a OracleCommand when C# Just like below: string sql = "select * from table1;"; OracleCommand oc = new OracleCommand(sql, con); oc.CommandType = CommandType.Text; o... | [
"c#",
"oracle",
"ado.net"
] | 5 | 10 | 6,076 | 1 | 0 | 2011-06-02T09:16:14.043000 | 2011-06-02T10:14:21.873000 |
6,212,578 | 6,212,599 | Why is there a curled bracket on the List? | Recently stumped upon this line in a program, and I have no idea what the bracket for ( List ) is for. Anybody got any idea? List levelList = (List )dao.getAllLevels(); | Its called typecasting. The data returned from dao.getAllLevels() is being casted into type List. This operation might not always be successful, and in that case jvm/jre throws a ClassCastException. You can read more about object typecasting in Java here. More about java and type-casting on Stackoverflow: Java Type-cas... | Why is there a curled bracket on the List? Recently stumped upon this line in a program, and I have no idea what the bracket for ( List ) is for. Anybody got any idea? List levelList = (List )dao.getAllLevels(); | TITLE:
Why is there a curled bracket on the List?
QUESTION:
Recently stumped upon this line in a program, and I have no idea what the bracket for ( List ) is for. Anybody got any idea? List levelList = (List )dao.getAllLevels();
ANSWER:
Its called typecasting. The data returned from dao.getAllLevels() is being casted... | [
"java"
] | 0 | 2 | 91 | 4 | 0 | 2011-06-02T09:16:27.740000 | 2011-06-02T09:18:26.090000 |
6,212,585 | 6,212,667 | Selectable panel in Swing | I´m trying to make something similar to the downloads panel of Transmission BT (here an image: http://www.transmissionbt.com/images/screenshots/Mac-Large.jpg ) but I´m having some problems. I made a JPanel with the progress bar, labels, icon and buttons and then added this panel to a container (JPanel again) but I need... | Dont you think A table would be easier with this? It has al the functions you need. JUst create a table on a FRAME and then remove the headers so you just have the table. In this was you can easily handle what was selected.. Another way is to use a grid layout that changes on each addition and then each section of the ... | Selectable panel in Swing I´m trying to make something similar to the downloads panel of Transmission BT (here an image: http://www.transmissionbt.com/images/screenshots/Mac-Large.jpg ) but I´m having some problems. I made a JPanel with the progress bar, labels, icon and buttons and then added this panel to a container... | TITLE:
Selectable panel in Swing
QUESTION:
I´m trying to make something similar to the downloads panel of Transmission BT (here an image: http://www.transmissionbt.com/images/screenshots/Mac-Large.jpg ) but I´m having some problems. I made a JPanel with the progress bar, labels, icon and buttons and then added this pa... | [
"java",
"swing",
"jpanel"
] | 2 | 2 | 1,593 | 2 | 0 | 2011-06-02T09:17:11.177000 | 2011-06-02T09:26:25.290000 |
6,212,590 | 6,212,817 | Android - Check the certificate of an app | Hi Is there any way to check the certificate of an app (e.g. Amazon Mobile )? decompile the apk or whatever? Thanks | You can use the jarsigner tool from JDK. JDKFOLDER\bin\jarsigner.exe -verify -verbose -certs myAndroidProgram.apk | Android - Check the certificate of an app Hi Is there any way to check the certificate of an app (e.g. Amazon Mobile )? decompile the apk or whatever? Thanks | TITLE:
Android - Check the certificate of an app
QUESTION:
Hi Is there any way to check the certificate of an app (e.g. Amazon Mobile )? decompile the apk or whatever? Thanks
ANSWER:
You can use the jarsigner tool from JDK. JDKFOLDER\bin\jarsigner.exe -verify -verbose -certs myAndroidProgram.apk | [
"android",
"decompiling",
"decompiler"
] | 2 | 3 | 3,147 | 1 | 0 | 2011-06-02T09:17:45.287000 | 2011-06-02T09:42:52.300000 |
6,212,592 | 6,212,720 | Paypal IPN INVALID message When has special chacracters | When I do a payment by credit card on paypal sandbox, I fill some special characters (ex:!@#@%^ & ) on address 1/address 2 text fields. After payment, I get a IPN message, post back to PP and receive a INVALID message (HTTP error 200). I set UTF-8 on profile/language on PP. But the problem is still there. Remark: The p... | You have to be careful to send to Paypal the exact data you received in the IPN call, with the notable exception of the cmd parameter, which has to be set to _notify-validate. Here is some PHP code that takes the raw POST data, parses it to an array, changes the cmd parameter, converts it back to POST data, and sends i... | Paypal IPN INVALID message When has special chacracters When I do a payment by credit card on paypal sandbox, I fill some special characters (ex:!@#@%^ & ) on address 1/address 2 text fields. After payment, I get a IPN message, post back to PP and receive a INVALID message (HTTP error 200). I set UTF-8 on profile/langu... | TITLE:
Paypal IPN INVALID message When has special chacracters
QUESTION:
When I do a payment by credit card on paypal sandbox, I fill some special characters (ex:!@#@%^ & ) on address 1/address 2 text fields. After payment, I get a IPN message, post back to PP and receive a INVALID message (HTTP error 200). I set UTF-... | [
"php",
"paypal",
"special-characters",
"paypal-ipn"
] | 1 | 3 | 1,585 | 1 | 0 | 2011-06-02T09:17:51.733000 | 2011-06-02T09:33:23.797000 |
6,212,598 | 6,212,630 | Server Role to execute SQL Server Agent Jobs in SQL SERVER 2008 | The users from other departments ask me to grant them to execute Schedule Jobs / SSIS in SQL Server Agent. At present, they cannot see SQL Server Agent tree in their ManagmentStudio. I think, it's because they don't have the rights to execute them. So, I would like to know which server role should I give to them. I onl... | It isn't a server role. It is one of the "SQL Server Agent Fixed Database Roles" in msdb See "How to: Configure a User to Create and Manage SQL Server Agent Jobs (SQL Server Management Studio)" on MSDN | Server Role to execute SQL Server Agent Jobs in SQL SERVER 2008 The users from other departments ask me to grant them to execute Schedule Jobs / SSIS in SQL Server Agent. At present, they cannot see SQL Server Agent tree in their ManagmentStudio. I think, it's because they don't have the rights to execute them. So, I w... | TITLE:
Server Role to execute SQL Server Agent Jobs in SQL SERVER 2008
QUESTION:
The users from other departments ask me to grant them to execute Schedule Jobs / SSIS in SQL Server Agent. At present, they cannot see SQL Server Agent tree in their ManagmentStudio. I think, it's because they don't have the rights to exe... | [
"sql-server",
"security",
"sql-server-2008",
"ssis"
] | 15 | 20 | 42,445 | 1 | 0 | 2011-06-02T09:18:23.977000 | 2011-06-02T09:21:35.920000 |
6,212,601 | 6,219,101 | Ruby on Rails 3: How to use MapReduce with the MongoDB Ruby driver? | How can I use MapReduce in Ruby on Rails if I'm using the MongoDB Ruby driver? | Define your map and reduce js functions as variables, and then something along these lines: activities = Connection.new(host,port).db(dbname).collection('activities') activities.mapreduce(map,reduce,:out=>'analytics') The 'analytics' collection will hold the result of the mapreduce operation. | Ruby on Rails 3: How to use MapReduce with the MongoDB Ruby driver? How can I use MapReduce in Ruby on Rails if I'm using the MongoDB Ruby driver? | TITLE:
Ruby on Rails 3: How to use MapReduce with the MongoDB Ruby driver?
QUESTION:
How can I use MapReduce in Ruby on Rails if I'm using the MongoDB Ruby driver?
ANSWER:
Define your map and reduce js functions as variables, and then something along these lines: activities = Connection.new(host,port).db(dbname).coll... | [
"ruby-on-rails-3",
"mongodb",
"mapreduce"
] | 1 | 2 | 956 | 1 | 0 | 2011-06-02T09:18:38.780000 | 2011-06-02T19:02:58.217000 |
6,212,602 | 6,213,138 | Database Library/ORM mapper without configuration | I'm currently planning an application that does work on an object relational database. The work is simple: just fetch data, analyse it, display it to the user and write back some changes. To support a wide range of databases I'm currently searching for access library that meets all (or at least some) of the following r... | You could use SQLAlchemy which uses zxJDBC on Jython. Django can also run on Jython, so that's another option. Both let you use Python to declare your models. Django's ORM is a bit less verbose, while SQLAlchemy is arguably more powerful, and tends to offer finer control. There is also a nice declarative wrapper for wo... | Database Library/ORM mapper without configuration I'm currently planning an application that does work on an object relational database. The work is simple: just fetch data, analyse it, display it to the user and write back some changes. To support a wide range of databases I'm currently searching for access library th... | TITLE:
Database Library/ORM mapper without configuration
QUESTION:
I'm currently planning an application that does work on an object relational database. The work is simple: just fetch data, analyse it, display it to the user and write back some changes. To support a wide range of databases I'm currently searching for... | [
"java",
"python",
"database",
"jython"
] | 3 | 1 | 244 | 1 | 0 | 2011-06-02T09:18:42.297000 | 2011-06-02T10:12:15.847000 |
6,212,619 | 6,212,709 | Sorting std::unordered_map by key | How can I sort an unordered_map by key? I need to print an unordered_map sorted by key. | std::unordered_map unordered;
std::map ordered(unordered.begin(), unordered.end()); for(auto it = ordered.begin(); it!= ordered.end(); ++it) std::cout << it->second; | Sorting std::unordered_map by key How can I sort an unordered_map by key? I need to print an unordered_map sorted by key. | TITLE:
Sorting std::unordered_map by key
QUESTION:
How can I sort an unordered_map by key? I need to print an unordered_map sorted by key.
ANSWER:
std::unordered_map unordered;
std::map ordered(unordered.begin(), unordered.end()); for(auto it = ordered.begin(); it!= ordered.end(); ++it) std::cout << it->second; | [
"c++",
"sorting",
"unordered-map"
] | 24 | 42 | 46,482 | 5 | 0 | 2011-06-02T09:20:44.917000 | 2011-06-02T09:31:49.150000 |
6,212,622 | 6,213,161 | How can I work with Iterables in my JSP pages? | I'm using an API that makes heavy use of Iterables (java.lang.Iterable), but I can't use them directly on my JSP pages because JSTL tags and EL can not process them. Right now, I'm transforming each iterable to a list prior to rendering them. What would be the cleanest and simplest approach to make it work without prev... | You can implement your own JSP tags in Java, so you could write a tag that accepted an Iterable and then use that in the same way as you'd use the JSTL forEach tag. This documentation has an example on how to create a custom tag that iterates through an arbitrary custom object - your implementation would likely be simp... | How can I work with Iterables in my JSP pages? I'm using an API that makes heavy use of Iterables (java.lang.Iterable), but I can't use them directly on my JSP pages because JSTL tags and EL can not process them. Right now, I'm transforming each iterable to a list prior to rendering them. What would be the cleanest and... | TITLE:
How can I work with Iterables in my JSP pages?
QUESTION:
I'm using an API that makes heavy use of Iterables (java.lang.Iterable), but I can't use them directly on my JSP pages because JSTL tags and EL can not process them. Right now, I'm transforming each iterable to a list prior to rendering them. What would b... | [
"java",
"jsp",
"jstl"
] | 5 | 0 | 2,754 | 3 | 0 | 2011-06-02T09:20:51.280000 | 2011-06-02T10:14:23.367000 |
6,212,628 | 6,212,704 | Effective use of a DLL | Up until now I've only used DLL's as a source for plugins in my applications. But I know that using DLL's will allow me to update my program "client side" a lot easier the re-downloading the main EXE all time. The problem is, I cant seem to find an effective way to use dll's in my application, or to use them in a way t... | OK - so you have 3 classes with dependencies on each other. Can you change the relationship so that instead of one class referencing another, instead you reference an interface? E.g. ClassA has a method which uses ClassB - MethodB1 ClassB implements interface IB, so now Class A has instead a reference to IB Put all you... | Effective use of a DLL Up until now I've only used DLL's as a source for plugins in my applications. But I know that using DLL's will allow me to update my program "client side" a lot easier the re-downloading the main EXE all time. The problem is, I cant seem to find an effective way to use dll's in my application, or... | TITLE:
Effective use of a DLL
QUESTION:
Up until now I've only used DLL's as a source for plugins in my applications. But I know that using DLL's will allow me to update my program "client side" a lot easier the re-downloading the main EXE all time. The problem is, I cant seem to find an effective way to use dll's in ... | [
"dll"
] | 0 | 0 | 316 | 3 | 0 | 2011-06-02T09:21:25.213000 | 2011-06-02T09:31:15.070000 |
6,212,632 | 6,212,664 | Is there a program that allows you to write "pretty" library tutorials? | I need to write tutorial for a library I wrote. The tutorial should also include code. I wonder if there is a platform/application that provides a nice option for writing such tutorials with code? | I would suggest write your documentation in Markdown syntax and publish the file on Github. | Is there a program that allows you to write "pretty" library tutorials? I need to write tutorial for a library I wrote. The tutorial should also include code. I wonder if there is a platform/application that provides a nice option for writing such tutorials with code? | TITLE:
Is there a program that allows you to write "pretty" library tutorials?
QUESTION:
I need to write tutorial for a library I wrote. The tutorial should also include code. I wonder if there is a platform/application that provides a nice option for writing such tutorials with code?
ANSWER:
I would suggest write yo... | [
"html"
] | 1 | 3 | 90 | 3 | 0 | 2011-06-02T09:22:15.587000 | 2011-06-02T09:26:14.743000 |
6,212,639 | 6,212,808 | Getting image on UIImageView | I'm currently making an app where the user takes a photo or select it from an album, then an overlay is placed over the image. The user can then scale, rotate and save the image. For now, I have 2 xib files. The first one has thumbnails for overlay pictures to choose from. Clicking on one of them goes to another xib fi... | You don't need to use xib at all in this situation. Create UIImageView by hands, set its frame and image, add it as a subview to your viewControllers.view. You can have as many UIImageViews as you need. Make an array of them. Your case is obviously misuse of xibs concept. Xibs are usually used when there is need to cre... | Getting image on UIImageView I'm currently making an app where the user takes a photo or select it from an album, then an overlay is placed over the image. The user can then scale, rotate and save the image. For now, I have 2 xib files. The first one has thumbnails for overlay pictures to choose from. Clicking on one o... | TITLE:
Getting image on UIImageView
QUESTION:
I'm currently making an app where the user takes a photo or select it from an album, then an overlay is placed over the image. The user can then scale, rotate and save the image. For now, I have 2 xib files. The first one has thumbnails for overlay pictures to choose from.... | [
"iphone",
"ios",
"uiimageview"
] | 1 | 2 | 2,803 | 2 | 0 | 2011-06-02T09:22:45.493000 | 2011-06-02T09:42:15.760000 |
6,212,650 | 6,223,338 | Factory vs PicoContainer - Benefits of IoC Containers | I'm trying to open my mind for fancy IoC principle, and I came across the article: Martin fowler on IoC He provides some examples of using PicoContainer: private MutablePicoContainer configureContainer() { MutablePicoContainer pico = new DefaultPicoContainer(); Parameter[] finderParams = {new ConstantParameter("movies1... | I just updated an answer related to this question here. In.Net I would take a look at the documentation around the Unity Framework (from MSFT). I was also leery of the idea of hard-coding the implementation registrations but over time I got over it. Mainly because you can indeed use file-based configuration, you can re... | Factory vs PicoContainer - Benefits of IoC Containers I'm trying to open my mind for fancy IoC principle, and I came across the article: Martin fowler on IoC He provides some examples of using PicoContainer: private MutablePicoContainer configureContainer() { MutablePicoContainer pico = new DefaultPicoContainer(); Para... | TITLE:
Factory vs PicoContainer - Benefits of IoC Containers
QUESTION:
I'm trying to open my mind for fancy IoC principle, and I came across the article: Martin fowler on IoC He provides some examples of using PicoContainer: private MutablePicoContainer configureContainer() { MutablePicoContainer pico = new DefaultPic... | [
"design-patterns",
"dependency-injection",
"inversion-of-control",
"ioc-container"
] | 2 | 1 | 1,685 | 1 | 0 | 2011-06-02T09:24:26.460000 | 2011-06-03T05:30:48.857000 |
6,212,660 | 6,234,158 | Async CTP installed Ok but nowhere to be found? | I installed the Async CTP Refresh on my Windows 7 machine with VS2010 Pro(which already had the WP7.0 (not Mango) dev tools installed) and even though it said it installed OK it is just not there!! According to my other dev machine that has the same setup the ASync CTP is in C:\Users\Mike\Documents\Microsoft Visual Stu... | I'm actually a bit embarrassed as I realised it had installed in the My Documents on my D: drive and I was looking for the default install in C:\My Documents! I do wish MS would offer us to choose the install folder with these tools though! | Async CTP installed Ok but nowhere to be found? I installed the Async CTP Refresh on my Windows 7 machine with VS2010 Pro(which already had the WP7.0 (not Mango) dev tools installed) and even though it said it installed OK it is just not there!! According to my other dev machine that has the same setup the ASync CTP is... | TITLE:
Async CTP installed Ok but nowhere to be found?
QUESTION:
I installed the Async CTP Refresh on my Windows 7 machine with VS2010 Pro(which already had the WP7.0 (not Mango) dev tools installed) and even though it said it installed OK it is just not there!! According to my other dev machine that has the same setu... | [
"c#-4.0",
"installation",
"async-ctp"
] | 0 | 0 | 557 | 1 | 0 | 2011-06-02T09:25:33.653000 | 2011-06-04T01:43:34.997000 |
6,212,665 | 6,212,755 | Why is %eax zeroed before a call to printf? | I am trying to pick up a little x86. I am compiling on a 64bit mac with gcc -S -O0. Code in C: printf("%d", 1); Output: movl $1, %esi leaq LC0(%rip), %rdi movl $0, %eax; WHY? call _printf I do not understand why %eax is cleared to 0 before 'printf' is called. Since printf returns the number of characters printed to %ea... | From the x86_64 System V ABI register usage table: %rax temporary register; with variable arguments passes information about the number of vector registers used; 1st return register... printf is a function with variable arguments, and the number of vector registers used is zero. Note that printf must check only %al, be... | Why is %eax zeroed before a call to printf? I am trying to pick up a little x86. I am compiling on a 64bit mac with gcc -S -O0. Code in C: printf("%d", 1); Output: movl $1, %esi leaq LC0(%rip), %rdi movl $0, %eax; WHY? call _printf I do not understand why %eax is cleared to 0 before 'printf' is called. Since printf ret... | TITLE:
Why is %eax zeroed before a call to printf?
QUESTION:
I am trying to pick up a little x86. I am compiling on a 64bit mac with gcc -S -O0. Code in C: printf("%d", 1); Output: movl $1, %esi leaq LC0(%rip), %rdi movl $0, %eax; WHY? call _printf I do not understand why %eax is cleared to 0 before 'printf' is called... | [
"macos",
"assembly",
"gcc",
"x86-64",
"calling-convention"
] | 57 | 45 | 16,836 | 3 | 0 | 2011-06-02T09:26:16.913000 | 2011-06-02T09:36:33.860000 |
6,212,671 | 6,213,018 | Find XmlElement in List<> using array of matching attribute names ... Using Linq | I have an XmlElement with several attributes xeObject = I also have a list of XmlElements with several (possibly different) attributes l_xeObject =... I would like a function call like FindMatchingElements(xeObject, l_xeObject, "Name", "Site") where any elements in l_xeObject that have the same values as xeObject.Name ... | You can use All() to match several attributes and GetAttribute() to avoid having to check for null: public static IEnumerable FindMatchingElements(XmlElement match, IEnumerable elements, params string[] attributeNames) { // Argument validation omitted for brevity.
return elements.Where( element => attributeNames.All( ... | Find XmlElement in List<> using array of matching attribute names ... Using Linq I have an XmlElement with several attributes xeObject = I also have a list of XmlElements with several (possibly different) attributes l_xeObject =... I would like a function call like FindMatchingElements(xeObject, l_xeObject, "Name", "Si... | TITLE:
Find XmlElement in List<> using array of matching attribute names ... Using Linq
QUESTION:
I have an XmlElement with several attributes xeObject = I also have a list of XmlElements with several (possibly different) attributes l_xeObject =... I would like a function call like FindMatchingElements(xeObject, l_xeO... | [
"c#",
".net",
"xml",
"linq"
] | 1 | 3 | 1,406 | 1 | 0 | 2011-06-02T09:26:50.790000 | 2011-06-02T10:00:19.823000 |
6,212,680 | 6,212,733 | Draw a chart line in Android | What would be a simple example of drawing a plot in Android with a CHART LINE using a JAR file (and the JAR file itself)? I want to draw a CHART LINE, not chart pie nor chart bar, and I want to do this by importing a JAR file into my application. I have found some examples of JAR file on the Internet, but these don't h... | Look in Any good graphing packages for Android? for lots of charting packages with links to each one. Each one of the links has examples of how to use it. I've used AChartEngine, and it was easy enough. See svn/trunk/achartengine/demo/org/achartengine/chartdemo/demo/chart/AverageTemperatureChart.jav for a simple exampl... | Draw a chart line in Android What would be a simple example of drawing a plot in Android with a CHART LINE using a JAR file (and the JAR file itself)? I want to draw a CHART LINE, not chart pie nor chart bar, and I want to do this by importing a JAR file into my application. I have found some examples of JAR file on th... | TITLE:
Draw a chart line in Android
QUESTION:
What would be a simple example of drawing a plot in Android with a CHART LINE using a JAR file (and the JAR file itself)? I want to draw a CHART LINE, not chart pie nor chart bar, and I want to do this by importing a JAR file into my application. I have found some examples... | [
"android",
"charts"
] | 1 | 1 | 6,226 | 1 | 0 | 2011-06-02T09:27:49.750000 | 2011-06-02T09:34:49.937000 |
6,212,687 | 6,219,476 | Vim display in statusline after delay | Is it possible to have the statusline in Vim be updated so and so long after a given event? And if so, how does one do that? | As others have already pointed out, using timed changes to the statusline is not possible at the moment. However, if you can pick a suitable event at which the status reverts to the default, then you might be in luck. For e.g., if your workflow is: Esc out to normal mode and call your shortcut See the outcome on the st... | Vim display in statusline after delay Is it possible to have the statusline in Vim be updated so and so long after a given event? And if so, how does one do that? | TITLE:
Vim display in statusline after delay
QUESTION:
Is it possible to have the statusline in Vim be updated so and so long after a given event? And if so, how does one do that?
ANSWER:
As others have already pointed out, using timed changes to the statusline is not possible at the moment. However, if you can pick ... | [
"vim",
"delay",
"statusline"
] | 9 | 33 | 2,328 | 1 | 0 | 2011-06-02T09:28:39.820000 | 2011-06-02T19:37:20.227000 |
6,212,693 | 6,212,790 | Which date class should I use in Android? | I'm making a small Calendar application with some specific functions for my userbase but I'm not sure which calendar that is best to use. I've been using the internal Calendar class so far but recently noticed that I probably should have used GregorianCalendar instead. So I'm about to change Calendar but wanted to know... | android.text.format.Time is "a faster replacement for the java.util.Calendar and java.util.GregorianCalendar classes". It's what I prefer to use, unless I want some of the fancy things offered by Joda-Time. | Which date class should I use in Android? I'm making a small Calendar application with some specific functions for my userbase but I'm not sure which calendar that is best to use. I've been using the internal Calendar class so far but recently noticed that I probably should have used GregorianCalendar instead. So I'm a... | TITLE:
Which date class should I use in Android?
QUESTION:
I'm making a small Calendar application with some specific functions for my userbase but I'm not sure which calendar that is best to use. I've been using the internal Calendar class so far but recently noticed that I probably should have used GregorianCalendar... | [
"android",
"date"
] | 3 | 1 | 1,712 | 2 | 0 | 2011-06-02T09:29:09.300000 | 2011-06-02T09:40:46.273000 |
6,212,701 | 6,212,717 | How do I clone an HTML element's style object using JavaScript or jQuery? | I'm trying to clone the style object of an element. This should allow me to reset the styles of said element after I change them. For example: el.style.left; // 50px curr_style.left; // 50px;
/* Modify the elements style. The cloned style should still hold the original properties from when it was cloned. */ el.style.l... | var curr_style; if (window.getComputedStyle) { curr_style = window.getComputedStyle(el); } else if (el.currentStyle) { curr_style = $.extend(true, {}, el.currentStyle); } else { throw "shit browser"; } style has non-enumerable properties which makes.extend fall over. You want to use the getComputedStyle method to get t... | How do I clone an HTML element's style object using JavaScript or jQuery? I'm trying to clone the style object of an element. This should allow me to reset the styles of said element after I change them. For example: el.style.left; // 50px curr_style.left; // 50px;
/* Modify the elements style. The cloned style should... | TITLE:
How do I clone an HTML element's style object using JavaScript or jQuery?
QUESTION:
I'm trying to clone the style object of an element. This should allow me to reset the styles of said element after I change them. For example: el.style.left; // 50px curr_style.left; // 50px;
/* Modify the elements style. The c... | [
"javascript",
"jquery",
"css"
] | 6 | 6 | 5,162 | 2 | 0 | 2011-06-02T09:30:30.593000 | 2011-06-02T09:33:13.260000 |
6,212,714 | 6,212,753 | How to solve date format problem when using Window XP in C? | I am using Window 7, when I run my code in local everything is alright, but when upload to Window server 2003 the code will coming error: "String was not recognized as a valid DateTime" My computer setting (date format) all same with my window server. Still come out the same problem. below is my code: dateFrom = Conver... | I do not know how this relates to the 'C' language, so I may have misinterpreted something. However, you are using the wrong format string as far as I can see. If your dates always look like that, try using a format string like "d-M-yyyy". Have a look at the following page for reference: http://msdn.microsoft.com/en-us... | How to solve date format problem when using Window XP in C? I am using Window 7, when I run my code in local everything is alright, but when upload to Window server 2003 the code will coming error: "String was not recognized as a valid DateTime" My computer setting (date format) all same with my window server. Still co... | TITLE:
How to solve date format problem when using Window XP in C?
QUESTION:
I am using Window 7, when I run my code in local everything is alright, but when upload to Window server 2003 the code will coming error: "String was not recognized as a valid DateTime" My computer setting (date format) all same with my windo... | [
"c#",
"vb.net",
"c#-3.0",
"c#-2.0"
] | 0 | 0 | 1,069 | 3 | 0 | 2011-06-02T09:32:21.513000 | 2011-06-02T09:36:23.063000 |
6,212,723 | 6,212,805 | How to do "static overloaded const" in C#? | I'm creating a game in C#. Each level is made up of several tiles. Each tile is of a certain type e.g. grass floor, wooden wall, etc. Ideally I would like to have one base class "Tile" and inherit from it to create classes for each type of tile. I would like to have the properties of the tile some kind of static/const/... | You are looking for the FlyWeight design pattern: http://en.wikipedia.org/wiki/Flyweight_pattern Flyweight is a software design pattern. A flyweight is an object that minimizes memory use by sharing as much data as possible with other similar objects; it is a way to use objects in large numbers when a simple repeated r... | How to do "static overloaded const" in C#? I'm creating a game in C#. Each level is made up of several tiles. Each tile is of a certain type e.g. grass floor, wooden wall, etc. Ideally I would like to have one base class "Tile" and inherit from it to create classes for each type of tile. I would like to have the proper... | TITLE:
How to do "static overloaded const" in C#?
QUESTION:
I'm creating a game in C#. Each level is made up of several tiles. Each tile is of a certain type e.g. grass floor, wooden wall, etc. Ideally I would like to have one base class "Tile" and inherit from it to create classes for each type of tile. I would like ... | [
"c#",
"polymorphism"
] | 7 | 4 | 630 | 5 | 0 | 2011-06-02T09:33:42.680000 | 2011-06-02T09:42:09.797000 |
6,212,726 | 6,213,196 | How to deal with inheritance in PageObjects pattern of WebDriver? | Could please anybody suggest a way to deal with Inheritance regarding Page Objects pattern? For instance, page objects need to share properties and methods. public class LoginPage extends SuperPage public class SuperPage extends LoadableComponent This would be Ok. But the problem is that your UnitTests don't extend Sup... | I haven't done much with WebDriver, but I remember, that most of of the PageObjects I created and tested, didn't need to be populated. They just contained a scenario - sequence of conditions to be tested, in form of testing methods to be called from UnitTest. The only property to be shared between PageObjects were just... | How to deal with inheritance in PageObjects pattern of WebDriver? Could please anybody suggest a way to deal with Inheritance regarding Page Objects pattern? For instance, page objects need to share properties and methods. public class LoginPage extends SuperPage public class SuperPage extends LoadableComponent This wo... | TITLE:
How to deal with inheritance in PageObjects pattern of WebDriver?
QUESTION:
Could please anybody suggest a way to deal with Inheritance regarding Page Objects pattern? For instance, page objects need to share properties and methods. public class LoginPage extends SuperPage public class SuperPage extends Loadabl... | [
"java",
"inheritance",
"webdriver",
"selenium-webdriver",
"pageobjects"
] | 1 | 0 | 2,653 | 2 | 0 | 2011-06-02T09:33:51.983000 | 2011-06-02T10:18:20.170000 |
6,212,737 | 6,212,773 | Sorted a javascript array of objects by an object property | Hay, i have an array of objects and i need to sort them (either DESC or ASC) by a certain property of each object. Here's the data obj1 = new Object; obj1.date = 1307010000;
obj2 = new Object; obj2.date = 1306923600;
obj3 = new Object; obj3.date = 1298974800;
obj4 = new Object; obj4.date = 1306923600;
obj5 = new Ob... | Use the Array sort() method data.sort(function(a, b){ return a.date - b.date; }); | Sorted a javascript array of objects by an object property Hay, i have an array of objects and i need to sort them (either DESC or ASC) by a certain property of each object. Here's the data obj1 = new Object; obj1.date = 1307010000;
obj2 = new Object; obj2.date = 1306923600;
obj3 = new Object; obj3.date = 1298974800;... | TITLE:
Sorted a javascript array of objects by an object property
QUESTION:
Hay, i have an array of objects and i need to sort them (either DESC or ASC) by a certain property of each object. Here's the data obj1 = new Object; obj1.date = 1307010000;
obj2 = new Object; obj2.date = 1306923600;
obj3 = new Object; obj3.... | [
"javascript",
"arrays",
"sorting",
"object"
] | 18 | 53 | 20,891 | 6 | 0 | 2011-06-02T09:35:01.207000 | 2011-06-02T09:38:58.247000 |
6,212,739 | 6,214,026 | inspect delphi control object without modify source code | I have an Stock program which developed by Delphi, I want a tools which can read the data from the stock program, for example, the stock price in Delphi grid object. The Stock program under test is close source, so no chance modify source code which QTP/Robot inspector required. I cannot tell out which Delphi version i... | Trying to read data out of a Delphi grid control is not going to work out for you. It's not like a standard Windows edit control which you could just call GetWindowText on. If you really want to get the information from this existing program then you'd need to poke at its internal memory or do an OCR on a screen grab. ... | inspect delphi control object without modify source code I have an Stock program which developed by Delphi, I want a tools which can read the data from the stock program, for example, the stock price in Delphi grid object. The Stock program under test is close source, so no chance modify source code which QTP/Robot ins... | TITLE:
inspect delphi control object without modify source code
QUESTION:
I have an Stock program which developed by Delphi, I want a tools which can read the data from the stock program, for example, the stock price in Delphi grid object. The Stock program under test is close source, so no chance modify source code w... | [
"delphi",
"testing",
"object",
"inspector",
"probe"
] | 1 | 0 | 435 | 2 | 0 | 2011-06-02T09:35:09.627000 | 2011-06-02T11:38:30.117000 |
6,212,742 | 6,213,062 | Problem with A Sync callback function in GWT | What I'm doing is: getSecroleByOrgNID(orgList[i-2],cu.currentUser.getProfileObj()); System.out.println("Value of sec role is "+ secondryRole); where the getSecroleByOrgNID function is: private String getSecroleByOrgNID(COrganization srOrg, CProfile srUser) { analyticsSrvc.getSecroleByOrgNID(srOrg, srUser, new AsyncCall... | As GWT docs says, in GWT you have to "embrace asynchronous transactions" and forget about synchronous ones. The problem is that getSecroleByOrgNID() invoke an asynchronous call to the server but this call doesn't stop execution, so it continues his work (server needs more time to return). You are asking for secondryRol... | Problem with A Sync callback function in GWT What I'm doing is: getSecroleByOrgNID(orgList[i-2],cu.currentUser.getProfileObj()); System.out.println("Value of sec role is "+ secondryRole); where the getSecroleByOrgNID function is: private String getSecroleByOrgNID(COrganization srOrg, CProfile srUser) { analyticsSrvc.ge... | TITLE:
Problem with A Sync callback function in GWT
QUESTION:
What I'm doing is: getSecroleByOrgNID(orgList[i-2],cu.currentUser.getProfileObj()); System.out.println("Value of sec role is "+ secondryRole); where the getSecroleByOrgNID function is: private String getSecroleByOrgNID(COrganization srOrg, CProfile srUser) ... | [
"gwt",
"jakarta-ee",
"functional-programming",
"gwt-rpc"
] | 0 | 4 | 604 | 1 | 0 | 2011-06-02T09:35:21.330000 | 2011-06-02T10:05:15.927000 |
6,212,745 | 6,212,801 | Weighted random bearing for wandering point | var latlon = new LatLon(50,-0.075); setInterval(function(){ latlon = latlon.destinationPoint(randomBetween(0,360),0.001); },1000); Here is my very basic wandering point. It creates a geospatial point then moves one metre in a random direction every second. However, this is too random. How can I give my wandering point ... | You could store last wandering coefficient (as I undestand that would be randomBetween(...) value) in a variable, and next time use a weighted average of this value and new random value. var latlon = new LatLon(50,-0.075); var oldValue = randomBetween(0,360); var weights = [0.5, 0.5]; // Here you can influece the level... | Weighted random bearing for wandering point var latlon = new LatLon(50,-0.075); setInterval(function(){ latlon = latlon.destinationPoint(randomBetween(0,360),0.001); },1000); Here is my very basic wandering point. It creates a geospatial point then moves one metre in a random direction every second. However, this is to... | TITLE:
Weighted random bearing for wandering point
QUESTION:
var latlon = new LatLon(50,-0.075); setInterval(function(){ latlon = latlon.destinationPoint(randomBetween(0,360),0.001); },1000); Here is my very basic wandering point. It creates a geospatial point then moves one metre in a random direction every second. H... | [
"javascript",
"random",
"geospatial"
] | 0 | 0 | 154 | 1 | 0 | 2011-06-02T09:35:38.850000 | 2011-06-02T09:41:33.067000 |
6,212,754 | 6,212,798 | How to get the focus on a textbox on a key press | We have a page which requires user to enter some input and post submission (e.g. by hitting Enter key or Submit button). The answer is shown to the end user and we provide a link which says 'Press any key to continue'. The focus on the input box is automatically shown, either after pressing any key or by clicking on th... | Try this: $('#other').click(function() { $('#target').focus(); }); | How to get the focus on a textbox on a key press We have a page which requires user to enter some input and post submission (e.g. by hitting Enter key or Submit button). The answer is shown to the end user and we provide a link which says 'Press any key to continue'. The focus on the input box is automatically shown, e... | TITLE:
How to get the focus on a textbox on a key press
QUESTION:
We have a page which requires user to enter some input and post submission (e.g. by hitting Enter key or Submit button). The answer is shown to the end user and we provide a link which says 'Press any key to continue'. The focus on the input box is auto... | [
"jquery"
] | 0 | 2 | 543 | 3 | 0 | 2011-06-02T09:36:32.623000 | 2011-06-02T09:41:08.153000 |
6,212,765 | 6,212,826 | Connection String and Datacontext in LINQ | I am developing a site using ASP.NET, SQL 2008 and LINQ. I want to ask about the connection string. I have made a class like that to get the datacontext in each page: using System; using System.Collections.Generic; using System.Linq; using System.Web;
public static class DatabaseConnection { static DataClassesDataCont... | That is a valid way of getting the data context instance, yes. You can use Data Source or Server I believe. Please be aware that DataContext is IDisposable, so make sure it's not left hanging around after usage, I tend to do: using (var context = DataHelper.GetContext()) { // Stuff. } Also, you should really put your c... | Connection String and Datacontext in LINQ I am developing a site using ASP.NET, SQL 2008 and LINQ. I want to ask about the connection string. I have made a class like that to get the datacontext in each page: using System; using System.Collections.Generic; using System.Linq; using System.Web;
public static class Datab... | TITLE:
Connection String and Datacontext in LINQ
QUESTION:
I am developing a site using ASP.NET, SQL 2008 and LINQ. I want to ask about the connection string. I have made a class like that to get the datacontext in each page: using System; using System.Collections.Generic; using System.Linq; using System.Web;
public ... | [
"c#",
"asp.net",
"linq",
"sql-server-2008"
] | 2 | 2 | 17,961 | 2 | 0 | 2011-06-02T09:38:00.447000 | 2011-06-02T09:43:49.813000 |
6,212,767 | 6,222,881 | Booting from an ISO image using PowerCLI scripts | How do I make the following script work? Currently I am able to create a new virtual machine in my server. I wish to also load the Windows ISO image and do an unattended installation in the virtual machine. How shall I edit the script to make this work? # Virtual Center Details $server_address = "xxxxx" $username = "xx... | my issue is with the ISO PATH image. I am getting the error "Invalid datastore format" You are specifying isopath using IsoPath parameter, which is the datastore path to the ISO, not simply the ISO name. From your code you are not indicating any datastore. The syntax for a datastore path is: "[yourdatastore] IsoFolder\... | Booting from an ISO image using PowerCLI scripts How do I make the following script work? Currently I am able to create a new virtual machine in my server. I wish to also load the Windows ISO image and do an unattended installation in the virtual machine. How shall I edit the script to make this work? # Virtual Center ... | TITLE:
Booting from an ISO image using PowerCLI scripts
QUESTION:
How do I make the following script work? Currently I am able to create a new virtual machine in my server. I wish to also load the Windows ISO image and do an unattended installation in the virtual machine. How shall I edit the script to make this work?... | [
"powershell",
"virtualization",
"vmware",
"virtual-machine",
"powercli"
] | 3 | 3 | 7,365 | 1 | 0 | 2011-06-02T09:38:19.337000 | 2011-06-03T04:12:56.470000 |
6,212,782 | 6,213,408 | SQL Efficiency - Query using dateAdd Function twice; or SubQuery and DateAdd Function once; on Date BETWEEN | The expense is using the DateAdd function not only in the SELECT, but also in the WHERE; Or using the Sub Query which initially returns more data than I need, but then can be filtered without using the DateAdd function again on the database. Execution Plan seems to imply that they are identical as far as it is concerne... | I don't think it matters which of the two you use. And the Execution Plans agree. But it seems you are doing calculations to column itsm_requiredbyx and then check if the result is between two external values, @DateFrom and @DateTo. This way, all datetimes from this field are processed by the functions before the WHERE... | SQL Efficiency - Query using dateAdd Function twice; or SubQuery and DateAdd Function once; on Date BETWEEN The expense is using the DateAdd function not only in the SELECT, but also in the WHERE; Or using the Sub Query which initially returns more data than I need, but then can be filtered without using the DateAdd fu... | TITLE:
SQL Efficiency - Query using dateAdd Function twice; or SubQuery and DateAdd Function once; on Date BETWEEN
QUESTION:
The expense is using the DateAdd function not only in the SELECT, but also in the WHERE; Or using the Sub Query which initially returns more data than I need, but then can be filtered without us... | [
"sql",
"sql-server",
"performance",
"t-sql"
] | 6 | 7 | 3,227 | 2 | 0 | 2011-06-02T09:40:08.600000 | 2011-06-02T10:37:46.567000 |
6,212,795 | 6,213,059 | The free Delphi 2006 compiler | On Wikipedia I read: Borland Delphi 2006 [...] Each version is available in two editions: Explorer—a free downloadable version—and Professional Is this edition still available? Or are people who grabbed it in 2006 lucky and the others not that much? | Unfortunately there are no free Delphi versions now. You can use free Turbo Delphi only if you already have the product keyfile, but you can't obtain new free Turbo Delphi keyfile anymore. | The free Delphi 2006 compiler On Wikipedia I read: Borland Delphi 2006 [...] Each version is available in two editions: Explorer—a free downloadable version—and Professional Is this edition still available? Or are people who grabbed it in 2006 lucky and the others not that much? | TITLE:
The free Delphi 2006 compiler
QUESTION:
On Wikipedia I read: Borland Delphi 2006 [...] Each version is available in two editions: Explorer—a free downloadable version—and Professional Is this edition still available? Or are people who grabbed it in 2006 lucky and the others not that much?
ANSWER:
Unfortunately... | [
"delphi",
"delphi-2006"
] | 2 | 5 | 1,087 | 2 | 0 | 2011-06-02T09:41:01.510000 | 2011-06-02T10:04:58.770000 |
6,212,796 | 6,212,829 | Java heap space error while creating ArrayList of large number of objects? | I have created an ArrayList (Java) of my custom class objects with a size around 3000. But when I run my code it gets the error "Heap space error". I want to keep thousands of objects in an ArrayList at runtime without getting out of heap space. How can the heap space error be avoided? | It seems like you need to pass your program more memory. Try running it like this: java -Xmx256M MyApp -Xmx sets the maximum heap size for Java. Putting M afterwards means megabytes, and G afterwards means gigabytes. So you can always do this if you have a bunch of memory: java -Xmx1g MyApp | Java heap space error while creating ArrayList of large number of objects? I have created an ArrayList (Java) of my custom class objects with a size around 3000. But when I run my code it gets the error "Heap space error". I want to keep thousands of objects in an ArrayList at runtime without getting out of heap space.... | TITLE:
Java heap space error while creating ArrayList of large number of objects?
QUESTION:
I have created an ArrayList (Java) of my custom class objects with a size around 3000. But when I run my code it gets the error "Heap space error". I want to keep thousands of objects in an ArrayList at runtime without getting ... | [
"java",
"arraylist",
"heap-memory"
] | 0 | 4 | 2,356 | 2 | 0 | 2011-06-02T09:41:04.730000 | 2011-06-02T09:44:16.320000 |
6,212,811 | 6,212,974 | Passing a Parameter to the function | I am trying to pass the parameter name to the function, but I am unable to pass function interfaceName(x,y,z){ return " "+x+" "; }
function mcrloadgraphdata(interfaceName) { alert(interfaceName); } | I didnt follow your question too well. But I guessed what you might be asking. There appears to be a mistake with Single quote and double quotes in your statement Try this function interfaceName(x,y,z){ return " "+x+" "; }
function mcrloadgraphdata(interfaceName) { alert(interfaceName); } | Passing a Parameter to the function I am trying to pass the parameter name to the function, but I am unable to pass function interfaceName(x,y,z){ return " "+x+" "; }
function mcrloadgraphdata(interfaceName) { alert(interfaceName); } | TITLE:
Passing a Parameter to the function
QUESTION:
I am trying to pass the parameter name to the function, but I am unable to pass function interfaceName(x,y,z){ return " "+x+" "; }
function mcrloadgraphdata(interfaceName) { alert(interfaceName); }
ANSWER:
I didnt follow your question too well. But I guessed what ... | [
"javascript"
] | 0 | 0 | 58 | 2 | 0 | 2011-06-02T09:42:31.077000 | 2011-06-02T09:56:43.153000 |
6,212,815 | 6,212,847 | How can I create an NSMutableArray of structs? | I created a structure like this typedef struct Node { NSString* Description; NSString* AE; NSString* IP; NSString* Port; } Node; I need to create NSMutableArray of this Node structure I need to know how create object of node path it to the NSMutableArray retrieve it and read for example the port. | You can only store Objective-C objects in an NSMutableArray. One route you can take is to use a standard C array: unsigned int array_length =...; Node** nodes = malloc(sizeof(Node *) * array_length); Another route is to wrap the structure in an Objective-C object: @interface NodeWrapper: NSObject { @public
Node *node;... | How can I create an NSMutableArray of structs? I created a structure like this typedef struct Node { NSString* Description; NSString* AE; NSString* IP; NSString* Port; } Node; I need to create NSMutableArray of this Node structure I need to know how create object of node path it to the NSMutableArray retrieve it and re... | TITLE:
How can I create an NSMutableArray of structs?
QUESTION:
I created a structure like this typedef struct Node { NSString* Description; NSString* AE; NSString* IP; NSString* Port; } Node; I need to create NSMutableArray of this Node structure I need to know how create object of node path it to the NSMutableArray ... | [
"objective-c"
] | 14 | 6 | 13,366 | 3 | 0 | 2011-06-02T09:42:43.837000 | 2011-06-02T09:46:03.873000 |
6,212,837 | 6,212,877 | How do I Bind a Collection (IEnumerable) of a custom type? | I have the following Action to display a form with 3 items: [HttpGet] public ActionResult ReferAFriend() { List friends = new List (); ReferAFriendModel f1 = new ReferAFriendModel(); ReferAFriendModel f2 = new ReferAFriendModel(); ReferAFriendModel f3 = new ReferAFriendModel();
friends.Add(f1); friends.Add(f2); friend... | You may take a look at the following blog post about the wire format for arrays and dictionaries. Personally I always use editor templates in my views which take care of generating proper names of the input fields so that the default model binder is able to bind the values correctly. @model IEnumerable @using (Html.BEg... | How do I Bind a Collection (IEnumerable) of a custom type? I have the following Action to display a form with 3 items: [HttpGet] public ActionResult ReferAFriend() { List friends = new List (); ReferAFriendModel f1 = new ReferAFriendModel(); ReferAFriendModel f2 = new ReferAFriendModel(); ReferAFriendModel f3 = new Ref... | TITLE:
How do I Bind a Collection (IEnumerable) of a custom type?
QUESTION:
I have the following Action to display a form with 3 items: [HttpGet] public ActionResult ReferAFriend() { List friends = new List (); ReferAFriendModel f1 = new ReferAFriendModel(); ReferAFriendModel f2 = new ReferAFriendModel(); ReferAFriend... | [
"c#",
"asp.net-mvc",
"asp.net-mvc-3",
"razor",
"model-binding"
] | 7 | 9 | 12,079 | 1 | 0 | 2011-06-02T09:45:08.313000 | 2011-06-02T09:48:45.320000 |
6,212,843 | 6,212,876 | Page not found: Running a php file on an Apache sever | I get page not found error when I try to run my php file running on the root folder of my apache. Other php files run fine(anyway this is a magento based site). Is it because i transferred the file through FTP? Can a server be configured not to run some specific files? How can i get round this? has is got something to ... | Be sure you uploaded your file into the /www or /httpdocs subdirectory. If so, check the permissions of your file. | Page not found: Running a php file on an Apache sever I get page not found error when I try to run my php file running on the root folder of my apache. Other php files run fine(anyway this is a magento based site). Is it because i transferred the file through FTP? Can a server be configured not to run some specific fil... | TITLE:
Page not found: Running a php file on an Apache sever
QUESTION:
I get page not found error when I try to run my php file running on the root folder of my apache. Other php files run fine(anyway this is a magento based site). Is it because i transferred the file through FTP? Can a server be configured not to run... | [
"php",
"apache"
] | 0 | 2 | 3,766 | 2 | 0 | 2011-06-02T09:45:33.780000 | 2011-06-02T09:48:44.960000 |
6,212,848 | 6,229,120 | Alternative to MS Access with Forms and Reporting Capabilities | I have been looking on SO and can't seem to find something more recent than around 2008. I am looking for an alternative to Microsoft Access with similar capabilities. I.e: Forms Macros Reports Etc In another question VS Lightswitch was recommended (Still in Beta 2). I had a look at it, although it seems good it is sti... | People are usually looking for Alternative to MS Access either because: They, for some reasons, consider that Microsoft is Evil They don't want to pay for the extra Access licensing For people from Group 1,I do not have that much to say. I was part of it till I realised how fast and simple it was to use some of these g... | Alternative to MS Access with Forms and Reporting Capabilities I have been looking on SO and can't seem to find something more recent than around 2008. I am looking for an alternative to Microsoft Access with similar capabilities. I.e: Forms Macros Reports Etc In another question VS Lightswitch was recommended (Still i... | TITLE:
Alternative to MS Access with Forms and Reporting Capabilities
QUESTION:
I have been looking on SO and can't seem to find something more recent than around 2008. I am looking for an alternative to Microsoft Access with similar capabilities. I.e: Forms Macros Reports Etc In another question VS Lightswitch was re... | [
"database",
"ms-access"
] | 1 | 7 | 7,284 | 4 | 0 | 2011-06-02T09:46:08.813000 | 2011-06-03T15:27:17.150000 |
6,212,857 | 6,212,957 | How to use a custom helper via the "helper" method in Rails 3? | I'm trying to create a custom helper like this: # app/controllers/my_controller.rb class MyController < ApplicationController helper:my def index puts foo end end
# app/helpers/my_helper.rb module MyHelper def foo "Hello" end end But, I got the following error: undefined local variable or method `foo' for # What am I ... | Helpers are accessed from the views, not the controllers. so if you try to put the following inside your index template it should work: #my/index.html.erb <%= foo %> If you do want to access something from the controller, then you should use the include syntax instead of helper, but do not name it like a helper module ... | How to use a custom helper via the "helper" method in Rails 3? I'm trying to create a custom helper like this: # app/controllers/my_controller.rb class MyController < ApplicationController helper:my def index puts foo end end
# app/helpers/my_helper.rb module MyHelper def foo "Hello" end end But, I got the following e... | TITLE:
How to use a custom helper via the "helper" method in Rails 3?
QUESTION:
I'm trying to create a custom helper like this: # app/controllers/my_controller.rb class MyController < ApplicationController helper:my def index puts foo end end
# app/helpers/my_helper.rb module MyHelper def foo "Hello" end end But, I g... | [
"ruby-on-rails",
"ruby-on-rails-3",
"helper"
] | 3 | 1 | 2,227 | 3 | 0 | 2011-06-02T09:46:54.430000 | 2011-06-02T09:55:20.627000 |
6,212,858 | 6,212,920 | The mysqli_connect not working | I installed apache, php and mysql. Now when I execute the php code, the mysqli_connect() is not working, neither it's showing the message in die. $dbc=mysqli_connect(' ', ' ', ' ', ' ') or die('not connecting'); Now someone tell me what database username shall I pass to mysqli_connect and what password. I don't remembe... | Looks like MySQLi extension is not installed. What does var_dump(function_exists('mysqli_connect')); output? | The mysqli_connect not working I installed apache, php and mysql. Now when I execute the php code, the mysqli_connect() is not working, neither it's showing the message in die. $dbc=mysqli_connect(' ', ' ', ' ', ' ') or die('not connecting'); Now someone tell me what database username shall I pass to mysqli_connect and... | TITLE:
The mysqli_connect not working
QUESTION:
I installed apache, php and mysql. Now when I execute the php code, the mysqli_connect() is not working, neither it's showing the message in die. $dbc=mysqli_connect(' ', ' ', ' ', ' ') or die('not connecting'); Now someone tell me what database username shall I pass to ... | [
"php",
"mysql"
] | 5 | 17 | 51,148 | 8 | 0 | 2011-06-02T09:46:55.590000 | 2011-06-02T09:52:36.867000 |
6,212,873 | 6,237,542 | Binding DataGridView to DataSource - Throws CurrencyError IndexOutOfRangeException | I've been puzzling over this one for a few days now and it's got me pretty beaten, but to be honest I'm not all that experienced yet and I'm having trouble with DataGridView - which seems a common topic. public partial class frmMain: Form { ServerConnection sabCom; private BindingSource jobSource = new BindingSource();... | The problem seems to be that with a refresh interval of say 1 second, while the user is scrolling or trying to access the fields of the data the data is constantly being removed and readded. This causes the binding to to call try call a value that it thinks might still be there, but isn't and that is why you are gettin... | Binding DataGridView to DataSource - Throws CurrencyError IndexOutOfRangeException I've been puzzling over this one for a few days now and it's got me pretty beaten, but to be honest I'm not all that experienced yet and I'm having trouble with DataGridView - which seems a common topic. public partial class frmMain: For... | TITLE:
Binding DataGridView to DataSource - Throws CurrencyError IndexOutOfRangeException
QUESTION:
I've been puzzling over this one for a few days now and it's got me pretty beaten, but to be honest I'm not all that experienced yet and I'm having trouble with DataGridView - which seems a common topic. public partial ... | [
"c#",
"datagridview",
"currencymanager"
] | 1 | 1 | 4,989 | 1 | 0 | 2011-06-02T09:48:32.200000 | 2011-06-04T15:15:52.150000 |
6,212,887 | 6,212,984 | Changing interpreter bash script | Is there any way for changing the interpreter in the middle of a bash script For instance start with: #!/bin/bash Later change to: #!$drush_location The reason is because I want to use bash to resolve the location of drush using bash and then pass that var in as an interpreter | You will need to write two scripts and use the first (bash) one to launch the second (drush). There are other ways to accomplish this, but they are all basically fancy ways of doing the above. For example you could use a here-doc to cram a script contained as a string in your first script into stdin on drush and have i... | Changing interpreter bash script Is there any way for changing the interpreter in the middle of a bash script For instance start with: #!/bin/bash Later change to: #!$drush_location The reason is because I want to use bash to resolve the location of drush using bash and then pass that var in as an interpreter | TITLE:
Changing interpreter bash script
QUESTION:
Is there any way for changing the interpreter in the middle of a bash script For instance start with: #!/bin/bash Later change to: #!$drush_location The reason is because I want to use bash to resolve the location of drush using bash and then pass that var in as an int... | [
"drupal",
"bash",
"interpreter",
"drush"
] | 1 | 3 | 1,617 | 1 | 0 | 2011-06-02T09:49:18.040000 | 2011-06-02T09:57:25.667000 |
6,212,892 | 6,212,926 | How to read uptill a particular character in a file, without going through the file, character by character? | Want to detect the '\n' without going through each and every character of a text file. Any hints? | Something has to read all the bytes to check for that delimiter. Use one of the getline (or istream::getline ) functions so that the library does the searching, not your code. | How to read uptill a particular character in a file, without going through the file, character by character? Want to detect the '\n' without going through each and every character of a text file. Any hints? | TITLE:
How to read uptill a particular character in a file, without going through the file, character by character?
QUESTION:
Want to detect the '\n' without going through each and every character of a text file. Any hints?
ANSWER:
Something has to read all the bytes to check for that delimiter. Use one of the getlin... | [
"c++",
"file-io",
"ifstream"
] | 2 | 3 | 122 | 2 | 0 | 2011-06-02T09:49:51.267000 | 2011-06-02T09:53:06.643000 |
6,212,894 | 6,268,286 | How to make a native C executable run forever in the Android? | Is there a way to make a native C executable run forever (in background) in Android OS? I have ported libpcap in Android and I made a sniffer. I have a rooted HTC Hero. I run the sniffer in the background through this commands: $ su # mount -o remount,rw -t vfat /dev/block//vold/179:0 /sdcard # /sdcard/mysniffer & I si... | I found a way to do this, and conduct my experiments and measurements!:) I just changed the PARTIAL_WAKE_LOCK with a SCREEN_DIM_WAKE_LOCK in my service! I can't understand the reason, but by doing this the native sniffer is not killed by Android.. If someone knows a better solution, please let us know. | How to make a native C executable run forever in the Android? Is there a way to make a native C executable run forever (in background) in Android OS? I have ported libpcap in Android and I made a sniffer. I have a rooted HTC Hero. I run the sniffer in the background through this commands: $ su # mount -o remount,rw -t ... | TITLE:
How to make a native C executable run forever in the Android?
QUESTION:
Is there a way to make a native C executable run forever (in background) in Android OS? I have ported libpcap in Android and I made a sniffer. I have a rooted HTC Hero. I run the sniffer in the background through this commands: $ su # mount... | [
"android",
"c",
"android-ndk",
"executable"
] | 1 | 0 | 1,218 | 1 | 0 | 2011-06-02T09:50:00.940000 | 2011-06-07T16:11:03.383000 |
6,212,896 | 6,217,168 | How to start ttk.Progressbar? | I am having trouble with getting the progressbar to start. I have scoured the internet for answers, and have tried multiple ways for hours, but have been rewarded with errors such as: TypeError: unbound method start() must be called with Progressbar instance as first argument (got nothing instead)
TypeError: unbound m... | Your prog variable does not contain the progressbar because you call the grid method which does return None. That does explain the AttributeError: 'NoneType' object has no attribute 'stop' change your code to prog = ttk.Progressbar(mainframe, mode='indeterminate') prog.grid(column=1, row=100, sticky=W) after that you c... | How to start ttk.Progressbar? I am having trouble with getting the progressbar to start. I have scoured the internet for answers, and have tried multiple ways for hours, but have been rewarded with errors such as: TypeError: unbound method start() must be called with Progressbar instance as first argument (got nothing ... | TITLE:
How to start ttk.Progressbar?
QUESTION:
I am having trouble with getting the progressbar to start. I have scoured the internet for answers, and have tried multiple ways for hours, but have been rewarded with errors such as: TypeError: unbound method start() must be called with Progressbar instance as first argu... | [
"python",
"debugging",
"progress-bar",
"ttk"
] | 2 | 4 | 5,243 | 1 | 0 | 2011-06-02T09:50:04.950000 | 2011-06-02T16:12:17.583000 |
6,212,897 | 6,213,042 | Can I use libjpeg to read JPEGs with an alpha channel? | There seems to be some debate about whether JPEGs with alpha channels are valid or not. The answer I had always understood to be correct is that in the JPEG FAQ, which is essentially "No". (This is reiterated in another question on Stack Overflow.) However, Java's JPEGImageWriter in Sun's ImageIO library will happily w... | Have you already tried libjpeg-turbo? It is supposed to be able to decode RGBA and there is already a Java wrapper for it. | Can I use libjpeg to read JPEGs with an alpha channel? There seems to be some debate about whether JPEGs with alpha channels are valid or not. The answer I had always understood to be correct is that in the JPEG FAQ, which is essentially "No". (This is reiterated in another question on Stack Overflow.) However, Java's ... | TITLE:
Can I use libjpeg to read JPEGs with an alpha channel?
QUESTION:
There seems to be some debate about whether JPEGs with alpha channels are valid or not. The answer I had always understood to be correct is that in the JPEG FAQ, which is essentially "No". (This is reiterated in another question on Stack Overflow.... | [
"java",
"jpeg",
"file-format",
"libjpeg",
"color-space"
] | 11 | 1 | 5,660 | 3 | 0 | 2011-06-02T09:50:10.410000 | 2011-06-02T10:03:27.897000 |
6,212,906 | 6,212,968 | How can you find translations of a word in english to other languages programmatically | The following is a sample set of translations from english --> french lundi (monday) mardi (tuesday) mercredi (wednesday) janvier (january) Is there an easier way to find the equivalent words for days and months from english to say french | german | japanese? | You could use SimpleDateFormat: Locale locale = new Locale("fr"); SimpleDateFormat df = new SimpleDateFormat("EEEE", locale); System.out.println(df.format(new Date())); Now instead of new Date() create a date with the required day - monday, tuesday, etc | How can you find translations of a word in english to other languages programmatically The following is a sample set of translations from english --> french lundi (monday) mardi (tuesday) mercredi (wednesday) janvier (january) Is there an easier way to find the equivalent words for days and months from english to say f... | TITLE:
How can you find translations of a word in english to other languages programmatically
QUESTION:
The following is a sample set of translations from english --> french lundi (monday) mardi (tuesday) mercredi (wednesday) janvier (january) Is there an easier way to find the equivalent words for days and months fro... | [
"java",
"translation"
] | 0 | 8 | 345 | 2 | 0 | 2011-06-02T09:51:05.940000 | 2011-06-02T09:56:13.163000 |
6,212,909 | 6,213,060 | Regarding broadcast receiver android | Can an activity be invoked using a BroadcastReceiver? The onReceive for BroadCast receiver will be triggered whenever the user presses the power button. | Yes we can invoke try below code Intent mIntent = new Intent(getBaseContext(), Activity.class); mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplication().startActivity(mIntent); | Regarding broadcast receiver android Can an activity be invoked using a BroadcastReceiver? The onReceive for BroadCast receiver will be triggered whenever the user presses the power button. | TITLE:
Regarding broadcast receiver android
QUESTION:
Can an activity be invoked using a BroadcastReceiver? The onReceive for BroadCast receiver will be triggered whenever the user presses the power button.
ANSWER:
Yes we can invoke try below code Intent mIntent = new Intent(getBaseContext(), Activity.class); mIntent... | [
"android"
] | 1 | 0 | 285 | 2 | 0 | 2011-06-02T09:51:22.593000 | 2011-06-02T10:04:59.530000 |
6,212,918 | 6,213,067 | Easier management of DOM creation of elements in PHP | I'm trying to find an easier way to create elements and inserting text values into them. There has to be an easier way than creating a new variable for each element, right? Perhaps making a class with some abstraction? Or maybe I'm doing it the wrong way? At this rate creating 7 s will require me to create 7 variables,... | You can add the text to the elements directly: $doc->createElement('td', 'This is title #1'); Apart from that, there isnt much to shorten in terms of method calls. DOM is a verbose API. | Easier management of DOM creation of elements in PHP I'm trying to find an easier way to create elements and inserting text values into them. There has to be an easier way than creating a new variable for each element, right? Perhaps making a class with some abstraction? Or maybe I'm doing it the wrong way? At this rat... | TITLE:
Easier management of DOM creation of elements in PHP
QUESTION:
I'm trying to find an easier way to create elements and inserting text values into them. There has to be an easier way than creating a new variable for each element, right? Perhaps making a class with some abstraction? Or maybe I'm doing it the wron... | [
"php",
"dom"
] | 1 | 3 | 313 | 3 | 0 | 2011-06-02T09:52:22.103000 | 2011-06-02T10:05:36.410000 |
6,212,921 | 6,212,973 | Is un-initialized integer always default to 0 in c? | I'm reading source code of nginx and find it's not initializing many of the numerical variables, including ngx_int_t ngx_last_process;,here ngx_int_t defined as long int #if 0 ngx_last_process = 0; #endif So here @Igor Sysoev think it unnecessary to do the initialization? But in the programe it's assuming the default v... | External and static variables are initialized to zero by default, this is guaranteed. Automatic and register variables that do not have en explicit initializer will have an indeterminate value (either an unspecified value or a trap representation). From The Standard: C89 6.5.7: If an object that has static storage dura... | Is un-initialized integer always default to 0 in c? I'm reading source code of nginx and find it's not initializing many of the numerical variables, including ngx_int_t ngx_last_process;,here ngx_int_t defined as long int #if 0 ngx_last_process = 0; #endif So here @Igor Sysoev think it unnecessary to do the initializat... | TITLE:
Is un-initialized integer always default to 0 in c?
QUESTION:
I'm reading source code of nginx and find it's not initializing many of the numerical variables, including ngx_int_t ngx_last_process;,here ngx_int_t defined as long int #if 0 ngx_last_process = 0; #endif So here @Igor Sysoev think it unnecessary to ... | [
"c",
"default-value",
"initialization"
] | 31 | 35 | 29,046 | 4 | 0 | 2011-06-02T09:52:37.473000 | 2011-06-02T09:56:33.333000 |
6,212,922 | 6,213,015 | Preg_match a string, must containing Letters and numbers | The sentence maybe: BenQ G2420HDBL 23.6" Wide LCD Monitor Need to grab the "G2420HDBL" part. The letters and numbers may be in a different order but still remains a string with both letters and numbers present. | You can use the following regex in case-insensitive mode: (?=[a-z]*[0-9])(?=[0-9]*[a-z])[a-z0-9-]+ Basically it matches the first string that is made up of only letters and numbers with atleast one letter and atleast one number. In PHP: if(preg_match("/(?=[a-z]*[0-9])(?=[0-9]*[a-z])([a-z0-9-]+)/i",$input,$match)) { ech... | Preg_match a string, must containing Letters and numbers The sentence maybe: BenQ G2420HDBL 23.6" Wide LCD Monitor Need to grab the "G2420HDBL" part. The letters and numbers may be in a different order but still remains a string with both letters and numbers present. | TITLE:
Preg_match a string, must containing Letters and numbers
QUESTION:
The sentence maybe: BenQ G2420HDBL 23.6" Wide LCD Monitor Need to grab the "G2420HDBL" part. The letters and numbers may be in a different order but still remains a string with both letters and numbers present.
ANSWER:
You can use the following... | [
"php",
"string",
"preg-match"
] | 2 | 2 | 3,493 | 5 | 0 | 2011-06-02T09:52:46.057000 | 2011-06-02T09:59:54.850000 |
6,212,925 | 6,213,617 | Prevent UIButton touch event for multitouch | after finding out that there is a bug in the UITapGestureRecognizer ( How to cancel button tap if UIGestureRecognizer fires? ) I am thinking about detecting two finger taps and two finger double-taps in the touchesEnded method of my view controller. Here is the situation, what I want to do and my problem: Situaion: I h... | @Mark I was trying to get your example from the other day working. As it is a bug, I altered it to use a tap recognizer. It's not a true solution as you don't get a clicked effect on the button but the right button messages the Touch Up Inside event. You can check out those changes here. See if it helps. | Prevent UIButton touch event for multitouch after finding out that there is a bug in the UITapGestureRecognizer ( How to cancel button tap if UIGestureRecognizer fires? ) I am thinking about detecting two finger taps and two finger double-taps in the touchesEnded method of my view controller. Here is the situation, wha... | TITLE:
Prevent UIButton touch event for multitouch
QUESTION:
after finding out that there is a bug in the UITapGestureRecognizer ( How to cancel button tap if UIGestureRecognizer fires? ) I am thinking about detecting two finger taps and two finger double-taps in the touchesEnded method of my view controller. Here is ... | [
"iphone",
"uiview",
"uibutton",
"touch",
"multi-touch"
] | 0 | 0 | 1,263 | 1 | 0 | 2011-06-02T09:53:01.017000 | 2011-06-02T10:57:46.530000 |
6,212,933 | 6,215,865 | Force the generation of HTTP links in HTTPS mode | I'm using SSL in my ASP.NET MVC 3 application. Once that the user enters in HTTPS mode, all the links in the page are generated with the HTTPS preface, but I'd like to "let the user leave" the HTTPS mode, and get back to HTTP when critical information exchange has been already done. Is there anyway in the Routes config... | As the user is browsing an HTTPS page, the request itself doesn't contain any information with respect to what port the HTTP binding is running on. which means that you would need to supply it yourself (it might be possible to get this value out from the IIS config file somehow). Below is a sample helper function that ... | Force the generation of HTTP links in HTTPS mode I'm using SSL in my ASP.NET MVC 3 application. Once that the user enters in HTTPS mode, all the links in the page are generated with the HTTPS preface, but I'd like to "let the user leave" the HTTPS mode, and get back to HTTP when critical information exchange has been a... | TITLE:
Force the generation of HTTP links in HTTPS mode
QUESTION:
I'm using SSL in my ASP.NET MVC 3 application. Once that the user enters in HTTPS mode, all the links in the page are generated with the HTTPS preface, but I'd like to "let the user leave" the HTTPS mode, and get back to HTTP when critical information e... | [
"asp.net-mvc",
"asp.net-mvc-3",
"https",
"security"
] | 0 | 2 | 1,180 | 1 | 0 | 2011-06-02T09:53:28.770000 | 2011-06-02T14:25:40.300000 |
6,212,934 | 6,212,958 | Most portable video codec for the web? | I am looking for a method to embed videos in web pages without using a plugin like Flash or Silverlight. Ideally, I would be able to and expect this to work in most browsers. I'm aiming to encode videos to a format that works across IE7 and later, Chrome and Firefox. But I need to know which codec is the most portable.... | H.264 and WebM is what you need. H.264 is supported in Safari and IE (these also refuse to include WebM support), WebM is supported by alternative browsers Chrome (of course), Firefox and Opera. I recommend using video tag first, then as a fallback option you can include a Flash player, which will play either version (... | Most portable video codec for the web? I am looking for a method to embed videos in web pages without using a plugin like Flash or Silverlight. Ideally, I would be able to and expect this to work in most browsers. I'm aiming to encode videos to a format that works across IE7 and later, Chrome and Firefox. But I need to... | TITLE:
Most portable video codec for the web?
QUESTION:
I am looking for a method to embed videos in web pages without using a plugin like Flash or Silverlight. Ideally, I would be able to and expect this to work in most browsers. I'm aiming to encode videos to a format that works across IE7 and later, Chrome and Fire... | [
"video",
"codec",
"html4"
] | 3 | 6 | 717 | 2 | 0 | 2011-06-02T09:53:30.657000 | 2011-06-02T09:55:21.610000 |
6,212,936 | 6,213,056 | string manipulation: partly convert to lowercase | As the title says: What's best way of converting a string from any-case to lowercase keeping a portion unchanged? e.g. a string like: FormatDate(%M)==2 or stArTDate(%Y/%m)==11/3 and I want to convert it to formatdate(%M)==2 or startdate(%Y/%m)==11/3 i.e. change it to lowercase except the part in between the braces (). ... | Do your strings always look exactly like this? If so, maybe this is enough: p1,p2 = instr.split('(',1) lc = '%s(%s' % (p1.lower(), p2) | string manipulation: partly convert to lowercase As the title says: What's best way of converting a string from any-case to lowercase keeping a portion unchanged? e.g. a string like: FormatDate(%M)==2 or stArTDate(%Y/%m)==11/3 and I want to convert it to formatdate(%M)==2 or startdate(%Y/%m)==11/3 i.e. change it to low... | TITLE:
string manipulation: partly convert to lowercase
QUESTION:
As the title says: What's best way of converting a string from any-case to lowercase keeping a portion unchanged? e.g. a string like: FormatDate(%M)==2 or stArTDate(%Y/%m)==11/3 and I want to convert it to formatdate(%M)==2 or startdate(%Y/%m)==11/3 i.e... | [
"python"
] | 3 | 5 | 303 | 5 | 0 | 2011-06-02T09:53:36.557000 | 2011-06-02T10:04:50.710000 |
6,212,938 | 6,215,775 | Upgrading running application on Android | Is Android system supposed to restart an application when it's upgraded while it's running? When we upgrade our application (by opening the.apk from SD card) and the application is running, the existing process stays around and the upgrade does not take effect until we "force close" the application from application man... | Is Android system supposed to restart an application when it's upgraded while it's running? I dont know what should be the expected behaviour. But I know that it does not restart the app. So I have a BroadcastReceiver waiting for the ACTION_PACKAGE_REPLACED intent and then handle the app restart accordingly. | Upgrading running application on Android Is Android system supposed to restart an application when it's upgraded while it's running? When we upgrade our application (by opening the.apk from SD card) and the application is running, the existing process stays around and the upgrade does not take effect until we "force cl... | TITLE:
Upgrading running application on Android
QUESTION:
Is Android system supposed to restart an application when it's upgraded while it's running? When we upgrade our application (by opening the.apk from SD card) and the application is running, the existing process stays around and the upgrade does not take effect ... | [
"android",
"android-install-apk"
] | 8 | 2 | 885 | 2 | 0 | 2011-06-02T09:53:41.733000 | 2011-06-02T14:19:12.627000 |
6,212,940 | 6,213,009 | Create Custom SQL Server Role in SQL 2008 Server | I want to add new custom SQL Server Role and assign the new users to these appropriate roles respectively. I try to find how to create role, but I could not find the place to add that. Could you please guide me how to achieve my requirement? | You cannot do this in the 2008 version just yet - this is a new feature that you'll get with SQL Server 2011 (a.k.a. "Denali") sometime in 2011/2012. See some resources: Create your own fixed server roles Custom server roles in SQL Server Denali Add your OWN server role in Denali | Create Custom SQL Server Role in SQL 2008 Server I want to add new custom SQL Server Role and assign the new users to these appropriate roles respectively. I try to find how to create role, but I could not find the place to add that. Could you please guide me how to achieve my requirement? | TITLE:
Create Custom SQL Server Role in SQL 2008 Server
QUESTION:
I want to add new custom SQL Server Role and assign the new users to these appropriate roles respectively. I try to find how to create role, but I could not find the place to add that. Could you please guide me how to achieve my requirement?
ANSWER:
Yo... | [
"security",
"sql-server-2008"
] | 5 | 7 | 17,678 | 5 | 0 | 2011-06-02T09:53:47.500000 | 2011-06-02T09:59:08.223000 |
6,212,967 | 6,213,007 | what is the fastest way to toggle images by class | i have a list of image and i want to change the source of all of the images (by using the class selector.onOff so each of the above images changes to this: what is the most efficient way to changing all of these images through jquery? | Prefix the class selector with the tag: $('img.onOff').attr('src', '/Content/Images/off.png'); However, if you've got some context (such as a container div ) you can add that too to improve performance: $('img.onOff', '#containerDiv').attr('src', '/Content/Images/off.png'); If this is just to change the image though, t... | what is the fastest way to toggle images by class i have a list of image and i want to change the source of all of the images (by using the class selector.onOff so each of the above images changes to this: what is the most efficient way to changing all of these images through jquery? | TITLE:
what is the fastest way to toggle images by class
QUESTION:
i have a list of image and i want to change the source of all of the images (by using the class selector.onOff so each of the above images changes to this: what is the most efficient way to changing all of these images through jquery?
ANSWER:
Prefix t... | [
"jquery",
"image"
] | 1 | 5 | 630 | 3 | 0 | 2011-06-02T09:56:11.413000 | 2011-06-02T09:58:54.947000 |
6,212,971 | 6,237,576 | mediaelement.js not working in FF or IE fine in Chrome & Safari | I jave a strange issue, I'am using the mediaelement js media player to serve up video from youtube videos. The thing is I'am using it on one site where it works great in all browsers. I have literally copied the code for use on another site and its not working properly in FF & IE. It throws this error in the console th... | Just in case anybody else comes across this issue... It turns out some scripts we were using - cbb by Roger Johansson - http://www.456bereastreet.com/ was conflicting with our video player. Maybe this has something to do with the fact that mediaelement was creating elements inside elements that were being created by th... | mediaelement.js not working in FF or IE fine in Chrome & Safari I jave a strange issue, I'am using the mediaelement js media player to serve up video from youtube videos. The thing is I'am using it on one site where it works great in all browsers. I have literally copied the code for use on another site and its not wor... | TITLE:
mediaelement.js not working in FF or IE fine in Chrome & Safari
QUESTION:
I jave a strange issue, I'am using the mediaelement js media player to serve up video from youtube videos. The thing is I'am using it on one site where it works great in all browsers. I have literally copied the code for use on another si... | [
"javascript",
"jquery",
"youtube",
"mediaelement",
"mediaelement.js"
] | 0 | 0 | 1,630 | 1 | 0 | 2011-06-02T09:56:21.060000 | 2011-06-04T15:23:45.203000 |
6,212,983 | 6,262,414 | Extending php SoapClient for siteminder authentication | Short Version I want to extend SoapClient so it does this internally when accessing the WSDL: curl -L -E /location/of/cert.pem -c /tmp/location/of/cookie.jar https://web-service-provider/servicename?wsdl Long Version I've got a SOAP request similar to this: $serviceUrl = 'https://service-url'; $wsdl = $serviceUrl. '?ws... | The answer to this head scratching, hair pulling problem can be found here: http://rabaix.net/en/articles/2008/03/13/using-soap-php-with-ntlm-authentication. Thanks to Jeffery Fernandez on the php soap mailing list who pointed this out. | Extending php SoapClient for siteminder authentication Short Version I want to extend SoapClient so it does this internally when accessing the WSDL: curl -L -E /location/of/cert.pem -c /tmp/location/of/cookie.jar https://web-service-provider/servicename?wsdl Long Version I've got a SOAP request similar to this: $servic... | TITLE:
Extending php SoapClient for siteminder authentication
QUESTION:
Short Version I want to extend SoapClient so it does this internally when accessing the WSDL: curl -L -E /location/of/cert.pem -c /tmp/location/of/cookie.jar https://web-service-provider/servicename?wsdl Long Version I've got a SOAP request simila... | [
"php",
"soap-client",
"ntlm",
"siteminder",
"soapserver"
] | 5 | 2 | 6,026 | 2 | 0 | 2011-06-02T09:57:25.533000 | 2011-06-07T08:18:13.560000 |
6,212,987 | 6,213,703 | How to compare "4A4B4C" (string shows hex value) actual string is "JKL" | I am getting a string "4A4B4C4D4E4F".. it is equal to a string ( "JKLMNO" ) How can I check this type of string in c++.. (one string shows the hexadecimal representation of another) hexadecimal value of J=4A, K=4B, L=4C | Alternatively this can be done using C++ strings and features rather than C-style strings: #include #include #include #include #include #include bool compareAscii(const std::string& string, const std::string& asciistr) { std::ostringstream result; result << std::setw(2) << std::setfill('0') << std::hex << std::uppercas... | How to compare "4A4B4C" (string shows hex value) actual string is "JKL" I am getting a string "4A4B4C4D4E4F".. it is equal to a string ( "JKLMNO" ) How can I check this type of string in c++.. (one string shows the hexadecimal representation of another) hexadecimal value of J=4A, K=4B, L=4C | TITLE:
How to compare "4A4B4C" (string shows hex value) actual string is "JKL"
QUESTION:
I am getting a string "4A4B4C4D4E4F".. it is equal to a string ( "JKLMNO" ) How can I check this type of string in c++.. (one string shows the hexadecimal representation of another) hexadecimal value of J=4A, K=4B, L=4C
ANSWER:
A... | [
"c++",
"string",
"hex",
"string-comparison"
] | 0 | 2 | 2,478 | 3 | 0 | 2011-06-02T09:57:37.040000 | 2011-06-02T11:04:48.933000 |
6,212,988 | 6,213,149 | UIPopoverController dismiss on 'tap off' - how do I detect this event? | I am using a UIPopover on my navigation bar. I have several UIBarButtonItems and the popover extends from one of these. When the popOver is activated I changed the style of the button to UIBarButtonItemStyleDone. However, the popOver is dismissed by tapping off the UIPopoverController as expected, but upon this I want ... | Implement the -popoverControllerDidDismissPopover: method in your UIPopoverControllerDelegate and you should be able to do what you need to do in there. - (void) popoverControllerDidDismissPopover:(UIPopoverController *) popoverController { //do stuff here... } | UIPopoverController dismiss on 'tap off' - how do I detect this event? I am using a UIPopover on my navigation bar. I have several UIBarButtonItems and the popover extends from one of these. When the popOver is activated I changed the style of the button to UIBarButtonItemStyleDone. However, the popOver is dismissed by... | TITLE:
UIPopoverController dismiss on 'tap off' - how do I detect this event?
QUESTION:
I am using a UIPopover on my navigation bar. I have several UIBarButtonItems and the popover extends from one of these. When the popOver is activated I changed the style of the button to UIBarButtonItemStyleDone. However, the popOv... | [
"ios",
"objective-c",
"uipopovercontroller"
] | 6 | 20 | 4,653 | 1 | 0 | 2011-06-02T09:57:38.800000 | 2011-06-02T10:12:47.247000 |
6,212,990 | 6,213,560 | MongoDB GridFS VS Directly disk IO | Use MongoDB GridFS store images and images stored directly on disk What are the advantages? | Main advantage in my opinion is easy files distribution across multiple servers when system start growing (sharding, replication). Easy improvement reads/writes speed. No need to care where to put new file. Files systems become slow with big amount of small files. | MongoDB GridFS VS Directly disk IO Use MongoDB GridFS store images and images stored directly on disk What are the advantages? | TITLE:
MongoDB GridFS VS Directly disk IO
QUESTION:
Use MongoDB GridFS store images and images stored directly on disk What are the advantages?
ANSWER:
Main advantage in my opinion is easy files distribution across multiple servers when system start growing (sharding, replication). Easy improvement reads/writes speed... | [
"mongodb",
"gridfs"
] | 19 | 13 | 2,398 | 1 | 0 | 2011-06-02T09:57:44.727000 | 2011-06-02T10:52:28.127000 |
6,212,992 | 6,251,901 | Using Dapper with Oracle | We use Oracle as our database provider and have looked into replacing some of our data access layer (hard to maintain, harder to merge XSD's) with a saner repository based pattern using Dapper at the bottom layer. However, we have hit a number of issues when using it with oracle. Named Parameters: these seem to be igno... | IMO, the correct approach here is not to (as per the accepted answer) use the database specific parameter prefix (so @ for sql-server,: for oracle) - but rather: use no prefix at all. So ultimately this is: il.Emit(OpCodes.Ldstr, prop.Name); (etc) In particular, a static property would be bad as it would limit you to o... | Using Dapper with Oracle We use Oracle as our database provider and have looked into replacing some of our data access layer (hard to maintain, harder to merge XSD's) with a saner repository based pattern using Dapper at the bottom layer. However, we have hit a number of issues when using it with oracle. Named Paramete... | TITLE:
Using Dapper with Oracle
QUESTION:
We use Oracle as our database provider and have looked into replacing some of our data access layer (hard to maintain, harder to merge XSD's) with a saner repository based pattern using Dapper at the bottom layer. However, we have hit a number of issues when using it with orac... | [
"c#",
"oracle",
"dapper"
] | 13 | 15 | 19,439 | 2 | 0 | 2011-06-02T09:57:52.740000 | 2011-06-06T12:21:21.777000 |
6,212,995 | 6,213,016 | function inside a function in android | what is this technique in java and android? please give basics about this technique objlistview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position,long id) { Cursor cr=(Cursor)parent.getItemAtPosition(position); int _id=cr.getInt(cr.getColumnIndex("_id"))... | It's an anonymous class - very popular for ActionListeners where you create them just where you need them. In your example, each time you create an instance of the OnItemClickListener via the new keyword you can specify the onItemClick behaviour (via the method) right where it's needed and bind it appropriately. This i... | function inside a function in android what is this technique in java and android? please give basics about this technique objlistview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position,long id) { Cursor cr=(Cursor)parent.getItemAtPosition(position); int _... | TITLE:
function inside a function in android
QUESTION:
what is this technique in java and android? please give basics about this technique objlistview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position,long id) { Cursor cr=(Cursor)parent.getItemAtPositio... | [
"java",
"android"
] | 2 | 4 | 1,294 | 2 | 0 | 2011-06-02T09:57:55.193000 | 2011-06-02T09:59:55.703000 |
6,213,008 | 6,213,096 | org.xml.sax.SAXParseException: Premature end of file | I have this piece of code which gives to SAXParseError i.e., it is not getting the content, but the same thing when i use in my test pg it works correctly. Here i am providing my original code piece, can any1 figure out what is the problem This is the part where I fetch a xml and append a node to it but it seems that i... | Assuming this is in Groovy, I believe you can replace all of your code with: File f = new File( '../webapps/abc/include/xml/data.xml' ) def root = new XmlSlurper().parse( f ) String[] splitString = res.split( ',' ) root.appendNode { row { name(splitString[1]) host(splitString[2]) desc(splitString[3]) product(splitStrin... | org.xml.sax.SAXParseException: Premature end of file I have this piece of code which gives to SAXParseError i.e., it is not getting the content, but the same thing when i use in my test pg it works correctly. Here i am providing my original code piece, can any1 figure out what is the problem This is the part where I fe... | TITLE:
org.xml.sax.SAXParseException: Premature end of file
QUESTION:
I have this piece of code which gives to SAXParseError i.e., it is not getting the content, but the same thing when i use in my test pg it works correctly. Here i am providing my original code piece, can any1 figure out what is the problem This is t... | [
"java",
"groovy"
] | 0 | 1 | 3,925 | 2 | 0 | 2011-06-02T09:59:07.657000 | 2011-06-02T10:08:23.697000 |
6,213,012 | 6,213,243 | Proper way to create JSON data with PHP/MySQL | Updated based on answers below: Based on the answers below, I now have the following PHP script: header('Content-type:application/json');
function getdata($the_query) { $connection = mysql_connect('server', 'user', 'pass') or die (mysql_error()); $db = mysql_select_db('db_name', $connection) or die (mysql_error());
$... | try this one: 'title goes here', 'link' => 'link here', 'description' => 'description', 'items' => array() ); while($row = mysql_fetch_array($results)) { extract($row); $channel['items'][] = array( 'title' => $title, 'link' => $link, 'guid' => $guid, 'pubDate' => $date, 'description' => $description ); } $channels = ar... | Proper way to create JSON data with PHP/MySQL Updated based on answers below: Based on the answers below, I now have the following PHP script: header('Content-type:application/json');
function getdata($the_query) { $connection = mysql_connect('server', 'user', 'pass') or die (mysql_error()); $db = mysql_select_db('db_... | TITLE:
Proper way to create JSON data with PHP/MySQL
QUESTION:
Updated based on answers below: Based on the answers below, I now have the following PHP script: header('Content-type:application/json');
function getdata($the_query) { $connection = mysql_connect('server', 'user', 'pass') or die (mysql_error()); $db = my... | [
"php",
"json"
] | 8 | 10 | 14,525 | 2 | 0 | 2011-06-02T09:59:33.320000 | 2011-06-02T10:22:32.870000 |
6,213,017 | 6,219,018 | How to stretch an image in Matlab | All, I need to know how to stretch an image for further work. for example, I have the next two images: I want that the numbers will fill the entire square like this: any help will be greatly appreciated. | Assuming that the background is a constant value, and that the image doesn't have any constant rows, cols, and that the useful image is a rectangle in the middle of the larger image with background: colsWithImg = find(any(abs(diff(img)))); % idxs of cols with any img in it. rowsWithImg = find(any(abs(diff(img')))); img... | How to stretch an image in Matlab All, I need to know how to stretch an image for further work. for example, I have the next two images: I want that the numbers will fill the entire square like this: any help will be greatly appreciated. | TITLE:
How to stretch an image in Matlab
QUESTION:
All, I need to know how to stretch an image for further work. for example, I have the next two images: I want that the numbers will fill the entire square like this: any help will be greatly appreciated.
ANSWER:
Assuming that the background is a constant value, and t... | [
"matlab",
"image-processing"
] | 1 | 3 | 4,590 | 2 | 0 | 2011-06-02T09:59:58.020000 | 2011-06-02T18:55:17.583000 |
6,213,020 | 6,213,344 | Round DateTime to closest quarter hour | How can I round a DateTime object to the closest quarter hour? So: 2011-05-30 09:11:00 will be rounded to 2011-05-30 09:15:00, 2011-05-30 09:47:00 will be rounded to 2011-05-30 09:45:00 and so on. | You could extract the minutes divide them by 15, round them and multiply them by 15 again. Something like // round the "minutes" $quarter = round(date('i', $yourdate) / 15) * 15; // get the new timestamp $roundeddate = mktime(date("H",$yourdate), $quarter, date("s",$yourdate), date("n",$yourdate), date("j",$yourdate), ... | Round DateTime to closest quarter hour How can I round a DateTime object to the closest quarter hour? So: 2011-05-30 09:11:00 will be rounded to 2011-05-30 09:15:00, 2011-05-30 09:47:00 will be rounded to 2011-05-30 09:45:00 and so on. | TITLE:
Round DateTime to closest quarter hour
QUESTION:
How can I round a DateTime object to the closest quarter hour? So: 2011-05-30 09:11:00 will be rounded to 2011-05-30 09:15:00, 2011-05-30 09:47:00 will be rounded to 2011-05-30 09:45:00 and so on.
ANSWER:
You could extract the minutes divide them by 15, round th... | [
"php"
] | 2 | 6 | 4,123 | 3 | 0 | 2011-06-02T10:00:23.520000 | 2011-06-02T10:31:26.643000 |
6,213,030 | 6,213,107 | Does C++ calls member object 's overloaded operator? | #include class InnerOne { int m_iDummy; public: InnerOne(int iDummy) { m_iDummy=iDummy; }
InnerOne& operator=(InnerOne &obj) { printf("In InnerOne Operator=\n"); m_iDummy = obj.m_iDummy; return *this; }
};
class OuterOne { InnerOne m_innerOne; public: OuterOne(int iVal): m_innerOne(iVal) { }
};
int main() { OuterO... | Yes. The compiler generated copy-assignment for OuterOne will invoke the operator= for InnerOne. As a sidenote, its better if you write InnerOne copy-assignment as: InnerOne& operator=(const InnerOne &obj) //^^^^ add this! const is necessary, or else your code wouldn't work for the following: const InnerOne x(10); Inne... | Does C++ calls member object 's overloaded operator? #include class InnerOne { int m_iDummy; public: InnerOne(int iDummy) { m_iDummy=iDummy; }
InnerOne& operator=(InnerOne &obj) { printf("In InnerOne Operator=\n"); m_iDummy = obj.m_iDummy; return *this; }
};
class OuterOne { InnerOne m_innerOne; public: OuterOne(int... | TITLE:
Does C++ calls member object 's overloaded operator?
QUESTION:
#include class InnerOne { int m_iDummy; public: InnerOne(int iDummy) { m_iDummy=iDummy; }
InnerOne& operator=(InnerOne &obj) { printf("In InnerOne Operator=\n"); m_iDummy = obj.m_iDummy; return *this; }
};
class OuterOne { InnerOne m_innerOne; pu... | [
"c++"
] | 2 | 2 | 105 | 2 | 0 | 2011-06-02T10:01:16.520000 | 2011-06-02T10:09:24.507000 |
6,213,034 | 6,231,109 | ASP and COM Error Handling | We are developing ASP based web server to run on a WIN CE device. The ASP pages use a COM component for performing the server side operations. We have a couple of doubts about the error handling. Our doubts are What is the best method for giving error information from a COM component to the ASP page? We are using VBScr... | COM object methods generally return an HRESULT, which contains an error code in case of failure. You can try to get this value in VB.Script by reading the property Err.Number. | ASP and COM Error Handling We are developing ASP based web server to run on a WIN CE device. The ASP pages use a COM component for performing the server side operations. We have a couple of doubts about the error handling. Our doubts are What is the best method for giving error information from a COM component to the A... | TITLE:
ASP and COM Error Handling
QUESTION:
We are developing ASP based web server to run on a WIN CE device. The ASP pages use a COM component for performing the server side operations. We have a couple of doubts about the error handling. Our doubts are What is the best method for giving error information from a COM ... | [
"com",
"asp-classic",
"vbscript",
"windows-ce"
] | 1 | 2 | 343 | 2 | 0 | 2011-06-02T10:02:21.387000 | 2011-06-03T18:23:16.157000 |
6,213,035 | 6,214,708 | how does android calculate the res directories | I have read http://developer.android.com/guide/practices/screens_support.html and http://developer.android.com/reference/android/util/DisplayMetrics.html and I somehow left with a gap here. How is the transition from DisplayMetrics.densityDpi to for example String ("ldpi") done? And more importantly from DisplayMetrics... | I figured it out, here the correct code (you need a valid android.content.Context instance in attribute context ): final android.view.WindowManager windowManager = (android.view.WindowManager) this.context.getSystemService (android.content.Context.WINDOW_SERVICE); final android.util.DisplayMetrics metrics = new android... | how does android calculate the res directories I have read http://developer.android.com/guide/practices/screens_support.html and http://developer.android.com/reference/android/util/DisplayMetrics.html and I somehow left with a gap here. How is the transition from DisplayMetrics.densityDpi to for example String ("ldpi")... | TITLE:
how does android calculate the res directories
QUESTION:
I have read http://developer.android.com/guide/practices/screens_support.html and http://developer.android.com/reference/android/util/DisplayMetrics.html and I somehow left with a gap here. How is the transition from DisplayMetrics.densityDpi to for examp... | [
"android"
] | 2 | 4 | 1,371 | 2 | 0 | 2011-06-02T10:02:21.593000 | 2011-06-02T12:49:17.057000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.