PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
11,262,074
06/29/2012 12:47:51
1,491,179
06/29/2012 12:40:19
1
0
Post Salesforce Marketing Campaign to Facebook
I have recently come across one client requirement is as he wanted to create Campaign and posted it to Facebook with some offers for, anybody does has any idea how to do it? or any code snippet that will work. Thanks. Harshala.
facebook
salesforce
null
null
null
null
open
Post Salesforce Marketing Campaign to Facebook === I have recently come across one client requirement is as he wanted to create Campaign and posted it to Facebook with some offers for, anybody does has any idea how to do it? or any code snippet that will work. Thanks. Harshala.
0
11,262,080
06/29/2012 12:48:24
417,267
08/11/2010 13:11:58
699
10
NSSplitView and autolayout
How should I use auto layout constrains inside `NSSplitView` subview? My `NSSplitView` subview has 3 subview: `topPane`, `tableContainer` and `bottomPane` and I set the constrains like this: NSDictionary* views = NSDictionaryOfVariableBindings(topPane, tableContainer, bottomPane); for (NSView* view in [views allValues]) { [view setTranslatesAutoresizingMaskIntoConstraints:NO]; } [myView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[topPane(34)][tableContainer][bottomPane(24)]|" options:0 metrics:nil views:views]]; [mySplitView addSubview:myView]; And got this in console: Unable to simultaneously satisfy constraints: ( "<NSLayoutConstraint:0x7fd6c4b1f770 V:[NSScrollView:0x7fd6c4b234c0]-(0)-[CPane:0x7fd6c4b2fd10]>", "<NSLayoutConstraint:0x7fd6c4b30910 V:[CPane:0x7fd6c4b2f870(34)]>", "<NSLayoutConstraint:0x7fd6c4b30770 V:|-(0)-[CPane:0x7fd6c4b2f870] (Names: '|':NSView:0x7fd6c4b22e50 )>", "<NSLayoutConstraint:0x7fd6c4b212f0 V:[CPane:0x7fd6c4b2fd10]-(0)-| (Names: '|':NSView:0x7fd6c4b22e50 )>", "<NSLayoutConstraint:0x7fd6c4b2f910 V:[CPane:0x7fd6c4b2f870]-(0)-[NSScrollView:0x7fd6c4b234c0]>", "<NSLayoutConstraint:0x7fd6c4b21290 V:[CPane:0x7fd6c4b2fd10(24)]>", "<NSAutoresizingMaskLayoutConstraint:0x7fd6c3630430 h=--& v=--& V:[NSView:0x7fd6c4b22e50(0)]>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x7fd6c4b1f770 V:[NSScrollView:0x7fd6c4b234c0]-(0)-[CPane:0x7fd6c4b2fd10]> I think `<NSAutoresizingMaskLayoutConstraint:0x7fd6c3630430 h=--& v=--& V:[NSView:0x7fd6c4b22e50(0)]>` causes this, but I can't reset autoresizing mask, because `NSSplitView` sets it. What is best way to use auto layout inside split view? And is there any way to handle min/max size of split view subview with auto layout without `NSSplitViewDelegate`?
cocoa
nssplitview
autolayout
null
null
null
open
NSSplitView and autolayout === How should I use auto layout constrains inside `NSSplitView` subview? My `NSSplitView` subview has 3 subview: `topPane`, `tableContainer` and `bottomPane` and I set the constrains like this: NSDictionary* views = NSDictionaryOfVariableBindings(topPane, tableContainer, bottomPane); for (NSView* view in [views allValues]) { [view setTranslatesAutoresizingMaskIntoConstraints:NO]; } [myView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[topPane(34)][tableContainer][bottomPane(24)]|" options:0 metrics:nil views:views]]; [mySplitView addSubview:myView]; And got this in console: Unable to simultaneously satisfy constraints: ( "<NSLayoutConstraint:0x7fd6c4b1f770 V:[NSScrollView:0x7fd6c4b234c0]-(0)-[CPane:0x7fd6c4b2fd10]>", "<NSLayoutConstraint:0x7fd6c4b30910 V:[CPane:0x7fd6c4b2f870(34)]>", "<NSLayoutConstraint:0x7fd6c4b30770 V:|-(0)-[CPane:0x7fd6c4b2f870] (Names: '|':NSView:0x7fd6c4b22e50 )>", "<NSLayoutConstraint:0x7fd6c4b212f0 V:[CPane:0x7fd6c4b2fd10]-(0)-| (Names: '|':NSView:0x7fd6c4b22e50 )>", "<NSLayoutConstraint:0x7fd6c4b2f910 V:[CPane:0x7fd6c4b2f870]-(0)-[NSScrollView:0x7fd6c4b234c0]>", "<NSLayoutConstraint:0x7fd6c4b21290 V:[CPane:0x7fd6c4b2fd10(24)]>", "<NSAutoresizingMaskLayoutConstraint:0x7fd6c3630430 h=--& v=--& V:[NSView:0x7fd6c4b22e50(0)]>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x7fd6c4b1f770 V:[NSScrollView:0x7fd6c4b234c0]-(0)-[CPane:0x7fd6c4b2fd10]> I think `<NSAutoresizingMaskLayoutConstraint:0x7fd6c3630430 h=--& v=--& V:[NSView:0x7fd6c4b22e50(0)]>` causes this, but I can't reset autoresizing mask, because `NSSplitView` sets it. What is best way to use auto layout inside split view? And is there any way to handle min/max size of split view subview with auto layout without `NSSplitViewDelegate`?
0
11,262,082
06/29/2012 12:48:26
352,627
05/28/2010 06:47:05
1,009
0
UIProgressview gets reset
I am trying to implement UIProgressview in my application it works fine , until i navigate to another view. When i navigate to another view controller , the progressview gets reset and starts updating again. Is this a intended behavior of uiprogressview when pushing a view-controller , is there a way to fix my issue. Please let me know your thoughts and advices.
iphone
ios
iphone-sdk-4.0
pushviewcontroller
uiprogressview
null
open
UIProgressview gets reset === I am trying to implement UIProgressview in my application it works fine , until i navigate to another view. When i navigate to another view controller , the progressview gets reset and starts updating again. Is this a intended behavior of uiprogressview when pushing a view-controller , is there a way to fix my issue. Please let me know your thoughts and advices.
0
11,262,083
06/29/2012 12:48:29
975,494
10/02/2011 15:10:49
36
2
Direct and non-direct download links
I want to create a member area for users who's paid for premium acc, that they can download files with out any restriction with pause/resume in their download manager with several connection. also if they don't pay for that and other who's not logged in site, they download these files with 1 connection and without ability to pause or resume downloads. i want a reference for download header and other related subjects, that means why some links could download with several connections, others not. obviously what should i read to solve this problem ?
php
linux
apache
null
null
06/29/2012 19:21:49
not a real question
Direct and non-direct download links === I want to create a member area for users who's paid for premium acc, that they can download files with out any restriction with pause/resume in their download manager with several connection. also if they don't pay for that and other who's not logged in site, they download these files with 1 connection and without ability to pause or resume downloads. i want a reference for download header and other related subjects, that means why some links could download with several connections, others not. obviously what should i read to solve this problem ?
1
11,262,085
06/29/2012 12:48:39
880,530
08/05/2011 12:09:12
83
2
how only some arguments to function C
I have this function:<br> `void func(int a, int b, char s, FILE *fp, int flag)` <br>and i want to use the function's args based on the flag. For example: <br>`func(num, NOTHING, NOTHING, file, 1)`<br>`func(num, othernum, NOTHING, NOTHING, 2)`<br>and on the function `this_is_function` i want to have:<br> void func(int a, int b, char s, FILE *fp, int flag){ if(flag == 1){ /* use a and file */ } if(flag == 2){ /* use a,b */ } /* etc etc */ } i would like to know if it is possible and how to do this!<br>Thanks in advance :)
c
function
null
null
null
null
open
how only some arguments to function C === I have this function:<br> `void func(int a, int b, char s, FILE *fp, int flag)` <br>and i want to use the function's args based on the flag. For example: <br>`func(num, NOTHING, NOTHING, file, 1)`<br>`func(num, othernum, NOTHING, NOTHING, 2)`<br>and on the function `this_is_function` i want to have:<br> void func(int a, int b, char s, FILE *fp, int flag){ if(flag == 1){ /* use a and file */ } if(flag == 2){ /* use a,b */ } /* etc etc */ } i would like to know if it is possible and how to do this!<br>Thanks in advance :)
0
11,262,086
06/29/2012 12:48:43
161,336
08/22/2009 17:38:04
1,289
37
Repository pattersn, ViewModel and ORMs
With Repository pattern and ViewModels, how do you build queries against the database if you don't want the raw database objects to leak outside the repository? How do I actually create queries without loading ALL the database in memory and using LINQ to Objects? I can't expose IQueryable<DbEntity> to the rest of the app. For example, with EF I have a bunch of POCOs with several properties that match db fields, but also some stuff to work around enums not being directly support (for now) as well as foreign key IDs to prevent N+1 and easier querying and so on. I don't want them to leak out to the rest of the application, I want the application to just see a normal object graph. public class DbUser { public int Id { get; set; } public string Name { get set; } public int GroupId { get; set; } public DbGroup Group { get; set; } public ICollection<DbComment> { get; set; } } public class User { public int Id { get; set; } public string Name { get set; } public Group Group { get; set; } public ICollection<Comment> { get; set; } } The problem here is my repository will internally use EF for the querying (and in-memory stuff when unit testing). But how do I implement `IQueryable<User> FindAll()`? I can't just do return `dbContext.Users.Select(u => new User(u))`, as in that case I lose all possible query ability; it'll just load the whole user collection in memory, convert all the types to User from DbUser and then build LINQ queries on the in-memory collection - that is horribly inefficient. I can't just build queries in the repository. On some pages I have queries that select a few fields, but also calculate some complex stuff from other related objects, filter them based on the result (for example count of comments with positive score), but I also need that back in the application. I could select all objects used to get the complex stuff and return them to the application (but not as db entities) but that would mean select a LOT of data. Basically how do I **prevent the database entities from polluting** the rest of the application with their cruft and hacks, while still **maintaining the ability to build queries** outside of the repository?
orm
viewmodel
repository-pattern
dto
null
null
open
Repository pattersn, ViewModel and ORMs === With Repository pattern and ViewModels, how do you build queries against the database if you don't want the raw database objects to leak outside the repository? How do I actually create queries without loading ALL the database in memory and using LINQ to Objects? I can't expose IQueryable<DbEntity> to the rest of the app. For example, with EF I have a bunch of POCOs with several properties that match db fields, but also some stuff to work around enums not being directly support (for now) as well as foreign key IDs to prevent N+1 and easier querying and so on. I don't want them to leak out to the rest of the application, I want the application to just see a normal object graph. public class DbUser { public int Id { get; set; } public string Name { get set; } public int GroupId { get; set; } public DbGroup Group { get; set; } public ICollection<DbComment> { get; set; } } public class User { public int Id { get; set; } public string Name { get set; } public Group Group { get; set; } public ICollection<Comment> { get; set; } } The problem here is my repository will internally use EF for the querying (and in-memory stuff when unit testing). But how do I implement `IQueryable<User> FindAll()`? I can't just do return `dbContext.Users.Select(u => new User(u))`, as in that case I lose all possible query ability; it'll just load the whole user collection in memory, convert all the types to User from DbUser and then build LINQ queries on the in-memory collection - that is horribly inefficient. I can't just build queries in the repository. On some pages I have queries that select a few fields, but also calculate some complex stuff from other related objects, filter them based on the result (for example count of comments with positive score), but I also need that back in the application. I could select all objects used to get the complex stuff and return them to the application (but not as db entities) but that would mean select a LOT of data. Basically how do I **prevent the database entities from polluting** the rest of the application with their cruft and hacks, while still **maintaining the ability to build queries** outside of the repository?
0
11,423,355
07/10/2012 23:14:29
1,509,425
07/08/2012 00:32:43
1
0
Loading image (gif) pause for a short time on ajax requests
I have a loader image (gif) that shows itself on ajax requests and hides when the request is complete. But the problem is that animated gif pauses for a short time on ajax requests rather than being beautifully displayed. I suppose this is not due to the delay it takes for ajax requests but the handler function after the request is received, such as modifying DOM elements afterwards with the received data. My code is as the following: $.ajax({ url:"php/selectVote.php", type: "POST", data: dataString, datatype: "text", beforeSend: function() { $("#loadingLeft").show(); $("#loadingRight").show(); }, success: function(msg) { // bunch of handler functions $("#loadingLeft").hide(); $("#loadingRight").hide(); } }); If I remove handler functions, there is no problem with animated loading image. So I guess it is the problem of heavy handler functions after the ajax requests... Is there a way to make this work without changing the success function inside ajax call? Or should I make the success function more efficient? I suppose the problem with my code is that I use document.getElementById() several times.. Should I use getElementById() not on document object but a more specific object?? I have the following code in my success function.. for (var i = 0; i < 100; i++) { var leftArea = document.getElementById("gridLeftVotePicLarge" + i); var rightArea = document.getElementById("gridRightVotePicLarge" + i); leftArea.setAttribute("onclick", "actualVote(" + data.vote.voteId + ", " + like1Id + ", 'like1', " + divNum + "," + i + ");"); rightArea.setAttribute("onclick", "actualVote(" + data.vote.voteId + ", " + like2Id + ", 'like2', " + divNum + "," + i + ");"); } Maybe calling document.getElementById() 100 times is what is causing the problem? If you have any ideas on this issue, please help me! Thanks in advance!
javascript
jquery
ajax
loading
null
null
open
Loading image (gif) pause for a short time on ajax requests === I have a loader image (gif) that shows itself on ajax requests and hides when the request is complete. But the problem is that animated gif pauses for a short time on ajax requests rather than being beautifully displayed. I suppose this is not due to the delay it takes for ajax requests but the handler function after the request is received, such as modifying DOM elements afterwards with the received data. My code is as the following: $.ajax({ url:"php/selectVote.php", type: "POST", data: dataString, datatype: "text", beforeSend: function() { $("#loadingLeft").show(); $("#loadingRight").show(); }, success: function(msg) { // bunch of handler functions $("#loadingLeft").hide(); $("#loadingRight").hide(); } }); If I remove handler functions, there is no problem with animated loading image. So I guess it is the problem of heavy handler functions after the ajax requests... Is there a way to make this work without changing the success function inside ajax call? Or should I make the success function more efficient? I suppose the problem with my code is that I use document.getElementById() several times.. Should I use getElementById() not on document object but a more specific object?? I have the following code in my success function.. for (var i = 0; i < 100; i++) { var leftArea = document.getElementById("gridLeftVotePicLarge" + i); var rightArea = document.getElementById("gridRightVotePicLarge" + i); leftArea.setAttribute("onclick", "actualVote(" + data.vote.voteId + ", " + like1Id + ", 'like1', " + divNum + "," + i + ");"); rightArea.setAttribute("onclick", "actualVote(" + data.vote.voteId + ", " + like2Id + ", 'like2', " + divNum + "," + i + ");"); } Maybe calling document.getElementById() 100 times is what is causing the problem? If you have any ideas on this issue, please help me! Thanks in advance!
0
11,423,356
07/10/2012 23:14:31
166,678
09/01/2009 15:24:00
74
6
Correct order of Postgres maintenance
I have a big table which is suffering from Index bloating because a lot of rows are frequently updated. I'm also in the process of deleting a big number of rows. What would the correct order of executing the following tasks in order to recover disk space? - Vacuum, mark dead tuples as free for database reuse, doesn't return space to system. - Vacuum Full, rewrites table reducing table bloat, returns space to system. - Reindex, rewrites indexes reducing index bloat, returns space to system.
database
postgresql
indexing
maintenance
vacuum
null
open
Correct order of Postgres maintenance === I have a big table which is suffering from Index bloating because a lot of rows are frequently updated. I'm also in the process of deleting a big number of rows. What would the correct order of executing the following tasks in order to recover disk space? - Vacuum, mark dead tuples as free for database reuse, doesn't return space to system. - Vacuum Full, rewrites table reducing table bloat, returns space to system. - Reindex, rewrites indexes reducing index bloat, returns space to system.
0
11,423,357
07/10/2012 23:14:33
1,238,887
02/28/2012 21:36:01
2,448
129
Get position of selected elements, not index of element in DOM
<div> <h3>Heading one</h3> <h3>Heading two</h3> <h4>heading caption</h4> <h3>Heading three</h3> </div>​ I want to get the position of the element within the jQuery selection, rather than it's index in the DOM. At the moment, if I `alert($("h3").eq(2).index());` I'll get '3' - I want '2'. http://jsfiddle.net/4QmEF/
javascript
jquery
null
null
null
null
open
Get position of selected elements, not index of element in DOM === <div> <h3>Heading one</h3> <h3>Heading two</h3> <h4>heading caption</h4> <h3>Heading three</h3> </div>​ I want to get the position of the element within the jQuery selection, rather than it's index in the DOM. At the moment, if I `alert($("h3").eq(2).index());` I'll get '3' - I want '2'. http://jsfiddle.net/4QmEF/
0
11,423,360
07/10/2012 23:14:47
625,226
02/20/2011 12:54:24
1
0
SQL Join with MAX
I have two tables (serverlogdetail a, serverlogid b) that tack user activity An user can have different log in several times (a.entrydate) in a day in to different applications (b.appname) For all the applications to which an user has access I need to return a list with the last time he/she logged in. SELECT b.appname ,max(to_char(a.entrydate)), a.username, a.msgnumber FROM serverlogdetail a, serverlogid b WHERE a.msgnumber = 1020055 AND A.entrydate BETWEEN (SYSDATE-90) AND SYSDATE GROUP BY b.appname, a.dbname, a.username,a.msgnumber, a.entrydate ORDER BY b.appname, max(to_char(a.entrydate)) THANKS IN ADVANCE
sql
null
null
null
null
null
open
SQL Join with MAX === I have two tables (serverlogdetail a, serverlogid b) that tack user activity An user can have different log in several times (a.entrydate) in a day in to different applications (b.appname) For all the applications to which an user has access I need to return a list with the last time he/she logged in. SELECT b.appname ,max(to_char(a.entrydate)), a.username, a.msgnumber FROM serverlogdetail a, serverlogid b WHERE a.msgnumber = 1020055 AND A.entrydate BETWEEN (SYSDATE-90) AND SYSDATE GROUP BY b.appname, a.dbname, a.username,a.msgnumber, a.entrydate ORDER BY b.appname, max(to_char(a.entrydate)) THANKS IN ADVANCE
0
11,423,367
07/10/2012 23:15:11
1,024,941
11/02/2011 04:35:41
6
1
Glassfish (2.1) JSF (1.2) setting 404 page
I've inherited a JSF 1.2 app that is running on glassfish 2.1. Currently, if a page is not found, a static HTML page is displayed. I want to change the location of this HTML page, but I'm not sure where I specify the page location to show if a page is not found. Can anyone help?
jsf
glassfish
http-status-code-404
jsf-1.2
null
null
open
Glassfish (2.1) JSF (1.2) setting 404 page === I've inherited a JSF 1.2 app that is running on glassfish 2.1. Currently, if a page is not found, a static HTML page is displayed. I want to change the location of this HTML page, but I'm not sure where I specify the page location to show if a page is not found. Can anyone help?
0
11,423,369
07/10/2012 23:15:29
1,486,376
06/27/2012 16:53:05
1
0
matplotlib legend circle markers
I'm making a legend for a scatter plot using a proxy artists (http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist) and attempting to make circle-shaped markers. This is my code: legend([Circle((0,0), fc='g')], ["Green Circle"]) But when I plot it, the legend doesn't have a circle and instead displays a rectangle... How do I get the legend to have circle markers?
matplotlib
circle
legend
null
null
null
open
matplotlib legend circle markers === I'm making a legend for a scatter plot using a proxy artists (http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist) and attempting to make circle-shaped markers. This is my code: legend([Circle((0,0), fc='g')], ["Green Circle"]) But when I plot it, the legend doesn't have a circle and instead displays a rectangle... How do I get the legend to have circle markers?
0
11,423,374
07/10/2012 23:16:20
38,765
11/19/2008 00:17:51
12,077
656
Determine whether a romanized name is Japanese or not, preferably in Ruby
How can I determine whether a romanized name is likely, or unlikely, to be a Japanese name? "Yukihiro Matsumoto".likely_to_be_japanese? # => true "John Smith".likely_to_be_japanese? # => false Ideally, I'd also like to feed in free-form text, and detect whether the text has a name likely to be Japanese, has a name unlikely to be Japanese, or doesn't have any names in it. Preferably ignoring false positives. "call Koichi on (02) 5550 5555".has_japanese_name_in_it? # => true "call John on (02) 5550 5556".has_non_japanese_name_in_it? # => true "utility bill to be shared equally".has_non_japanese_name_in_it? => false Are there any libraries that can help me do this, preferably in Ruby? Or would I have to find a corpus of Japanese, and non-Japanese, names and build my own solution?
ruby
nlp
null
null
null
null
open
Determine whether a romanized name is Japanese or not, preferably in Ruby === How can I determine whether a romanized name is likely, or unlikely, to be a Japanese name? "Yukihiro Matsumoto".likely_to_be_japanese? # => true "John Smith".likely_to_be_japanese? # => false Ideally, I'd also like to feed in free-form text, and detect whether the text has a name likely to be Japanese, has a name unlikely to be Japanese, or doesn't have any names in it. Preferably ignoring false positives. "call Koichi on (02) 5550 5555".has_japanese_name_in_it? # => true "call John on (02) 5550 5556".has_non_japanese_name_in_it? # => true "utility bill to be shared equally".has_non_japanese_name_in_it? => false Are there any libraries that can help me do this, preferably in Ruby? Or would I have to find a corpus of Japanese, and non-Japanese, names and build my own solution?
0
11,423,239
07/10/2012 22:58:32
128,967
06/25/2009 17:20:14
4,036
62
Upload a file using a PUT request in Java with upload progress
I'm trying to do something really simple, but so far I've been unsuccessful in trying various methods of making it happen. I've tried uploading to a URL using a simple `java.io.Socket`, using a `java.io.HttpURLConnection`, and last using a `org.apache.commons.httpclient.HttpClient`, but I've failed to make it happen each time. I need to make a request like this: PUT http://1.2.3.4:8080/upload?ticket_id=abcdef124567890 HTTP/1.1 Host: 1.2.3.4:8080 Content-Length: 339108 Content-Type: video/mp4 \0abc\32af ... etc. I need to write the bytes of a file (presumably from a `FileInputStream`) to the main request body, containing the video bytes. I basically have two requirements: 1. I must upload the file using a PUT request to a given server. 2. I must be able to watch the progress of the upload as it's happening. How can I make this happen in Java?
java
http
http-put
null
null
null
open
Upload a file using a PUT request in Java with upload progress === I'm trying to do something really simple, but so far I've been unsuccessful in trying various methods of making it happen. I've tried uploading to a URL using a simple `java.io.Socket`, using a `java.io.HttpURLConnection`, and last using a `org.apache.commons.httpclient.HttpClient`, but I've failed to make it happen each time. I need to make a request like this: PUT http://1.2.3.4:8080/upload?ticket_id=abcdef124567890 HTTP/1.1 Host: 1.2.3.4:8080 Content-Length: 339108 Content-Type: video/mp4 \0abc\32af ... etc. I need to write the bytes of a file (presumably from a `FileInputStream`) to the main request body, containing the video bytes. I basically have two requirements: 1. I must upload the file using a PUT request to a given server. 2. I must be able to watch the progress of the upload as it's happening. How can I make this happen in Java?
0
11,226,506
06/27/2012 12:43:36
1,451,980
06/12/2012 18:34:02
1
0
How to log into router with HttpWebRequest?
I'm trying to figure out how to successfully log into a DSL-Router (Model: Speedport w504v Type A). I wrote a function usinig HttpWebRequest and HttpWebResponse. So far this function is not finished and is only for finding out the right login process. Public Function DoRequest(ByVal url As String, ByVal password As String, ByVal container As CookieContainer) As String 'Login Request Dim reqLogin As HttpWebRequest = DirectCast(HttpWebRequest.Create("https://speedport.ip/cgi-bin/login.cgi"), HttpWebRequest) reqLogin.CookieContainer = container reqLogin.Method = "POST" reqLogin.Referer = "https://speedport.ip/hcti_start_passwort.stm" reqLogin.KeepAlive = True reqLogin.Host = "speedport.ip" reqLogin.ContentType = "application/x-www-form-urlencoded" reqLogin.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" reqLogin.Headers.Add("Accept-Language", "de-de,de;q=0.8,en-us;q=0.5,en;q=0.3") reqLogin.Headers.Add("Accept-Encoding", "gzip, deflate") 'Login Data Dim encoding As New ASCIIEncoding() Dim data As String = Uri.EscapeDataString("pws") & "=" & Uri.EscapeDataString(password) Dim bytes As Byte() = encoding.GetBytes(data) reqLogin.ContentLength = bytes.Length Dim stream As Stream = reqLogin.GetRequestStream stream.Write(bytes, 0, bytes.Length) stream.Close() 'Login Response Dim resLogin As HttpWebResponse = DirectCast(reqLogin.GetResponse(), HttpWebResponse) 'Receive Cookie Dim CookieHeaderValue As String = reqLogin.Headers.Get("Cookie") If CookieHeaderValue <> Nothing Then Dim aCookie As String() = CookieHeaderValue.Split("=") Dim Cookie As New Cookie Cookie.Domain = "speedport.ip" Cookie.Path = "/" Cookie.Secure = True Cookie.Name = aCookie(0) Cookie.Value = aCookie(1) container.Add(Cookie) End If 'Url Request Dim reqIndex As HttpWebRequest = DirectCast(HttpWebRequest.Create(url), HttpWebRequest) reqIndex.CookieContainer = container reqIndex.Method = "GET" reqIndex.Referer = "https://speedport.ip/wait_login.stm" reqIndex.KeepAlive = True reqIndex.Host = "speedport.ip" reqIndex.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 'Url Content Dim resIndex As HttpWebResponse = DirectCast(reqIndex.GetResponse(), HttpWebResponse) Dim sr As StreamReader = New StreamReader(resIndex.GetResponseStream()) Dim output As String = sr.ReadToEnd resIndex.Close() Return output End Function Unfortunately I don't get the right content. Instead I'm getting the sitecontent from an Error-Page saying: > double administration access! This site is returned when you try to login but there is another session already running. So maybe I'm already successfully logged in but don't get the site content. I get the header information from an Firefox AddOn called HTTP Live Header. I also tried to run curl but also did not work: curl -d "pws=PASSWORD" -c cookies.txt -e https://speedport.ip/hcti_start_passwort.stm -k https://speedport.ip/cgi-bin/login.cgi curl -c cookies.txt -e https://speedport.ip/wait_login.stm -k https://speedport.ip/index.stm Maybe someone has an idea what's going wrong.
vb.net
login
httpwebrequest
router
null
null
open
How to log into router with HttpWebRequest? === I'm trying to figure out how to successfully log into a DSL-Router (Model: Speedport w504v Type A). I wrote a function usinig HttpWebRequest and HttpWebResponse. So far this function is not finished and is only for finding out the right login process. Public Function DoRequest(ByVal url As String, ByVal password As String, ByVal container As CookieContainer) As String 'Login Request Dim reqLogin As HttpWebRequest = DirectCast(HttpWebRequest.Create("https://speedport.ip/cgi-bin/login.cgi"), HttpWebRequest) reqLogin.CookieContainer = container reqLogin.Method = "POST" reqLogin.Referer = "https://speedport.ip/hcti_start_passwort.stm" reqLogin.KeepAlive = True reqLogin.Host = "speedport.ip" reqLogin.ContentType = "application/x-www-form-urlencoded" reqLogin.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" reqLogin.Headers.Add("Accept-Language", "de-de,de;q=0.8,en-us;q=0.5,en;q=0.3") reqLogin.Headers.Add("Accept-Encoding", "gzip, deflate") 'Login Data Dim encoding As New ASCIIEncoding() Dim data As String = Uri.EscapeDataString("pws") & "=" & Uri.EscapeDataString(password) Dim bytes As Byte() = encoding.GetBytes(data) reqLogin.ContentLength = bytes.Length Dim stream As Stream = reqLogin.GetRequestStream stream.Write(bytes, 0, bytes.Length) stream.Close() 'Login Response Dim resLogin As HttpWebResponse = DirectCast(reqLogin.GetResponse(), HttpWebResponse) 'Receive Cookie Dim CookieHeaderValue As String = reqLogin.Headers.Get("Cookie") If CookieHeaderValue <> Nothing Then Dim aCookie As String() = CookieHeaderValue.Split("=") Dim Cookie As New Cookie Cookie.Domain = "speedport.ip" Cookie.Path = "/" Cookie.Secure = True Cookie.Name = aCookie(0) Cookie.Value = aCookie(1) container.Add(Cookie) End If 'Url Request Dim reqIndex As HttpWebRequest = DirectCast(HttpWebRequest.Create(url), HttpWebRequest) reqIndex.CookieContainer = container reqIndex.Method = "GET" reqIndex.Referer = "https://speedport.ip/wait_login.stm" reqIndex.KeepAlive = True reqIndex.Host = "speedport.ip" reqIndex.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 'Url Content Dim resIndex As HttpWebResponse = DirectCast(reqIndex.GetResponse(), HttpWebResponse) Dim sr As StreamReader = New StreamReader(resIndex.GetResponseStream()) Dim output As String = sr.ReadToEnd resIndex.Close() Return output End Function Unfortunately I don't get the right content. Instead I'm getting the sitecontent from an Error-Page saying: > double administration access! This site is returned when you try to login but there is another session already running. So maybe I'm already successfully logged in but don't get the site content. I get the header information from an Firefox AddOn called HTTP Live Header. I also tried to run curl but also did not work: curl -d "pws=PASSWORD" -c cookies.txt -e https://speedport.ip/hcti_start_passwort.stm -k https://speedport.ip/cgi-bin/login.cgi curl -c cookies.txt -e https://speedport.ip/wait_login.stm -k https://speedport.ip/index.stm Maybe someone has an idea what's going wrong.
0
11,226,507
06/27/2012 12:43:41
11,991
09/16/2008 12:45:46
343
12
Package custom fonts in a Monotouch assembly
I have an iPad app that uses custom fonts though the **<key>UIAppFonts</key>** elements in the Info.plist of the primary executable, [as described in this answer][1]. I was wondering if there is a way to package those fonts in a reusable assembly so I can share the fonts across several applications. Can a Monotouch assembly contain an Info.plist of its own? [1]: http://stackoverflow.com/questions/2927348/monotouch-bundle-font-with-binary
assembly
fonts
monotouch
null
null
null
open
Package custom fonts in a Monotouch assembly === I have an iPad app that uses custom fonts though the **<key>UIAppFonts</key>** elements in the Info.plist of the primary executable, [as described in this answer][1]. I was wondering if there is a way to package those fonts in a reusable assembly so I can share the fonts across several applications. Can a Monotouch assembly contain an Info.plist of its own? [1]: http://stackoverflow.com/questions/2927348/monotouch-bundle-font-with-binary
0
11,226,508
06/27/2012 12:43:44
1,469,980
06/20/2012 17:04:15
10
0
gathering item lists from eBay
I am trying to figure out a way for somehow fetching the all the items from a given category. I don't even know if it is legal to do so. But im curious :) I need to gather the items then i will put them in my own database by using C#.net or java, it doesn't matter. Is there any API or service for doing so? Any help would be appriciated.
api
ebay
null
null
null
null
open
gathering item lists from eBay === I am trying to figure out a way for somehow fetching the all the items from a given category. I don't even know if it is legal to do so. But im curious :) I need to gather the items then i will put them in my own database by using C#.net or java, it doesn't matter. Is there any API or service for doing so? Any help would be appriciated.
0
11,226,509
06/27/2012 12:43:47
744,270
05/08/2011 21:40:46
175
1
UIProgressView not updating?
I have started playing with UIProgressView in iOS5, but havent really had luck with it. I am having trouble updating view. I have set of sequential actions, after each i update progress. Problem is, progress view is not updated little by little but only after all have finished. It goes something like this: float cnt = 0.2; for (Photo *photo in [Photo photos]) { [photos addObject:[photo createJSON]]; [progressBar setProgress:cnt animated:YES]; cnt += 0.2; } Browsing stack overflow, i have found posts like these - http://stackoverflow.com/questions/8803189/setprogress-is-no-longer-updating-uiprogressview-since-ios-5, implying in order for this to work, i need to run a separate thread. I would like to clarify this, do i really need separate thread for UIProgressView to work properly?
multithreading
ios5
uiprogressview
null
null
null
open
UIProgressView not updating? === I have started playing with UIProgressView in iOS5, but havent really had luck with it. I am having trouble updating view. I have set of sequential actions, after each i update progress. Problem is, progress view is not updated little by little but only after all have finished. It goes something like this: float cnt = 0.2; for (Photo *photo in [Photo photos]) { [photos addObject:[photo createJSON]]; [progressBar setProgress:cnt animated:YES]; cnt += 0.2; } Browsing stack overflow, i have found posts like these - http://stackoverflow.com/questions/8803189/setprogress-is-no-longer-updating-uiprogressview-since-ios-5, implying in order for this to work, i need to run a separate thread. I would like to clarify this, do i really need separate thread for UIProgressView to work properly?
0
11,226,510
06/27/2012 12:43:47
1,477,887
06/24/2012 09:46:21
11
3
Verify if a QTTrack can be decoded by the installed codecs
I'm writing an application that plays user selected video files, but some video files need codecs that may not be installed on the system.<br> Although, most of the times, the tracks appear on the array of tracks returned by the QTMovie object and I could not find on the attributes of the QTTrack object nor on the attributes of the respective QTMedia object something that could tell me that that track is playable using the installed codecs.<br> An I missing something? Is there any way I can verify this?
cocoa
null
null
null
null
null
open
Verify if a QTTrack can be decoded by the installed codecs === I'm writing an application that plays user selected video files, but some video files need codecs that may not be installed on the system.<br> Although, most of the times, the tracks appear on the array of tracks returned by the QTMovie object and I could not find on the attributes of the QTTrack object nor on the attributes of the respective QTMedia object something that could tell me that that track is playable using the installed codecs.<br> An I missing something? Is there any way I can verify this?
0
11,226,511
06/27/2012 12:43:57
1,485,644
06/27/2012 12:32:36
1
0
How to play two audio files from the iPod library simultaneously?
I know that the MediaPickerConroller can be used to access the iPod library, however I'm not sure that it can play two songs at the same time. AVFoundation would allow this, but then how do you get AVFoundation to access the library? Is there an easier way of doing this? Any help appreciated, thanks.
iphone
ios
audio
avfoundation
mpmediapickercontroller
null
open
How to play two audio files from the iPod library simultaneously? === I know that the MediaPickerConroller can be used to access the iPod library, however I'm not sure that it can play two songs at the same time. AVFoundation would allow this, but then how do you get AVFoundation to access the library? Is there an easier way of doing this? Any help appreciated, thanks.
0
11,226,485
06/27/2012 12:42:26
274,344
02/16/2010 12:24:15
2,428
120
Can the contents of an AMQ topic be viewed somehow?
I'm trying to view the contents of a topic using `activemq-admin`. This is what I'm trying: ./activemq-admin browse --amqurl tcp://localhost:61616 my.topic This is what I get as output: Java Runtime: Sun Microsystems Inc. 1.6.0_24 /usr/lib/jvm/java-6-sun-1.6.0.24/jre Heap sizes: current=62848k free=62190k max=932096k JVM args: -Dactivemq.classpath=/home/pc/dev/apache-activemq-5.3.1/conf; -Dactivemq.home=/home/pc/dev/apache-activemq-5.3.1 -Dactivemq.base=/home/pc/dev/apache-activemq-5.3.1 ACTIVEMQ_HOME: /home/pc/dev/apache-activemq-5.3.1 ACTIVEMQ_BASE: /home/pc/dev/apache-activemq-5.3.1 Which is not what I want. I want to see the messages in the queue in raw form somehow. Is that possible ? Thanks,
java
jms
activemq
null
null
null
open
Can the contents of an AMQ topic be viewed somehow? === I'm trying to view the contents of a topic using `activemq-admin`. This is what I'm trying: ./activemq-admin browse --amqurl tcp://localhost:61616 my.topic This is what I get as output: Java Runtime: Sun Microsystems Inc. 1.6.0_24 /usr/lib/jvm/java-6-sun-1.6.0.24/jre Heap sizes: current=62848k free=62190k max=932096k JVM args: -Dactivemq.classpath=/home/pc/dev/apache-activemq-5.3.1/conf; -Dactivemq.home=/home/pc/dev/apache-activemq-5.3.1 -Dactivemq.base=/home/pc/dev/apache-activemq-5.3.1 ACTIVEMQ_HOME: /home/pc/dev/apache-activemq-5.3.1 ACTIVEMQ_BASE: /home/pc/dev/apache-activemq-5.3.1 Which is not what I want. I want to see the messages in the queue in raw form somehow. Is that possible ? Thanks,
0
11,221,829
06/27/2012 08:02:59
534,957
12/08/2010 12:16:37
90
2
Restart Countdown Timer with new time android
I want to restart countdown timer with new time when countdown timer finishes. I am giving code below: futureInMillis = newTime(); CountDownTimer remainingTimeCounter = new CountDownTimer(futureInMillis, 1000) { public void onTick(long millisUntilFinished) { remainingTime = calculateRemainingTime(millisUntilFinished / 1000); runOnUiThread(updateTime); } public void onFinish() { // TODO: restart counter cancel(); futureInMillis = newTime(); // remainingTimeCounter = null; this.start(); } }.start();
android
countdowntimer
null
null
null
null
open
Restart Countdown Timer with new time android === I want to restart countdown timer with new time when countdown timer finishes. I am giving code below: futureInMillis = newTime(); CountDownTimer remainingTimeCounter = new CountDownTimer(futureInMillis, 1000) { public void onTick(long millisUntilFinished) { remainingTime = calculateRemainingTime(millisUntilFinished / 1000); runOnUiThread(updateTime); } public void onFinish() { // TODO: restart counter cancel(); futureInMillis = newTime(); // remainingTimeCounter = null; this.start(); } }.start();
0
11,226,512
06/27/2012 12:43:58
1,009,507
10/23/2011 12:36:36
103
0
Wordpress store date
I'm a newbie in php and Wordpress. I'm trying to create a script that will store data into a custom table in wordpress. I want the script to store the current date and time in the mysql database. I have created a column in the Mysql table with it's data type set to `DATETIME` but when I try to insert data into the table, the current date is not being shown. Waht might be the problem? My script is shown below. $wpdb->insert($table,array('account_id' => $account_id, 'billing_first_name'=>$first_name,'billing_last_name' => $last_name, 'feature_level' => 'FreeAccount','created_at'=> date("Y-m-d, h:i a"),'billing_interval' => "Manual"));
php
mysql
wordpress
datetime
null
null
open
Wordpress store date === I'm a newbie in php and Wordpress. I'm trying to create a script that will store data into a custom table in wordpress. I want the script to store the current date and time in the mysql database. I have created a column in the Mysql table with it's data type set to `DATETIME` but when I try to insert data into the table, the current date is not being shown. Waht might be the problem? My script is shown below. $wpdb->insert($table,array('account_id' => $account_id, 'billing_first_name'=>$first_name,'billing_last_name' => $last_name, 'feature_level' => 'FreeAccount','created_at'=> date("Y-m-d, h:i a"),'billing_interval' => "Manual"));
0
11,226,514
06/27/2012 12:44:10
1,389,106
05/11/2012 09:35:45
305
2
How to stop the google chrome to save the session
While using Google chrome if I shut down it unexpectedly. like turn of pc or terminate the process. it saves all the information. like id password of current accounts. any one can restore and can get the access to the last session. How I can turn off this or stop the chrome to save the informations
google-chrome
google
null
null
null
null
open
How to stop the google chrome to save the session === While using Google chrome if I shut down it unexpectedly. like turn of pc or terminate the process. it saves all the information. like id password of current accounts. any one can restore and can get the access to the last session. How I can turn off this or stop the chrome to save the informations
0
11,226,517
06/27/2012 12:44:14
1,485,652
06/27/2012 12:35:34
1
0
Rails 3 Nested Attributes
I've had this issue for a few days and looked over every tutorial and stack overflow. I cannot seem to resolve. I can't seem to use nested attributes that work. I get an error with this form view. **Form View** <%= form_for @trip, :html => { :class => 'form-horizontal' } do |f| %> <div class="control-group"> <%= f.label :start, :class => 'control-label' %> <div class="controls"> <%= f.text_field :start, :class => 'text_field' %> </div> <div class="control-group"> <%= f.label :end, :class => 'control-label' %> <div class="controls"> <%= f.text_field :end, :class => 'text_field' %> </div> </div> <div class="control-group"> <% f.fields_for :driver do |d| -%> <%= d.label :driver, :class => 'control-label' %> <div class="controls"> <%= d.text_field :driver, :class => 'text_field' %> </div> </div> Model: class Trip < ActiveRecord::Base attr_accessible :end, :start belongs_to :driver belongs_to :customer accepts_nested_attributes_for :driver end class Driver < ActiveRecord::Base attr_accessible :name has_many :trips end
ruby-on-rails-3
nested-attributes
null
null
null
null
open
Rails 3 Nested Attributes === I've had this issue for a few days and looked over every tutorial and stack overflow. I cannot seem to resolve. I can't seem to use nested attributes that work. I get an error with this form view. **Form View** <%= form_for @trip, :html => { :class => 'form-horizontal' } do |f| %> <div class="control-group"> <%= f.label :start, :class => 'control-label' %> <div class="controls"> <%= f.text_field :start, :class => 'text_field' %> </div> <div class="control-group"> <%= f.label :end, :class => 'control-label' %> <div class="controls"> <%= f.text_field :end, :class => 'text_field' %> </div> </div> <div class="control-group"> <% f.fields_for :driver do |d| -%> <%= d.label :driver, :class => 'control-label' %> <div class="controls"> <%= d.text_field :driver, :class => 'text_field' %> </div> </div> Model: class Trip < ActiveRecord::Base attr_accessible :end, :start belongs_to :driver belongs_to :customer accepts_nested_attributes_for :driver end class Driver < ActiveRecord::Base attr_accessible :name has_many :trips end
0
11,734,201
07/31/2012 06:16:02
1,564,840
07/31/2012 06:11:37
1
0
Website is forced to run on http:// (SSL not working because of the website)
I buyed recently a SSL certificate. The company that host my website has installed it. But them told me that my website is forcing the website to run on http:// and https:// don't work. I believe that the problem is from this page: <?php $site_url_arr = array_merge($folder_names_arr , $relative_modules_arr); $default_ports = array('https' => 443, 'http' => 80); $prefix = (!empty($_SERVER['HTTPS']) ? 'https' : 'http'); $host = ''; if (isset($_SERVER['HTTP_HOST'])) //some says that this might not be set in IIS $host = $_SERVER['HTTP_HOST']; else if (isset($_SERVER['SERVER_NAME'])) $host = $_SERVER['SERVER_NAME']; $CFG['site']['host'] = $host; $CFG['site']['url'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $host . str_replace( $site_url_arr, '', substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1) ); $CFG['site']['url'] = strrpos($CFG['site']['url'], '/')==strlen($CFG['site']['url'])-1?$CFG['site']['url']:$CFG['site']['url'].'/'; foreach($CFG['site']['modules_arr'] as $module) { $CFG['site'][$module.'_url']=$CFG['site']['url'].$module.'/'; } $CFG['site']['relative_url'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $host . substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1); $CFG['site']['itunes']['url'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'itpc') . '://' . $host . str_replace( $site_url_arr, '', substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1) ); $CFG['site']['current_url'] = $prefix. (($_SERVER['SERVER_PORT']!=$default_ports[$prefix]) ? ':'.$_SERVER['SERVER_PORT'] : '') . '://' .$host .$_SERVER['REQUEST_URI']; //PATH_TRANSLATED is removed in SAPI version since PHP 5 or 4.3.2?? Don't use it for auto detection //Important: Though DIRECTORY_SEPARATOR is always '\' under windows, $_SERVER variables are with '/' in some cases (in SAPI alone?). So fix it. $slash = (stripos(php_sapi_name(), 'apache')!==false) ? '/' : DIRECTORY_SEPARATOR; $CFG['site']['project_path'] = str_replace( array('\\') + $site_url_arr, array('/' ) + array_fill(0, count($folder_names_arr) + count($CFG['site']['modules_arr']), '' ), substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], $slash)+1) ); $CFG['site']['project_path'] = strrpos($CFG['site']['project_path'], '/')==strlen($CFG['site']['project_path'])-1?$CFG['site']['project_path']:$CFG['site']['project_path'].'/'; $CFG['site']['project_path_relative'] = str_replace( array_merge(array('common/', 'admin/'), $relative_modules_arr), '', substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1) ); $CFG['site']['project_path_relative'] = strrpos($CFG['site']['project_path_relative'], '/')==strlen($CFG['site']['project_path_relative'])-1?$CFG['site']['project_path_relative']:$CFG['site']['project_path_relative'].'/'; $CFG['site']['script_name'] = substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')+1); //$CFG['ssl']['secure_pages'] = '*'; $CFG['ssl']['secure_pages'][] = $CFG['site']['project_path_relative'].'login.php'; $CFG['http_headers']['unmodified_pages'][] = ''; $CFG['redirect']['dsabled_module_url'] = $CFG['site']['url']; $CFG['members_url'] = $CFG['site']['url']; //----Test cases in standalone mode-----*/ //@todo Remove these lines for security reasons. if (isset($CFG['debug']['debug_standalone_modules']) and $CFG['debug']['debug_standalone_modules']) { echo '<pre>'."\n"; print_r($GLOBALS); //print_r($CFG); echo '</pre>'."\n"; } ?> Please take a look and tell me if you find where the website is forced to load on http://
php
http
ssl
https
certificate
null
open
Website is forced to run on http:// (SSL not working because of the website) === I buyed recently a SSL certificate. The company that host my website has installed it. But them told me that my website is forcing the website to run on http:// and https:// don't work. I believe that the problem is from this page: <?php $site_url_arr = array_merge($folder_names_arr , $relative_modules_arr); $default_ports = array('https' => 443, 'http' => 80); $prefix = (!empty($_SERVER['HTTPS']) ? 'https' : 'http'); $host = ''; if (isset($_SERVER['HTTP_HOST'])) //some says that this might not be set in IIS $host = $_SERVER['HTTP_HOST']; else if (isset($_SERVER['SERVER_NAME'])) $host = $_SERVER['SERVER_NAME']; $CFG['site']['host'] = $host; $CFG['site']['url'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $host . str_replace( $site_url_arr, '', substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1) ); $CFG['site']['url'] = strrpos($CFG['site']['url'], '/')==strlen($CFG['site']['url'])-1?$CFG['site']['url']:$CFG['site']['url'].'/'; foreach($CFG['site']['modules_arr'] as $module) { $CFG['site'][$module.'_url']=$CFG['site']['url'].$module.'/'; } $CFG['site']['relative_url'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $host . substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1); $CFG['site']['itunes']['url'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'itpc') . '://' . $host . str_replace( $site_url_arr, '', substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1) ); $CFG['site']['current_url'] = $prefix. (($_SERVER['SERVER_PORT']!=$default_ports[$prefix]) ? ':'.$_SERVER['SERVER_PORT'] : '') . '://' .$host .$_SERVER['REQUEST_URI']; //PATH_TRANSLATED is removed in SAPI version since PHP 5 or 4.3.2?? Don't use it for auto detection //Important: Though DIRECTORY_SEPARATOR is always '\' under windows, $_SERVER variables are with '/' in some cases (in SAPI alone?). So fix it. $slash = (stripos(php_sapi_name(), 'apache')!==false) ? '/' : DIRECTORY_SEPARATOR; $CFG['site']['project_path'] = str_replace( array('\\') + $site_url_arr, array('/' ) + array_fill(0, count($folder_names_arr) + count($CFG['site']['modules_arr']), '' ), substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], $slash)+1) ); $CFG['site']['project_path'] = strrpos($CFG['site']['project_path'], '/')==strlen($CFG['site']['project_path'])-1?$CFG['site']['project_path']:$CFG['site']['project_path'].'/'; $CFG['site']['project_path_relative'] = str_replace( array_merge(array('common/', 'admin/'), $relative_modules_arr), '', substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1) ); $CFG['site']['project_path_relative'] = strrpos($CFG['site']['project_path_relative'], '/')==strlen($CFG['site']['project_path_relative'])-1?$CFG['site']['project_path_relative']:$CFG['site']['project_path_relative'].'/'; $CFG['site']['script_name'] = substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')+1); //$CFG['ssl']['secure_pages'] = '*'; $CFG['ssl']['secure_pages'][] = $CFG['site']['project_path_relative'].'login.php'; $CFG['http_headers']['unmodified_pages'][] = ''; $CFG['redirect']['dsabled_module_url'] = $CFG['site']['url']; $CFG['members_url'] = $CFG['site']['url']; //----Test cases in standalone mode-----*/ //@todo Remove these lines for security reasons. if (isset($CFG['debug']['debug_standalone_modules']) and $CFG['debug']['debug_standalone_modules']) { echo '<pre>'."\n"; print_r($GLOBALS); //print_r($CFG); echo '</pre>'."\n"; } ?> Please take a look and tell me if you find where the website is forced to load on http://
0
11,734,161
07/31/2012 06:12:09
1,093,634
12/12/2011 11:46:53
1,446
71
Add 'www.' to URL with htaccess
I've been rewriting my URLs like this: RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Which works fine, however I have a subdirectory that is password protected via apache/htaccess. When I navigate to this directory, my browser gets a 401 error. Does anyone know how to solve this?
apache
.htaccess
null
null
null
null
open
Add 'www.' to URL with htaccess === I've been rewriting my URLs like this: RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Which works fine, however I have a subdirectory that is password protected via apache/htaccess. When I navigate to this directory, my browser gets a 401 error. Does anyone know how to solve this?
0
11,734,164
07/31/2012 06:12:26
1,522,773
07/13/2012 06:41:07
35
1
Is algorithm analysis needed for a linux kernel, linux device driver or module writer programmer?
I am not good in analysis of algorithm and trying to get some knowledge. As I am interested in kernel, linux device driver or module writer programming is this analysis really needed for these programming ,if yes then some concept is enough or I have to be good analyser of my code or Can I skip this and work on Programming knowledge like C,C++,Linux kernel etc Thanks
linux
algorithm
kernel
linux-device-driver
null
null
open
Is algorithm analysis needed for a linux kernel, linux device driver or module writer programmer? === I am not good in analysis of algorithm and trying to get some knowledge. As I am interested in kernel, linux device driver or module writer programming is this analysis really needed for these programming ,if yes then some concept is enough or I have to be good analyser of my code or Can I skip this and work on Programming knowledge like C,C++,Linux kernel etc Thanks
0
11,734,208
07/31/2012 06:16:35
1,208,575
02/14/2012 07:51:28
28
1
Is it possible to get the stack of subflows in spring webFlow
In our application we are using Spring WebFlow to navigate users through the site. In certain pages i need to know from which flow i started the current subflow. Is there any simple way to get this information in Spring WebFlow? I am using Spring WebFlow version 2.0.9 and unfortunatelly cannot upgrade to newer version. Simple example: I am having pages `foo/foo.xhtml` called from `foo/flow.xml`, `bar/bar.xhtml` called from `bar/flow.xml`. Finally i have `baz/baz.xhtml` that has a `baz/flow.xml`. This is called as subflow from either foo flow or bar flow. In backing bean of baz flow i need to see the "history" how i called my `baz/flow.xml`
navigation
spring-webflow
null
null
null
null
open
Is it possible to get the stack of subflows in spring webFlow === In our application we are using Spring WebFlow to navigate users through the site. In certain pages i need to know from which flow i started the current subflow. Is there any simple way to get this information in Spring WebFlow? I am using Spring WebFlow version 2.0.9 and unfortunatelly cannot upgrade to newer version. Simple example: I am having pages `foo/foo.xhtml` called from `foo/flow.xml`, `bar/bar.xhtml` called from `bar/flow.xml`. Finally i have `baz/baz.xhtml` that has a `baz/flow.xml`. This is called as subflow from either foo flow or bar flow. In backing bean of baz flow i need to see the "history" how i called my `baz/flow.xml`
0
11,734,210
07/31/2012 06:16:46
1,505,895
07/06/2012 06:14:04
31
1
How to login uer with node.js express backbon.js mongodb?
am really new to nodejs and backbone its so confusing the login: the client side i use backbone model var testModel = Backbone.Model.extend({ url:'api/test', defaults:{ login:false, apikey:{}, }, initialize:function(){ this.bind('change:apikey',this.onApiKeyChange,this); // this.set({'apikey': localStorage.getItem('apikey')}); }, setApiKey:function(apikey){ localStorage.setItem('apiKey', apikey); this.set({'apikey':apikey}); }, onApiKeyChange:function(){ // console.log(this.toJSON()) //login here } }); view var testView = Backbone.View.extend({ el:'#content', events:{ 'submit #loginForm':'login', }, login:function(e){ e.preventDefault(); this.model.setApiKey({name:this.$('input[name=username]').val(),password:this.$('input[name=password]').val()}); } }) var test= new testView({model:new testModel()}); so when user submit the form the model get changed and that trigger the onApiKeyChange(),if the user login then onApiKeyChange() should update the model with user detail.i dont know how to do that,how dose backbone send a request like this? the server side: var express = require('express'); var routes = require('./routes'); var http = require('http'); var mongoose = require('mongoose'); var app = express(); mongoose.connect('mongodb://localhost/test'); var User = mongoose.model('User',new mongoose.Schema({ name:String, password:String, })); app.configure(function(){ app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.cookieParser()); app.use(express.session({ secret: "keyboard cat" })); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(__dirname + '/public')); }); app.configure('development', function(){ app.use(express.errorHandler()); }); app.get('/', routes.index); app.get('/api/test', someFunction()); http.createServer(app).listen(app.get('port'), function(){ console.log("Express server listening on port " + app.get('port')); }); the server side is just basic express app.js, i dont know how to use the session. i know this may be a basic problem, but i just dont get it please give me some advice or tell me some easy tutorials for beginner
node.js
mongodb
backbone.js
express
null
null
open
How to login uer with node.js express backbon.js mongodb? === am really new to nodejs and backbone its so confusing the login: the client side i use backbone model var testModel = Backbone.Model.extend({ url:'api/test', defaults:{ login:false, apikey:{}, }, initialize:function(){ this.bind('change:apikey',this.onApiKeyChange,this); // this.set({'apikey': localStorage.getItem('apikey')}); }, setApiKey:function(apikey){ localStorage.setItem('apiKey', apikey); this.set({'apikey':apikey}); }, onApiKeyChange:function(){ // console.log(this.toJSON()) //login here } }); view var testView = Backbone.View.extend({ el:'#content', events:{ 'submit #loginForm':'login', }, login:function(e){ e.preventDefault(); this.model.setApiKey({name:this.$('input[name=username]').val(),password:this.$('input[name=password]').val()}); } }) var test= new testView({model:new testModel()}); so when user submit the form the model get changed and that trigger the onApiKeyChange(),if the user login then onApiKeyChange() should update the model with user detail.i dont know how to do that,how dose backbone send a request like this? the server side: var express = require('express'); var routes = require('./routes'); var http = require('http'); var mongoose = require('mongoose'); var app = express(); mongoose.connect('mongodb://localhost/test'); var User = mongoose.model('User',new mongoose.Schema({ name:String, password:String, })); app.configure(function(){ app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.cookieParser()); app.use(express.session({ secret: "keyboard cat" })); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(__dirname + '/public')); }); app.configure('development', function(){ app.use(express.errorHandler()); }); app.get('/', routes.index); app.get('/api/test', someFunction()); http.createServer(app).listen(app.get('port'), function(){ console.log("Express server listening on port " + app.get('port')); }); the server side is just basic express app.js, i dont know how to use the session. i know this may be a basic problem, but i just dont get it please give me some advice or tell me some easy tutorials for beginner
0
11,734,214
07/31/2012 06:16:58
1,525,494
07/14/2012 11:28:07
11
1
How to convert Zipfile into a octet stream
I am working on soap webservices .I have given a third party wsdl url in which i need to generate client code . My query is i need to pass zip file which contains bundle of xml which the passing parameter should be type octet stream. I dont know how to pass argument as octet stream. Plzz Help me..
java
soapui
zipfile
webservices-client
null
null
open
How to convert Zipfile into a octet stream === I am working on soap webservices .I have given a third party wsdl url in which i need to generate client code . My query is i need to pass zip file which contains bundle of xml which the passing parameter should be type octet stream. I dont know how to pass argument as octet stream. Plzz Help me..
0
11,734,216
07/31/2012 06:17:05
1,553,203
07/26/2012 01:05:54
21
4
Lucene performance: Transferring fields data from one index to another
In short, I am in need to exchange the mapping of multiple field and values from one Index to the resulting Index. The following is the scenario. **Index 1** Structure [Field => Values] [Stored] Doc 1 keys => keyword1; Ids => id1, id1, id2, id3, id7, id11, etc.. Doc 2 keys => keyword2; Ids => id3, id11, etc.. **Index 2** Structure [Field => Values] [Stored] Doc 1 ids => id1 keys => keyword1, keyword1 Doc 3 ids => id3 keys => keyword1, keyword2, etc.. Please note that the keys<->ids **mapping is reversed** in the resulting Index. What do you think the most effective way to accomplish this in terms of time complexity? .. The only way I could think of is that.. 1) index1Reader.terms(); 2) Process only terms belonging to "Ids" field 3) For each term, get TermDocs 4) For each doc, load it, get "keys" field info 5) Create a new Lucene Doc, add 'Id', multi Keys, write it to index2. 6) Go to step 2. Since the fields are stored, I'm sure that there are multiple ways of doing it. Please guide me with any performance techniques. **Even the slightest improvement** will have a huge impact in my scenario considering that the Index1 size is ~ 6GB.
java
search
lucene
lucene-index
null
null
open
Lucene performance: Transferring fields data from one index to another === In short, I am in need to exchange the mapping of multiple field and values from one Index to the resulting Index. The following is the scenario. **Index 1** Structure [Field => Values] [Stored] Doc 1 keys => keyword1; Ids => id1, id1, id2, id3, id7, id11, etc.. Doc 2 keys => keyword2; Ids => id3, id11, etc.. **Index 2** Structure [Field => Values] [Stored] Doc 1 ids => id1 keys => keyword1, keyword1 Doc 3 ids => id3 keys => keyword1, keyword2, etc.. Please note that the keys<->ids **mapping is reversed** in the resulting Index. What do you think the most effective way to accomplish this in terms of time complexity? .. The only way I could think of is that.. 1) index1Reader.terms(); 2) Process only terms belonging to "Ids" field 3) For each term, get TermDocs 4) For each doc, load it, get "keys" field info 5) Create a new Lucene Doc, add 'Id', multi Keys, write it to index2. 6) Go to step 2. Since the fields are stored, I'm sure that there are multiple ways of doing it. Please guide me with any performance techniques. **Even the slightest improvement** will have a huge impact in my scenario considering that the Index1 size is ~ 6GB.
0
11,401,069
07/09/2012 18:39:38
989,977
10/11/2011 16:52:13
11
0
c# Datagridview Row Calculation
I have a windows form with a Datagridview in it containing data from an xml file. The DGV is setup like this: Date, Product, Price There are 10 rows of data. Im trying to calculate the change in Price from one row to the next and having difficulty finding a solution. For example: 1/1/12, ABC, $2.00 1/1/12, ABC, $2.50 Net Change: .50 Across columns I can use a Table.Columns.Expression, but it is unclear to me how I can do this calculation subtracting previous vs. current. I thought about iterating through the columns, adding to a new table and calculating it that way, but seems like a sub-par solution. Once I get the change Id like to add that to that Datagridview. Have not tested, but something like this: if (dataGridView1.Rows.Count > 0) { specifier = "###,###.00"; double tier1Minus = 0; double tier2Minus = 0; for (int i = 0; i < dataGridView1.Rows.Count; ++i) { tier1Minus += Convert.ToDouble(dataGridView1.Rows[i].Cells["Price"].Value); tier2Minus += Convert.ToDouble(dataGridView1.Rows[i+1].Cells["Price"].Value); } // then add to dataGridView1
c#
datagridview
date-calculation
null
null
null
open
c# Datagridview Row Calculation === I have a windows form with a Datagridview in it containing data from an xml file. The DGV is setup like this: Date, Product, Price There are 10 rows of data. Im trying to calculate the change in Price from one row to the next and having difficulty finding a solution. For example: 1/1/12, ABC, $2.00 1/1/12, ABC, $2.50 Net Change: .50 Across columns I can use a Table.Columns.Expression, but it is unclear to me how I can do this calculation subtracting previous vs. current. I thought about iterating through the columns, adding to a new table and calculating it that way, but seems like a sub-par solution. Once I get the change Id like to add that to that Datagridview. Have not tested, but something like this: if (dataGridView1.Rows.Count > 0) { specifier = "###,###.00"; double tier1Minus = 0; double tier2Minus = 0; for (int i = 0; i < dataGridView1.Rows.Count; ++i) { tier1Minus += Convert.ToDouble(dataGridView1.Rows[i].Cells["Price"].Value); tier2Minus += Convert.ToDouble(dataGridView1.Rows[i+1].Cells["Price"].Value); } // then add to dataGridView1
0
11,401,070
07/09/2012 18:39:48
1,427,146
05/30/2012 22:23:18
125
2
Using awk to print characters of specific index on a line
Alright, so I know it is quite simple to print specific arguments of a line using $: $ cat file hello world $ awk '{print $0}' file hello But what if I want to print chars 2 through 8? or 3 through 7? Is that possible with awk?
awk
null
null
null
null
null
open
Using awk to print characters of specific index on a line === Alright, so I know it is quite simple to print specific arguments of a line using $: $ cat file hello world $ awk '{print $0}' file hello But what if I want to print chars 2 through 8? or 3 through 7? Is that possible with awk?
0
11,401,071
07/09/2012 18:39:50
1,061,324
11/23/2011 06:53:22
8
0
how to build a c file into a dll library in linux
I need to build a hello world function into a dll library. I'm coding in c language on linux. Can anyone help with a sample code for doing that? and also for linking against the generated library?
c
linux
dll
build
null
null
open
how to build a c file into a dll library in linux === I need to build a hello world function into a dll library. I'm coding in c language on linux. Can anyone help with a sample code for doing that? and also for linking against the generated library?
0
11,401,074
07/09/2012 18:39:58
1,385,112
05/09/2012 16:11:05
324
10
How to update array value then store/save it in the array using PHP?
I am operating with array that looks like this: $pms = array( 'msg1' => array( 'status' => 'unread', 'subject' => 'bla bla' ), 'msg2' => array( 'status' => 'unread', 'subject' => 'test..' ), 'msg3' => array( 'status' => 'unread', 'subject' => 'moreee..' ) ); What I want to achieve is to be able to select 'msg3' for example, update the status from 'unread' to 'read' and put it back in its position in the array. How to do that?
php
arrays
null
null
null
null
open
How to update array value then store/save it in the array using PHP? === I am operating with array that looks like this: $pms = array( 'msg1' => array( 'status' => 'unread', 'subject' => 'bla bla' ), 'msg2' => array( 'status' => 'unread', 'subject' => 'test..' ), 'msg3' => array( 'status' => 'unread', 'subject' => 'moreee..' ) ); What I want to achieve is to be able to select 'msg3' for example, update the status from 'unread' to 'read' and put it back in its position in the array. How to do that?
0
11,401,077
07/09/2012 18:40:08
322,909
04/22/2010 04:31:44
660
22
Coldfusion 9 JSON parsing error
I have a function that essentially does this <cffunction name="foo" access="remote" returnformat="JSON" > <cfreturn ["000", "001", "002"] <cffunction> I am retrieving this array using `jQuery.ajax`, In firebug I see `[000, "001", "002"]`. See how the zeros are missing their quotations. This is causing a jQuery to through a parsing error, `SyntaxError: JSON.parse: expected ',' or ']' after array element`, or that's what I am assuming. Can anyone explain why ColdFusion isn't putting quotations around the zeros, and a way to fix it?
jquery
coldfusion-9
null
null
null
null
open
Coldfusion 9 JSON parsing error === I have a function that essentially does this <cffunction name="foo" access="remote" returnformat="JSON" > <cfreturn ["000", "001", "002"] <cffunction> I am retrieving this array using `jQuery.ajax`, In firebug I see `[000, "001", "002"]`. See how the zeros are missing their quotations. This is causing a jQuery to through a parsing error, `SyntaxError: JSON.parse: expected ',' or ']' after array element`, or that's what I am assuming. Can anyone explain why ColdFusion isn't putting quotations around the zeros, and a way to fix it?
0
11,401,079
07/09/2012 18:40:40
963,182
09/25/2011 01:13:37
213
0
makeinfo package missing in ubuntu 12.04
Please can anybody give me a answer for this, I have already tried sudo apt-get install makeinfo textinfo texi2html but, I still get the error as Unable to find the pacakge.
ubuntu
build
packages
ubuntu-12.04
null
null
open
makeinfo package missing in ubuntu 12.04 === Please can anybody give me a answer for this, I have already tried sudo apt-get install makeinfo textinfo texi2html but, I still get the error as Unable to find the pacakge.
0
11,401,081
07/09/2012 18:40:44
1,512,794
07/09/2012 18:16:11
1
0
Wordpress: Insert Custom Markup in Template
probably I'm asking a newbie question here, but I couldn't find a satisfying answer by using search or scanning through books. Basically my problem is this: I have a page.php template and I want the first section to be wrapped in `<div id="featured">` to style it differently. How do I go about it? I can't insert the div in my template since the_content() just outputs the whole content. I could insert the additional markup in the editor in HTML mode, but then I would have to repeat this process for every new page. Also the editor seems to insert empty p tags for no reason.. Markup looks like this: <img> <p> <p> <p> <P> ... What I want is: <div id="featured"> <img> <p> </div> <p> <p> ... So what's the best way to do this. I would imagine everyone had this problem when he got started with wordpress, so I apologize if the answer is obvious :)
wordpress
wordpress-theming
null
null
null
null
open
Wordpress: Insert Custom Markup in Template === probably I'm asking a newbie question here, but I couldn't find a satisfying answer by using search or scanning through books. Basically my problem is this: I have a page.php template and I want the first section to be wrapped in `<div id="featured">` to style it differently. How do I go about it? I can't insert the div in my template since the_content() just outputs the whole content. I could insert the additional markup in the editor in HTML mode, but then I would have to repeat this process for every new page. Also the editor seems to insert empty p tags for no reason.. Markup looks like this: <img> <p> <p> <p> <P> ... What I want is: <div id="featured"> <img> <p> </div> <p> <p> ... So what's the best way to do this. I would imagine everyone had this problem when he got started with wordpress, so I apologize if the answer is obvious :)
0
11,401,065
07/09/2012 18:39:31
1,124,500
12/31/2011 16:30:12
71
4
Noir - unable to resolve symbol html5 in this context
I am trying to use noir and am following the tutorial that is given at the default tutorial and am using this code (defpage "/my-page" [] (html5 [:h1 "This is my first page!"])) However, clojure throws up an error and refuses to work.
clojure
noir
hiccup
null
null
null
open
Noir - unable to resolve symbol html5 in this context === I am trying to use noir and am following the tutorial that is given at the default tutorial and am using this code (defpage "/my-page" [] (html5 [:h1 "This is my first page!"])) However, clojure throws up an error and refuses to work.
0
954,405
06/05/2009 05:42:44
77,466
03/12/2009 22:54:59
145
5
Tool to convert ASP to PHP
I program mostly in PHP and have a site along with other samples in ASP I need to convert over to PHP. Is there some kind of "translator" tool that can either enter lines of code or full slabs that attempts to output a close PHP equivalent? Otherwise, is there an extensive table that lists comparisons (such as [design215.com/toolbox/asp.php][1]) [1]: http://www.design215.com/toolbox/asp.php
asp
php
conversion
null
null
null
open
Tool to convert ASP to PHP === I program mostly in PHP and have a site along with other samples in ASP I need to convert over to PHP. Is there some kind of "translator" tool that can either enter lines of code or full slabs that attempts to output a close PHP equivalent? Otherwise, is there an extensive table that lists comparisons (such as [design215.com/toolbox/asp.php][1]) [1]: http://www.design215.com/toolbox/asp.php
0
11,401,088
07/09/2012 18:41:24
1,470,642
06/20/2012 22:59:08
1
0
How to add a link to a new page from CAS login page
I'm new to JASIG CAS and am creating some new pages that will be linked from the CAS login page (e.g., password reset, create new account). I'm not sure where to start to do this outside of creating a new JSP file for the new page's contents in WEB-INF/view/jsp/default/ui/. I've tried linking directly to the new JSP file from the casLoginView.jsp file with and without the file extension. I've also tried changing web.xml to add a new <servlet-mapping> to a <url-pattern> for my new JSP. Neither attempt has worked: instead, the link to the new JSP just reloads the login page. Thanks in advance for any suggestions!
spring
jsp
cas
jasig
null
null
open
How to add a link to a new page from CAS login page === I'm new to JASIG CAS and am creating some new pages that will be linked from the CAS login page (e.g., password reset, create new account). I'm not sure where to start to do this outside of creating a new JSP file for the new page's contents in WEB-INF/view/jsp/default/ui/. I've tried linking directly to the new JSP file from the casLoginView.jsp file with and without the file extension. I've also tried changing web.xml to add a new <servlet-mapping> to a <url-pattern> for my new JSP. Neither attempt has worked: instead, the link to the new JSP just reloads the login page. Thanks in advance for any suggestions!
0
11,401,089
07/09/2012 18:41:27
945,871
09/15/2011 02:26:35
52
2
How to use libcurl in Windows?
ALL, I feel like I'm missing something obvious, but can't figure out what... :( I'm trying to use libcurl in my app. I successfully build libcurl from sources by converting vc6.dsw to vc10.sln and got the lib file libcurld.lib in the folder c:\libcurl\lib\LIB-Debug. Now I open my application solution and added "c:\libcurl\lib\LIB-Debug" to "Project->Linker->General" and "libcurld" to "Project->Linker->Additional Dependancies" But I still getting following errors: 1> error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function "public: virtual bool __thiscall MyApp::OnInit(void)" (?OnInit@MyApp@@UAE_NXZ) 1>error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function "public: virtual int __thiscall MyApp::OnExit(void)" (?OnExit@MyApp@@UAEHXZ) What am I missing? Thank you.
visual-c++
wxwidgets
libcurl
msvc10
null
null
open
How to use libcurl in Windows? === ALL, I feel like I'm missing something obvious, but can't figure out what... :( I'm trying to use libcurl in my app. I successfully build libcurl from sources by converting vc6.dsw to vc10.sln and got the lib file libcurld.lib in the folder c:\libcurl\lib\LIB-Debug. Now I open my application solution and added "c:\libcurl\lib\LIB-Debug" to "Project->Linker->General" and "libcurld" to "Project->Linker->Additional Dependancies" But I still getting following errors: 1> error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function "public: virtual bool __thiscall MyApp::OnInit(void)" (?OnInit@MyApp@@UAE_NXZ) 1>error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function "public: virtual int __thiscall MyApp::OnExit(void)" (?OnExit@MyApp@@UAEHXZ) What am I missing? Thank you.
0
11,298,081
07/02/2012 17:05:00
1,416,040
05/24/2012 20:41:37
24
3
Magento grid column sorting
Once upon a time I tried creating some custom columns. I created the entire XML structure like I should have. I created controllers. I even created the custom grid controller. After creating my custom grid, I figured the columns would sort. I was wrong, dead wrong. Clicking on the column headers do nothing. Suggestions? class Company_Googlemerchant_Block_Adminhtml_Products_Grid extends Mage_Adminhtml_Block_Widget_Grid { public function __construct() { parent::__construct(); $this->setId('gm_product_grid'); $this->setDefaultSort('id'); $this->setDefaultDir('ASC'); $this->setSaveParametersInSession(false); } protected function _prepareCollection() { $storeId = 1; $collection = Mage::getModel('catalog/product')->getCollection()->addStoreFilter($storeId); $collection ->addAttributeToSelect('enable_googlemerchant') ->addAttributeToSelect('name') ->addAttributeToSelect('entity_id') ->addAttributeToSelect('type_id') ->addAttributeToSelect('status') ->addFieldToFilter('enable_googlemerchant', array( "eq" => '1') ) ->addFieldToFilter('status', array( "eq" => '1') ) ->addAttributeToSort('name', 'asc') ; $this->setCollection($collection); return parent::_prepareCollection(); } protected function _prepareColumns() { $this->addColumn('id', array( 'header' => Mage::helper('googlemerchant')->__('ID'), 'align' =>'left', 'index' => 'entity_id', 'width' => '100px', )); $this->addColumn('product_name', array( 'header' => Mage::helper('googlemerchant')->__('Product Name'), 'align' =>'left', 'index' => 'name', 'width' => '250px', )); $this->addColumn('type_id', array( 'header' => Mage::helper('googlemerchant')->__('Product Type'), 'align' =>'left', 'index' => 'type_id', 'width' => '100px', )); $this->addColumn('action', array( 'header' => Mage::helper('googlemerchant')->__('Action'), 'width' => '100px', 'type' => 'action', 'getter' => 'getId', 'actions' => array( array( 'caption' => Mage::helper('googlemerchant')->__('Remove from export'), 'url' => array( 'base' => '*/*/removeexport' ), 'field' => 'id' ) ), 'filter' => false, 'sortable' => true, 'index' => 'id', )); return parent::_prepareColumns(); } }
magento
adminhtml
null
null
null
null
open
Magento grid column sorting === Once upon a time I tried creating some custom columns. I created the entire XML structure like I should have. I created controllers. I even created the custom grid controller. After creating my custom grid, I figured the columns would sort. I was wrong, dead wrong. Clicking on the column headers do nothing. Suggestions? class Company_Googlemerchant_Block_Adminhtml_Products_Grid extends Mage_Adminhtml_Block_Widget_Grid { public function __construct() { parent::__construct(); $this->setId('gm_product_grid'); $this->setDefaultSort('id'); $this->setDefaultDir('ASC'); $this->setSaveParametersInSession(false); } protected function _prepareCollection() { $storeId = 1; $collection = Mage::getModel('catalog/product')->getCollection()->addStoreFilter($storeId); $collection ->addAttributeToSelect('enable_googlemerchant') ->addAttributeToSelect('name') ->addAttributeToSelect('entity_id') ->addAttributeToSelect('type_id') ->addAttributeToSelect('status') ->addFieldToFilter('enable_googlemerchant', array( "eq" => '1') ) ->addFieldToFilter('status', array( "eq" => '1') ) ->addAttributeToSort('name', 'asc') ; $this->setCollection($collection); return parent::_prepareCollection(); } protected function _prepareColumns() { $this->addColumn('id', array( 'header' => Mage::helper('googlemerchant')->__('ID'), 'align' =>'left', 'index' => 'entity_id', 'width' => '100px', )); $this->addColumn('product_name', array( 'header' => Mage::helper('googlemerchant')->__('Product Name'), 'align' =>'left', 'index' => 'name', 'width' => '250px', )); $this->addColumn('type_id', array( 'header' => Mage::helper('googlemerchant')->__('Product Type'), 'align' =>'left', 'index' => 'type_id', 'width' => '100px', )); $this->addColumn('action', array( 'header' => Mage::helper('googlemerchant')->__('Action'), 'width' => '100px', 'type' => 'action', 'getter' => 'getId', 'actions' => array( array( 'caption' => Mage::helper('googlemerchant')->__('Remove from export'), 'url' => array( 'base' => '*/*/removeexport' ), 'field' => 'id' ) ), 'filter' => false, 'sortable' => true, 'index' => 'id', )); return parent::_prepareColumns(); } }
0
11,296,325
07/02/2012 15:07:42
1,373,048
05/03/2012 16:14:14
32
3
Status bar for csv file read
I am currently working with some somewhat large csv files (sometimes up to 700Mb), and it takes a while (pulling from a network drive). I would like to be able to give the user some feed back as the the status of the process. This led me to the ttk statusbar. I have looked at as many examples as I could find, and then tried to apply them to my program with no success. I think my problem is that I am using a `for` loop to read my csv file, but that might not be the issue. I don't know. Below is an example of how my code works. import csv import Tkinter as tk import ttk class MAIN(tk.Frame): def __init__(self, master, *args, **kwargs): n=0 self.filename = 'some.csv' tk.Frame.__init__(self, *args, **kwargs) frame=tk.Frame(master, **kwargs) frame.grid() getdata = tk.Button(frame, text='Get Data', command=self.csvget) getdata.grid(row=n) n+=1 self.progress = ttk.Progressbar(frame, orient='horizontal', length =200, mode='determinate') self.progress.grid(row=n) def prog(self): self.progress['value']=0 try: f=open(self.filename, 'rb') except: return read = csv.reader(f, delimiter=',') self.maxrows=0 for row in read: self.maxrows+=1 self.progress['maximum']=self.maxrows def csvget(self): try: f=open(self.filename, 'rb') except: return read = csv.reader(f, delimiter=',') q=0 for row in read: if q%100==0: self.progress['value']=q elif q==self.maxrows: self.progress['value']=q ... do some stuff (read into lists etc.)... root=tk.Tk() app=MAIN(root) app.mainloop() Well that turned out longer than I expected. I know I am reading the file twice. (I couldn't figure out how to get the length of the csv file any other way, if you have a solution for this I am all ears.) But the main thrust of of my question remains how do I get the progress bar to work. In its current configuration it goes from zero to full instantly as soon as the file is done reading. Suggestions?
python
csv
tkinter
python-2.7
null
null
open
Status bar for csv file read === I am currently working with some somewhat large csv files (sometimes up to 700Mb), and it takes a while (pulling from a network drive). I would like to be able to give the user some feed back as the the status of the process. This led me to the ttk statusbar. I have looked at as many examples as I could find, and then tried to apply them to my program with no success. I think my problem is that I am using a `for` loop to read my csv file, but that might not be the issue. I don't know. Below is an example of how my code works. import csv import Tkinter as tk import ttk class MAIN(tk.Frame): def __init__(self, master, *args, **kwargs): n=0 self.filename = 'some.csv' tk.Frame.__init__(self, *args, **kwargs) frame=tk.Frame(master, **kwargs) frame.grid() getdata = tk.Button(frame, text='Get Data', command=self.csvget) getdata.grid(row=n) n+=1 self.progress = ttk.Progressbar(frame, orient='horizontal', length =200, mode='determinate') self.progress.grid(row=n) def prog(self): self.progress['value']=0 try: f=open(self.filename, 'rb') except: return read = csv.reader(f, delimiter=',') self.maxrows=0 for row in read: self.maxrows+=1 self.progress['maximum']=self.maxrows def csvget(self): try: f=open(self.filename, 'rb') except: return read = csv.reader(f, delimiter=',') q=0 for row in read: if q%100==0: self.progress['value']=q elif q==self.maxrows: self.progress['value']=q ... do some stuff (read into lists etc.)... root=tk.Tk() app=MAIN(root) app.mainloop() Well that turned out longer than I expected. I know I am reading the file twice. (I couldn't figure out how to get the length of the csv file any other way, if you have a solution for this I am all ears.) But the main thrust of of my question remains how do I get the progress bar to work. In its current configuration it goes from zero to full instantly as soon as the file is done reading. Suggestions?
0
11,298,087
07/02/2012 17:05:19
1,480,106
06/25/2012 13:23:03
34
0
simplify gam with first order AR process
In the following example I am trying to model the temperature variation at two locations in the states, to do this I use a gam: set.seed(10) RandData <- rnorm(8760*2) America <- rep(c('NewYork','Miami'),each=8760) Date = seq(from=as.POSIXct("1991-01-01 00:00"), to=as.POSIXct("1991-12-31 23:00"), length=8760) DatNew <- data.frame(Loc = America, Doy = as.numeric(format(Date,format = "%j")), Tod = as.numeric(format(Date,format = "%H")), Temp = RandData, DecTime = rep(seq(1, length(RandData)/2) / (length(RandData)/2), 2)) require(mgcv) mod1 <- gam(Temp ~ Loc + s(Doy) + s(Doy,by = Loc) + s(Tod) + s(Tod,by = Loc),data = DatNew, method = "ML") From this, there still seems to be a pattern in the residuals, I assume this is caused by the correlation in the residuals (due to it being a times series). I have tried to account for this by fitting the gam and assuming AR(1) correlations in the model residuals: mod1 <- gam(Temp ~ Loc + s(Doy) + s(Doy,by = Loc) + s(Tod) + s(Tod,by = Loc),data = DatNew, method = "ML", correlation = corAR1(form = ~ DecTime | Loc)) But this crashes my computer, so, I read that it is possible to simplify the model further by restricting the order of the autocorrelations to a small number of lags i.e. the first order AR process. In other words, build the covariance matrix by only using the first lag in the acf. How would I create this covariance matrix by considering that I have two locations so I would need to create 2 (1 for each location)? thanks in advance
r
gam
null
null
null
07/03/2012 13:59:53
off topic
simplify gam with first order AR process === In the following example I am trying to model the temperature variation at two locations in the states, to do this I use a gam: set.seed(10) RandData <- rnorm(8760*2) America <- rep(c('NewYork','Miami'),each=8760) Date = seq(from=as.POSIXct("1991-01-01 00:00"), to=as.POSIXct("1991-12-31 23:00"), length=8760) DatNew <- data.frame(Loc = America, Doy = as.numeric(format(Date,format = "%j")), Tod = as.numeric(format(Date,format = "%H")), Temp = RandData, DecTime = rep(seq(1, length(RandData)/2) / (length(RandData)/2), 2)) require(mgcv) mod1 <- gam(Temp ~ Loc + s(Doy) + s(Doy,by = Loc) + s(Tod) + s(Tod,by = Loc),data = DatNew, method = "ML") From this, there still seems to be a pattern in the residuals, I assume this is caused by the correlation in the residuals (due to it being a times series). I have tried to account for this by fitting the gam and assuming AR(1) correlations in the model residuals: mod1 <- gam(Temp ~ Loc + s(Doy) + s(Doy,by = Loc) + s(Tod) + s(Tod,by = Loc),data = DatNew, method = "ML", correlation = corAR1(form = ~ DecTime | Loc)) But this crashes my computer, so, I read that it is possible to simplify the model further by restricting the order of the autocorrelations to a small number of lags i.e. the first order AR process. In other words, build the covariance matrix by only using the first lag in the acf. How would I create this covariance matrix by considering that I have two locations so I would need to create 2 (1 for each location)? thanks in advance
2
11,298,058
07/02/2012 17:01:47
1,496,597
07/02/2012 16:19:54
1
0
How to use jquery to drop a div when you click navigation link?
I'm new to jquery. I have a jquery function that drops a div from a hidden position when you click on a div box. this works fine with a css div as parameter, but when I try to parse two navigation links as parameters it doesn't work. Anybody know what I'm doing wrong? I want to replace .logobox with a <a href> link. <script type="text/javascript"> $(document).ready(function(){ $('.logoBox').toggle(function(){ $('.lowerContainer').slideDown(); }, function(){ $('.lowerContainer').slideUp(); }); }); </script>
jquery
html
css
null
null
null
open
How to use jquery to drop a div when you click navigation link? === I'm new to jquery. I have a jquery function that drops a div from a hidden position when you click on a div box. this works fine with a css div as parameter, but when I try to parse two navigation links as parameters it doesn't work. Anybody know what I'm doing wrong? I want to replace .logobox with a <a href> link. <script type="text/javascript"> $(document).ready(function(){ $('.logoBox').toggle(function(){ $('.lowerContainer').slideDown(); }, function(){ $('.lowerContainer').slideUp(); }); }); </script>
0
11,298,089
07/02/2012 17:05:31
910,721
08/24/2011 21:47:27
36
2
Titanium - XHR not working in 3G
I am using the following function to take an array of three items and then download the url of each item. This works great in a wireless enviroment, but when im out in 3g territory, it only works 75 percent of the time. Seems like it will only download a little bit of the document and them move on to the next. Any ideas on best practices when dealing with multiple files to download to the device? var xhr = Titanium.Network.createHTTPClient({ enableKeepAlive:false, setTimeout:60000 // 1 minute, useful over 3G... }); function main_loading_screen(e) { try { xhr.open("GET", response.main[0].link, false); var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + "../Library/Caches/", file_school); xhr.setFile(f); xhr.send(); } catch(err) { } var xmlData = [ {title:'tsr', url:response.links[0].tsr}, {title:'video', url:response.links[0].videos}, {title:'pic', url:response.links[0].photos} ]; for (i = 0, b = 3; i < b; i++) { if(xmlData[i].url != ''){ try { xhr.open("GET", xmlData[i].url, false); var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + "../Library/Caches/", xmlData[i].title + '.xml'); xhr.setFile(f); xhr.send(); } catch(err) { } } } };
ios
xmlhttprequest
titanium
file-download
3g
null
open
Titanium - XHR not working in 3G === I am using the following function to take an array of three items and then download the url of each item. This works great in a wireless enviroment, but when im out in 3g territory, it only works 75 percent of the time. Seems like it will only download a little bit of the document and them move on to the next. Any ideas on best practices when dealing with multiple files to download to the device? var xhr = Titanium.Network.createHTTPClient({ enableKeepAlive:false, setTimeout:60000 // 1 minute, useful over 3G... }); function main_loading_screen(e) { try { xhr.open("GET", response.main[0].link, false); var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + "../Library/Caches/", file_school); xhr.setFile(f); xhr.send(); } catch(err) { } var xmlData = [ {title:'tsr', url:response.links[0].tsr}, {title:'video', url:response.links[0].videos}, {title:'pic', url:response.links[0].photos} ]; for (i = 0, b = 3; i < b; i++) { if(xmlData[i].url != ''){ try { xhr.open("GET", xmlData[i].url, false); var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + "../Library/Caches/", xmlData[i].title + '.xml'); xhr.setFile(f); xhr.send(); } catch(err) { } } } };
0
11,298,091
07/02/2012 17:05:33
651,924
03/09/2011 16:10:54
1,895
55
How to include ColdFusion code but not have it processed?
I am using ColdFusion 8. I am creating some code that will create a folder and insert a file. The file will be tweaked later by a human. I create the directory like this: <cfdirectory action="create" directory="#LOCAL.PathToCreate#"> Next, I need to create a file with the name of index.cfm. Right now, the content that needs to go into the index.cfm file is within Test-21-index.txt. I create the content like this: <cfsavecontent variable="LOCAL.MyContent"> <cfinclude template="Test-21-index.txt"> </cfsavecontent> <cffile action="write" file="#NewTreatmentPath##LOCAL.NewFile#" output="#LOCAL.MyContent#" nameconflict="overwrite"> The content of Test-21-index.txt has ColdFusion code in it. The problem that I am encountering is that when I include the file Test-21-index.txt, the ColdFusion code is being run. How do I get the code to be created as a text file that is NOT run during the creation of the file?
coldfusion
coldfusion-8
cffile
null
null
null
open
How to include ColdFusion code but not have it processed? === I am using ColdFusion 8. I am creating some code that will create a folder and insert a file. The file will be tweaked later by a human. I create the directory like this: <cfdirectory action="create" directory="#LOCAL.PathToCreate#"> Next, I need to create a file with the name of index.cfm. Right now, the content that needs to go into the index.cfm file is within Test-21-index.txt. I create the content like this: <cfsavecontent variable="LOCAL.MyContent"> <cfinclude template="Test-21-index.txt"> </cfsavecontent> <cffile action="write" file="#NewTreatmentPath##LOCAL.NewFile#" output="#LOCAL.MyContent#" nameconflict="overwrite"> The content of Test-21-index.txt has ColdFusion code in it. The problem that I am encountering is that when I include the file Test-21-index.txt, the ColdFusion code is being run. How do I get the code to be created as a text file that is NOT run during the creation of the file?
0
11,298,093
07/02/2012 17:05:59
279,307
02/23/2010 09:34:55
994
25
CSS force child element to fit into parent element
How do I force a child element to fit into the parent, i.e. show the scroll bar on #content? http://jsfiddle.net/vzaVc/ HTML: <div id="parent"> <div id="header"> varied-sized header </div> <div id="content"> the real content<br> this can be so long<br> that it doesn't fit into the parent<br> so this should get a scroll bar<br> so that the user can... scroll it down<br> </div> </div>​ CSS: #parent { background-color: red; display: inline-block; width: 200px; height: 300px; } #header { background-color: yellow; font-size: 32px; margin: 20px; } #content { background-color: green; font-size: 24px; margin: 20px; overflow: auto; }​
css
height
overflow
null
null
null
open
CSS force child element to fit into parent element === How do I force a child element to fit into the parent, i.e. show the scroll bar on #content? http://jsfiddle.net/vzaVc/ HTML: <div id="parent"> <div id="header"> varied-sized header </div> <div id="content"> the real content<br> this can be so long<br> that it doesn't fit into the parent<br> so this should get a scroll bar<br> so that the user can... scroll it down<br> </div> </div>​ CSS: #parent { background-color: red; display: inline-block; width: 200px; height: 300px; } #header { background-color: yellow; font-size: 32px; margin: 20px; } #content { background-color: green; font-size: 24px; margin: 20px; overflow: auto; }​
0
11,297,704
07/02/2012 16:36:19
250,934
01/14/2010 17:22:36
86
7
Strange Date Format in XML, Convert to Ruby DateTime Object
This is a tough one to google for. I have an XML document that's a million lines long, and I'm using Ruby to parse it and remove entries I don't care about. One my my criteria is the date created. These XML blocks have funny looking dates in them <attribute name="datemodified" type="date">362895460.21263897418975830078</attribute> <attribute name="datecreated" type="date">356831173.15324598550796508789</attribute> I've never seen dates formatted like that exactly. They look similar to if you did something like `Time.now.to_f`. Even so I don't know how I'd turn those into Ruby DateTime objects. If you can even identify how these times are created, or what they mean, that would be super helpful. If it helps, this XML file was originally created by a Mac OS X application known as "Things". Thanks for reading!
ruby
xml
datetime
null
null
null
open
Strange Date Format in XML, Convert to Ruby DateTime Object === This is a tough one to google for. I have an XML document that's a million lines long, and I'm using Ruby to parse it and remove entries I don't care about. One my my criteria is the date created. These XML blocks have funny looking dates in them <attribute name="datemodified" type="date">362895460.21263897418975830078</attribute> <attribute name="datecreated" type="date">356831173.15324598550796508789</attribute> I've never seen dates formatted like that exactly. They look similar to if you did something like `Time.now.to_f`. Even so I don't know how I'd turn those into Ruby DateTime objects. If you can even identify how these times are created, or what they mean, that would be super helpful. If it helps, this XML file was originally created by a Mac OS X application known as "Things". Thanks for reading!
0
11,297,706
07/02/2012 16:36:27
1,148,921
01/14/2012 04:48:00
28
0
Decryption issues in gnu.crypto library
I am implementing gnu.crypto library for encryption/decryption.I have been doing some testing with all ciphers and i have run into problems with the decryption process in all the ciphers.Both Encryption/Decryption process work fine if the string length is limited 20 chars.But,whenever the length of the string crosses a particular threshold say(20 characters),I get the ArrayIndexOutOfBounds exception somewhere in the decrypt method of the corresponding Cipher class. Here goes the decryption method.. void decrypt(byte[] in, int i, byte[] out, int o, Object k, int bs) { Block x = new Block(); x.left = (in[i ] & 0xff) << 24 | (in[i+1] & 0xff) << 16 | (in[i+2] & 0xff) << 8 | (in[i+3] & 0xff); x.right = (in[i+4] & 0xff) << 24 | (in[i+5] & 0xff) << 16 | (in[i+6] & 0xff) << 8 | (in[i+7] & 0xff); blowfishDecrypt(x, (Context) k); out[o ] = (byte) (x.right >>> 24); out[o+1] = (byte) (x.right >>> 16); out[o+2] = (byte) (x.right >>> 8); out[o+3] = (byte) x.right; out[o+4] = (byte) (x.left >>> 24); out[o+5] = (byte) (x.left >>> 16); out[o+6] = (byte) (x.left >>> 8); out[o+7] = (byte) x.left; x.left = x.right = 0; } The ArrayIndexOutOfBounds exception occurs in the following line x.right = (in[i+4] & 0xff) << 24 | (in[i+5] & 0xff) << 16 | (in[i+6] & 0xff) << 8 | (in[i+7] & 0xff); Here goes the blowfishDecrypt method /** Decrypt a single pair of 32-bit integers. */ private void blowfishDecrypt(Block x, Context ctx) { int[] p = ctx.p; int[] s0 = ctx.s0, s1 = ctx.s1, s2 = ctx.s2, s3 = ctx.s3; x.left ^= p[17]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[16]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[15]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[14]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[13]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[12]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[11]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[10]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[9]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[8]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[7]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[6]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[5]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[4]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[3]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[2]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[1]; x.right ^= p[0]; } I would like to reiterate that the problem persists across all the ciphers and only in the decryption process. Has anybody faced this issue before? Please guide me in fixing this issue?? Thanx in advance!!
java
security
cryptography
decrypt
null
null
open
Decryption issues in gnu.crypto library === I am implementing gnu.crypto library for encryption/decryption.I have been doing some testing with all ciphers and i have run into problems with the decryption process in all the ciphers.Both Encryption/Decryption process work fine if the string length is limited 20 chars.But,whenever the length of the string crosses a particular threshold say(20 characters),I get the ArrayIndexOutOfBounds exception somewhere in the decrypt method of the corresponding Cipher class. Here goes the decryption method.. void decrypt(byte[] in, int i, byte[] out, int o, Object k, int bs) { Block x = new Block(); x.left = (in[i ] & 0xff) << 24 | (in[i+1] & 0xff) << 16 | (in[i+2] & 0xff) << 8 | (in[i+3] & 0xff); x.right = (in[i+4] & 0xff) << 24 | (in[i+5] & 0xff) << 16 | (in[i+6] & 0xff) << 8 | (in[i+7] & 0xff); blowfishDecrypt(x, (Context) k); out[o ] = (byte) (x.right >>> 24); out[o+1] = (byte) (x.right >>> 16); out[o+2] = (byte) (x.right >>> 8); out[o+3] = (byte) x.right; out[o+4] = (byte) (x.left >>> 24); out[o+5] = (byte) (x.left >>> 16); out[o+6] = (byte) (x.left >>> 8); out[o+7] = (byte) x.left; x.left = x.right = 0; } The ArrayIndexOutOfBounds exception occurs in the following line x.right = (in[i+4] & 0xff) << 24 | (in[i+5] & 0xff) << 16 | (in[i+6] & 0xff) << 8 | (in[i+7] & 0xff); Here goes the blowfishDecrypt method /** Decrypt a single pair of 32-bit integers. */ private void blowfishDecrypt(Block x, Context ctx) { int[] p = ctx.p; int[] s0 = ctx.s0, s1 = ctx.s1, s2 = ctx.s2, s3 = ctx.s3; x.left ^= p[17]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[16]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[15]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[14]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[13]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[12]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[11]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[10]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[9]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[8]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[7]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[6]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[5]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[4]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[3]; x.right ^= ((s0[x.left >>> 24] + s1[x.left >>> 16 & 0xff]) ^ s2[x.left >>> 8 & 0xff]) + s3[x.left & 0xff] ^ p[2]; x.left ^= ((s0[x.right >>> 24] + s1[x.right >>> 16 & 0xff]) ^ s2[x.right >>> 8 & 0xff]) + s3[x.right & 0xff] ^ p[1]; x.right ^= p[0]; } I would like to reiterate that the problem persists across all the ciphers and only in the decryption process. Has anybody faced this issue before? Please guide me in fixing this issue?? Thanx in advance!!
0
11,541,198
07/18/2012 12:19:10
1,495,772
07/02/2012 10:23:33
1
0
On html web page hit the html submit form, the data of form must email at the desired email address by ruby on rails code
I'm a beginner of Ruby and Rails, so this is probably an easy question. This is the code which I pasted below I know how to sent this form data to desired email id with PHP, or ASP, but I want to sent it through Ruby on rails some one help me! <form method="post" action="process-pan.php"> <table width="550px" align="center" border="0" cellpadding="0" cellspacing="1" class="tbl_brdr" style="font-family: Verdana; font-size: 11px"> <tr><td width="200px" align="center">Full Name<br></td> <td width="270px">&nbsp;<input type="text" name="customer_name" size="29" maxlength="200"></td></tr> <tr><td width="200px" align="center">Email ID:</td><td width="270px">&nbsp;<input type="text" name="email" size="29" maxlength="200"></td></tr> <tr><td width="200px" align="center">Date of Birth </td><td width="270px">&nbsp;<input type="text" name="date_of_birth" size="15" maxlength="100">&nbsp;(In dd/mm/yyyy format)</td></tr> <tr><td width="200px" align="center">Father's full name <br></td><td width="270px">&nbsp;<input type="text" name="fathers_name" size="29" maxlength="200"></td></tr> <tr><td width="470px" colspan="2" align="center"><input name="submit" type="submit" value="Submit and reconfirm"></td></tr> </table></form>
script
roi
null
null
null
null
open
On html web page hit the html submit form, the data of form must email at the desired email address by ruby on rails code === I'm a beginner of Ruby and Rails, so this is probably an easy question. This is the code which I pasted below I know how to sent this form data to desired email id with PHP, or ASP, but I want to sent it through Ruby on rails some one help me! <form method="post" action="process-pan.php"> <table width="550px" align="center" border="0" cellpadding="0" cellspacing="1" class="tbl_brdr" style="font-family: Verdana; font-size: 11px"> <tr><td width="200px" align="center">Full Name<br></td> <td width="270px">&nbsp;<input type="text" name="customer_name" size="29" maxlength="200"></td></tr> <tr><td width="200px" align="center">Email ID:</td><td width="270px">&nbsp;<input type="text" name="email" size="29" maxlength="200"></td></tr> <tr><td width="200px" align="center">Date of Birth </td><td width="270px">&nbsp;<input type="text" name="date_of_birth" size="15" maxlength="100">&nbsp;(In dd/mm/yyyy format)</td></tr> <tr><td width="200px" align="center">Father's full name <br></td><td width="270px">&nbsp;<input type="text" name="fathers_name" size="29" maxlength="200"></td></tr> <tr><td width="470px" colspan="2" align="center"><input name="submit" type="submit" value="Submit and reconfirm"></td></tr> </table></form>
0
11,541,362
07/18/2012 12:28:35
1,314,554
04/05/2012 06:53:46
13
0
Juqery position().top returns 0 rather than real value
according to the Jquery official document **"Get the current coordinates of the first element in the set of matched elements, relative to the offset parent."** following code is excepted to return value 51, but it returns value 0. Could anyone give me a help? Thanks in advance. <html> <head> <style type="text/css"> .outer { width:200px; height:200px; overflow-y:auto; border:1px dotted grey; position:absolute; } .inner { width:50px; height:50px; margin-top: 50px; border:1px solid red; } </style> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript""> $(document).ready(function () { $('.inner').mousedown(function (e) { alert($(this).position().top); }) }) </script> </head> <body> <div class="outer"> <div class="inner"></div> </div> </body> </html>
jquery
null
null
null
null
null
open
Juqery position().top returns 0 rather than real value === according to the Jquery official document **"Get the current coordinates of the first element in the set of matched elements, relative to the offset parent."** following code is excepted to return value 51, but it returns value 0. Could anyone give me a help? Thanks in advance. <html> <head> <style type="text/css"> .outer { width:200px; height:200px; overflow-y:auto; border:1px dotted grey; position:absolute; } .inner { width:50px; height:50px; margin-top: 50px; border:1px solid red; } </style> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript""> $(document).ready(function () { $('.inner').mousedown(function (e) { alert($(this).position().top); }) }) </script> </head> <body> <div class="outer"> <div class="inner"></div> </div> </body> </html>
0
11,541,368
07/18/2012 12:28:54
386,940
07/08/2010 17:07:22
133
0
Oracle Materialized view VS Physical Table
*Note: Oracle 11gR2 Standard version (so no partitioning)* So I have to build a process to build reports off a table containing about 27 million records. The dilemma I'm facing is the fact that I can't create my own index off this table as it's a 3rd party table that we can't alter. So, I started experimenting with the use of Materialized views where I can then create my own indexes, or a physical table that would basically just be a duplicate that I'd truncate and repopulate on demand. The advantage with the MAT view is that it's basically pulling from the "Live" table, so I don't have to worry about discrepancies as long as I refresh it before use, the problem is the refresh seems to take a significant amount of time. I then decided to try the physical table approach, where I tried truncating and repopulating (Took around 10 min), then rebuild indexes (which takes another 10, give or take).... I also tried updating with only "new" record by performing a: INSERT... SELECT where NOT Exists (Select 1 from Table where PK = PK) Which almost takes 10 min also regardless of my index, parallelism, etc... Has anyone had to deal with this amount of data (which will keep growing) and found an approach that performs well works efficiently?? Seems a view won't do.... so I'm left with those 2 options because I can't tweak indexes on my primary table, so any tips suggestions would be greatly appreciated... The whole purpose of this process was to make things "faster" for reporting, but somehow where I'm gaining performance in some areas, I end up losing in others given the amount of data I need to move around. Are there other options aside from: 1. Truncate / Populate Table, Rebuild indexes 2. Populate secondary table from primary table where PK not exist 3. Materialized view (Refresh, Rebuild indexes) 4. View that pulls from Live table (No new indexes) Thanks in advance for any suggestions.....
database
performance
oracle
oracle11g
null
null
open
Oracle Materialized view VS Physical Table === *Note: Oracle 11gR2 Standard version (so no partitioning)* So I have to build a process to build reports off a table containing about 27 million records. The dilemma I'm facing is the fact that I can't create my own index off this table as it's a 3rd party table that we can't alter. So, I started experimenting with the use of Materialized views where I can then create my own indexes, or a physical table that would basically just be a duplicate that I'd truncate and repopulate on demand. The advantage with the MAT view is that it's basically pulling from the "Live" table, so I don't have to worry about discrepancies as long as I refresh it before use, the problem is the refresh seems to take a significant amount of time. I then decided to try the physical table approach, where I tried truncating and repopulating (Took around 10 min), then rebuild indexes (which takes another 10, give or take).... I also tried updating with only "new" record by performing a: INSERT... SELECT where NOT Exists (Select 1 from Table where PK = PK) Which almost takes 10 min also regardless of my index, parallelism, etc... Has anyone had to deal with this amount of data (which will keep growing) and found an approach that performs well works efficiently?? Seems a view won't do.... so I'm left with those 2 options because I can't tweak indexes on my primary table, so any tips suggestions would be greatly appreciated... The whole purpose of this process was to make things "faster" for reporting, but somehow where I'm gaining performance in some areas, I end up losing in others given the amount of data I need to move around. Are there other options aside from: 1. Truncate / Populate Table, Rebuild indexes 2. Populate secondary table from primary table where PK not exist 3. Materialized view (Refresh, Rebuild indexes) 4. View that pulls from Live table (No new indexes) Thanks in advance for any suggestions.....
0
11,541,371
07/18/2012 12:29:12
582,686
01/20/2011 08:56:15
70
5
Split an object with child objects to multiple files using Serialization and Merge on Deserialization
I am having a complex requirement (in .Net using DataContractSerializer) Consider the following example class ClassA { public string A; public ClassB[] Bs; public string Context; } class ClassB { public string C; public string Context; } Now I want to serialize an object of class A into two files as below. Any help. ![Click to see the image][1] [1]: http://i.stack.imgur.com/T5pQ1.jpg
.net
serialization
datacontractserializer
null
null
null
open
Split an object with child objects to multiple files using Serialization and Merge on Deserialization === I am having a complex requirement (in .Net using DataContractSerializer) Consider the following example class ClassA { public string A; public ClassB[] Bs; public string Context; } class ClassB { public string C; public string Context; } Now I want to serialize an object of class A into two files as below. Any help. ![Click to see the image][1] [1]: http://i.stack.imgur.com/T5pQ1.jpg
0
11,540,989
07/18/2012 12:06:20
1,216,963
02/17/2012 19:09:36
110
10
why is this c# SQL Login system not working?
I am not sure what I am doing wrong here string commandString = "SELECT Password FROM UserTable WHERE Username = @UserName"; DataTable result = new DataTable(); using (SqlCommand command = new SqlCommand(commandString, dataConnection)) { command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = info.username; using (SqlDataReader dr = command.ExecuteReader()) { result.Load(dr); } } if (result.Rows.Count == 0) { Console.WriteLine("correct username"); string dbPassword = (string)result.Rows[0]["Password"]; if (string.Compare(dbPassword, info.password) == 0) return true; else return false; } else return false;
c#
sql
database
query
data
07/18/2012 14:19:57
too localized
why is this c# SQL Login system not working? === I am not sure what I am doing wrong here string commandString = "SELECT Password FROM UserTable WHERE Username = @UserName"; DataTable result = new DataTable(); using (SqlCommand command = new SqlCommand(commandString, dataConnection)) { command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = info.username; using (SqlDataReader dr = command.ExecuteReader()) { result.Load(dr); } } if (result.Rows.Count == 0) { Console.WriteLine("correct username"); string dbPassword = (string)result.Rows[0]["Password"]; if (string.Compare(dbPassword, info.password) == 0) return true; else return false; } else return false;
3
11,540,990
07/18/2012 12:06:20
930,835
09/06/2011 14:04:10
318
3
Android equivalent for org.apache.commons.io.IOUtils.toByteArray(CipherInputStream)
I need to call the "toByteArray" method on a CipherInputStream variable, or use an utility class. Which is the Android code to do so?
java
android
apache
bytearray
cipher
null
open
Android equivalent for org.apache.commons.io.IOUtils.toByteArray(CipherInputStream) === I need to call the "toByteArray" method on a CipherInputStream variable, or use an utility class. Which is the Android code to do so?
0
11,693,029
07/27/2012 17:48:50
656,925
08/12/2010 02:22:36
2,753
49
How is localStorage space allocated if a user has mutliple browsers?
I believe the maximum storage is domain based...i.e. each domain gets x amount of data. But what about when a user switches between browsers? Do they use two completely separate spaces? **Similar SO** http://stackoverflow.com/questions/2989284/max-size-of-localstorage-values http://stackoverflow.com/questions/2747285/html5-localstorage-restrictions-and-limits **Reference** [W3][1] [Mozilla][2] [Wikipedia][3] [1]: http://www.w3schools.com/html5/html5_webstorage.asp [2]: https://developer.mozilla.org/en/DOM/Storage [3]: http://en.wikipedia.org/wiki/Web_Storage
javascript
local-storage
null
null
null
null
open
How is localStorage space allocated if a user has mutliple browsers? === I believe the maximum storage is domain based...i.e. each domain gets x amount of data. But what about when a user switches between browsers? Do they use two completely separate spaces? **Similar SO** http://stackoverflow.com/questions/2989284/max-size-of-localstorage-values http://stackoverflow.com/questions/2747285/html5-localstorage-restrictions-and-limits **Reference** [W3][1] [Mozilla][2] [Wikipedia][3] [1]: http://www.w3schools.com/html5/html5_webstorage.asp [2]: https://developer.mozilla.org/en/DOM/Storage [3]: http://en.wikipedia.org/wiki/Web_Storage
0
11,693,033
07/27/2012 17:49:13
493,965
11/01/2010 19:13:50
133
1
How can i convert ¶ (pilcrow) to \n in PHP after reading a record from MySQL
In the following code when I echo the text in "Details" column after retrieving the record from mySQL database, I want it to echo line break (< br/ >) for all the ¶ (pilcrows) in the database record. I know I can use nl2br() to replace all \n to < br /> but first I need to replace all ¶ (pilcrows) to \n. How can I do it? .Here is my code: <?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM Persons"); while($row = mysql_fetch_array($result)) { echo $row['Details']; } mysql_close($con); ?>
php
null
null
null
null
null
open
How can i convert ¶ (pilcrow) to \n in PHP after reading a record from MySQL === In the following code when I echo the text in "Details" column after retrieving the record from mySQL database, I want it to echo line break (< br/ >) for all the ¶ (pilcrows) in the database record. I know I can use nl2br() to replace all \n to < br /> but first I need to replace all ¶ (pilcrows) to \n. How can I do it? .Here is my code: <?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM Persons"); while($row = mysql_fetch_array($result)) { echo $row['Details']; } mysql_close($con); ?>
0
11,692,788
07/27/2012 17:34:18
486,998
10/25/2010 22:23:45
278
7
Does AVFoundation (OS X) support transparent playback of videos with alpha channel?
Is there a way of playing back video files that include an alpha channel using `AVFoundation`? I would like to add an `AVPlayerLayer` as a sublayer to my layer tree preserving transparency so it works like as an overlay. Or is it alternatively possible to use a second greyscale video as an alpha mask for the main movie?
cocoa
avfoundation
null
null
null
null
open
Does AVFoundation (OS X) support transparent playback of videos with alpha channel? === Is there a way of playing back video files that include an alpha channel using `AVFoundation`? I would like to add an `AVPlayerLayer` as a sublayer to my layer tree preserving transparency so it works like as an overlay. Or is it alternatively possible to use a second greyscale video as an alpha mask for the main movie?
0
11,692,791
07/27/2012 17:34:31
420,217
08/14/2010 07:02:01
74
3
Can't get pubDate to output in Yahoo! Pipes?
In one of my RSS feeds in Yahoo! Pipes, I'm formatting dates using the Date Formatter module and using the format %K so they are pubDate-compliant. In Pipe Output, my four dates appears as follows: `Wed, 25 Jul 2012 03:30:00 +0000`, `Mon, 16 Jul 2012 06:30:00 +0000`, `Wed, 11 Jul 2012 07:00:00 +0000`, and `Wed, 27 Jun 2012 13:00:00 +0000`. However, in the RSS feed output, none of these dates appear. Are they formatted incorrectly? Why does Yahoo! Pipes not output these dates?
date
rss
feed
yahoo-pipes
pubdate
null
open
Can't get pubDate to output in Yahoo! Pipes? === In one of my RSS feeds in Yahoo! Pipes, I'm formatting dates using the Date Formatter module and using the format %K so they are pubDate-compliant. In Pipe Output, my four dates appears as follows: `Wed, 25 Jul 2012 03:30:00 +0000`, `Mon, 16 Jul 2012 06:30:00 +0000`, `Wed, 11 Jul 2012 07:00:00 +0000`, and `Wed, 27 Jun 2012 13:00:00 +0000`. However, in the RSS feed output, none of these dates appear. Are they formatted incorrectly? Why does Yahoo! Pipes not output these dates?
0
11,693,038
07/27/2012 17:49:45
1,551,891
07/25/2012 14:11:16
21
2
copyshortcut feature lag/behind
i'm writing a macro to go into internet explorer, search and employee number, find the manager from that search, and finally copy+paste it to a cell in the workbook.... however, it seems to always be one behind "copy" behind. By that i mean, if i copy something before running the macro, then run it, what is copied goes in the cell. Yet, i hit run again, and it copies the manager name. it seems to always be one "copy" behind, or selects the second most recent item on the clipboard. Why is that? `Sub Macro1() ' Dim ie As Object Set ie = CreateObject("internetexplorer.application") 'start up IE Dim HWNDSrc As Long HWNDSrc = ie.HWND 'to setup for focusing internet explorer ie.Visible = True ie.navigate "http://url.com/" 'address to find While ie.Busy 'loop until ie is done loading DoEvents Wend Call WaitForIE(ie, HWNDSrc, 7) 'to check and make sure ie is done loading ie.document.getElementById("SSOID").Value = "m1z016p32" 'input into search box ie.document.getElementById("SSOID").Select SetForegroundWindow HWNDSrc 'focuses the active application Application.SendKeys "~" 'enter key ie.document.getElementById("Advanced").Checked = False 'make sure the advanced box is unchecked For i = 1 To 200000000 'loop to load the search i = i + 1 Next i ie.document.getElementById("Advanced").Checked = False ie.document.getElementById("SSOID").Select 'focuses the cursor so the tabs will align SetForegroundWindow HWNDSrc Application.SendKeys "{TAB 6}" 'tab to location Application.SendKeys "+{F10}" 'right click on the manger name Application.SendKeys "{DOWN}" 'goes down to 'copyshortcut' Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "~" '[presses enter Windows("Book21").Activate 'workbook o activate Range("A1").Select 'selects the cell ActiveSheet.Paste 'past the data End Sub`
vba
excel-vba
macros
clipboard
copy-paste
null
open
copyshortcut feature lag/behind === i'm writing a macro to go into internet explorer, search and employee number, find the manager from that search, and finally copy+paste it to a cell in the workbook.... however, it seems to always be one behind "copy" behind. By that i mean, if i copy something before running the macro, then run it, what is copied goes in the cell. Yet, i hit run again, and it copies the manager name. it seems to always be one "copy" behind, or selects the second most recent item on the clipboard. Why is that? `Sub Macro1() ' Dim ie As Object Set ie = CreateObject("internetexplorer.application") 'start up IE Dim HWNDSrc As Long HWNDSrc = ie.HWND 'to setup for focusing internet explorer ie.Visible = True ie.navigate "http://url.com/" 'address to find While ie.Busy 'loop until ie is done loading DoEvents Wend Call WaitForIE(ie, HWNDSrc, 7) 'to check and make sure ie is done loading ie.document.getElementById("SSOID").Value = "m1z016p32" 'input into search box ie.document.getElementById("SSOID").Select SetForegroundWindow HWNDSrc 'focuses the active application Application.SendKeys "~" 'enter key ie.document.getElementById("Advanced").Checked = False 'make sure the advanced box is unchecked For i = 1 To 200000000 'loop to load the search i = i + 1 Next i ie.document.getElementById("Advanced").Checked = False ie.document.getElementById("SSOID").Select 'focuses the cursor so the tabs will align SetForegroundWindow HWNDSrc Application.SendKeys "{TAB 6}" 'tab to location Application.SendKeys "+{F10}" 'right click on the manger name Application.SendKeys "{DOWN}" 'goes down to 'copyshortcut' Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "{DOWN}" Application.SendKeys "~" '[presses enter Windows("Book21").Activate 'workbook o activate Range("A1").Select 'selects the cell ActiveSheet.Paste 'past the data End Sub`
0
11,693,041
07/27/2012 17:49:55
1,553,411
07/26/2012 03:44:19
1
0
Creating new column based on rows of previous column
I am trying to assign treatment labels to my experimental ids. SO has been helpful in getting me this far, but now I'm not sure why my code doesn't work. The ids are numbers (entered as factors(colname is plotF)) and the treatments are A, B, and C. The dataframe is very large, this is an example. data$trt[data$plotF == c(12, 21, 35, 43)] <- "A" data$trt[data$plotF == c(15, 23, 32, 41)] <- "B" data$trt[data$plotF == c(13, 24, 31, 46)] <- "C" The output is: plotF trt 21 <NA> 24 C 46 <NA> 12 <NA> 23 <NA> 31 <NA> 13 <NA> 43 A 32 <NA> 15 <NA> 35 A 41 B 24 <NA> 46 <NA> 32 B 31 <NA> 13 C 21 A 12 <NA> 43 A 23 <NA> 15 <NA> 41 <NA> 35 <NA> Why is it working sometimes but not always?
r
data.frame
null
null
null
null
open
Creating new column based on rows of previous column === I am trying to assign treatment labels to my experimental ids. SO has been helpful in getting me this far, but now I'm not sure why my code doesn't work. The ids are numbers (entered as factors(colname is plotF)) and the treatments are A, B, and C. The dataframe is very large, this is an example. data$trt[data$plotF == c(12, 21, 35, 43)] <- "A" data$trt[data$plotF == c(15, 23, 32, 41)] <- "B" data$trt[data$plotF == c(13, 24, 31, 46)] <- "C" The output is: plotF trt 21 <NA> 24 C 46 <NA> 12 <NA> 23 <NA> 31 <NA> 13 <NA> 43 A 32 <NA> 15 <NA> 35 A 41 B 24 <NA> 46 <NA> 32 B 31 <NA> 13 C 21 A 12 <NA> 43 A 23 <NA> 15 <NA> 41 <NA> 35 <NA> Why is it working sometimes but not always?
0
11,692,924
07/27/2012 17:42:18
1,413,866
05/24/2012 00:41:06
111
0
What's the proper way to handle a variable across multiple methods?
Say I have a `List<Objects>`. I want to define the list of objects in one method, and use them in several others. Here's the ways I've come up with and I'm looking for more or the correct way to do it. 1. You can define `List<Objects>` in every method that uses it. - Pros: It works. No chance of getting the wrong variable. - Cons: Code duplication. 2. You can use a private `List<Objects>` defined in the class and update it using `(ref ListObjects)` - Pros: I only have to define it once. - Cons: I feel like it's messy and bad practice. 3. You can pass `List<Objects>` as a parameter to the methods that use it. - Pros: Prevents code duplication - Cons: Have to make my populate functions return functions, and add parameters to my other methods. Possible conflicts with Events? So that's what I've come up with. I'm really not sure which to use or if there's a better way to do this. Thoughts?
c#
null
null
null
null
null
open
What's the proper way to handle a variable across multiple methods? === Say I have a `List<Objects>`. I want to define the list of objects in one method, and use them in several others. Here's the ways I've come up with and I'm looking for more or the correct way to do it. 1. You can define `List<Objects>` in every method that uses it. - Pros: It works. No chance of getting the wrong variable. - Cons: Code duplication. 2. You can use a private `List<Objects>` defined in the class and update it using `(ref ListObjects)` - Pros: I only have to define it once. - Cons: I feel like it's messy and bad practice. 3. You can pass `List<Objects>` as a parameter to the methods that use it. - Pros: Prevents code duplication - Cons: Have to make my populate functions return functions, and add parameters to my other methods. Possible conflicts with Events? So that's what I've come up with. I'm really not sure which to use or if there's a better way to do this. Thoughts?
0
11,692,927
07/27/2012 17:42:30
1,511,547
07/09/2012 09:19:25
35
1
hover and moveout not giving expcted result
Because I am creating DOM using Jquery it was difficult to copy the output so i am adding one image of code that i have captured using one tool ![enter image description here][1] [1]: http://i.stack.imgur.com/TKZnp.png i have attached hover and mouseout event to `id='nf1'` using this code $("#nf"+n).hover(function(){ $("#nf"+$(this).attr("post_id")+"post_delete").show(); }); $("#nf"+n).mouseout(function(){ $("#nf"+$(this).attr("post_id")+"post_delete").hide(); }); Here n is post_id and i am looping all post_id got from response.This attach events but not giving expected behaviour Like when mouse over to `id='nf1post_delete'` it is hide Please ask if any doubts
javascript
jquery
html
css
null
null
open
hover and moveout not giving expcted result === Because I am creating DOM using Jquery it was difficult to copy the output so i am adding one image of code that i have captured using one tool ![enter image description here][1] [1]: http://i.stack.imgur.com/TKZnp.png i have attached hover and mouseout event to `id='nf1'` using this code $("#nf"+n).hover(function(){ $("#nf"+$(this).attr("post_id")+"post_delete").show(); }); $("#nf"+n).mouseout(function(){ $("#nf"+$(this).attr("post_id")+"post_delete").hide(); }); Here n is post_id and i am looping all post_id got from response.This attach events but not giving expected behaviour Like when mouse over to `id='nf1post_delete'` it is hide Please ask if any doubts
0
11,693,047
07/27/2012 17:50:27
1,449,530
06/11/2012 17:23:47
5
0
How to create a DLL with SWIG from Visual Studio 2010
I've been trying for weeks to get Microsoft Visual Studio 2010 to create a DLL for me with SWIG. If you have already gone through this process, would you be so kind as to give a thoughtful step-by-step process explanation? I've looked everywhere online and have spent many many hours trying to do this; but all of the tutorials that I have found are outdated or badly explained. I have succeeded in going through this process with cygwin; but as some of you know, a cygwin DLL is not very practical. As a result, I have .i, .cpp, and .h files that I know can create a DLL together. I just need to know how to do this with Visual Studio C++ 2010. The language that I am targeting is Python. Please don't refer me to another site; because chances are that I've already been there and tried that. Also, please no snarky comments because it's very important that I get this to work in the near future. Thank you abundantly for your help in advance!
c++
python
visual-studio-2010
swig
null
null
open
How to create a DLL with SWIG from Visual Studio 2010 === I've been trying for weeks to get Microsoft Visual Studio 2010 to create a DLL for me with SWIG. If you have already gone through this process, would you be so kind as to give a thoughtful step-by-step process explanation? I've looked everywhere online and have spent many many hours trying to do this; but all of the tutorials that I have found are outdated or badly explained. I have succeeded in going through this process with cygwin; but as some of you know, a cygwin DLL is not very practical. As a result, I have .i, .cpp, and .h files that I know can create a DLL together. I just need to know how to do this with Visual Studio C++ 2010. The language that I am targeting is Python. Please don't refer me to another site; because chances are that I've already been there and tried that. Also, please no snarky comments because it's very important that I get this to work in the near future. Thank you abundantly for your help in advance!
0
11,692,868
07/27/2012 17:39:17
849,065
07/17/2011 21:23:39
1,065
7
why is my text input border not showing up when set?
I'm trying to apply an error class of a red border color to my text input field like so: jquery //save ... $("input.required").each(function(){ if ($.trim($(this).val()).length == 0){ $(this).addClass("form_error"); formValid = false; } else{ $(this).removeClass("form_error"); } }); HTML <div class="control-group"> <label class="control-label" for="city_id">City</label> <div class="controls"> <input class="span2 required" type="text" value="" name="test" id='testId'/> </div> </div> CSS .form_error { border-color: #ee5f5b; } This is working for my select elements but not text inputs. Any idea what I'm missing?
jquery
css
null
null
null
null
open
why is my text input border not showing up when set? === I'm trying to apply an error class of a red border color to my text input field like so: jquery //save ... $("input.required").each(function(){ if ($.trim($(this).val()).length == 0){ $(this).addClass("form_error"); formValid = false; } else{ $(this).removeClass("form_error"); } }); HTML <div class="control-group"> <label class="control-label" for="city_id">City</label> <div class="controls"> <input class="span2 required" type="text" value="" name="test" id='testId'/> </div> </div> CSS .form_error { border-color: #ee5f5b; } This is working for my select elements but not text inputs. Any idea what I'm missing?
0
11,692,871
07/27/2012 17:39:25
1,558,366
07/27/2012 17:34:48
1
0
What is the formal classification of d3.js? Framework? Library? Package?
I've been using d3.js but have no idea how it fits into the grand scope of software development. - It uses JavaScript - It sits ontop of the DOM - Has a very interesting (at times, perhaps even declarative) style of coding - It can use SVG, but doesn't have to What is its formal classification? Can it really be a framework? Does it actually provide a skeleton/Inversion of Control? Or is it just basically a library? Or is it a package, etc?
frameworks
packages
d3.js
null
null
null
open
What is the formal classification of d3.js? Framework? Library? Package? === I've been using d3.js but have no idea how it fits into the grand scope of software development. - It uses JavaScript - It sits ontop of the DOM - Has a very interesting (at times, perhaps even declarative) style of coding - It can use SVG, but doesn't have to What is its formal classification? Can it really be a framework? Does it actually provide a skeleton/Inversion of Control? Or is it just basically a library? Or is it a package, etc?
0
11,386,889
07/08/2012 21:33:07
269,477
02/09/2010 12:52:53
301
11
What is the currently accepted way to embed forms in Refinery CMS sites?
I'd like to create a couple of forms on a Refinery based CMS site. One is a contact form, and another is a variation on this contact form with a few additional fields. For this form, I've looked at the [Refinery inquiry gem](https://github.com/resolve/refinerycms-inquiries) but I can't seem to find a way of modifying the form for the additional fields, or embedding this on multiple pages (each of which has multiple languages through the i18n gem). I also stumbled across [Refinery Engines](https://github.com/resolve/refinerycms-generators/tree/forms) which might meet my requirements, but it hasn't been updated in quite a while, so wasn't sure whether it would work with the latest version. Is the Generators gem still in use? Has anyone used this gem for what I'm trying to achieve or what is the Refinery way of creating custom forms?
ruby-on-rails
ruby-on-rails-3
refinerycms
null
null
null
open
What is the currently accepted way to embed forms in Refinery CMS sites? === I'd like to create a couple of forms on a Refinery based CMS site. One is a contact form, and another is a variation on this contact form with a few additional fields. For this form, I've looked at the [Refinery inquiry gem](https://github.com/resolve/refinerycms-inquiries) but I can't seem to find a way of modifying the form for the additional fields, or embedding this on multiple pages (each of which has multiple languages through the i18n gem). I also stumbled across [Refinery Engines](https://github.com/resolve/refinerycms-generators/tree/forms) which might meet my requirements, but it hasn't been updated in quite a while, so wasn't sure whether it would work with the latest version. Is the Generators gem still in use? Has anyone used this gem for what I'm trying to achieve or what is the Refinery way of creating custom forms?
0
11,386,887
07/08/2012 21:33:01
1,287,938
03/23/2012 09:38:03
1
2
I know it's a reference cycle. But is it a memory leak? (JavaScript)
The setup: `enter code here`obj = object `enter code here\n` obj.fun = function obj.fun.ob = <br />reference to obj. Does the garbage collector look for this type of cycle, or is this a leak?
javascript
leak
cycle
null
null
null
open
I know it's a reference cycle. But is it a memory leak? (JavaScript) === The setup: `enter code here`obj = object `enter code here\n` obj.fun = function obj.fun.ob = <br />reference to obj. Does the garbage collector look for this type of cycle, or is this a leak?
0
11,386,888
07/08/2012 21:33:01
1,357,201
04/25/2012 20:43:29
23
0
How do I implement a new game feature for my application? explained inside
I've made a small application for class that works like this: 1. you click any button on the chessboard to start the knight's tour from that button. 2. my program solves the knight's tour and prints out 1-64 on the chessboard for how the knight traversed the board. Now I'm trying to implement a New Game feature. I have a menu bar, File, that has New Game in it. I have absolutely no idea how to implement a new game where upon clicking new game, a "fresh" new board is displayed for the user to click. Is there any built in function in java that can do this? Thanks
java
gui
applet
null
null
null
open
How do I implement a new game feature for my application? explained inside === I've made a small application for class that works like this: 1. you click any button on the chessboard to start the knight's tour from that button. 2. my program solves the knight's tour and prints out 1-64 on the chessboard for how the knight traversed the board. Now I'm trying to implement a New Game feature. I have a menu bar, File, that has New Game in it. I have absolutely no idea how to implement a new game where upon clicking new game, a "fresh" new board is displayed for the user to click. Is there any built in function in java that can do this? Thanks
0
11,386,899
07/08/2012 21:34:41
1,376,876
05/05/2012 13:52:23
59
1
How to use a named delegate to a Comparison for List.Sort()?
In my app, I have several comparison methods. I would like the user to be able to select the sorting method to use. Ideally, I would like to set a delegate and it is updated based on the user's selection. This way, I can keep the code generic using List.Sort(delegate). This is my first time attempting to use C# delegates and I'm running into syntax errors. Here is what I have so far: The delegate: private delegate int SortVideos(VideoData x, VideoData y); private SortVideos sortVideos; In the class constructor: sortVideos = Sorting.VideoPerformanceDescending; The comparison method in the public static Sorting class (which works when I call it directly): public static int VideoPerformanceDescending(VideoData x, VideoData y) { *code statements* *return -1, 0, or 1* } Failed syntax that complains of "some invalid arguments": videos.Sort(sortVideos); Ultimately, I would like to change "sortVideos" to point to the method of choice. "videos" is a list of type VideoData. What am I doing wrong?
c#
delegates
null
null
null
null
open
How to use a named delegate to a Comparison for List.Sort()? === In my app, I have several comparison methods. I would like the user to be able to select the sorting method to use. Ideally, I would like to set a delegate and it is updated based on the user's selection. This way, I can keep the code generic using List.Sort(delegate). This is my first time attempting to use C# delegates and I'm running into syntax errors. Here is what I have so far: The delegate: private delegate int SortVideos(VideoData x, VideoData y); private SortVideos sortVideos; In the class constructor: sortVideos = Sorting.VideoPerformanceDescending; The comparison method in the public static Sorting class (which works when I call it directly): public static int VideoPerformanceDescending(VideoData x, VideoData y) { *code statements* *return -1, 0, or 1* } Failed syntax that complains of "some invalid arguments": videos.Sort(sortVideos); Ultimately, I would like to change "sortVideos" to point to the method of choice. "videos" is a list of type VideoData. What am I doing wrong?
0
11,386,907
07/08/2012 21:35:01
1,380,936
05/08/2012 00:52:45
32
1
MySQL Timestamp - Display 3 Rows within last hour
How would I display rows that have a timestamp value within the last hour? Here is what I have right now, and it is showing the latest rows, and only 3 rows because of the LIMIT. $query5= mysql_query("SELECT * FROM `made_orders` ORDER by id DESC LIMIT 0,3"); WHILE($datarows5 = mysql_fetch_array($query5)): $name4 = $datarows5['Name']; $phone4 = $datarows5['Phone']; $entree4 = $datarows5['Entree']; $side14 = $datarows5['Side 1']; $side24 = $datarows5['Side 2']; $drink4 = $datarows5['Drink']; $totalcost4 = $datarows5['Total Cost']; $ip4 = $datarows5['Ip']; $id4 = $datarows5['id']; $time4 = $datarows5['timestamp']; echo "<iframe src=\"creatmeal-data.php?id={$id4}\" width=\"430px\" style=\"border:0px\" height=\"350px\"/></iframe>"; endwhile; ?> In my above code, each time a row is found, it echos an iframe. How would I edit the query to use my timestamp column to show only the latest within an hour. Thanks in advance for your help!
php
mysql
timestamp
null
null
null
open
MySQL Timestamp - Display 3 Rows within last hour === How would I display rows that have a timestamp value within the last hour? Here is what I have right now, and it is showing the latest rows, and only 3 rows because of the LIMIT. $query5= mysql_query("SELECT * FROM `made_orders` ORDER by id DESC LIMIT 0,3"); WHILE($datarows5 = mysql_fetch_array($query5)): $name4 = $datarows5['Name']; $phone4 = $datarows5['Phone']; $entree4 = $datarows5['Entree']; $side14 = $datarows5['Side 1']; $side24 = $datarows5['Side 2']; $drink4 = $datarows5['Drink']; $totalcost4 = $datarows5['Total Cost']; $ip4 = $datarows5['Ip']; $id4 = $datarows5['id']; $time4 = $datarows5['timestamp']; echo "<iframe src=\"creatmeal-data.php?id={$id4}\" width=\"430px\" style=\"border:0px\" height=\"350px\"/></iframe>"; endwhile; ?> In my above code, each time a row is found, it echos an iframe. How would I edit the query to use my timestamp column to show only the latest within an hour. Thanks in advance for your help!
0
11,226,523
06/27/2012 12:44:39
1,285,948
03/22/2012 12:52:55
85
5
autoconf not generating makefile?
I am currently trying to create an installation package using autoconf to generate the configure file. I have successfully managed to auto generate these however when i run ./configure no makefile is generated from Makefile.in. My question is how do i debug this issue in order to narrow down why it is failing?
unix
configure
autoconf
null
null
null
open
autoconf not generating makefile? === I am currently trying to create an installation package using autoconf to generate the configure file. I have successfully managed to auto generate these however when i run ./configure no makefile is generated from Makefile.in. My question is how do i debug this issue in order to narrow down why it is failing?
0
11,226,529
06/27/2012 12:44:52
1,285,924
03/22/2012 12:38:16
21
0
Photo gallery, like iPhone native photo gallery?
Is there a way to generate a photo gallery, similar in behavior to the native photo app in iPhone?
iphone
ios
ipad
null
null
06/27/2012 13:08:23
not a real question
Photo gallery, like iPhone native photo gallery? === Is there a way to generate a photo gallery, similar in behavior to the native photo app in iPhone?
1
11,226,329
06/27/2012 12:34:23
525,965
12/01/2010 01:47:27
1,400
10
Iterate through each html tag
I want to get each circle inside a div so i can resize it using jquery. My code is as follows: <div id="DG_circles"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="75"> <desc>Created with Raphaël</desc> <defs> <circle cx="39" cy="39.5" r="16" fill="#d57b19" stroke="none" style="stroke-width: 0;" stroke-width="0"> <image x="28.8" y="29.3" width="22.4" height="22.4" preserveAspectRatio="none" href="load?name=icon-hotel-chart"> <text x="39" y="17.5" text-anchor="middle" style="text-anchor: middle; font: bold 9px Arial,Verdana,Courier; stroke-width: 0;" font="10px "Arial"" stroke="none" fill="#333333" font-size="9px" font-family="Arial, Verdana, Courier" stroke-width="0" font-weight="bold"> <circle cx="91" cy="39.5" r="16" fill="#b1102b" stroke="none" style="stroke-width: 0;" stroke-width="0"> <image x="80.8" y="29.3" width="22.4" height="22.4" preserveAspectRatio="none" href="load?name=icon-card-chart"> <text x="91" y="17.5" text-anchor="middle" style="text-anchor: middle; font: bold 9px Arial,Verdana,Courier; stroke-width: 0;" font="10px "Arial"" stroke="none" fill="#333333" font-size="9px" font-family="Arial, Verdana, Courier" stroke-width="0" font-weight="bold"> <circle cx="143" cy="39.5" r="16" fill="#85bb3c" stroke="none" style="stroke-width: 0;" stroke-width="0"> <image x="132.8" y="29.3" width="22.4" height="22.4" preserveAspectRatio="none" href="load?name=icon-airplane-chart"> <text x="143" y="17.5" text-anchor="middle" style="text-anchor: middle; font: bold 9px Arial,Verdana,Courier; stroke-width: 0;" font="10px "Arial"" stroke="none" fill="#333333" font-size="9px" font-family="Arial, Verdana, Courier" stroke-width="0" font-weight="bold"> </svg> </div>​ var $circle = $('#DG_circles').find("circle"); $circle.each(function(index, value){ if(index == 0){ $this.attr("r", "24"); } else if(index == 1){ $this.attr("r", "20"); } else if(index == 2){ $this.attr("r", "18"); } }); But it doesn't change the "r" attribute of the circle. Please help. Thank you.
javascript
jquery
null
null
null
null
open
Iterate through each html tag === I want to get each circle inside a div so i can resize it using jquery. My code is as follows: <div id="DG_circles"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="75"> <desc>Created with Raphaël</desc> <defs> <circle cx="39" cy="39.5" r="16" fill="#d57b19" stroke="none" style="stroke-width: 0;" stroke-width="0"> <image x="28.8" y="29.3" width="22.4" height="22.4" preserveAspectRatio="none" href="load?name=icon-hotel-chart"> <text x="39" y="17.5" text-anchor="middle" style="text-anchor: middle; font: bold 9px Arial,Verdana,Courier; stroke-width: 0;" font="10px "Arial"" stroke="none" fill="#333333" font-size="9px" font-family="Arial, Verdana, Courier" stroke-width="0" font-weight="bold"> <circle cx="91" cy="39.5" r="16" fill="#b1102b" stroke="none" style="stroke-width: 0;" stroke-width="0"> <image x="80.8" y="29.3" width="22.4" height="22.4" preserveAspectRatio="none" href="load?name=icon-card-chart"> <text x="91" y="17.5" text-anchor="middle" style="text-anchor: middle; font: bold 9px Arial,Verdana,Courier; stroke-width: 0;" font="10px "Arial"" stroke="none" fill="#333333" font-size="9px" font-family="Arial, Verdana, Courier" stroke-width="0" font-weight="bold"> <circle cx="143" cy="39.5" r="16" fill="#85bb3c" stroke="none" style="stroke-width: 0;" stroke-width="0"> <image x="132.8" y="29.3" width="22.4" height="22.4" preserveAspectRatio="none" href="load?name=icon-airplane-chart"> <text x="143" y="17.5" text-anchor="middle" style="text-anchor: middle; font: bold 9px Arial,Verdana,Courier; stroke-width: 0;" font="10px "Arial"" stroke="none" fill="#333333" font-size="9px" font-family="Arial, Verdana, Courier" stroke-width="0" font-weight="bold"> </svg> </div>​ var $circle = $('#DG_circles').find("circle"); $circle.each(function(index, value){ if(index == 0){ $this.attr("r", "24"); } else if(index == 1){ $this.attr("r", "20"); } else if(index == 2){ $this.attr("r", "18"); } }); But it doesn't change the "r" attribute of the circle. Please help. Thank you.
0
11,226,530
06/27/2012 12:44:53
1,485,609
06/27/2012 12:21:02
1
0
Creating nested folders with variable names using Applescript/mkdir
I'm trying to create an applescript that prompts for a job name, then a desired directory in which to create a folder with the job name. It then should create a series of subfolders within the initial folder with names such as "job name-Links" & "job name-PDFs" etc. I've cobbled this script together from different sources & would like feedback on how to improve it, because I'm sure it's ugly as sin. tell application "Finder" activate set jobNum to text returned of (display dialog "Enter a job number:" default answer "[JobNumber]-[Description]") set folderpath to POSIX path of (choose folder with prompt "Select client folder") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-Links") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-PDFs") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-Supplied") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-Versions") end tell Any thoughts & comments would be greatly appreciated. This is my first attempt at a script. I thought I'd post this because I've hunted for this specific use case for ages and only found bits and pieces. Hopefully someone can help me out so other will find it useful too.
osx
applescript
finder
mkdir
null
null
open
Creating nested folders with variable names using Applescript/mkdir === I'm trying to create an applescript that prompts for a job name, then a desired directory in which to create a folder with the job name. It then should create a series of subfolders within the initial folder with names such as "job name-Links" & "job name-PDFs" etc. I've cobbled this script together from different sources & would like feedback on how to improve it, because I'm sure it's ugly as sin. tell application "Finder" activate set jobNum to text returned of (display dialog "Enter a job number:" default answer "[JobNumber]-[Description]") set folderpath to POSIX path of (choose folder with prompt "Select client folder") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-Links") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-PDFs") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-Supplied") do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum) & "/" & quoted form of (jobNum & "-Versions") end tell Any thoughts & comments would be greatly appreciated. This is my first attempt at a script. I thought I'd post this because I've hunted for this specific use case for ages and only found bits and pieces. Hopefully someone can help me out so other will find it useful too.
0
11,226,534
06/27/2012 12:45:07
557,534
12/29/2010 19:52:14
288
14
Is it possible to construct a PCRE UTF-8 regex which matches 3 or more non-consecutive UTF codepoints
Good morning, We are trying to match the German string 'DAS tausendschöne Jungfräulein tausendschçne' using the C/C++ PCRE regex \x{00F6}.*\x{00E4}.*\x{00E7}. The PCRE regex matches only once beginning at byte positions 14 and 43. Is our PCRE regex correct or should it be corrected? THank you.
c++
windows
pcre
null
null
null
open
Is it possible to construct a PCRE UTF-8 regex which matches 3 or more non-consecutive UTF codepoints === Good morning, We are trying to match the German string 'DAS tausendschöne Jungfräulein tausendschçne' using the C/C++ PCRE regex \x{00F6}.*\x{00E4}.*\x{00E7}. The PCRE regex matches only once beginning at byte positions 14 and 43. Is our PCRE regex correct or should it be corrected? THank you.
0
11,226,536
06/27/2012 12:45:14
1,269,086
03/14/2012 13:18:58
1,438
110
Play Video using MPMoviePlayer Controller in ios
i am play video on mpmovieplayercontroller from local project resource.i am starting app console showing some errors occurred and how to fix and play proper way in mpmovieplayercontroller or any alternative for mpmovieplayercontroller. below shows the error for i am getting in console output but app does not crash: Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.171 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.229 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.237 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.252 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.260 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security here's my code for play the video: #import "VideoPlayerControllerViewController.h" @interface VideoPlayerControllerViewController () @end @implementation VideoPlayerControllerViewController @synthesize moviePlayer; - (void)viewDidLoad { [super viewDidLoad]; [self playMovie]; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } -(void)moviePlayBackDidFinish:(NSNotification*)aNotification{ NSLog(@"Play Back Finished!"); [moviePlayer play]; } -(void)playMovie { NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Menu_Free" ofType:@"mp4"]]; moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer]; moviePlayer.controlStyle = MPMovieControlStyleDefault; moviePlayer.shouldAutoplay = YES; moviePlayer.view.frame = self.view.bounds; moviePlayer.scalingMode= MPMovieScalingModeFill; moviePlayer.controlStyle =MPMovieControlStyleNone; [self.view addSubview:moviePlayer.view]; [moviePlayer setFullscreen:YES animated:YES]; } @end Thanks in Advance!
iphone
ios
mpmovieplayercontroller
null
null
null
open
Play Video using MPMoviePlayer Controller in ios === i am play video on mpmovieplayercontroller from local project resource.i am starting app console showing some errors occurred and how to fix and play proper way in mpmovieplayercontroller or any alternative for mpmovieplayercontroller. below shows the error for i am getting in console output but app does not crash: Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.171 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.229 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.237 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.252 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-27 18:08:49.260 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security here's my code for play the video: #import "VideoPlayerControllerViewController.h" @interface VideoPlayerControllerViewController () @end @implementation VideoPlayerControllerViewController @synthesize moviePlayer; - (void)viewDidLoad { [super viewDidLoad]; [self playMovie]; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } -(void)moviePlayBackDidFinish:(NSNotification*)aNotification{ NSLog(@"Play Back Finished!"); [moviePlayer play]; } -(void)playMovie { NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Menu_Free" ofType:@"mp4"]]; moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer]; moviePlayer.controlStyle = MPMovieControlStyleDefault; moviePlayer.shouldAutoplay = YES; moviePlayer.view.frame = self.view.bounds; moviePlayer.scalingMode= MPMovieScalingModeFill; moviePlayer.controlStyle =MPMovieControlStyleNone; [self.view addSubview:moviePlayer.view]; [moviePlayer setFullscreen:YES animated:YES]; } @end Thanks in Advance!
0
11,226,488
06/27/2012 12:42:35
165,729
08/30/2009 22:13:35
796
14
On duplicating an Xcode product. Why is the name red, and how can I change the name?
I am trying to duplicate an Xcode target (Xcode 4.3.2) in order to make a free version of my iPhone App. In Xcode, I have selected the old target, right clicked, and then "duplicated". As a result, I got `myapp copy.app` and `myapp copy-info.plist`. However, the name `myapp copy.app` is printed in **red** (even after the build). I guess it indicates that the file is missing! Question 1: How can I solve the above problem? Question 2: How can I change the name of the new target?
iphone
xcode
xcode4
null
null
null
open
On duplicating an Xcode product. Why is the name red, and how can I change the name? === I am trying to duplicate an Xcode target (Xcode 4.3.2) in order to make a free version of my iPhone App. In Xcode, I have selected the old target, right clicked, and then "duplicated". As a result, I got `myapp copy.app` and `myapp copy-info.plist`. However, the name `myapp copy.app` is printed in **red** (even after the build). I guess it indicates that the file is missing! Question 1: How can I solve the above problem? Question 2: How can I change the name of the new target?
0
11,226,489
06/27/2012 12:42:47
1,481,792
06/26/2012 06:04:48
13
0
Show/hide forms using buttons and javascript
I need to show a form using a button, and hide it when the user presses another button, because the other button shows another form. I did a similar thing with select box, but I can't figure out how to do this. Thanks in advance =)
javascript
html
null
null
null
null
open
Show/hide forms using buttons and javascript === I need to show a form using a button, and hide it when the user presses another button, because the other button shows another form. I did a similar thing with select box, but I can't figure out how to do this. Thanks in advance =)
0
11,226,491
06/27/2012 12:42:53
1,101,350
12/16/2011 06:12:46
1
0
Eclipse Indigo - JPA Validation Problems
since i am using eclipse indigo, there are "JPA Validation Problems". my named query is: from Person p where p.name = :name and there is this error: The query does not start with a valid identifier, has to be either SELECT, UPDATE or DELETE FROM. But it's a valid JPQL query. Somebody know how i can remove this error? if i change my query to select p from Person p where p.name = :name there is no more error, but i do not want to change all my queries. thanks mp5
java
eclipse
validation
jpa
jpql
null
open
Eclipse Indigo - JPA Validation Problems === since i am using eclipse indigo, there are "JPA Validation Problems". my named query is: from Person p where p.name = :name and there is this error: The query does not start with a valid identifier, has to be either SELECT, UPDATE or DELETE FROM. But it's a valid JPQL query. Somebody know how i can remove this error? if i change my query to select p from Person p where p.name = :name there is no more error, but i do not want to change all my queries. thanks mp5
0
11,226,537
06/27/2012 12:45:16
965,769
09/26/2011 20:04:09
277
9
Error when create a instance of WebService
I have a WebService that when I use the instance of this webservice, occurs the following error // Instance of WebService ServicoZap.EnvArqSenhaSoapClient envia = new ServicoZap.EnvArqSenhaSoapClient(); Error: Could not find default endpoint element that references contract 'Contract Name' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. In my app.config the reference is OK. But to test the webservice, I'm using another project in my solution, called Test. In this project (Test), I don't have an app.config (I don't know if was necessary). Can help me ?
c#
web-services
null
null
null
null
open
Error when create a instance of WebService === I have a WebService that when I use the instance of this webservice, occurs the following error // Instance of WebService ServicoZap.EnvArqSenhaSoapClient envia = new ServicoZap.EnvArqSenhaSoapClient(); Error: Could not find default endpoint element that references contract 'Contract Name' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. In my app.config the reference is OK. But to test the webservice, I'm using another project in my solution, called Test. In this project (Test), I don't have an app.config (I don't know if was necessary). Can help me ?
0
11,226,540
06/27/2012 12:45:42
1,485,529
06/27/2012 11:51:24
1
0
Sitecore issue on replacing danish characters in url
I used [this solution][1] to optimize urls, all works fine but there are a problem with danish characters (æ and ø) which sould be replaced to "a" and "o". I used this in Web.config: <replace mode="on" find="æ" replaceWith="a" /> <replace mode="on" find="ø" replaceWith="o" /> Urls looks good, but when I try to go by this link I got 404 error and if I manually change "a" to "æ" in url page opens. Help me please!:) [1]: http://blog.navigationarts.com/seo-url-sitecore/
url
replace
seo
sitecore
null
null
open
Sitecore issue on replacing danish characters in url === I used [this solution][1] to optimize urls, all works fine but there are a problem with danish characters (æ and ø) which sould be replaced to "a" and "o". I used this in Web.config: <replace mode="on" find="æ" replaceWith="a" /> <replace mode="on" find="ø" replaceWith="o" /> Urls looks good, but when I try to go by this link I got 404 error and if I manually change "a" to "æ" in url page opens. Help me please!:) [1]: http://blog.navigationarts.com/seo-url-sitecore/
0
11,226,542
06/27/2012 12:45:45
1,058,586
11/21/2011 20:51:49
307
0
Object Oriented PHP to pass message to user upon success of function
I am new to OO php so this may seem basic.. Basically I have a list of courses a user can book. I have got it so the user can remove the course from their list, but I want a message to be displayed to them after they delete. I have done something similar to what I want here: <form name="removecourse" action="<?php bloginfo('url');?>/user/<?php echo $current_user->first_name ; ?>" method="post"> <input type="hidden" value="<?php the_id();?>" name="courseid" /> <input id="removebutton" type="submit" name="removecourse" value="Remove"> </form> The form sends the required data to the same page, and at the top of that page is a check to see if the forms post name is present in $_POST[] like so: if(isset($_POST['removecourse']) && !empty($_POST['removecourse'])){ $courseManager->delete_post($_POST['courseid'], $_POST['cancel-reason']); echo $courseManager->delete_response; }; This is where the Class and object part comes in... public $delete_response; function delete_post($postid, $reason){ //stuff to actually delete the post $this->delete_response = 'Thanks, your course has been removed.'; } So here I am adding a value to the delete_response variable and calling it above at the top of the page. This works, but when I refresh the page the message is still there as I am resubmitting the POST. I am just wondering if what I am doing is along the right track, and how to implement a Post/Redirect/Get type functionallity to stop the messaage from appearing on page refresh?
php
forms
oop
post-redirect-get
null
null
open
Object Oriented PHP to pass message to user upon success of function === I am new to OO php so this may seem basic.. Basically I have a list of courses a user can book. I have got it so the user can remove the course from their list, but I want a message to be displayed to them after they delete. I have done something similar to what I want here: <form name="removecourse" action="<?php bloginfo('url');?>/user/<?php echo $current_user->first_name ; ?>" method="post"> <input type="hidden" value="<?php the_id();?>" name="courseid" /> <input id="removebutton" type="submit" name="removecourse" value="Remove"> </form> The form sends the required data to the same page, and at the top of that page is a check to see if the forms post name is present in $_POST[] like so: if(isset($_POST['removecourse']) && !empty($_POST['removecourse'])){ $courseManager->delete_post($_POST['courseid'], $_POST['cancel-reason']); echo $courseManager->delete_response; }; This is where the Class and object part comes in... public $delete_response; function delete_post($postid, $reason){ //stuff to actually delete the post $this->delete_response = 'Thanks, your course has been removed.'; } So here I am adding a value to the delete_response variable and calling it above at the top of the page. This works, but when I refresh the page the message is still there as I am resubmitting the POST. I am just wondering if what I am doing is along the right track, and how to implement a Post/Redirect/Get type functionallity to stop the messaage from appearing on page refresh?
0
11,226,543
06/27/2012 12:45:54
136,264
07/10/2009 13:11:01
1,783
51
Pinning collections/chunks to specific shards/nodes
MonogDB's auto-sharding distributes collections or chunks (i.e. parts of a collection) to different nodes/shards. Is it possible to configure which nodes are used for specific collections or chunks? Example: Let's say we have the collections C1, C2 and C3 as well as nodes/shards N1, N2. Can the sharding be configured in a way that C1 will always be stored on N1? Can the sharding be configured in a way that chunk A of C3 will always be stored on N1? I know that the key ranges are stored in a special config database and that a balancer process modifies this data to distribute the load. However, is it safe to modify this data manually?
mongodb
sharding
null
null
null
null
open
Pinning collections/chunks to specific shards/nodes === MonogDB's auto-sharding distributes collections or chunks (i.e. parts of a collection) to different nodes/shards. Is it possible to configure which nodes are used for specific collections or chunks? Example: Let's say we have the collections C1, C2 and C3 as well as nodes/shards N1, N2. Can the sharding be configured in a way that C1 will always be stored on N1? Can the sharding be configured in a way that chunk A of C3 will always be stored on N1? I know that the key ranges are stored in a special config database and that a balancer process modifies this data to distribute the load. However, is it safe to modify this data manually?
0
11,226,544
06/27/2012 12:45:56
1,482,765
06/26/2012 12:47:57
1
0
How to Limit Support to Sepecific Resolution?
I am developing an app for android deviices and i only want it to run on devices with big displays and resolutions higher or equal to WVGA is there any solution? i have tried the follwing solution and the likes of it: (including http://developer.android.com/guide/practices/screens_support.html) http://stackoverflow.com/questions/10681714/how-to-support-wvga-on-an-android-app-only the problem is that although i have added the <support-screens> tag to my manifest the app still installs (and runs) on my galaxy mini and HTC Wildfire!
resolution
null
null
null
null
null
open
How to Limit Support to Sepecific Resolution? === I am developing an app for android deviices and i only want it to run on devices with big displays and resolutions higher or equal to WVGA is there any solution? i have tried the follwing solution and the likes of it: (including http://developer.android.com/guide/practices/screens_support.html) http://stackoverflow.com/questions/10681714/how-to-support-wvga-on-an-android-app-only the problem is that although i have added the <support-screens> tag to my manifest the app still installs (and runs) on my galaxy mini and HTC Wildfire!
0
11,226,480
06/27/2012 12:42:17
842,291
07/13/2011 08:37:47
147
4
Grails collections
I want to check if any of curently logged in user roles are in specific list of roles. But it can be any two collection. Basically I want to check if any memeber of [x1,x3,x4] collection is contained in [x2,x3,x7] How to do this in Groovy (Grails)?
grails
collections
groovy
gorm
null
null
open
Grails collections === I want to check if any of curently logged in user roles are in specific list of roles. But it can be any two collection. Basically I want to check if any memeber of [x1,x3,x4] collection is contained in [x2,x3,x7] How to do this in Groovy (Grails)?
0
11,327,091
07/04/2012 10:18:08
1,501,212
07/04/2012 09:56:23
1
0
Multiple errors when trying to integrate barcode scanner application in my own android application
I'm pretty new in Android programming, so sorry if I am going to ask dumb questions. I'm creating an application, and I'm trying to integrate ZXing Barcode Scanner, following the instructions here: http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java What I've done so far. I've created some buttons for my application, and put an action On Click for the button supposed to use ZXing for scanning. Value: IntentIntegrator. Then I've copy-pasted the code from the link into the file IntentIntegrator.java from my package. Following the advices given in eclipse I've created IntentResult class in com.google.zxing.integration.android package. Here I am in this moment. For 2 days I've been reading advices, opinions, I've done started all from the beginning but it didn't work. So I'm trying again. Can anyone tell me please, step by step, how to integrate this app in my own? Or if I am right with what I've done so far, why when I run as Android project on the emulator, I get at least 20 errors, like these for exemple: http://s17.postimage.org/n9w5lddof/errors.png Thank you!
android
application
barcode
zxing
integrate
null
open
Multiple errors when trying to integrate barcode scanner application in my own android application === I'm pretty new in Android programming, so sorry if I am going to ask dumb questions. I'm creating an application, and I'm trying to integrate ZXing Barcode Scanner, following the instructions here: http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java What I've done so far. I've created some buttons for my application, and put an action On Click for the button supposed to use ZXing for scanning. Value: IntentIntegrator. Then I've copy-pasted the code from the link into the file IntentIntegrator.java from my package. Following the advices given in eclipse I've created IntentResult class in com.google.zxing.integration.android package. Here I am in this moment. For 2 days I've been reading advices, opinions, I've done started all from the beginning but it didn't work. So I'm trying again. Can anyone tell me please, step by step, how to integrate this app in my own? Or if I am right with what I've done so far, why when I run as Android project on the emulator, I get at least 20 errors, like these for exemple: http://s17.postimage.org/n9w5lddof/errors.png Thank you!
0
11,327,333
07/04/2012 10:33:52
1,382,234
05/08/2012 13:51:13
22
1
Multiple portlets project
Have a question, If i have a severel portlets how to call one of they? For example if i have one portlet that i write his name in `portlet.xml` <portlet-class>ru.my-portlet</portlet-class> And when i want to call it i write like this <form name="form" action="<portlet:actionURL/>" method="post" enctype="multipart/form-data"> <div id="up"> <input id="fileUpload1" type="file" name="filename1"value="Browse..."/> </div> <div> <input id="btnSubmit" type="submit" value="Загрузить"> <input type="button" id="del" onclick="deleting()" value="Удалить"> </div> </form> What i gonna do if i have several portlets?
java
portlet
null
null
null
null
open
Multiple portlets project === Have a question, If i have a severel portlets how to call one of they? For example if i have one portlet that i write his name in `portlet.xml` <portlet-class>ru.my-portlet</portlet-class> And when i want to call it i write like this <form name="form" action="<portlet:actionURL/>" method="post" enctype="multipart/form-data"> <div id="up"> <input id="fileUpload1" type="file" name="filename1"value="Browse..."/> </div> <div> <input id="btnSubmit" type="submit" value="Загрузить"> <input type="button" id="del" onclick="deleting()" value="Удалить"> </div> </form> What i gonna do if i have several portlets?
0
11,326,649
07/04/2012 09:53:10
1,145,630
01/12/2012 13:43:52
1
0
FB.canvs.setAutoGrow() with https on fanpage tab
I've noticed that since this morning (maybe since yesterday night), the function FB.canvas.setAutoGrow didn't work anymore on a fanpage tab when i'm connected with https protocol. Is it a facebook bug which will be solved soon ?
https
facebook-javascript-sdk
null
null
null
null
open
FB.canvs.setAutoGrow() with https on fanpage tab === I've noticed that since this morning (maybe since yesterday night), the function FB.canvas.setAutoGrow didn't work anymore on a fanpage tab when i'm connected with https protocol. Is it a facebook bug which will be solved soon ?
0
11,327,346
07/04/2012 10:34:36
631,803
02/24/2011 06:46:03
76
3
Gmail/Google credentials to login in my android application?
I want overcome the procedure of registering the user first and then he can use his credentials to login into an app. I want to create an app in which i can use any Google/Gmail username and password to login into the application. Can any help me out in this? Thanks in advance
android
authentication
google
gmail
null
null
open
Gmail/Google credentials to login in my android application? === I want overcome the procedure of registering the user first and then he can use his credentials to login into an app. I want to create an app in which i can use any Google/Gmail username and password to login into the application. Can any help me out in this? Thanks in advance
0
11,327,342
07/04/2012 10:34:31
1,501,240
07/04/2012 10:05:54
1
0
How to create agree tooltip
I have some links for download. When i click on the link open tooltip with agree text (I Agree) when user check the checkbox download link show up you can see the example on this link [example][1] but i need to work this tooltip on every new links i add on my website. Now it works only on one link. Thank you! [1]: http://jsfiddle.net/2HR7p/
jquery
tooltip
null
null
null
null
open
How to create agree tooltip === I have some links for download. When i click on the link open tooltip with agree text (I Agree) when user check the checkbox download link show up you can see the example on this link [example][1] but i need to work this tooltip on every new links i add on my website. Now it works only on one link. Thank you! [1]: http://jsfiddle.net/2HR7p/
0
11,327,290
07/04/2012 10:30:45
1,235,370
02/27/2012 10:41:29
293
55
Javascript failing on staging environment (jQuery slider)
Hi there as for a project I run a staging environment. I have been busy with a jQuery slider (easySlider 1.7) and I have been running into some strange behaviour in my development environment (creating double html instances of next button and numerics) after a while I figured out I had included the easySlider.js 2 times. so now this is fixed on development! but after I push it to my Staging environment it still contains double instances? I have tried the following: <br /> overwrite the staging.rb settings to development to see if this is were the issue is.<br /> clear my browser cache and clear server cache. any idea on how I could sync my development to staging properly?
javascript
jquery
ruby-on-rails
ruby-on-rails-3
null
null
open
Javascript failing on staging environment (jQuery slider) === Hi there as for a project I run a staging environment. I have been busy with a jQuery slider (easySlider 1.7) and I have been running into some strange behaviour in my development environment (creating double html instances of next button and numerics) after a while I figured out I had included the easySlider.js 2 times. so now this is fixed on development! but after I push it to my Staging environment it still contains double instances? I have tried the following: <br /> overwrite the staging.rb settings to development to see if this is were the issue is.<br /> clear my browser cache and clear server cache. any idea on how I could sync my development to staging properly?
0
11,298,094
07/02/2012 17:06:17
879,592
08/04/2011 22:44:28
68
0
NSFetchedResultsController is blank while fetching from NSManagedObjectContext with NSPrivateQueueConcurrencyType
I am using UIDocument to access core data and trying to setup NSFetchedResultsController in a background thread not to block main UI. It works if i use the uidocument's managedobjectcontext but not the child. I took some of this code from one of the answers here at stack overflow but are not able to make it work with fetchedresultscontroller. [ZH peopleDocumentusingBlock:^(UIManagedDocument *peopleDoc){ NSManagedObjectContext *context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; context.parentContext = peopleDoc.managedObjectContext; [context performBlock:^{ NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Person"]; request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"key" ascending:YES]]; [NSFetchedResultsController deleteCacheWithName:nil]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"imageurl.length>0"]; request.predicate = predicate; NSError *error = nil; if(!self.totalNumberOfPeople) //set total number of people for this fetch used for show more records { self.totalNumberOfPeople = [context countForFetchRequest:request error:&error]; NSLog(@"total number of people -> %d",self.totalNumberOfPeople); } self.fetchedResultsController = [[NSFetchedResultsController alloc]initWithFetchRequest:request managedObjectContext:context sectionNameKeyPath:nil cacheName:@"peopleCache"]; dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate refreshPeoplelTableview]; NSLog(@"fetched objects -> %d",[self.fetchedResultsController.fetchedObjects count]); NSLog(@"total number of people -> %d",self.totalNumberOfPeople); }); }]; }]; Actually `context countforfetchrequest` does but not fetcheresultscontroller. Thanks in advance!
objective-c
ios
core-data
null
null
null
open
NSFetchedResultsController is blank while fetching from NSManagedObjectContext with NSPrivateQueueConcurrencyType === I am using UIDocument to access core data and trying to setup NSFetchedResultsController in a background thread not to block main UI. It works if i use the uidocument's managedobjectcontext but not the child. I took some of this code from one of the answers here at stack overflow but are not able to make it work with fetchedresultscontroller. [ZH peopleDocumentusingBlock:^(UIManagedDocument *peopleDoc){ NSManagedObjectContext *context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; context.parentContext = peopleDoc.managedObjectContext; [context performBlock:^{ NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Person"]; request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"key" ascending:YES]]; [NSFetchedResultsController deleteCacheWithName:nil]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"imageurl.length>0"]; request.predicate = predicate; NSError *error = nil; if(!self.totalNumberOfPeople) //set total number of people for this fetch used for show more records { self.totalNumberOfPeople = [context countForFetchRequest:request error:&error]; NSLog(@"total number of people -> %d",self.totalNumberOfPeople); } self.fetchedResultsController = [[NSFetchedResultsController alloc]initWithFetchRequest:request managedObjectContext:context sectionNameKeyPath:nil cacheName:@"peopleCache"]; dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate refreshPeoplelTableview]; NSLog(@"fetched objects -> %d",[self.fetchedResultsController.fetchedObjects count]); NSLog(@"total number of people -> %d",self.totalNumberOfPeople); }); }]; }]; Actually `context countforfetchrequest` does but not fetcheresultscontroller. Thanks in advance!
0
11,297,880
07/02/2012 16:49:10
383,283
07/04/2010 22:55:56
85
5
Use READ BINARY to read more than 256 bytes
I am trying to read a smartcard([German Gesundheitskarte][3]) using javax.smartcardio In the [definition][2] of the EF "PD" its length is specified as 850 bytes. The content should be a gzipped ISO5589-15 encoded XML string as specified [here][5] As CommandAPDU I send 00 B0 00 00 00 to get the first 256 bytes. After sending 00 B0 00 FF 00 I get the next 256 bytes. But how do I get the rest? How will I know when the binary data ends? [German Specification Part 1][4] | [German Specification Part 2][1] [1]: http://www.gematik.de/cms/media/dokumente/release_0_5_3/release_0_5_3_egk/gematik_eGK_Spezifikation_Teil2_V2_2_0.pdf [2]:http://imgur.com/b54eq [3]:http://de.wikipedia.org/wiki/Elektronische_Gesundheitskarte [4]:http://www.gematik.de/cms/media/dokumente/release_0_5_3/release_0_5_3_egk/gematik_eGK_Spezifikation_Teil1_V2_2_0.pdf [5]:http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx#chap6_1
java
smartcard
null
null
null
null
open
Use READ BINARY to read more than 256 bytes === I am trying to read a smartcard([German Gesundheitskarte][3]) using javax.smartcardio In the [definition][2] of the EF "PD" its length is specified as 850 bytes. The content should be a gzipped ISO5589-15 encoded XML string as specified [here][5] As CommandAPDU I send 00 B0 00 00 00 to get the first 256 bytes. After sending 00 B0 00 FF 00 I get the next 256 bytes. But how do I get the rest? How will I know when the binary data ends? [German Specification Part 1][4] | [German Specification Part 2][1] [1]: http://www.gematik.de/cms/media/dokumente/release_0_5_3/release_0_5_3_egk/gematik_eGK_Spezifikation_Teil2_V2_2_0.pdf [2]:http://imgur.com/b54eq [3]:http://de.wikipedia.org/wiki/Elektronische_Gesundheitskarte [4]:http://www.gematik.de/cms/media/dokumente/release_0_5_3/release_0_5_3_egk/gematik_eGK_Spezifikation_Teil1_V2_2_0.pdf [5]:http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx#chap6_1
0
11,268,633
06/29/2012 20:36:45
866,450
07/27/2011 23:16:08
323
25
Converting current role based procedural php site to MVC and ACL
I currently have a project where a procedural PHP site with an odd role based setup needs to be rewritten in MVC (probably codeigniter as I am new to MVC) and I can't quite get my head around the best way to proceed. The current site uses sort of a front controller that checks the security level for the logged in user in the db, and builds the pages based on a directory structure that mirrors the security levels. i.e. Dir structure: root -admin (sees everything and everyone elses subordinates) -- Reports listing managers, and their users -- CRUD for managers and their reports -- CRUD for users and their reports (types listed below) -manager (has users as subordinates, and can see all data related to them) -- Reports listing the manager's users -- CRUD for users and their reports (types listed below) -user (Can only see their own information) -- Reports listing the users information (lists, calendars, calls, etc.) -- CRUD for users reports (types listed above) db user table psuedo 1 = admin 2 = manager 3 = user UserAccountTable id pass user email security level (1,2,3) manager Table manager ID User Account ID other fields containing personal info user Info Table user Info id User Account ID Manager ID other fields containing personal info front controller pseudo load header load menu determine level from db if 1 load requested file from admin folder if 2 load requested file from manager folder if 3 load requested file from user folder load footer Main Question: Are there any inherent issues in the current design that stand out (let me know if you need more specifics on current structure in order to answer)? Given the structure above for the current site, what would be a solid approach for redesigning security using the current top down type of security (1 sees 2 and 3, 2 sees 3, 3 sees only 3) in an MVC structure, and is it possible with minimal changes to the db? I'm not looking for code (although if anyone knows of something like this that I can look at to glean some understanding, that would be helpful), but more of a conceptual understanding of the process.
php
security
mvc
codeigniter
null
null
open
Converting current role based procedural php site to MVC and ACL === I currently have a project where a procedural PHP site with an odd role based setup needs to be rewritten in MVC (probably codeigniter as I am new to MVC) and I can't quite get my head around the best way to proceed. The current site uses sort of a front controller that checks the security level for the logged in user in the db, and builds the pages based on a directory structure that mirrors the security levels. i.e. Dir structure: root -admin (sees everything and everyone elses subordinates) -- Reports listing managers, and their users -- CRUD for managers and their reports -- CRUD for users and their reports (types listed below) -manager (has users as subordinates, and can see all data related to them) -- Reports listing the manager's users -- CRUD for users and their reports (types listed below) -user (Can only see their own information) -- Reports listing the users information (lists, calendars, calls, etc.) -- CRUD for users reports (types listed above) db user table psuedo 1 = admin 2 = manager 3 = user UserAccountTable id pass user email security level (1,2,3) manager Table manager ID User Account ID other fields containing personal info user Info Table user Info id User Account ID Manager ID other fields containing personal info front controller pseudo load header load menu determine level from db if 1 load requested file from admin folder if 2 load requested file from manager folder if 3 load requested file from user folder load footer Main Question: Are there any inherent issues in the current design that stand out (let me know if you need more specifics on current structure in order to answer)? Given the structure above for the current site, what would be a solid approach for redesigning security using the current top down type of security (1 sees 2 and 3, 2 sees 3, 3 sees only 3) in an MVC structure, and is it possible with minimal changes to the db? I'm not looking for code (although if anyone knows of something like this that I can look at to glean some understanding, that would be helpful), but more of a conceptual understanding of the process.
0
11,298,100
07/02/2012 17:07:10
1,496,658
07/02/2012 16:47:33
1
0
how i can run some part of a program in cpu and some parts in gpu?
I want to write a program that some of the codes run in cpu and some of that in run in gpu. i want to use opencl.it is possible to do it if yes how i can do that?an i want to use visual studio.
visual-c++
opencl
null
null
null
null
open
how i can run some part of a program in cpu and some parts in gpu? === I want to write a program that some of the codes run in cpu and some of that in run in gpu. i want to use opencl.it is possible to do it if yes how i can do that?an i want to use visual studio.
0
11,298,101
07/02/2012 17:07:18
1,057,785
11/21/2011 12:31:14
34
1
error in parsing apache access logs using regex with JAVA containing double quote
I am trying to parse apache access logs using following regular expression logPattern = "^([\\d.]+) (\\S+) (\\S+) \\[([\\w:/]+\\s[+\\-]\\d{4})\\] \"(.+?)\" (\\d{3}) (\\d+) \"([^\"]+)\" \"([^\"]+)\""; This regular expression is working fine with normal log entry but if there are any double quotes in user-agents field then matching fails. Can you suggest how can I solve this problem? Or can you suggest me efficient and batter way of parsing Apache access logs?
regex
apache
http
logging
null
null
open
error in parsing apache access logs using regex with JAVA containing double quote === I am trying to parse apache access logs using following regular expression logPattern = "^([\\d.]+) (\\S+) (\\S+) \\[([\\w:/]+\\s[+\\-]\\d{4})\\] \"(.+?)\" (\\d{3}) (\\d+) \"([^\"]+)\" \"([^\"]+)\""; This regular expression is working fine with normal log entry but if there are any double quotes in user-agents field then matching fails. Can you suggest how can I solve this problem? Or can you suggest me efficient and batter way of parsing Apache access logs?
0