PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
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
47
30.1k
OpenStatus_id
int64
0
4
11,630,166
07/24/2012 11:44:53
960,761
09/23/2011 09:01:30
71
5
Button action is not called on UIViewController added on Paging
I'm making one application in which I had added four class on childView [self addChildViewController:homeScreenViewController]; [self addChildViewController:portFolioViewController]; [self addChildViewController:watchListViewController]; [self addChildViewController:marketingViewController]; Than I call the childView on pageControl as paging. Now on the homeScreenViewController Class I have added a button but the button do not take any action. Please suggest me.
xcode
uiviewcontroller
paging
null
null
null
open
Button action is not called on UIViewController added on Paging === I'm making one application in which I had added four class on childView [self addChildViewController:homeScreenViewController]; [self addChildViewController:portFolioViewController]; [self addChildViewController:watchListViewController]; [self addChildViewController:marketingViewController]; Than I call the childView on pageControl as paging. Now on the homeScreenViewController Class I have added a button but the button do not take any action. Please suggest me.
0
11,525,978
07/17/2012 15:37:30
1,385,462
05/09/2012 19:14:17
20
0
Opening an automated list in notepad (VBA / Excel)
I have a script that goes and grabs all of the documents from a certain folder and lists all of the files in that folder. It then goes and makes a link to open these files from inside of Excel. I was wondering if there was a way to put it in a shell so that the files only opened in notepad. The code that I am using right now is: Sub MakeLink(ByVal cell As Range, ByVal url As String, ByVal txt As String, ByVal tooltip_text As String) ActiveSheet.Hyperlinks.Add _ Anchor:=cell, _ Address:=url, _ ScreenTip:=tooltip_text, _ TextToDisplay:=txt End Sub Sub Portfolios() Range("A1:Z200").Clear Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Dim ws As Worksheet Range("A3").Font.Bold = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set ws = Worksheets("Library") 'Get the folder object associated with the directory Set objFolder = objFSO.GetFolder("C:\Portfolios") ws.Cells(3, 1).Value = "The files found in " & objFolder.Name & " are:" 'Loop through the Files collection For Each objFile In objFolder.Files 'ws.Cells(ws.UsedRange.Rows.Count + 3, 2).Value = objFile.Name MakeLink ws.Cells(ws.UsedRange.Rows.Count + 3, 2), objFile, objFile.Name, objFile.Name Next 'Clean up! Set objFolder = Nothing Set objFile = Nothing Set objFSO = Nothing End Sub I know I have to do something along the lines of `MakeLink = Shell("C:\WINDOWS\notepad.exe", 1)` but I seem to be hitting a bit of a snag as to where this will fit. Thanks, F
excel
vba
excel-vba
hyperlink
null
null
open
Opening an automated list in notepad (VBA / Excel) === I have a script that goes and grabs all of the documents from a certain folder and lists all of the files in that folder. It then goes and makes a link to open these files from inside of Excel. I was wondering if there was a way to put it in a shell so that the files only opened in notepad. The code that I am using right now is: Sub MakeLink(ByVal cell As Range, ByVal url As String, ByVal txt As String, ByVal tooltip_text As String) ActiveSheet.Hyperlinks.Add _ Anchor:=cell, _ Address:=url, _ ScreenTip:=tooltip_text, _ TextToDisplay:=txt End Sub Sub Portfolios() Range("A1:Z200").Clear Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Dim ws As Worksheet Range("A3").Font.Bold = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set ws = Worksheets("Library") 'Get the folder object associated with the directory Set objFolder = objFSO.GetFolder("C:\Portfolios") ws.Cells(3, 1).Value = "The files found in " & objFolder.Name & " are:" 'Loop through the Files collection For Each objFile In objFolder.Files 'ws.Cells(ws.UsedRange.Rows.Count + 3, 2).Value = objFile.Name MakeLink ws.Cells(ws.UsedRange.Rows.Count + 3, 2), objFile, objFile.Name, objFile.Name Next 'Clean up! Set objFolder = Nothing Set objFile = Nothing Set objFSO = Nothing End Sub I know I have to do something along the lines of `MakeLink = Shell("C:\WINDOWS\notepad.exe", 1)` but I seem to be hitting a bit of a snag as to where this will fit. Thanks, F
0
7,947,078
10/30/2011 19:04:08
627,473
03/01/2010 16:37:51
1,412
34
git tag delete and re-add
On git hub I re-added the tag by doing: git tag -d 12.15 git push origin :refs/tags/12.15 git tag -a 12.15 -m '12.15' git push --tags The tag is still referring to the old tag on github, but locally it is done right.
git
null
null
null
null
06/24/2012 02:35:26
not a real question
git tag delete and re-add === On git hub I re-added the tag by doing: git tag -d 12.15 git push origin :refs/tags/12.15 git tag -a 12.15 -m '12.15' git push --tags The tag is still referring to the old tag on github, but locally it is done right.
1
5,702,372
04/18/2011 11:49:11
687,261
04/01/2011 08:54:39
8
0
Make application With timers etc.?
I need to make an application as followed. A query needs to be executed 10 times a second to check in the database (Ms SQL 2005) if the value of the field is 1 or 0. if its 1 then the appication needs to start Windows Media Player (Fullscreen) and run a video. The application needs to sleep during the video and when the video is finished the application needs to awake and close Windows Media Player and open Internet Explorer(fullscreen) and show a website. I have no idea how to make this im not that experienced with Delphi.
delphi
delphi-2007
null
null
null
04/19/2011 19:05:36
not a real question
Make application With timers etc.? === I need to make an application as followed. A query needs to be executed 10 times a second to check in the database (Ms SQL 2005) if the value of the field is 1 or 0. if its 1 then the appication needs to start Windows Media Player (Fullscreen) and run a video. The application needs to sleep during the video and when the video is finished the application needs to awake and close Windows Media Player and open Internet Explorer(fullscreen) and show a website. I have no idea how to make this im not that experienced with Delphi.
1
729,912
04/08/2009 13:08:50
86,388
04/02/2009 19:47:19
90
5
Standart delegates in C#
There are some Delegates predefined in C# I know these: EventHandler // Default event callbacks EventHandler<T> // Default event callbacks with custom parameter (inheriting from EventArgs) Action // Function without return value and without parameter Action<T> // Function without return value and one parameter Func<T> // Methos without parameters and one result type There are many more for special cases and generated form parts of the framework, but these are often good to use in self written code. If you know some more useful add them. Otherwise this is answered.
c#
delegates
list
null
null
01/02/2012 01:48:50
not a real question
Standart delegates in C# === There are some Delegates predefined in C# I know these: EventHandler // Default event callbacks EventHandler<T> // Default event callbacks with custom parameter (inheriting from EventArgs) Action // Function without return value and without parameter Action<T> // Function without return value and one parameter Func<T> // Methos without parameters and one result type There are many more for special cases and generated form parts of the framework, but these are often good to use in self written code. If you know some more useful add them. Otherwise this is answered.
1
7,152,358
08/22/2011 19:13:48
577,979
01/17/2011 02:06:29
111
10
Login in two website at the same time
I've created 2 website. Both website have their own database. but there is a user table in both website that have exactly the same values. What I want to do is make something that can help when one of the user logged-in in website one it automatically login to website tow as well. Honesty I don't even know how to do it. I've tried to use extra page and login with session and javascript trick but most of the time its not working specially in IE. By the way i'm using classic ASP and SQL 2008. Any Idea?
sql-server-2008
asp
null
null
null
null
open
Login in two website at the same time === I've created 2 website. Both website have their own database. but there is a user table in both website that have exactly the same values. What I want to do is make something that can help when one of the user logged-in in website one it automatically login to website tow as well. Honesty I don't even know how to do it. I've tried to use extra page and login with session and javascript trick but most of the time its not working specially in IE. By the way i'm using classic ASP and SQL 2008. Any Idea?
0
9,278,738
02/14/2012 14:37:16
227,545
12/08/2009 22:41:37
499
44
db like ms access for php
As you know ASP can use MS Access. It is useful for small websites. It reduces time and money. Is there an alternative to MySQL that I can use like ms access for PHP? What I want is to use db as a file as ms access do. Any opinion?
php
mysql
ms-access
null
null
null
open
db like ms access for php === As you know ASP can use MS Access. It is useful for small websites. It reduces time and money. Is there an alternative to MySQL that I can use like ms access for PHP? What I want is to use db as a file as ms access do. Any opinion?
0
6,881,500
07/30/2011 06:16:58
841,342
07/12/2011 18:33:19
15
0
python stop selenium standalone server
How would I stop the selenium-server-standalone. I know you can start it by `java -jar selenium-server-standalone.jar` But how would you stop it? Also, is there a simple way to script it in python to start and stop it as I am running tests.I feel like this is pretty simple. But am unable to find the answer to my question.
python
selenium
stop
start
standalone
null
open
python stop selenium standalone server === How would I stop the selenium-server-standalone. I know you can start it by `java -jar selenium-server-standalone.jar` But how would you stop it? Also, is there a simple way to script it in python to start and stop it as I am running tests.I feel like this is pretty simple. But am unable to find the answer to my question.
0
8,424,994
12/08/2011 01:20:18
815,052
06/25/2011 05:49:06
1
0
WPF DataGrid - highlight new rows when inserted into datagrid
I have a datagrid bound to an ObservableCollection, and what I'd like to do is highlight new rows when they are added to the datagrid (i.e. when a new object is inserted into the ObservableCollection). I'd like to highlight the rows when they are inserted by changing the background colour initially, but then having the colour fade back to normal over time. I've tried a variety of different methods to get it to work but nothing quite works properly. Method 1: I have an event trigger that fires when the column loads. It does fire when the element loads, but it seems to fire almost randomly on other old rows as well (rows on which it already fired once when the row was new). <DataGridHyperlinkColumn x:Name="OrderID" Binding="{Binding OrderNumber}" Header="Order" SortMemberPath="ciOrderId"> <DataGridHyperlinkColumn.ElementStyle> <Style TargetType="TextBlock"> <Setter Property="Background" Value="Transparent"/> <EventSetter Event="Hyperlink.Click" Handler="OrderNumber_Click" /> <Style.Triggers> <EventTrigger RoutedEvent="Loaded"> <BeginStoryboard> <Storyboard> <ColorAnimation Storyboard.TargetProperty="(TextBlock.Background).(SolidColorBrush.Color)" Duration="00:00:03" From="Red" To="Transparent" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Style.Triggers> </Style> </DataGridHyperlinkColumn.ElementStyle> </DataGridHyperlinkColumn> Method 2: I made a bool in the view model that is set to true when the new item is added to the ObservableCollection. I then check this value in a trigger and if it is true I fire the storyboard. I can't get this to work properly though, and the application keeps erroring out when I run it. Also, I can't figure out a way to set this value to false once the storyboard has run (I can't use the storyboard's Completed event because the DataTrigger is in a style). <DataTrigger Binding="{Binding isNew}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> <ColorAnimation Storyboard.TargetProperty="(TextBlock.Background).(SolidColorBrush.Color)" Duration="00:00:03" From="Red" To="{x:Null}" FillBehavior="Stop"/> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> Method 3: I tried setting a timestamp field in the view model when the new item is added to the observable collection. Then in XAML I want to be able to compare that timestamp to the current time, and if it matches then I will fire the event. I even have another field that contains the current time and is automatically updated by INotifyPropertyChanged, but I can't seem to figure out a way to compare the timestamp of the new row to the field containing the current time. I feel like there must be a solution to this, but after spending a frustrating day trying to figure it out I'm hoping someone out there will be able to shed some light.
triggers
wpfdatagrid
storyboard
coloranimation
null
null
open
WPF DataGrid - highlight new rows when inserted into datagrid === I have a datagrid bound to an ObservableCollection, and what I'd like to do is highlight new rows when they are added to the datagrid (i.e. when a new object is inserted into the ObservableCollection). I'd like to highlight the rows when they are inserted by changing the background colour initially, but then having the colour fade back to normal over time. I've tried a variety of different methods to get it to work but nothing quite works properly. Method 1: I have an event trigger that fires when the column loads. It does fire when the element loads, but it seems to fire almost randomly on other old rows as well (rows on which it already fired once when the row was new). <DataGridHyperlinkColumn x:Name="OrderID" Binding="{Binding OrderNumber}" Header="Order" SortMemberPath="ciOrderId"> <DataGridHyperlinkColumn.ElementStyle> <Style TargetType="TextBlock"> <Setter Property="Background" Value="Transparent"/> <EventSetter Event="Hyperlink.Click" Handler="OrderNumber_Click" /> <Style.Triggers> <EventTrigger RoutedEvent="Loaded"> <BeginStoryboard> <Storyboard> <ColorAnimation Storyboard.TargetProperty="(TextBlock.Background).(SolidColorBrush.Color)" Duration="00:00:03" From="Red" To="Transparent" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Style.Triggers> </Style> </DataGridHyperlinkColumn.ElementStyle> </DataGridHyperlinkColumn> Method 2: I made a bool in the view model that is set to true when the new item is added to the ObservableCollection. I then check this value in a trigger and if it is true I fire the storyboard. I can't get this to work properly though, and the application keeps erroring out when I run it. Also, I can't figure out a way to set this value to false once the storyboard has run (I can't use the storyboard's Completed event because the DataTrigger is in a style). <DataTrigger Binding="{Binding isNew}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> <ColorAnimation Storyboard.TargetProperty="(TextBlock.Background).(SolidColorBrush.Color)" Duration="00:00:03" From="Red" To="{x:Null}" FillBehavior="Stop"/> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> Method 3: I tried setting a timestamp field in the view model when the new item is added to the observable collection. Then in XAML I want to be able to compare that timestamp to the current time, and if it matches then I will fire the event. I even have another field that contains the current time and is automatically updated by INotifyPropertyChanged, but I can't seem to figure out a way to compare the timestamp of the new row to the field containing the current time. I feel like there must be a solution to this, but after spending a frustrating day trying to figure it out I'm hoping someone out there will be able to shed some light.
0
10,354,375
04/27/2012 16:24:00
1,361,550
04/27/2012 16:10:24
1
0
How do i use Libfacerec library and Opencv
So i recently came across a library for face recognition and gender recognition called libfacerec https://github.com/bytefish/libfacerec Since i'm new to OpenCV and libfacerec, i wanted to know how would i integrate the two so that i can use a webcam to detect gender of the person in frame? I am able to compile the demo code here http://bytefish.de/dev/libfacerec/api/example/example_gender_classification.html But where i'm stuck is how do i move forward from here? how do i connect this to a camera source to compare against whats been trained. Thanks.
c++
opencv
null
null
null
04/30/2012 15:25:11
not constructive
How do i use Libfacerec library and Opencv === So i recently came across a library for face recognition and gender recognition called libfacerec https://github.com/bytefish/libfacerec Since i'm new to OpenCV and libfacerec, i wanted to know how would i integrate the two so that i can use a webcam to detect gender of the person in frame? I am able to compile the demo code here http://bytefish.de/dev/libfacerec/api/example/example_gender_classification.html But where i'm stuck is how do i move forward from here? how do i connect this to a camera source to compare against whats been trained. Thanks.
4
10,670,038
05/20/2012 01:12:02
784,637
06/05/2011 10:22:07
1,156
5
How to combine a a SELECT query and a COUNT(*) query?
I have the following query SELECT c.cd, c.c_id FROM f f INNER JOIN s s ON s.s_id = f.s_id INNER JOIN c c ON c.c_id = s.c_id WHERE f.m_id =2 AND f.deleted='no' GROUP BY s.c_id ORDER BY f.update_datetime DESC; Which returns a sample result set: c.cd c.c_id moot 4 derp 5 I have another query based on the `c.c_id` of the above result set which iterates for each record in the above result set: SELECT COUNT(*) as totals FROM s WHERE c_id =? AND status='good'; returns `7` when `c_id=4` and returns `20` when `c_id=5` Is there any way I can combine the two queries to form a result set like this? c.cd c.c_id totals moot 4 7 derp 5 20
mysql
sql
null
null
null
null
open
How to combine a a SELECT query and a COUNT(*) query? === I have the following query SELECT c.cd, c.c_id FROM f f INNER JOIN s s ON s.s_id = f.s_id INNER JOIN c c ON c.c_id = s.c_id WHERE f.m_id =2 AND f.deleted='no' GROUP BY s.c_id ORDER BY f.update_datetime DESC; Which returns a sample result set: c.cd c.c_id moot 4 derp 5 I have another query based on the `c.c_id` of the above result set which iterates for each record in the above result set: SELECT COUNT(*) as totals FROM s WHERE c_id =? AND status='good'; returns `7` when `c_id=4` and returns `20` when `c_id=5` Is there any way I can combine the two queries to form a result set like this? c.cd c.c_id totals moot 4 7 derp 5 20
0
10,202,931
04/18/2012 04:47:04
205,270
11/06/2009 21:48:53
4,598
275
Haml::SyntaxError - Illegal nesting: content can't be both given on the same line as %a and nested within it
I'm using "Button dropdowns" from Twitter Bootstrap with HAML. In the Bootstrap docs I have found the example: <div class="btn-group"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> Action <span class="caret"></span> </a> <ul class="dropdown-menu"> <!-- dropdown menu links --> </ul> </div> I have tried rewrite it using HAML: %div{:class => 'btn-group task_controller'} %a{:class => 'btn-mini dropdown-toggle', "data-toggle" => 'dropdown', :href => '#'} Action %span{:class => 'caret'} %ul{:class => 'dropdown-menu'} %a{:class => 'close_task', :name => task.name, :href => '#' } Close But got the error message: Haml::SyntaxError - Illegal nesting: content can't be both given on the same line as %a and nested within it. So Bootstrap said me put the <span> element inside <a>-tag, but HAML didn't allow to do it. How can I fix the problem?
haml
twitter-bootstrap
bootstrap
null
null
null
open
Haml::SyntaxError - Illegal nesting: content can't be both given on the same line as %a and nested within it === I'm using "Button dropdowns" from Twitter Bootstrap with HAML. In the Bootstrap docs I have found the example: <div class="btn-group"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> Action <span class="caret"></span> </a> <ul class="dropdown-menu"> <!-- dropdown menu links --> </ul> </div> I have tried rewrite it using HAML: %div{:class => 'btn-group task_controller'} %a{:class => 'btn-mini dropdown-toggle', "data-toggle" => 'dropdown', :href => '#'} Action %span{:class => 'caret'} %ul{:class => 'dropdown-menu'} %a{:class => 'close_task', :name => task.name, :href => '#' } Close But got the error message: Haml::SyntaxError - Illegal nesting: content can't be both given on the same line as %a and nested within it. So Bootstrap said me put the <span> element inside <a>-tag, but HAML didn't allow to do it. How can I fix the problem?
0
10,488,603
05/07/2012 20:24:52
547,239
12/18/2010 20:18:40
26
0
Boost Multithread incompatible with Managed C++
I have heard that Boost Threads are incompatible with Managed C++ code.. I mean in any Unmanaged C++ project, if I am using Boost Libraries, then i can't use Managed C++ library in the same project. Is that true, I tried to google it but could not verify it. If it is true, is there any solution of it ? Thanks -Pankaj
c++
boost
managed
null
null
05/08/2012 08:41:36
not constructive
Boost Multithread incompatible with Managed C++ === I have heard that Boost Threads are incompatible with Managed C++ code.. I mean in any Unmanaged C++ project, if I am using Boost Libraries, then i can't use Managed C++ library in the same project. Is that true, I tried to google it but could not verify it. If it is true, is there any solution of it ? Thanks -Pankaj
4
10,768,292
05/26/2012 17:14:47
1,245,593
03/02/2012 16:59:29
71
3
Android Publishing taking a long time
I've published my Android app over two hours ago and it's still not published, my other App was published within a hour. Does anyone know why this is the case?
android
publish
null
null
null
05/27/2012 02:56:03
off topic
Android Publishing taking a long time === I've published my Android app over two hours ago and it's still not published, my other App was published within a hour. Does anyone know why this is the case?
2
11,249,465
06/28/2012 16:57:17
1,403,568
05/18/2012 14:11:27
34
0
include js in django
`script type="text/javascript" src="/static/js/functions.js">` This shit won't include itself in django template. Any ideas how can I set my settings.py to make it work correctly ?
django
null
null
null
null
06/28/2012 19:01:57
not constructive
include js in django === `script type="text/javascript" src="/static/js/functions.js">` This shit won't include itself in django template. Any ideas how can I set my settings.py to make it work correctly ?
4
5,619,273
04/11/2011 09:26:22
559,026
12/31/2010 06:04:07
338
41
Connection URl for SQLExpress database using Hibernate
I am using `jtds` drivers to connect to SQL Server on local using Hibernate I can conect to server using server name: COMP6\SQLEXPRESS Below is my connection properties in hibernate.cfg <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:jtds:sqlserver://COMP6\\SQLEXPRESS/ipms_m1_new_final_1apr</property> <property name="hibernate.connection.username">sa</property> <property name="hibernate.connection.password">xxxx</property> Whole stacktrace java.sql.SQLException: Unknown server host name 'COMP6\\SQLEXPRESS'. at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:401) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:154) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at com.nextenders.facadeimplementation.hibernate.util.HibernateFactory.configureSessionFactory(HibernateFactory.java:103) at com.nextenders.facadeimplementation.hibernate.util.HibernateFactory.buildIfNeeded(HibernateFactory.java:40) at com.nextenders.facadeimplementation.model.dao.AbstractDao.<init>(AbstractDao.java:19) at com.nextenders.facadeimplementation.model.dao.domain.common.ConfigurationDao.<init>(ConfigurationDao.java:28) at com.nextenders.facadeimplementation.facade.domain.common.ConfigurationFacade.getConfigurationList(ConfigurationFacade.java:83) at com.nextenders.server.businessdelegates.domain.common.ConfigurationBusinessDelegate.getConfigurationList(ConfigurationBusinessDelegate.java:45) at com.nextenders.server.actions.common.ContextListener.contextInitialized(ContextListener.java:60) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:447) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:222) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:543) at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:421) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1035) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783) at com.google.gwt.dev.DevMode.main(DevMode.java:275) Caused by: java.net.UnknownHostException: COMP6\\SQLEXPRESS at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:307) at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:257) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:311)
hibernate
sql-server-express
jtds
null
null
null
open
Connection URl for SQLExpress database using Hibernate === I am using `jtds` drivers to connect to SQL Server on local using Hibernate I can conect to server using server name: COMP6\SQLEXPRESS Below is my connection properties in hibernate.cfg <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:jtds:sqlserver://COMP6\\SQLEXPRESS/ipms_m1_new_final_1apr</property> <property name="hibernate.connection.username">sa</property> <property name="hibernate.connection.password">xxxx</property> Whole stacktrace java.sql.SQLException: Unknown server host name 'COMP6\\SQLEXPRESS'. at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:401) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:154) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at com.nextenders.facadeimplementation.hibernate.util.HibernateFactory.configureSessionFactory(HibernateFactory.java:103) at com.nextenders.facadeimplementation.hibernate.util.HibernateFactory.buildIfNeeded(HibernateFactory.java:40) at com.nextenders.facadeimplementation.model.dao.AbstractDao.<init>(AbstractDao.java:19) at com.nextenders.facadeimplementation.model.dao.domain.common.ConfigurationDao.<init>(ConfigurationDao.java:28) at com.nextenders.facadeimplementation.facade.domain.common.ConfigurationFacade.getConfigurationList(ConfigurationFacade.java:83) at com.nextenders.server.businessdelegates.domain.common.ConfigurationBusinessDelegate.getConfigurationList(ConfigurationBusinessDelegate.java:45) at com.nextenders.server.actions.common.ContextListener.contextInitialized(ContextListener.java:60) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:447) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:222) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:543) at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:421) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1035) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783) at com.google.gwt.dev.DevMode.main(DevMode.java:275) Caused by: java.net.UnknownHostException: COMP6\\SQLEXPRESS at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:307) at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:257) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:311)
0
9,610,168
03/07/2012 22:30:56
1,024,941
11/02/2011 04:35:41
1
0
Unresponsive website
We have a production website running on Windows Server 2003. We use Glassfish 2.1 and the site is written in Java using JSF 1.2. A couple of times per day, the website becomes unreachable. Can anyone suggest how to troubleshoot and determine why the site becomes unresponsive.
java
jsf
glassfish
null
null
03/08/2012 12:17:00
off topic
Unresponsive website === We have a production website running on Windows Server 2003. We use Glassfish 2.1 and the site is written in Java using JSF 1.2. A couple of times per day, the website becomes unreachable. Can anyone suggest how to troubleshoot and determine why the site becomes unresponsive.
2
8,485,501
12/13/2011 07:03:38
1,045,214
11/14/2011 08:39:41
1
0
Hindi font display through LWUIT
I created **Hindi font resource** (Mangal face) through LWUIT. I have developed a small application which displays Hindi font on two components, Label and Text area. (Both components are LWUIT components) It displays properly in Text Area **but not in Label**. It displays as letters separate and Matras separate, not as combined. (ex: क + । = का ). Please give suggestions to my problem. Thanks in advance.
fonts
lwuit-resource-editor
null
null
null
null
open
Hindi font display through LWUIT === I created **Hindi font resource** (Mangal face) through LWUIT. I have developed a small application which displays Hindi font on two components, Label and Text area. (Both components are LWUIT components) It displays properly in Text Area **but not in Label**. It displays as letters separate and Matras separate, not as combined. (ex: क + । = का ). Please give suggestions to my problem. Thanks in advance.
0
294,582
11/16/2008 23:41:58
38,072
11/16/2008 19:57:09
11
1
PHP 5 Reflection API performance
I'm currently considering the use of Reflection classes (ReflectionClass and ReflectionMethod mainly) in my own MVC web framework, because I need to automatically instanciate controller classes and invoke their methods without any required configuration ("convention over configuration" approach). I'm concerned about performance, even though I think that database requests are likely to be bigger bottlenecks than the actual PHP code. So, I'm wondering if anyone has any good or bad experience with PHP 5 Reflection from a performance point of view. Besides, I'd be curious to know if any one of the popular PHP frameworks (CI, Cake, Symfony, etc.) actually use Reflection.
php
reflection
mvc
null
null
null
open
PHP 5 Reflection API performance === I'm currently considering the use of Reflection classes (ReflectionClass and ReflectionMethod mainly) in my own MVC web framework, because I need to automatically instanciate controller classes and invoke their methods without any required configuration ("convention over configuration" approach). I'm concerned about performance, even though I think that database requests are likely to be bigger bottlenecks than the actual PHP code. So, I'm wondering if anyone has any good or bad experience with PHP 5 Reflection from a performance point of view. Besides, I'd be curious to know if any one of the popular PHP frameworks (CI, Cake, Symfony, etc.) actually use Reflection.
0
7,079,282
08/16/2011 13:56:09
284,405
03/02/2010 13:07:17
179
5
Continues to execute MVC-controller after FormsAuthentication.SignOut()
I save all session in the database. Lets imagine that this session was lost in the database, not in the cookies. In OnAuthorization(AuthorizationContext filterContext) I retrieve user object from database base on the session id. if (HttpContext.User.Identity.IsAuthenticated) { //Gets user data from DB. var user = userRepos.GetUser(HttpContext.User.Identity.Name); if (user != null) { CurrentUser = user; Thread.CurrentPrincipal = HttpContext.User = new DibPrincipal(user); return; } else { FormsAuthentication.SignOut(); Session.Abandon(); Response.Redirect(FormsAuthentication.LoginUrl, true); } } } Imagine that user called a controller GetDocuments, but he was redirected to FormsAuthentication.LoginUrl. It works, user is been redirected, but I get en exception which shows an error in GetDocument controller, because CurrentUser does not exist. So .net trying to call GetDocuments even after redirecting. How to avoid this error? Thanks! :)
.net
mvc
session
authentication
controller
null
open
Continues to execute MVC-controller after FormsAuthentication.SignOut() === I save all session in the database. Lets imagine that this session was lost in the database, not in the cookies. In OnAuthorization(AuthorizationContext filterContext) I retrieve user object from database base on the session id. if (HttpContext.User.Identity.IsAuthenticated) { //Gets user data from DB. var user = userRepos.GetUser(HttpContext.User.Identity.Name); if (user != null) { CurrentUser = user; Thread.CurrentPrincipal = HttpContext.User = new DibPrincipal(user); return; } else { FormsAuthentication.SignOut(); Session.Abandon(); Response.Redirect(FormsAuthentication.LoginUrl, true); } } } Imagine that user called a controller GetDocuments, but he was redirected to FormsAuthentication.LoginUrl. It works, user is been redirected, but I get en exception which shows an error in GetDocument controller, because CurrentUser does not exist. So .net trying to call GetDocuments even after redirecting. How to avoid this error? Thanks! :)
0
5,806,715
04/27/2011 15:36:53
727,239
04/27/2011 12:23:53
3
0
sum of cost spent on advertisments on specific magazine (month?, year?)
Here are the tables //sorry for the bad format// ADV_COST -------- PAGE_SIZE MAG_ID COST //SAMPLE DATA ADV_COST// PAGE_SIZE MAG_ID COST -------------------- ---------- ---------- 1/25 PAGE 1 40 1/8 PAGE 1 60 1/6 PAGE 1 65 ... ADS -------- AD_ID ADV_ID PAGE_SIZE MAG_ID START_DATE PURCH_DATE NUM_ISSUES //SAMPLE DATA ADS// AD_ID ADV_ID PAGE_SIZE MAG_ID START_DAT PURCH_DAT NUM_ISSUES ---------- ---------- ---------- ---------- --------- --------- ---------- 1 5 1/4 PAGE 1 01-APR-11 01-MAR-11 4 ... ---------- Here's the question: Whirlpool ADV_ID=6; HOUSES: MAG_ID=1; "How much money did Whirlpool spend in advertising in HOUSES this month?, this year?"
sql
oracle
null
null
null
null
open
sum of cost spent on advertisments on specific magazine (month?, year?) === Here are the tables //sorry for the bad format// ADV_COST -------- PAGE_SIZE MAG_ID COST //SAMPLE DATA ADV_COST// PAGE_SIZE MAG_ID COST -------------------- ---------- ---------- 1/25 PAGE 1 40 1/8 PAGE 1 60 1/6 PAGE 1 65 ... ADS -------- AD_ID ADV_ID PAGE_SIZE MAG_ID START_DATE PURCH_DATE NUM_ISSUES //SAMPLE DATA ADS// AD_ID ADV_ID PAGE_SIZE MAG_ID START_DAT PURCH_DAT NUM_ISSUES ---------- ---------- ---------- ---------- --------- --------- ---------- 1 5 1/4 PAGE 1 01-APR-11 01-MAR-11 4 ... ---------- Here's the question: Whirlpool ADV_ID=6; HOUSES: MAG_ID=1; "How much money did Whirlpool spend in advertising in HOUSES this month?, this year?"
0
2,910,569
05/26/2010 06:32:42
294,045
03/15/2010 15:03:25
0
6
What are collections in .net 4.0
Types of collections in .Net 4.0 .. How to implement ListDictionary in .Net 4.0
c#
null
null
null
null
05/26/2010 06:40:53
not a real question
What are collections in .net 4.0 === Types of collections in .Net 4.0 .. How to implement ListDictionary in .Net 4.0
1
7,766,071
10/14/2011 10:04:08
771,004
05/26/2011 09:12:10
27
0
Value not adding/subtracting correct amount and if/else statement bugs
I have a script that adds elements to a div, rotates them for a set amount of time, then when the amount of time has been met, the rotation stops and a random element within the div is animated. I have a few issues: 1. if you turn the `// alert(maxspeed)` and `//alert(maxcount)` alerts on and click on 'Run' (Edit: Click append all first) to run the script, you will see that values start by adding/subtracting at rates of `0.1` but will lose out on 0.00000001 or so here or there, why is this(Memory issue due to poor coding maybe?)? 2. after clicking on 'Run' (Edit: Click append all first), the images will begin to animate, but why is the animation random at times? When all it should be doing is increasing the `maxspeed` by a value of `0.1` a time 3. Finally; why does it seemingly hit the 'else' stage of my if/else statement before the conditions of 'if' have been met? I'm a newcomer to JS/jQuery so please excuse any poor coding (I followed a tutorial to achieve the rotation effect). Here is my jsFiddle http://jsfiddle.net/pAk9N/9/ and jQuery code below, thanks :) $(document).ready(function(){ //You can edit the following file paths to change images in selection var img1 = '<img src="/img/logo.png">'; var img2 = '<img src="/img/logo.png">'; var img3 = '<img src="/img/logo.png">'; var img4 = '<img src="/img/logo.png">'; var img5 = '<img src="/img/logo.png">'; var img6 = '<img src="/img/logo.png">'; var all = img1 + img2 + img3 + img4 + img5 + img6; //Rotation part 1 var maxspeed = 0.00; var minspeed = 0.01; var stopped = 0.0; var speed = maxspeed; var radius = 100; var count = 0; function rotate() { var centerx = $(document).width()/2; var centery = $(document).height()/2; var num_items = $("#container > img").length; $("#container > img").each(function(){ var angle = count * (Math.PI/180); var newx = centerx + Math.cos(angle)*radius - $(this).width()/2; var newy = centery + Math.sin(angle)*radius - $(this).height()/2; $(this).css("left",newx+"px").css("top",newy+"px"); count += 360/num_items + speed; }); } //Rotation part 2 setInterval(rotate,1000/360); $(document).mousemove(function(e) { var dw = $(document).width(); var dh = $(document).height(); var itemh = $("#container > img").height(); var itemw = $("#container > img").width(); if (e.pageX > dw/2-radius-itemw/2 && e.pageX < dw/2 + radius + itemw/2 && e.pageY > dh/2-radius-itemh/2 && e.pageY < dh/2+radius+itemh/2) { speed = minspeed; } else { speed = maxspeed; } }); //Append elements to container $("#appendall").click(function(){$('#container').append(all);}); $('#append').children().eq(2).click(function(){$('#container').append(img1);}); $('#append').children().eq(3).click(function(){$('#container').append(img2);}); $('#append').children().eq(4).click(function(){$('#container').append(img3);}); $('#append').children().eq(5).click(function(){$('#container').append(img4);}); $('#append').children().eq(6).click(function(){$('#container').append(img5);}); $('#append').children().eq(7).click(function(){$('#container').append(img6);}); //Refresh page $("#reset").click(function(){location.reload();}); //IF speed is greater than 0 - ELSE add animation to div element $("#run").click(function(){ var maxcount = 1.00; var incdec = 0.01; counter() function counter() { if (parseFloat(maxcount) >= 0.00) { maxcount = parseFloat(maxcount) - parseFloat(incdec); maxspeed = parseFloat(maxspeed) + parseFloat(incdec); // alert(maxspeed) //alert(maxcount) setTimeout(counter,40); } else { maxspeed = 0; //Find amount of div elements and add 1 var brewees = $('#container').children().length +=1; //get a random number var rand = (Math.floor(Math.random()*brewees)); var ap = '20px'; var ab = '#ddd'; var ad = 1000; //match random number corrosponding child in div $('#container').children().eq(parseFloat(rand)) .animate({padding: ap, background : ab}, {duration:ad}); } } }); });
javascript
jquery
loops
if-statement
null
null
open
Value not adding/subtracting correct amount and if/else statement bugs === I have a script that adds elements to a div, rotates them for a set amount of time, then when the amount of time has been met, the rotation stops and a random element within the div is animated. I have a few issues: 1. if you turn the `// alert(maxspeed)` and `//alert(maxcount)` alerts on and click on 'Run' (Edit: Click append all first) to run the script, you will see that values start by adding/subtracting at rates of `0.1` but will lose out on 0.00000001 or so here or there, why is this(Memory issue due to poor coding maybe?)? 2. after clicking on 'Run' (Edit: Click append all first), the images will begin to animate, but why is the animation random at times? When all it should be doing is increasing the `maxspeed` by a value of `0.1` a time 3. Finally; why does it seemingly hit the 'else' stage of my if/else statement before the conditions of 'if' have been met? I'm a newcomer to JS/jQuery so please excuse any poor coding (I followed a tutorial to achieve the rotation effect). Here is my jsFiddle http://jsfiddle.net/pAk9N/9/ and jQuery code below, thanks :) $(document).ready(function(){ //You can edit the following file paths to change images in selection var img1 = '<img src="/img/logo.png">'; var img2 = '<img src="/img/logo.png">'; var img3 = '<img src="/img/logo.png">'; var img4 = '<img src="/img/logo.png">'; var img5 = '<img src="/img/logo.png">'; var img6 = '<img src="/img/logo.png">'; var all = img1 + img2 + img3 + img4 + img5 + img6; //Rotation part 1 var maxspeed = 0.00; var minspeed = 0.01; var stopped = 0.0; var speed = maxspeed; var radius = 100; var count = 0; function rotate() { var centerx = $(document).width()/2; var centery = $(document).height()/2; var num_items = $("#container > img").length; $("#container > img").each(function(){ var angle = count * (Math.PI/180); var newx = centerx + Math.cos(angle)*radius - $(this).width()/2; var newy = centery + Math.sin(angle)*radius - $(this).height()/2; $(this).css("left",newx+"px").css("top",newy+"px"); count += 360/num_items + speed; }); } //Rotation part 2 setInterval(rotate,1000/360); $(document).mousemove(function(e) { var dw = $(document).width(); var dh = $(document).height(); var itemh = $("#container > img").height(); var itemw = $("#container > img").width(); if (e.pageX > dw/2-radius-itemw/2 && e.pageX < dw/2 + radius + itemw/2 && e.pageY > dh/2-radius-itemh/2 && e.pageY < dh/2+radius+itemh/2) { speed = minspeed; } else { speed = maxspeed; } }); //Append elements to container $("#appendall").click(function(){$('#container').append(all);}); $('#append').children().eq(2).click(function(){$('#container').append(img1);}); $('#append').children().eq(3).click(function(){$('#container').append(img2);}); $('#append').children().eq(4).click(function(){$('#container').append(img3);}); $('#append').children().eq(5).click(function(){$('#container').append(img4);}); $('#append').children().eq(6).click(function(){$('#container').append(img5);}); $('#append').children().eq(7).click(function(){$('#container').append(img6);}); //Refresh page $("#reset").click(function(){location.reload();}); //IF speed is greater than 0 - ELSE add animation to div element $("#run").click(function(){ var maxcount = 1.00; var incdec = 0.01; counter() function counter() { if (parseFloat(maxcount) >= 0.00) { maxcount = parseFloat(maxcount) - parseFloat(incdec); maxspeed = parseFloat(maxspeed) + parseFloat(incdec); // alert(maxspeed) //alert(maxcount) setTimeout(counter,40); } else { maxspeed = 0; //Find amount of div elements and add 1 var brewees = $('#container').children().length +=1; //get a random number var rand = (Math.floor(Math.random()*brewees)); var ap = '20px'; var ab = '#ddd'; var ad = 1000; //match random number corrosponding child in div $('#container').children().eq(parseFloat(rand)) .animate({padding: ap, background : ab}, {duration:ad}); } } }); });
0
10,177,601
04/16/2012 16:00:54
1,336,709
04/16/2012 15:49:03
1
0
Joomla Multilanguage website has 2 URL and one of them has to be redirected to a subdirectory
I have a Joomla website with 2 url www.acb.be and www.atlantec.fr These 2 url are both going to the same joomla website. Now client asks me to redirect www.atlantec.fr to the french version on the site, found on www.atlantec.fr/fr/ Provider (Hostbasket Telenet) is not able to help me. I read lots of articles about changing my .htaccess, but it doesn't work. Can someone help me out here please? Check out my .htaccess on http://www.acb.be/htaccess.txt Thank you in advance
.htaccess
url-rewriting
joomla1.5
null
null
null
open
Joomla Multilanguage website has 2 URL and one of them has to be redirected to a subdirectory === I have a Joomla website with 2 url www.acb.be and www.atlantec.fr These 2 url are both going to the same joomla website. Now client asks me to redirect www.atlantec.fr to the french version on the site, found on www.atlantec.fr/fr/ Provider (Hostbasket Telenet) is not able to help me. I read lots of articles about changing my .htaccess, but it doesn't work. Can someone help me out here please? Check out my .htaccess on http://www.acb.be/htaccess.txt Thank you in advance
0
2,381,115
03/04/2010 16:57:13
117,700
06/04/2009 23:04:34
1,244
20
can someone recommend beginners grails tutorials
i just downloaded grails i dont know java can someone please recommend some basic grails tutorials??
java
grails
null
null
null
05/14/2012 17:07:00
not constructive
can someone recommend beginners grails tutorials === i just downloaded grails i dont know java can someone please recommend some basic grails tutorials??
4
10,514,585
05/09/2012 10:51:45
1,031,474
11/05/2011 19:14:21
48
0
Cocoa enumeration
I'm creating a list of error codes as so enum{ firstErrorCode = 1, secondErrorCode = 2, }; I would like to create an error domain-type concept for a custom error class (subclass of NSObject) I'm writing. Is there any way I could associate this enumeration with a string name? For instance MyErrorDomain?
objective-c
ios
cocoa
nserror
null
null
open
Cocoa enumeration === I'm creating a list of error codes as so enum{ firstErrorCode = 1, secondErrorCode = 2, }; I would like to create an error domain-type concept for a custom error class (subclass of NSObject) I'm writing. Is there any way I could associate this enumeration with a string name? For instance MyErrorDomain?
0
10,156,410
04/14/2012 18:58:20
429,938
08/24/2010 19:16:26
314
9
Clearing element cache in CakePHP
I echo one element from my ctp file like this: echo $this->element('myelement', array( "name" => $name) , array( "cache" => "false") ); Elements is shown successfully. But it seems like the same element is shown. It doesn't change after a refresh. I couldn't clear element cache. I tried - Cache::clear(); - clearCache(); but didn't work. My debug level is default: 2 Should i check any other thing? Thank you
php
cakephp
caching
cache-control
cakephp-2.1
null
open
Clearing element cache in CakePHP === I echo one element from my ctp file like this: echo $this->element('myelement', array( "name" => $name) , array( "cache" => "false") ); Elements is shown successfully. But it seems like the same element is shown. It doesn't change after a refresh. I couldn't clear element cache. I tried - Cache::clear(); - clearCache(); but didn't work. My debug level is default: 2 Should i check any other thing? Thank you
0
9,658,653
03/11/2012 20:36:03
1,231,478
02/24/2012 19:12:38
1
0
Website down due to password change, how to find what to change it back to?
PDOException: SQLSTATE[28000] [1045] Access denied for user 'lev1127301002684'@'188.121.41.131' (using password: YES) in lock_may_be_available() (line 167 of /home/content/69/8327469/html/includes/lock.inc).
mysql
drupal
drupal-7
godaddy
null
03/12/2012 03:18:22
off topic
Website down due to password change, how to find what to change it back to? === PDOException: SQLSTATE[28000] [1045] Access denied for user 'lev1127301002684'@'188.121.41.131' (using password: YES) in lock_may_be_available() (line 167 of /home/content/69/8327469/html/includes/lock.inc).
2
1,993,879
01/03/2010 03:36:36
16,940
09/17/2008 22:43:34
3,219
185
Render ASP.NET MVC string to View without HttpContext or ControllerContext?
I need to render an ASP.NET MVC view to a string so as to be able to send it via an email (it is an order confirmation email defined in an .ascx file ). I've successfully been able to render an ASP.NET MVC View to string using [one][1] of the methods in this [question][2]. However now I need to be able to do it via a WCF service (that will be accessed via silverlight) and so I don't have a `ControllerContext`. This WCF service is contained within the same project as my MVC project so has access to all my models etc. I've looked at several questions on Stackoverflow about this issue, but they all seem to need a controller context. I thought there was something in mvccontrib but it [doesn't seem to be there anymore][3]. The closest I've found is the [accepted answer to the aforementioned question][4], but it unfortunately breaks with RenderPartial within the view you're rendering. I'm hoping maybe some of the behind the scenes work for ASP.NET MVC 2 related to RenderAction may help make this possible now? [1]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string/663980#663980 [2]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string/ [3]: http://www.codeplex.com/MVCContrib/WorkItem/View.aspx?WorkItemId=1708 [4]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string/484932#484932
asp.net-mvc
renderpartial
null
null
null
null
open
Render ASP.NET MVC string to View without HttpContext or ControllerContext? === I need to render an ASP.NET MVC view to a string so as to be able to send it via an email (it is an order confirmation email defined in an .ascx file ). I've successfully been able to render an ASP.NET MVC View to string using [one][1] of the methods in this [question][2]. However now I need to be able to do it via a WCF service (that will be accessed via silverlight) and so I don't have a `ControllerContext`. This WCF service is contained within the same project as my MVC project so has access to all my models etc. I've looked at several questions on Stackoverflow about this issue, but they all seem to need a controller context. I thought there was something in mvccontrib but it [doesn't seem to be there anymore][3]. The closest I've found is the [accepted answer to the aforementioned question][4], but it unfortunately breaks with RenderPartial within the view you're rendering. I'm hoping maybe some of the behind the scenes work for ASP.NET MVC 2 related to RenderAction may help make this possible now? [1]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string/663980#663980 [2]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string/ [3]: http://www.codeplex.com/MVCContrib/WorkItem/View.aspx?WorkItemId=1708 [4]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string/484932#484932
0
803,804
04/29/2009 19:07:46
97,863
04/29/2009 18:09:20
1
0
Tool to recover & repair a corrupted *.MDB database (Access).
Over the years I have seen many errors on corrupted Access *.MDB files. I do not use Access as frontend, just as backend to store data Tables. I already use the best practices: normalization, close the database connection ASAP, etc. I was wondering if somebody knew which the best commercial tool to recover data from a corrupted MDB file is. (I need a tool, not a service). I have seen AccessFix, Access Recovery, Advanced Access Repair. Have you used any of these tools? Any winner? Any recommendation? Any advice? Thanks, Jag P.S. I know I shouldn’t be using an Access backend on a concurrent user & network environment, but there is nothing I can do right now.
ms-access
corruption
null
null
null
06/05/2012 11:49:08
not constructive
Tool to recover & repair a corrupted *.MDB database (Access). === Over the years I have seen many errors on corrupted Access *.MDB files. I do not use Access as frontend, just as backend to store data Tables. I already use the best practices: normalization, close the database connection ASAP, etc. I was wondering if somebody knew which the best commercial tool to recover data from a corrupted MDB file is. (I need a tool, not a service). I have seen AccessFix, Access Recovery, Advanced Access Repair. Have you used any of these tools? Any winner? Any recommendation? Any advice? Thanks, Jag P.S. I know I shouldn’t be using an Access backend on a concurrent user & network environment, but there is nothing I can do right now.
4
4,678,047
01/13/2011 08:25:59
566,289
12/31/2010 21:47:12
1
0
Need some code in joomla to upload youtube videos
In my website i want to provide a feature to upload local videos from my system to youtube account. I want PHP script in joomla which could allow user to login to youtube using youtube API and then upload videos on his/her youtube account. A sample code will be more favourable.
php
joomla
youtube-api
null
null
05/24/2012 13:54:08
not constructive
Need some code in joomla to upload youtube videos === In my website i want to provide a feature to upload local videos from my system to youtube account. I want PHP script in joomla which could allow user to login to youtube using youtube API and then upload videos on his/her youtube account. A sample code will be more favourable.
4
3,118,082
06/25/2010 12:46:48
376,274
06/25/2010 12:46:48
1
0
is free base an open source
is free base an open source api can i use it in any commercial application....
freebase
null
null
null
null
06/26/2010 15:34:49
off topic
is free base an open source === is free base an open source api can i use it in any commercial application....
2
6,913,474
08/02/2011 14:12:38
292,157
03/12/2010 07:19:26
83
4
Is VB 6 worth learning today?
How necessary is it to learn VB6 and what are the advantages of using this language today? Does it really have advantages?
vb
vb6
language
visual
basic
08/02/2011 14:31:51
not constructive
Is VB 6 worth learning today? === How necessary is it to learn VB6 and what are the advantages of using this language today? Does it really have advantages?
4
1,797,984
11/25/2009 16:05:46
54,889
01/14/2009 04:14:39
1
3
Anyone tried JustCode?
Have you used [JustCode][1]? is it better than resharper? seems like performance better. Do I need to uninstall resharper before using JustCode? [1]: http://www.telerik.com/products/justcode.aspx
visual-studio
refactoring
resharper
null
null
12/08/2011 16:54:18
not constructive
Anyone tried JustCode? === Have you used [JustCode][1]? is it better than resharper? seems like performance better. Do I need to uninstall resharper before using JustCode? [1]: http://www.telerik.com/products/justcode.aspx
4
11,514,888
07/17/2012 01:30:51
1,515,956
07/10/2012 20:27:52
1
0
Simultaneous Networking and Gesture Recognition on iPad
I am having some problems doing some simple network client stuff (just asking the server to return some data). I also have a view that has various gesture recognizers. When a gesture event goes off, I should be placing a query to the server. However, the gesture recognition does not work when including the networking code. If I comment out critical code to the networking side of things, the gesture recognition works, but the networking does not work. I will post some code in the morning, but does anyone have any introductory ideas to resolving this issue? Thanks in advance!
objective-c
ios
ipad
networking
uipangesturerecognizer
null
open
Simultaneous Networking and Gesture Recognition on iPad === I am having some problems doing some simple network client stuff (just asking the server to return some data). I also have a view that has various gesture recognizers. When a gesture event goes off, I should be placing a query to the server. However, the gesture recognition does not work when including the networking code. If I comment out critical code to the networking side of things, the gesture recognition works, but the networking does not work. I will post some code in the morning, but does anyone have any introductory ideas to resolving this issue? Thanks in advance!
0
11,676,874
07/26/2012 19:45:10
486,871
10/25/2010 20:11:26
767
28
3rd Party Python Modules in PyQt
I am trying to decide on a technology for developing a desktop application that can interface with the serial port. I have looked into python and it looks like a console based app would not be difficult - http://pyserial.sourceforge.net/ , and I have also looked at PyQt, which would fulfill the GUI portion of my project. But is it possible to include 3rd party modules like PySerial in PyQt?
python
pyqt
pyserial
null
null
null
open
3rd Party Python Modules in PyQt === I am trying to decide on a technology for developing a desktop application that can interface with the serial port. I have looked into python and it looks like a console based app would not be difficult - http://pyserial.sourceforge.net/ , and I have also looked at PyQt, which would fulfill the GUI portion of my project. But is it possible to include 3rd party modules like PySerial in PyQt?
0
4,639,806
01/09/2011 14:52:02
568,839
01/09/2011 14:52:02
1
0
Need help to correct java code
I have created the following code from this pseudocode: but I cannot get it to run properly can someone please tell me what I did wrong in my code? Start Main( ) Get name of player Get cash (starting cash amount) Set more = "yes" Start Loop Set betAmount = 0; Start Loop Get betAmount If( betAmount > cash ) Display "You do not have enough cash for that bet amount." Display "Cash: " & cash End If While( betAmount > cash ), continue looping Display "Press Enter to draw a card." Generate a random number from 2 to 14 and place in player variable Call DisplayCard( player ) Display "Press Enter to see the dealer's card." Create a random number between 2 and 14 and place in dealer variable Call DisplayCard( dealer ) Call Evaluate( player, dealer ) that returns a boolean (true if player wins) If player wins then Display name & ", you win!" Increase cash by the betAmount Otherwise if player loses then Display name & ", you lose" Decrease cash by the betAmount End If If cash > 0 then Display "You have " & cash & " cash in hand." Get more with prompt "Play again? (yes/no): " Otherwise Display "You are out of cash." Set more = "no" End If While more = "yes", continue looping Display "Thanks for playing." Stop Start DisplayCard(name as String card as integer ) If card = 14 then Display name of player and "Ace" Otherwise if card = 13 then Display name of player and "King" Otherwise if card = 12 then Display name of player and "Queen" Otherwise if card = 11 then Display name of player and "Jack" Otherwise if card >= 2 AND card <= 10 then Display name of player and card Otherwise Display name of player and "Error: " & card & "is not valid." End If Stop Start Evaluate( player, dealer ) If player > dealer then Return "win" Otherwise if dealer > player then Return "lose" Otherwise Return "tie" End If Stop package Lab1; import java.text.NumberFormat; import javax.swing.JOptionPane; public class CasinoWar { //create the limit constants private static final double MIN_CASH_LIMIT = 10; private static final double MAX_CASH_LIMIT = 10000; //Create Currency format object, which is available to the entire class private static NumberFormat nf = NumberFormat.getCurrencyInstance(); private static Object betAmount; public static void main(String[] args) { String name; boolean keepGoing = false; double cash = 0; double betamount = 0; int playerCard = 2; int dealerCard = 2; boolean playerWinner = true; displayApplicationInformation(); name = getPlayerName(); cash = getCashLimit (name); betAmount = getBetAmount (name, cash); do { playerCard = getCard(name); dealerCard = getCard("Dealer"); playerWinner = determineWinner(playerCard, name, dealerCard); cash = updateCashAmount (cash, betAmount, playerWinner, name); keepGoing = playAgain (cash, betAmount, name); } while (keepGoing); } private static void displayApplicationInformation() { displayDivider(true); System.out.println("Welcome to the Casino Game Program"); System.out.println("CIS247B, Week 1 Lab"); System.out.println("Name: Taheera Nabors"); displayDivider(true); } private static void displayDivider(boolean longDivider) { if(longDivider) System.out.println("____________________________"); else System.out.println("xxxxxxxxxxxxxxxxxxx"); System.out.println(); } private static String getPlayerName() { String name; name = JOptionPane.showInputDialog(null, "Enter the player's name", "Get Player's Name,", JOptionPane.QUESTION_MESSAGE); return name; } private static double getCashLimit(String name) { double limit = 0; String strLimit; do { strLimit = JOptionPane.showInputDialog(null, "Enter the cash limit", "Cash Limit", JOptionPane.QUESTION_MESSAGE); limit = Double.parseDouble(strLimit); if (limit < MIN_CASH_LIMIT) { System.out.println("The minimum cash limit is:" + nf.format (MIN_CASH_LIMIT)); } else if (limit > MAX_CASH_LIMIT) { System.out.println("The maximum cash limit is:" + nf.format(MAX_CASH_LIMIT)); } } while (limit < MIN_CASH_LIMIT || limit > MAX_CASH_LIMIT); return limit; } private static double getBetAmount(String name, double limit) { double bet = 0; String strBet; do { strBet = JOptionPane.showInputDialog(null, "Enter the bet amount", "Bet Amount", JOptionPane.QUESTION_MESSAGE); bet = Double.parseDouble(strBet); if (bet < MIN_CASH_LIMIT) { System.out.println("The minimum bet is:" + nf.format (MIN_CASH_LIMIT)); } else if (bet > limit) { System.out.println("The maximum cash bet is:" + nf.format(limit)); } }while (bet < MIN_CASH_LIMIT || bet > limit); return bet; } private static int getCard(String name) { int response = 0; int card = 0; response = JOptionPane.showConfirmDialog(null, name + "draw a card", "Draw Card", JOptionPane.YES_OPTION); if (response == JOptionPane.YES_OPTION) { card = 2 + (int) (Math.random()* 12); card = 0; } return card; } @SuppressWarnings("unused") private static void displayCard(int card, String name) { System.out.println("xxxxxxxxxx" + name + " card xxxxxxxxxx"); if (card == 14) { System.out.println(name + ": Ace"); } else if (card == 13) { System.out.println(name + ": King"); } else if (card == 12) { System.out.println(name + ": Queen"); } else if (card == 11) { System.out.println(name + ": Jack"); } else { System.out.println(name + ": " + card); } } public static boolean evaluate(int player, int dealer) { //Check to see if player card is greater than or equal to dealer card if (player >= dealer) { return true; } else { return false; } } }
java
null
null
null
null
01/09/2011 14:57:12
not a real question
Need help to correct java code === I have created the following code from this pseudocode: but I cannot get it to run properly can someone please tell me what I did wrong in my code? Start Main( ) Get name of player Get cash (starting cash amount) Set more = "yes" Start Loop Set betAmount = 0; Start Loop Get betAmount If( betAmount > cash ) Display "You do not have enough cash for that bet amount." Display "Cash: " & cash End If While( betAmount > cash ), continue looping Display "Press Enter to draw a card." Generate a random number from 2 to 14 and place in player variable Call DisplayCard( player ) Display "Press Enter to see the dealer's card." Create a random number between 2 and 14 and place in dealer variable Call DisplayCard( dealer ) Call Evaluate( player, dealer ) that returns a boolean (true if player wins) If player wins then Display name & ", you win!" Increase cash by the betAmount Otherwise if player loses then Display name & ", you lose" Decrease cash by the betAmount End If If cash > 0 then Display "You have " & cash & " cash in hand." Get more with prompt "Play again? (yes/no): " Otherwise Display "You are out of cash." Set more = "no" End If While more = "yes", continue looping Display "Thanks for playing." Stop Start DisplayCard(name as String card as integer ) If card = 14 then Display name of player and "Ace" Otherwise if card = 13 then Display name of player and "King" Otherwise if card = 12 then Display name of player and "Queen" Otherwise if card = 11 then Display name of player and "Jack" Otherwise if card >= 2 AND card <= 10 then Display name of player and card Otherwise Display name of player and "Error: " & card & "is not valid." End If Stop Start Evaluate( player, dealer ) If player > dealer then Return "win" Otherwise if dealer > player then Return "lose" Otherwise Return "tie" End If Stop package Lab1; import java.text.NumberFormat; import javax.swing.JOptionPane; public class CasinoWar { //create the limit constants private static final double MIN_CASH_LIMIT = 10; private static final double MAX_CASH_LIMIT = 10000; //Create Currency format object, which is available to the entire class private static NumberFormat nf = NumberFormat.getCurrencyInstance(); private static Object betAmount; public static void main(String[] args) { String name; boolean keepGoing = false; double cash = 0; double betamount = 0; int playerCard = 2; int dealerCard = 2; boolean playerWinner = true; displayApplicationInformation(); name = getPlayerName(); cash = getCashLimit (name); betAmount = getBetAmount (name, cash); do { playerCard = getCard(name); dealerCard = getCard("Dealer"); playerWinner = determineWinner(playerCard, name, dealerCard); cash = updateCashAmount (cash, betAmount, playerWinner, name); keepGoing = playAgain (cash, betAmount, name); } while (keepGoing); } private static void displayApplicationInformation() { displayDivider(true); System.out.println("Welcome to the Casino Game Program"); System.out.println("CIS247B, Week 1 Lab"); System.out.println("Name: Taheera Nabors"); displayDivider(true); } private static void displayDivider(boolean longDivider) { if(longDivider) System.out.println("____________________________"); else System.out.println("xxxxxxxxxxxxxxxxxxx"); System.out.println(); } private static String getPlayerName() { String name; name = JOptionPane.showInputDialog(null, "Enter the player's name", "Get Player's Name,", JOptionPane.QUESTION_MESSAGE); return name; } private static double getCashLimit(String name) { double limit = 0; String strLimit; do { strLimit = JOptionPane.showInputDialog(null, "Enter the cash limit", "Cash Limit", JOptionPane.QUESTION_MESSAGE); limit = Double.parseDouble(strLimit); if (limit < MIN_CASH_LIMIT) { System.out.println("The minimum cash limit is:" + nf.format (MIN_CASH_LIMIT)); } else if (limit > MAX_CASH_LIMIT) { System.out.println("The maximum cash limit is:" + nf.format(MAX_CASH_LIMIT)); } } while (limit < MIN_CASH_LIMIT || limit > MAX_CASH_LIMIT); return limit; } private static double getBetAmount(String name, double limit) { double bet = 0; String strBet; do { strBet = JOptionPane.showInputDialog(null, "Enter the bet amount", "Bet Amount", JOptionPane.QUESTION_MESSAGE); bet = Double.parseDouble(strBet); if (bet < MIN_CASH_LIMIT) { System.out.println("The minimum bet is:" + nf.format (MIN_CASH_LIMIT)); } else if (bet > limit) { System.out.println("The maximum cash bet is:" + nf.format(limit)); } }while (bet < MIN_CASH_LIMIT || bet > limit); return bet; } private static int getCard(String name) { int response = 0; int card = 0; response = JOptionPane.showConfirmDialog(null, name + "draw a card", "Draw Card", JOptionPane.YES_OPTION); if (response == JOptionPane.YES_OPTION) { card = 2 + (int) (Math.random()* 12); card = 0; } return card; } @SuppressWarnings("unused") private static void displayCard(int card, String name) { System.out.println("xxxxxxxxxx" + name + " card xxxxxxxxxx"); if (card == 14) { System.out.println(name + ": Ace"); } else if (card == 13) { System.out.println(name + ": King"); } else if (card == 12) { System.out.println(name + ": Queen"); } else if (card == 11) { System.out.println(name + ": Jack"); } else { System.out.println(name + ": " + card); } } public static boolean evaluate(int player, int dealer) { //Check to see if player card is greater than or equal to dealer card if (player >= dealer) { return true; } else { return false; } } }
1
7,334,626
09/07/2011 13:26:10
220,583
11/28/2009 18:55:25
518
30
How to set the time in phone7?
Can an application set the current time on a phone7 device? I can't seem to find any documentation about it but I'm sure it's possible.
windows-phone-7
null
null
null
null
null
open
How to set the time in phone7? === Can an application set the current time on a phone7 device? I can't seem to find any documentation about it but I'm sure it's possible.
0
7,604,024
09/29/2011 22:20:21
518,198
11/24/2010 00:33:38
21
2
Clone observable objects in Knockout js
There seem to be a seriouse issue with cloning (deep copying) of objects in JavaScript. There are numerous posts on how to do it with compact objects such as [this post on StackOverflow][1]. However libraries such as [Knockout][2] expose wrappers that aren't that easily cloned. Here is a trick to copy Knockout objects: var temp = ko.toJS(template) var copy = ko.mapping.fromJS() array.push(copy) [1]: http://stackoverflow.com/questions/728360/copying-an-object-in-javascript [2]: http://knockoutjs.com
javascript
knockout.js
null
null
null
09/29/2011 22:49:26
not a real question
Clone observable objects in Knockout js === There seem to be a seriouse issue with cloning (deep copying) of objects in JavaScript. There are numerous posts on how to do it with compact objects such as [this post on StackOverflow][1]. However libraries such as [Knockout][2] expose wrappers that aren't that easily cloned. Here is a trick to copy Knockout objects: var temp = ko.toJS(template) var copy = ko.mapping.fromJS() array.push(copy) [1]: http://stackoverflow.com/questions/728360/copying-an-object-in-javascript [2]: http://knockoutjs.com
1
9,106,651
02/02/2012 03:11:18
877,819
08/04/2011 03:58:29
124
15
Facebook Bigpipe Technique Algorihtm
![enter image description here][1] [1]: http://i.stack.imgur.com/XD0Jq.png I keep studying this flow of the Facebook's bigpipe technique but I have this question. How this thing is implemented? does the pagelet is received through an ajax request? I keep on searching for the source code of this bigpipe but it points me to a 404 page of github. Can someone explain this bigpipe in a low level(programming algorithm) way. I'm really interested with this technique. Thanks in advance
facebook
null
null
null
null
null
open
Facebook Bigpipe Technique Algorihtm === ![enter image description here][1] [1]: http://i.stack.imgur.com/XD0Jq.png I keep studying this flow of the Facebook's bigpipe technique but I have this question. How this thing is implemented? does the pagelet is received through an ajax request? I keep on searching for the source code of this bigpipe but it points me to a 404 page of github. Can someone explain this bigpipe in a low level(programming algorithm) way. I'm really interested with this technique. Thanks in advance
0
5,893,243
05/05/2011 05:54:41
196,480
10/26/2009 07:45:38
305
2
Test ipad appication online
Is there any way to test ipad web application on internet, Please tell me the websites. Thanks
iphone
ipad
apple
jqtouch
ipod
05/05/2011 06:52:01
not a real question
Test ipad appication online === Is there any way to test ipad web application on internet, Please tell me the websites. Thanks
1
2,961,038
06/02/2010 19:39:46
125,173
06/18/2009 15:05:49
443
9
what's wrong with my producer-consumer queue design?
I'm starting with the C# code example [here][1]. I'm trying to adapt it for a couple reasons: 1) in my scenario, all tasks will be put in the queue up-front before consumers will start, and 2) I wanted to abstract the worker into a separate class instead of having raw `Thread` members within the `WorkerQueue` class. My queue doesn't seem to dispose of itself though, it just hangs, and when I break in Visual Studio it's stuck on the `_th.Join()` line for `WorkerThread` #1. Also, is there a better way to organize this? Something about exposing the `WaitOne()` and `Join()` methods seems wrong, but I couldn't think of an appropriate way to let the `WorkerThread` interact with the queue. Also, an aside - if I call `q.Start(#)` at the top of the `using` block, only some of the threads every kick in (e.g. threads 1, 2, and 8 process every task). Why is this? Is it a race condition of some sort, or am I doing something wrong? <pre><code> using System; using System.Collections.Generic; using System.Text; using System.Messaging; using System.Threading; using System.Linq; namespace QueueTest { class Program { static void Main(string[] args) { using (WorkQueue q = new WorkQueue()) { q.Finished += new Action(delegate { Console.WriteLine("All jobs finished"); }); Random r = new Random(); foreach (int i in Enumerable.Range(1, 10)) q.Enqueue(r.Next(100, 500)); Console.WriteLine("All jobs queued"); q.Start(8); } } } class WorkQueue : IDisposable { private Queue<int> _jobs = new Queue<int>(); private int _job_count; private EventWaitHandle _wh = new AutoResetEvent(false); private object _lock = new object(); private List<WorkerThread> _th; public event Action Finished; public WorkQueue() { } public void Start(int num_threads) { _job_count = _jobs.Count; _th = new List<WorkerThread>(num_threads); foreach (int i in Enumerable.Range(1, num_threads)) { _th.Add(new WorkerThread(i, this)); _th[_th.Count - 1].JobFinished += new Action<int>(WorkQueue_JobFinished); } } void WorkQueue_JobFinished(int obj) { lock (_lock) { _job_count--; if (_job_count == 0 && Finished != null) Finished(); } } public void Enqueue(int job) { lock (_lock) _jobs.Enqueue(job); _wh.Set(); } public void Dispose() { Enqueue(Int32.MinValue); _th.ForEach(th => th.Join()); _wh.Close(); } public int GetNextJob() { lock (_lock) { if (_jobs.Count > 0) return _jobs.Dequeue(); else return Int32.MinValue; } } public void WaitOne() { _wh.WaitOne(); } } class WorkerThread { private Thread _th; private WorkQueue _q; private int _i; public event Action<int> JobFinished; public WorkerThread(int i, WorkQueue q) { _i = i; _q = q; _th = new Thread(DoWork); _th.Start(); } public void Join() { _th.Join(); } private void DoWork() { while (true) { int job = _q.GetNextJob(); if (job != Int32.MinValue) { Console.WriteLine("Thread {0} Got job {1}", _i, job); Thread.Sleep(job * 10); // in reality would to actual work here if (JobFinished != null) JobFinished(job); } else { Console.WriteLine("Thread {0} no job available", _i); _q.WaitOne(); } } } } } </code></pre> [1]: http://www.albahari.com/threading/part2.aspx#_ProducerConsumerQWaitHandle "here"
c#
multithreading
queue
producer-consumer
null
null
open
what's wrong with my producer-consumer queue design? === I'm starting with the C# code example [here][1]. I'm trying to adapt it for a couple reasons: 1) in my scenario, all tasks will be put in the queue up-front before consumers will start, and 2) I wanted to abstract the worker into a separate class instead of having raw `Thread` members within the `WorkerQueue` class. My queue doesn't seem to dispose of itself though, it just hangs, and when I break in Visual Studio it's stuck on the `_th.Join()` line for `WorkerThread` #1. Also, is there a better way to organize this? Something about exposing the `WaitOne()` and `Join()` methods seems wrong, but I couldn't think of an appropriate way to let the `WorkerThread` interact with the queue. Also, an aside - if I call `q.Start(#)` at the top of the `using` block, only some of the threads every kick in (e.g. threads 1, 2, and 8 process every task). Why is this? Is it a race condition of some sort, or am I doing something wrong? <pre><code> using System; using System.Collections.Generic; using System.Text; using System.Messaging; using System.Threading; using System.Linq; namespace QueueTest { class Program { static void Main(string[] args) { using (WorkQueue q = new WorkQueue()) { q.Finished += new Action(delegate { Console.WriteLine("All jobs finished"); }); Random r = new Random(); foreach (int i in Enumerable.Range(1, 10)) q.Enqueue(r.Next(100, 500)); Console.WriteLine("All jobs queued"); q.Start(8); } } } class WorkQueue : IDisposable { private Queue<int> _jobs = new Queue<int>(); private int _job_count; private EventWaitHandle _wh = new AutoResetEvent(false); private object _lock = new object(); private List<WorkerThread> _th; public event Action Finished; public WorkQueue() { } public void Start(int num_threads) { _job_count = _jobs.Count; _th = new List<WorkerThread>(num_threads); foreach (int i in Enumerable.Range(1, num_threads)) { _th.Add(new WorkerThread(i, this)); _th[_th.Count - 1].JobFinished += new Action<int>(WorkQueue_JobFinished); } } void WorkQueue_JobFinished(int obj) { lock (_lock) { _job_count--; if (_job_count == 0 && Finished != null) Finished(); } } public void Enqueue(int job) { lock (_lock) _jobs.Enqueue(job); _wh.Set(); } public void Dispose() { Enqueue(Int32.MinValue); _th.ForEach(th => th.Join()); _wh.Close(); } public int GetNextJob() { lock (_lock) { if (_jobs.Count > 0) return _jobs.Dequeue(); else return Int32.MinValue; } } public void WaitOne() { _wh.WaitOne(); } } class WorkerThread { private Thread _th; private WorkQueue _q; private int _i; public event Action<int> JobFinished; public WorkerThread(int i, WorkQueue q) { _i = i; _q = q; _th = new Thread(DoWork); _th.Start(); } public void Join() { _th.Join(); } private void DoWork() { while (true) { int job = _q.GetNextJob(); if (job != Int32.MinValue) { Console.WriteLine("Thread {0} Got job {1}", _i, job); Thread.Sleep(job * 10); // in reality would to actual work here if (JobFinished != null) JobFinished(job); } else { Console.WriteLine("Thread {0} no job available", _i); _q.WaitOne(); } } } } } </code></pre> [1]: http://www.albahari.com/threading/part2.aspx#_ProducerConsumerQWaitHandle "here"
0
5,937,121
05/09/2011 12:50:18
374,395
06/23/2010 15:40:28
50
18
Configuration-files in a Greasemonkey script
from what I understood, it is not possible to read files using Greasemonkey. But I need to define lot of static configuration files, and it seems completely messy to include those directly in the user script. So, what is the best way to store and retrieve those data? Thank you :-)
javascript
firefox
greasemonkey
configuration-files
null
null
open
Configuration-files in a Greasemonkey script === from what I understood, it is not possible to read files using Greasemonkey. But I need to define lot of static configuration files, and it seems completely messy to include those directly in the user script. So, what is the best way to store and retrieve those data? Thank you :-)
0
9,333,209
02/17/2012 18:06:54
1,017,102
10/27/2011 18:26:19
1
0
Getting image out of a C# 2D array
One of the routines for converting PDF to images that I have to work with returns the image as 2D array. After calling the convert function I have this: byte[][] image = convertToPdf.... Hovering over the image variable, the debugger shows: image {byte[1][]} and hovering over that shows [0]{byte[124353]} I am confused how I would could get the image into a 1d byte array in order to process or convert it to an actual image. Any help is appreciated.
c#
null
null
null
null
null
open
Getting image out of a C# 2D array === One of the routines for converting PDF to images that I have to work with returns the image as 2D array. After calling the convert function I have this: byte[][] image = convertToPdf.... Hovering over the image variable, the debugger shows: image {byte[1][]} and hovering over that shows [0]{byte[124353]} I am confused how I would could get the image into a 1d byte array in order to process or convert it to an actual image. Any help is appreciated.
0
3,833,580
09/30/2010 18:18:25
431,281
08/25/2010 22:47:34
49
0
error:failed retrieve data for this request.
*Hi,I need to attach my database to SQL server 2008(I used it before without problem),but now when I want to attach db , sqlsrv sent me this error. error:failed retrieve data for this request. ![alt text][1] [1]: http://i.stack.imgur.com/VSqre.jpg Why do I have this problem and how can I solve it?*
sql-server-2008
null
null
null
null
null
open
error:failed retrieve data for this request. === *Hi,I need to attach my database to SQL server 2008(I used it before without problem),but now when I want to attach db , sqlsrv sent me this error. error:failed retrieve data for this request. ![alt text][1] [1]: http://i.stack.imgur.com/VSqre.jpg Why do I have this problem and how can I solve it?*
0
8,831,656
01/12/2012 07:47:08
1,144,934
01/12/2012 07:32:59
1
0
Primary and Secondary DNS on two internet connections, one server
Currently my network setup is as follows: 1 server, 3 ethernet cards. eth0 - ISP1 eth1 - ISP2 eth2 - local network. What would be the proper way of configuring primary and secondary DNS? Using tinydns. Current configuration: 2 tinydns services running on the same machine, each configured on a different ip (NS1 = eth0, NS2 = eth1) each dns configuration contains both records: NS1: .domain.lv:10.10.10.10:ns.domain.lv .domain.lv:20.20.20.20:ns2.domain.lv @domain.lv:10.10.10.10:mail.didzis.lv:10:256:: @domain.lv:20.20.20.20:mail.domain.lv:20:256:: +www.domain.lv:10.10.10.10 NS2: .domain.lv:20.20.20.20:ns.domain.lv .domain.lv:10.10.10.10:ns2.domain.lv @domain.lv:10.10.10.10:mail.didzis.lv:10:256:: @domain.lv:20.20.20.20:mail.domain.lv:20:256:: +www.domain.lv:20.20.20.20 The second link is more like a backup in case the first one fails and vice versa. Wont this configuration fail if eth1 is down and the www resolves to 20.20.20.20 Thanks!
dns
null
null
null
null
01/12/2012 11:23:50
off topic
Primary and Secondary DNS on two internet connections, one server === Currently my network setup is as follows: 1 server, 3 ethernet cards. eth0 - ISP1 eth1 - ISP2 eth2 - local network. What would be the proper way of configuring primary and secondary DNS? Using tinydns. Current configuration: 2 tinydns services running on the same machine, each configured on a different ip (NS1 = eth0, NS2 = eth1) each dns configuration contains both records: NS1: .domain.lv:10.10.10.10:ns.domain.lv .domain.lv:20.20.20.20:ns2.domain.lv @domain.lv:10.10.10.10:mail.didzis.lv:10:256:: @domain.lv:20.20.20.20:mail.domain.lv:20:256:: +www.domain.lv:10.10.10.10 NS2: .domain.lv:20.20.20.20:ns.domain.lv .domain.lv:10.10.10.10:ns2.domain.lv @domain.lv:10.10.10.10:mail.didzis.lv:10:256:: @domain.lv:20.20.20.20:mail.domain.lv:20:256:: +www.domain.lv:20.20.20.20 The second link is more like a backup in case the first one fails and vice versa. Wont this configuration fail if eth1 is down and the www resolves to 20.20.20.20 Thanks!
2
7,652,185
10/04/2011 18:07:38
851,043
07/19/2011 00:35:07
72
1
'x' must be a numeric vector: Error from data.frame of numbers
I am running a cor.test on two columns within a file/table. tmp <- read.table(files_to_test[i], header=TRUE, sep="\t") ## Obtain Columns To Compare ## colA <-tmp[compareA] colB <-tmp[compareB] # sctr = 'spearman cor.test result' sctr <- cor.test(colA, colB, alternative="two.sided", method="spearman") But I am getting this confounding error... Error in cor.test.default(colA, colB, alternative = "two.sided", method = "spearman") : 'x' must be a numeric vector the values in the columns ARE numbers but is.numeric(colA) = FALSE class (colA) = data.frame What have I missed?
r
data.frame
null
null
null
null
open
'x' must be a numeric vector: Error from data.frame of numbers === I am running a cor.test on two columns within a file/table. tmp <- read.table(files_to_test[i], header=TRUE, sep="\t") ## Obtain Columns To Compare ## colA <-tmp[compareA] colB <-tmp[compareB] # sctr = 'spearman cor.test result' sctr <- cor.test(colA, colB, alternative="two.sided", method="spearman") But I am getting this confounding error... Error in cor.test.default(colA, colB, alternative = "two.sided", method = "spearman") : 'x' must be a numeric vector the values in the columns ARE numbers but is.numeric(colA) = FALSE class (colA) = data.frame What have I missed?
0
9,731,240
03/16/2012 03:01:57
986,139
10/09/2011 07:18:02
88
1
Event order when multiple threads are waiting on syncronised on the same object
If I have a common thread pool that queues runnable tasks and the runnable task is the same object everytime. What happens when it reaches a block of code (within the runnable task) that has a synchronised lock? and say 5 threads are waiting on the same lock? When it unlocks, is the synchronised block a queue line waiting to be executed and new threads join the queue, or whoever managed to grab the block first? If there isn't a queue line, assuming I want an ordered execution, what is the best method to do so?
java
null
null
null
null
null
open
Event order when multiple threads are waiting on syncronised on the same object === If I have a common thread pool that queues runnable tasks and the runnable task is the same object everytime. What happens when it reaches a block of code (within the runnable task) that has a synchronised lock? and say 5 threads are waiting on the same lock? When it unlocks, is the synchronised block a queue line waiting to be executed and new threads join the queue, or whoever managed to grab the block first? If there isn't a queue line, assuming I want an ordered execution, what is the best method to do so?
0
7,976,155
11/02/2011 05:24:13
1,000,441
10/18/2011 05:32:23
15
0
changing public to private
Class Loan { public : Loan( ); Loan (double amt, double rate, int term); double get_loanAmt( ) const; double get_intRate( ) const; double get_termOfLoan( ) const; void setAmt (double amt); void setRate (double rate); void setTerm (int term); void output (ostream & out) const; double calculate_interest( ) const; protected : double loanaAmt; double intrate; int termOfLoan; this piece of code that i wrote : double Carloan::calculate_interest( ) const - { - return (2 * loanAmt * intRate * termOfLoan); - } - im trieng to change the access of member variable of class Loan to private but the line Carloan of calculate_interest gives me compilation error how can i fix this problem ? Ive tried this : Public : - void setTerm(int term); - double get_termOfLoan( ) const; - Private : - double int rate; - double int loanAmt; ------------------ can some one help me plz ?
c++
null
null
null
null
11/02/2011 06:07:36
too localized
changing public to private === Class Loan { public : Loan( ); Loan (double amt, double rate, int term); double get_loanAmt( ) const; double get_intRate( ) const; double get_termOfLoan( ) const; void setAmt (double amt); void setRate (double rate); void setTerm (int term); void output (ostream & out) const; double calculate_interest( ) const; protected : double loanaAmt; double intrate; int termOfLoan; this piece of code that i wrote : double Carloan::calculate_interest( ) const - { - return (2 * loanAmt * intRate * termOfLoan); - } - im trieng to change the access of member variable of class Loan to private but the line Carloan of calculate_interest gives me compilation error how can i fix this problem ? Ive tried this : Public : - void setTerm(int term); - double get_termOfLoan( ) const; - Private : - double int rate; - double int loanAmt; ------------------ can some one help me plz ?
3
11,424,252
07/11/2012 01:19:21
782,252
06/03/2011 06:19:00
156
3
what is this particular code doing?
i am trying to unit test my friends code: public override object GetReferenceValue(TOwner owner) { Person value = this.Accessor(owner); if (value == null) return null; else return value.Name; } this is under a generic class which is called PersonalProperty: public class PersonalProperty<TOwner> : Property<TOwner, Person> where TOwner : class the Accessor is a property (i believe so) under the Property Class: public virtual Func<TOwner, TProperty> Accessor { get; internal set; } in my unit test, i have this: [Test] public void Test_GetReferenceValue() { Person person= new Person() { Name = "PJ" }; PersonalProperty<Person> personalProperty = new PersonalProperty<Person>(); var result = personalProperty.GetReferenceValue(person); Assert.AreEqual("PJ", result); } the test fails and it says: Object reference not set to an instance of an object. upon debugging it, it fails on the line: Person value = this.Accessor(owner) i read that func is some sort of a delegate. but isnt delegates supposed to be calling a method? i do not really understand what is happening in this code, maybe i am testing it the wrong way... anybody can help me understand this? PS: my friend is not around so i cant ask him, he said that this code is working and i should create a unit test for it.
c#
unit-testing
func
null
null
07/12/2012 02:41:50
too localized
what is this particular code doing? === i am trying to unit test my friends code: public override object GetReferenceValue(TOwner owner) { Person value = this.Accessor(owner); if (value == null) return null; else return value.Name; } this is under a generic class which is called PersonalProperty: public class PersonalProperty<TOwner> : Property<TOwner, Person> where TOwner : class the Accessor is a property (i believe so) under the Property Class: public virtual Func<TOwner, TProperty> Accessor { get; internal set; } in my unit test, i have this: [Test] public void Test_GetReferenceValue() { Person person= new Person() { Name = "PJ" }; PersonalProperty<Person> personalProperty = new PersonalProperty<Person>(); var result = personalProperty.GetReferenceValue(person); Assert.AreEqual("PJ", result); } the test fails and it says: Object reference not set to an instance of an object. upon debugging it, it fails on the line: Person value = this.Accessor(owner) i read that func is some sort of a delegate. but isnt delegates supposed to be calling a method? i do not really understand what is happening in this code, maybe i am testing it the wrong way... anybody can help me understand this? PS: my friend is not around so i cant ask him, he said that this code is working and i should create a unit test for it.
3
10,866,626
06/02/2012 23:10:28
1,432,581
06/02/2012 15:40:58
1
0
Clock synchronization between servers using Sockets on Java
I need to synch my servers that i built by using web service on java using Sockets.Can you give me any suggestions how to do that?I am planning to use Symmetric Time Model but even though i know the logic of it, i couldnt implement it. THanks
java
web-services
sockets
null
null
06/03/2012 09:54:24
not constructive
Clock synchronization between servers using Sockets on Java === I need to synch my servers that i built by using web service on java using Sockets.Can you give me any suggestions how to do that?I am planning to use Symmetric Time Model but even though i know the logic of it, i couldnt implement it. THanks
4
1,849,907
12/04/2009 21:55:06
22,399
09/25/2008 21:09:10
78
6
Changing the Default "Copy to Output Directory" Setting for Text Files
Does anyone know if there is a way to change a file type's default "Copy to Output Directory" setting in Visual Studio 2008? I often add text files to my projects. They could be anything from readme files, or some usage information, or test files actually used by the app at runtime. But I've never ever added a text file where I did not want it copied to the output directory on build. I always want them copied, but I often forget to change the setting (esp if I am adding a bunch, as in the case of the test files). I'd like to set the default for Visual Studio so that ALL .txt files are ALWAYS copied to the output folder. Does anyone know if there is a way to permanently change the default setting for .txt files so they are always copied?
visual-studio-2008
null
null
null
null
null
open
Changing the Default "Copy to Output Directory" Setting for Text Files === Does anyone know if there is a way to change a file type's default "Copy to Output Directory" setting in Visual Studio 2008? I often add text files to my projects. They could be anything from readme files, or some usage information, or test files actually used by the app at runtime. But I've never ever added a text file where I did not want it copied to the output directory on build. I always want them copied, but I often forget to change the setting (esp if I am adding a bunch, as in the case of the test files). I'd like to set the default for Visual Studio so that ALL .txt files are ALWAYS copied to the output folder. Does anyone know if there is a way to permanently change the default setting for .txt files so they are always copied?
0
11,364,387
07/06/2012 14:41:35
1,202,172
02/10/2012 13:43:14
108
8
PrimeFaces <p:tree>: how to save tree state between refreshes?
I am using PrimeFaces JSF library, and I have a tree where each node is a checkbox: <p:tree selectionMode="checkbox"...> This tree represents some files, and it is dynamicaly refreshed (polled) every 5 seconds since the files/nodes can be added or removed: <p:poll interval="5" update="treeId"... /> User can select files via tree node checkboxes. Selected nodes are saved in an array of TreeNodes: <p:tree selection="#{BackingBean.selectedNodes}"...> Where selectedNodes is defined as: private TreeNode[] selectedNodes; The problem is: since the tree is constantly being refreshed (every 5 sec), I loose the tree state! What user has checked becomes unchecked again. How would I keep the tree state remembered between 5-sec refreshes?
jsf
tree
primefaces
null
null
null
open
PrimeFaces <p:tree>: how to save tree state between refreshes? === I am using PrimeFaces JSF library, and I have a tree where each node is a checkbox: <p:tree selectionMode="checkbox"...> This tree represents some files, and it is dynamicaly refreshed (polled) every 5 seconds since the files/nodes can be added or removed: <p:poll interval="5" update="treeId"... /> User can select files via tree node checkboxes. Selected nodes are saved in an array of TreeNodes: <p:tree selection="#{BackingBean.selectedNodes}"...> Where selectedNodes is defined as: private TreeNode[] selectedNodes; The problem is: since the tree is constantly being refreshed (every 5 sec), I loose the tree state! What user has checked becomes unchecked again. How would I keep the tree state remembered between 5-sec refreshes?
0
9,255,942
02/13/2012 05:21:33
1,204,336
02/11/2012 21:13:23
6
0
BMI Calculator... except BMI won't show up
Good evening, everyone :> I am currently trying to finalize code for a simple BMI calculator. The trouble is that it won't show me a BMI reading when I input my height and weight in my browser. I'm 99% certain that my HTML is solid, it's just the Javascript that seems to be causing problems. Any input I can get on this matter would be appreciated. Thanks! <!DOCTYPE HTML> <html> <head> <title>BMI Calculator</title> <script type="text/javascript"> /* <![CDATA[ */ function calculate() { var height = document.getElementById("height"); var weight = document.getElementById("weight") * 703; var denom = Math.pow(height, 2); var totalbmi = weight/denom; var bmi = document.getElementById("bmi"); if (isFinite(bmi)) { bmi.innerHTML = totalbmi.toFixed(2); } } /* ]]> */ </script> <style type="text/css"> <!-- .result {font-weight: bold; } --> </style> </head> <body> <form name="details"> <table> <tr> <td>Height<br /> (in Inches)</td> <td><input type="text" size="3" id="height" onChange="calculate();"/></td> </tr> <tr> <td>Weight<br /> (in Pounds)</td> <td><input type="text" size="3" id="weight" onChange="calculate();"/></td> </tr> <tr> <td><input type="button" value="My BMI" onClick="calculate();"/></td> </tr> </table> </table> <table width="270"> <tr> <td width="104">Your BMI is:</td> <td width="154"><input type="text" id="totalbmi"></span></td> </tr> </table> </form> </body> </html>
javascript
null
null
null
null
02/14/2012 08:49:04
too localized
BMI Calculator... except BMI won't show up === Good evening, everyone :> I am currently trying to finalize code for a simple BMI calculator. The trouble is that it won't show me a BMI reading when I input my height and weight in my browser. I'm 99% certain that my HTML is solid, it's just the Javascript that seems to be causing problems. Any input I can get on this matter would be appreciated. Thanks! <!DOCTYPE HTML> <html> <head> <title>BMI Calculator</title> <script type="text/javascript"> /* <![CDATA[ */ function calculate() { var height = document.getElementById("height"); var weight = document.getElementById("weight") * 703; var denom = Math.pow(height, 2); var totalbmi = weight/denom; var bmi = document.getElementById("bmi"); if (isFinite(bmi)) { bmi.innerHTML = totalbmi.toFixed(2); } } /* ]]> */ </script> <style type="text/css"> <!-- .result {font-weight: bold; } --> </style> </head> <body> <form name="details"> <table> <tr> <td>Height<br /> (in Inches)</td> <td><input type="text" size="3" id="height" onChange="calculate();"/></td> </tr> <tr> <td>Weight<br /> (in Pounds)</td> <td><input type="text" size="3" id="weight" onChange="calculate();"/></td> </tr> <tr> <td><input type="button" value="My BMI" onClick="calculate();"/></td> </tr> </table> </table> <table width="270"> <tr> <td width="104">Your BMI is:</td> <td width="154"><input type="text" id="totalbmi"></span></td> </tr> </table> </form> </body> </html>
3
11,053,025
06/15/2012 14:49:44
988,932
10/11/2011 06:27:34
10
1
simple example code for getting text from softkeyboard
Can someone please help me with android java code to launch a softkeyboard from a function call and just get a string in return ??
java
android
null
null
null
06/16/2012 02:26:48
not a real question
simple example code for getting text from softkeyboard === Can someone please help me with android java code to launch a softkeyboard from a function call and just get a string in return ??
1
5,436,358
03/25/2011 18:05:28
677,236
03/25/2011 18:05:28
1
0
android - getting xml data from google weather fails on mobile data connection
I get an issue fetching XML data from google api weather. With WIFI connection, my code works fine, I get xml data from google. Turning off Wifi connection, only with 3G mobile data connection OK : I get a java.io.FileNotFoundException from my BufferedReader. 03-25 18:20:47.991: WARN/System.err(4477): java.io.FileNotFoundException: http://sorry.google.com/sorry/?continue=http://www.google.com/ig/api%3Fweather%3DParis,%2520France%26hl%3DFR On mobile connection, it seems that my URL is altered, some characters are added like 3D% .... like google is responding While the correct URL ( seems to be used when WIFI is ok) is : http://www.google.com/ig/api?weather=Paris,%20France&hl=FR So here's the code that fetch xml : String queryString = "http://www.google.com/ig/api?weather=" + cityParam + "&hl="+Locale.getDefault().getCountry(); URL serverAddress = new URL(queryString.replace(" ", "%20")); HttpURLConnection connection = (HttpURLConnection)serverAddress.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setReadTimeout(10000); connection.connect(); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), Charset.forName("UTF-8"))); etc..... What's the matter with that ?? Any Help would be appreciate ! Chris D from france.
android
null
null
null
null
null
open
android - getting xml data from google weather fails on mobile data connection === I get an issue fetching XML data from google api weather. With WIFI connection, my code works fine, I get xml data from google. Turning off Wifi connection, only with 3G mobile data connection OK : I get a java.io.FileNotFoundException from my BufferedReader. 03-25 18:20:47.991: WARN/System.err(4477): java.io.FileNotFoundException: http://sorry.google.com/sorry/?continue=http://www.google.com/ig/api%3Fweather%3DParis,%2520France%26hl%3DFR On mobile connection, it seems that my URL is altered, some characters are added like 3D% .... like google is responding While the correct URL ( seems to be used when WIFI is ok) is : http://www.google.com/ig/api?weather=Paris,%20France&hl=FR So here's the code that fetch xml : String queryString = "http://www.google.com/ig/api?weather=" + cityParam + "&hl="+Locale.getDefault().getCountry(); URL serverAddress = new URL(queryString.replace(" ", "%20")); HttpURLConnection connection = (HttpURLConnection)serverAddress.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setReadTimeout(10000); connection.connect(); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), Charset.forName("UTF-8"))); etc..... What's the matter with that ?? Any Help would be appreciate ! Chris D from france.
0
7,205,749
08/26/2011 13:56:32
839,280
07/11/2011 16:29:04
135
1
What is AST,CFG,CLANG, how can we use it in deadcode removal algorithm?
I am about to write a dead-code removal algorithm using C language for an online event with our team. The requirements are..... 1. To read a C program source file,Which has many forms of dead-codes. 2. And our output should be a file, Which is free from all dead-codes. While surfing the internet, we came across the SO links... http://stackoverflow.com/questions/4813947/how-can-i-know-which-parts-in-the-code-are-never-used http://stackoverflow.com/questions/229069/dead-code-detection-in-legacy-c-c-project Before seeing these links,we had the basic idea... Reading the input C file, line by line using normal file stream and store in an string array. Then to analyze those strings and determine the very basic dead codes like if(0) and if(1) etc.. And making a stack, for maintaining the parenthesis. And so more... But this has a great problem, that this idea will lead us to do more with string operations rather than removing dead-codes. But After seeing these link... We came to know about Clang library,Abstract Syntax Tree,Control-Flow-Graph etc... But we are very newbie to those libraries and those concepts. We came to know that they are used to parse the C code. Hence we need some basic ideas about these AST,CFG and some basic guidance, explaining how can we use that in our code... Can we include that clang library as a normal library like math.h? Where can we download that library?
c
algorithm
clang
ast
dead-code
08/26/2011 20:24:47
not a real question
What is AST,CFG,CLANG, how can we use it in deadcode removal algorithm? === I am about to write a dead-code removal algorithm using C language for an online event with our team. The requirements are..... 1. To read a C program source file,Which has many forms of dead-codes. 2. And our output should be a file, Which is free from all dead-codes. While surfing the internet, we came across the SO links... http://stackoverflow.com/questions/4813947/how-can-i-know-which-parts-in-the-code-are-never-used http://stackoverflow.com/questions/229069/dead-code-detection-in-legacy-c-c-project Before seeing these links,we had the basic idea... Reading the input C file, line by line using normal file stream and store in an string array. Then to analyze those strings and determine the very basic dead codes like if(0) and if(1) etc.. And making a stack, for maintaining the parenthesis. And so more... But this has a great problem, that this idea will lead us to do more with string operations rather than removing dead-codes. But After seeing these link... We came to know about Clang library,Abstract Syntax Tree,Control-Flow-Graph etc... But we are very newbie to those libraries and those concepts. We came to know that they are used to parse the C code. Hence we need some basic ideas about these AST,CFG and some basic guidance, explaining how can we use that in our code... Can we include that clang library as a normal library like math.h? Where can we download that library?
1
11,304,619
07/03/2012 04:46:33
271,619
02/12/2010 05:42:07
896
6
Aptana IDE - Add New Language
I'm starting to investigate Aptana's features. I come from a Dreamweaver background. Both have great qualities I need. But Dreamweaver doesn't quite allow me to add a new development language into their list. There's syntax highlighting for most of the coding languages I see: PHP, HTML, etc.... But I don't see all languages I need. Like LUA. Is it possible to add a new language type into Aptana, from a Preferences side? Seems most IDE's don't allow for that kind of extensibility. Which forces me to use multiple IDE's. I'm not expecting a perfect IDE, but I would like to know if Aptana can go that far.
aptana
null
null
null
null
null
open
Aptana IDE - Add New Language === I'm starting to investigate Aptana's features. I come from a Dreamweaver background. Both have great qualities I need. But Dreamweaver doesn't quite allow me to add a new development language into their list. There's syntax highlighting for most of the coding languages I see: PHP, HTML, etc.... But I don't see all languages I need. Like LUA. Is it possible to add a new language type into Aptana, from a Preferences side? Seems most IDE's don't allow for that kind of extensibility. Which forces me to use multiple IDE's. I'm not expecting a perfect IDE, but I would like to know if Aptana can go that far.
0
7,909,167
10/26/2011 21:29:17
223,386
12/03/2009 00:19:03
10,171
474
PowerShell remove quietly directory with content
Is it possible to remove in `PowerShell` some directory that contains files with no prompt ?
powershell
directory
null
null
null
null
open
PowerShell remove quietly directory with content === Is it possible to remove in `PowerShell` some directory that contains files with no prompt ?
0
10,514,388
05/09/2012 10:38:16
1,287,366
03/23/2012 02:32:50
25
0
Assistance with an SQL function
This past week I was given an SQL lab involving functions. My knowledge of SQL pre-dating this lab was minimal at best and am having a hard time getting my head around a particular function. Four tables: ![enter image description here][1] [1]: http://i.stack.imgur.com/nP8Rg.jpg I am to create a stored function called teamsize which returns the number of players in a given teams name for a particular year. The team name is to be supplied as a parameter passed to the function. To my knowledge a join is required but that is about all I know. Any help is appreciated
sql
homework
function
join
null
05/10/2012 03:58:54
not a real question
Assistance with an SQL function === This past week I was given an SQL lab involving functions. My knowledge of SQL pre-dating this lab was minimal at best and am having a hard time getting my head around a particular function. Four tables: ![enter image description here][1] [1]: http://i.stack.imgur.com/nP8Rg.jpg I am to create a stored function called teamsize which returns the number of players in a given teams name for a particular year. The team name is to be supplied as a parameter passed to the function. To my knowledge a join is required but that is about all I know. Any help is appreciated
1
10,947,628
06/08/2012 11:04:57
1,314,522
04/05/2012 06:29:17
1
0
How to xml parsing
I want to get distance text from following link but unable to get. please tell me which xml method should i used for following xml. http://maps.googleapis.com/maps/api/directions/xml?origin=30.9165904,75.8634752&destination=30.89314000,75.86938000&sensor=true Thanks to all
iphone
null
null
null
null
06/08/2012 12:41:40
not a real question
How to xml parsing === I want to get distance text from following link but unable to get. please tell me which xml method should i used for following xml. http://maps.googleapis.com/maps/api/directions/xml?origin=30.9165904,75.8634752&destination=30.89314000,75.86938000&sensor=true Thanks to all
1
10,533,169
05/10/2012 11:36:23
1,043,342
11/12/2011 16:55:46
199
1
Why create own request object?
Im building an own php framework. I saw in other frameworks there are even object for doing this, but I cant see the reason why not just use POST and GET arrays directly. Moreover, how to decide when POST or GET? What if there are variables in both area?
php
post
get
request
null
05/10/2012 13:48:27
not constructive
Why create own request object? === Im building an own php framework. I saw in other frameworks there are even object for doing this, but I cant see the reason why not just use POST and GET arrays directly. Moreover, how to decide when POST or GET? What if there are variables in both area?
4
8,311,461
11/29/2011 13:23:39
221,683
11/30/2009 22:36:02
325
3
BeginInvoke - Why isn't this exception caught?
private void f() { Action<string> action = WriteLogToFile; AsyncCallback callBack = LogCallBack; action.BeginInvoke("Hello world!", callBack, action); } private void WriteLogToFile(string message) { Monitor.Enter(locker); string formattedLog = Write(message); try { SendEmailNotifications(formattedLog); } catch (InvalidOperationException) { ... } Monitor.Exit(locker); } private static void LogCallBack(IAsyncResult r) { if (r.IsCompleted) { ((Action<String>) r.AsyncState).EndInvoke(r); } }
c#
.net
asynchronous
delegates
null
null
open
BeginInvoke - Why isn't this exception caught? === private void f() { Action<string> action = WriteLogToFile; AsyncCallback callBack = LogCallBack; action.BeginInvoke("Hello world!", callBack, action); } private void WriteLogToFile(string message) { Monitor.Enter(locker); string formattedLog = Write(message); try { SendEmailNotifications(formattedLog); } catch (InvalidOperationException) { ... } Monitor.Exit(locker); } private static void LogCallBack(IAsyncResult r) { if (r.IsCompleted) { ((Action<String>) r.AsyncState).EndInvoke(r); } }
0
4,333,961
12/02/2010 10:34:01
527,619
12/02/2010 06:59:41
1
0
Telecommunications management network
Telecommunications management network provides a framework for telecommunications management. In fact, management of a telecommunication network facilitates a number of changes in the way telecommunication operators can view their telecommunication resource. The management carried out by a TMN is information management. The information that is being managed is about how the telecommunication network is carrying out its job of providing and maintaining telecommunication services. **How the TMN is control remotely the operations of the telecommunication network? Can anyone help me
networking
null
null
null
null
04/08/2011 01:55:35
not a real question
Telecommunications management network === Telecommunications management network provides a framework for telecommunications management. In fact, management of a telecommunication network facilitates a number of changes in the way telecommunication operators can view their telecommunication resource. The management carried out by a TMN is information management. The information that is being managed is about how the telecommunication network is carrying out its job of providing and maintaining telecommunication services. **How the TMN is control remotely the operations of the telecommunication network? Can anyone help me
1
5,556,229
04/05/2011 17:54:14
554,217
12/26/2010 09:29:16
56
7
i want to build anti virus using c# & winforms
i am thinking of using the windows api. but i have no direction, and i dont know exactly what it involves can anyone give me a direction to build an anti virus in winforms?
c#
winforms
antivirus
null
null
04/05/2011 17:59:13
not a real question
i want to build anti virus using c# & winforms === i am thinking of using the windows api. but i have no direction, and i dont know exactly what it involves can anyone give me a direction to build an anti virus in winforms?
1
9,927,229
03/29/2012 14:18:36
525,039
11/30/2010 10:53:56
27
1
Deploying JSF Application with Virtual host in TomcatServer
I am using Mojarra 2.0.4 implementation of JSF with Tomcat server for one of my application, now i came to a problem during its deployment. I had added a virtual host to the Tomcat server.xml as follows, <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"/> <Host name="www.edgeutil308.com" appBase="webapps/EdgeUtil" unpackWARs="true" autoDeploy="true"> <Alias>edgeutil308.com</Alias> <Context path="" docBase="."/> </Host> The problem which i am facing is that my mojarra implementation initializes twice as like below\ INFO: Initializing Mojarra 2.0.4 (FCS b06) for context '' ----- ----- INFO: Initializing Mojarra 2.0.4 (FCS b06) for context '/EdgeUtil' and also i couldnot get the application run without using the project name as its context path like this www.edgeutil308.com/EdgeUtil Please help me to solve this issue.
jsf
tomcat
virtualhost
mojarra
null
null
open
Deploying JSF Application with Virtual host in TomcatServer === I am using Mojarra 2.0.4 implementation of JSF with Tomcat server for one of my application, now i came to a problem during its deployment. I had added a virtual host to the Tomcat server.xml as follows, <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"/> <Host name="www.edgeutil308.com" appBase="webapps/EdgeUtil" unpackWARs="true" autoDeploy="true"> <Alias>edgeutil308.com</Alias> <Context path="" docBase="."/> </Host> The problem which i am facing is that my mojarra implementation initializes twice as like below\ INFO: Initializing Mojarra 2.0.4 (FCS b06) for context '' ----- ----- INFO: Initializing Mojarra 2.0.4 (FCS b06) for context '/EdgeUtil' and also i couldnot get the application run without using the project name as its context path like this www.edgeutil308.com/EdgeUtil Please help me to solve this issue.
0
9,823,888
03/22/2012 14:06:16
1,065,635
11/25/2011 12:44:18
48
0
Make winforms application run on other computer
I developed a WinForms application (using C#, with visual studio 2008) and I have a few questions regarding how to build it properly: 1. Will the exe release file be able to run on other computer with only the required .net framework and not visual studio (or any other visual-ish program)? The exe file size is only around 50kb, which is way too small for such an application so I really doubt it. I did try this on other computer with .net installed and it seemed to work fine, just want to reassure that though. 2. Is there any way to include the .net framework functions that I use into my application so that it will run on any other Windows computer (with .net framework installed or not)? As in, include everything in a single exe file, just click-click and run.
c#
winforms
frameworks
build
net
null
open
Make winforms application run on other computer === I developed a WinForms application (using C#, with visual studio 2008) and I have a few questions regarding how to build it properly: 1. Will the exe release file be able to run on other computer with only the required .net framework and not visual studio (or any other visual-ish program)? The exe file size is only around 50kb, which is way too small for such an application so I really doubt it. I did try this on other computer with .net installed and it seemed to work fine, just want to reassure that though. 2. Is there any way to include the .net framework functions that I use into my application so that it will run on any other Windows computer (with .net framework installed or not)? As in, include everything in a single exe file, just click-click and run.
0
8,241,573
11/23/2011 11:41:20
1,018,711
10/28/2011 16:07:04
105
1
Clickonce - Deploy on DVD, update online
i have wpf application and want to distribute it on CD/DVD via clickonce installer. I want to target also users without internet connection. So I included offline .net framework installer. But i also want to take advantage of internet connection if available to download updates. So basicaly i want to have - DVD installer with internet autoupdate via clickonce. In visual studio in wizard i select publish on DVD and install updates from http://www.sudokucd.cz/autoupdate. Here is strange thing, it does not support ftp and credentials, in the textbox for source location is only http protocol available. And if i publish on visual studio it only publishes on selected folder (which i should burn to DVD) but not on update location. So how does it work when i make new version of product and want to publish it to update location for users to be availible for autoupdate? Do i need to copy to thre somehow manually and if yes -
c#
.net
clickonce
autoupdate
null
null
open
Clickonce - Deploy on DVD, update online === i have wpf application and want to distribute it on CD/DVD via clickonce installer. I want to target also users without internet connection. So I included offline .net framework installer. But i also want to take advantage of internet connection if available to download updates. So basicaly i want to have - DVD installer with internet autoupdate via clickonce. In visual studio in wizard i select publish on DVD and install updates from http://www.sudokucd.cz/autoupdate. Here is strange thing, it does not support ftp and credentials, in the textbox for source location is only http protocol available. And if i publish on visual studio it only publishes on selected folder (which i should burn to DVD) but not on update location. So how does it work when i make new version of product and want to publish it to update location for users to be availible for autoupdate? Do i need to copy to thre somehow manually and if yes -
0
10,087,098
04/10/2012 10:33:21
1,193,202
02/06/2012 20:07:09
3
1
SQL filtering syntax
I have table "TableA" which contain several data, I need run query which sort out items which have EAN prefix 423 *and* with price higher 100. What would be correct query for this case? Another table is "TableB", where I need match all items that have prefix 406 in column "EAN", have any values in column "DPA", have names "toro" or "nevo" in column "Description", have any values in column "EAN". I.e. list all items that match any of these criteria. Can someone specify a proper SQL syntax for queries?
sql
excel
null
null
null
null
open
SQL filtering syntax === I have table "TableA" which contain several data, I need run query which sort out items which have EAN prefix 423 *and* with price higher 100. What would be correct query for this case? Another table is "TableB", where I need match all items that have prefix 406 in column "EAN", have any values in column "DPA", have names "toro" or "nevo" in column "Description", have any values in column "EAN". I.e. list all items that match any of these criteria. Can someone specify a proper SQL syntax for queries?
0
10,157,952
04/14/2012 22:41:40
1,333,839
04/14/2012 22:16:40
1
0
Is it proper to reference your project name inside your Django project?
I'm using Django and I'm wondering whether it's proper to use myapp.models, opposed to myproject.myapp.models, or in INSTALLED_APPS, should the FULL NAME be used myproject.myapp or is it alright to just use myapp for it's name? I am wondering because if I were to change the project name using the latter method it would break my app, but I'm not sure that just because the former method works that it is correct. Could someone clear this up for me. Thank you!
python
django
import
null
null
null
open
Is it proper to reference your project name inside your Django project? === I'm using Django and I'm wondering whether it's proper to use myapp.models, opposed to myproject.myapp.models, or in INSTALLED_APPS, should the FULL NAME be used myproject.myapp or is it alright to just use myapp for it's name? I am wondering because if I were to change the project name using the latter method it would break my app, but I'm not sure that just because the former method works that it is correct. Could someone clear this up for me. Thank you!
0
9,104,236
02/01/2012 22:20:43
396,077
07/19/2010 17:52:03
708
1
Detect when a user comes through the new Facebook Authenticated Referrals
With the new Authenticated Referrals in the new FB auth system, the user logs in before even hitting my app. My question is, is there any way to detect when a user has just come from one of these authenticated referrel dialogs? For example, by specifying the redirect_uri on them and appending some GET params.
facebook
null
null
null
null
null
open
Detect when a user comes through the new Facebook Authenticated Referrals === With the new Authenticated Referrals in the new FB auth system, the user logs in before even hitting my app. My question is, is there any way to detect when a user has just come from one of these authenticated referrel dialogs? For example, by specifying the redirect_uri on them and appending some GET params.
0
6,869,535
07/29/2011 06:41:26
868,850
07/29/2011 06:41:26
1
0
GUI application that translates number to word sentence.
I would like to create a GUI application that can take a number and translates it to a word sentence. e.g. 101 = One hundred and one. I have already completed the layout (Buttons etc) but I cant create the code for the button press that will translate the word. Thank you.
c#
null
null
null
null
07/29/2011 06:51:33
not a real question
GUI application that translates number to word sentence. === I would like to create a GUI application that can take a number and translates it to a word sentence. e.g. 101 = One hundred and one. I have already completed the layout (Buttons etc) but I cant create the code for the button press that will translate the word. Thank you.
1
1,688,465
11/06/2009 15:52:46
74,727
03/06/2009 15:05:23
3,086
139
ReSharper Warning - Access to Modified Closure
I have the following code: string acctStatus = account.AccountStatus.ToString(); if (!SettableStatuses().Any(status => status == acctStatus)) acctStatus = ACCOUNTSTATUS.Pending.ToString(); Note that account.AccountStatus is an enum of type ACCOUNTSTATUS. On the second line, ReSharper is giving me the warning "Access to Modified Closure" for acctStatus. When I do the recommended operation, *Copy to local variable*, it modifies the code to the following: string acctStatus = realAccount.AccountStatus.ToString(); string s = acctStatus; if (!SettableStatuses().Any(status => status == s)) acctStatus = ACCOUNTSTATUS.Pending.ToString(); Why is this better or preferable to what I had originally? **EDIT** It also recommends *Wrap local variable in array*, which produces: string[] acctStatus = {realAccount.AccountStatus.ToString()}; if (!SettableStatuses().Any(status => status == acctStatus[0])) acctStatus[0] = ACCOUNTSTATUS.Pending.ToString(); This seems downright wacky to me.
c#
resharper
warnings
null
null
null
open
ReSharper Warning - Access to Modified Closure === I have the following code: string acctStatus = account.AccountStatus.ToString(); if (!SettableStatuses().Any(status => status == acctStatus)) acctStatus = ACCOUNTSTATUS.Pending.ToString(); Note that account.AccountStatus is an enum of type ACCOUNTSTATUS. On the second line, ReSharper is giving me the warning "Access to Modified Closure" for acctStatus. When I do the recommended operation, *Copy to local variable*, it modifies the code to the following: string acctStatus = realAccount.AccountStatus.ToString(); string s = acctStatus; if (!SettableStatuses().Any(status => status == s)) acctStatus = ACCOUNTSTATUS.Pending.ToString(); Why is this better or preferable to what I had originally? **EDIT** It also recommends *Wrap local variable in array*, which produces: string[] acctStatus = {realAccount.AccountStatus.ToString()}; if (!SettableStatuses().Any(status => status == acctStatus[0])) acctStatus[0] = ACCOUNTSTATUS.Pending.ToString(); This seems downright wacky to me.
0
10,143,352
04/13/2012 15:04:39
613,631
02/11/2011 20:53:56
135
7
Eclipse: multiple project from single source
at first i have to say that i'm not very good with english, so i'm sorry if i can explain very well what i mean :) I have one project that i need to replicate n times; every new project must have the same source code, but different resources (ex: images, html files, sounds, pdf, etc) and different class/packages names. Is it possible? The best is to have also a system to commit source changes form the main project to the childs, but it's not mandatory. Sorry again for my english.
eclipse
null
null
null
null
null
open
Eclipse: multiple project from single source === at first i have to say that i'm not very good with english, so i'm sorry if i can explain very well what i mean :) I have one project that i need to replicate n times; every new project must have the same source code, but different resources (ex: images, html files, sounds, pdf, etc) and different class/packages names. Is it possible? The best is to have also a system to commit source changes form the main project to the childs, but it's not mandatory. Sorry again for my english.
0
9,405,125
02/22/2012 23:52:36
87,968
04/07/2009 07:18:35
877
11
Finding all permutations of a string
I am attempting to write a function to generate all possible permutations of a string. However it is not working as expected. Can anyone help me find the problem? static List<string> GenerateAllPermutations(string pStr) { List<string> tempList = new List<string>(); if(pStr.Length == 1) { tempList.Add(pStr); return tempList; } foreach (string s in GenerateAllPermutations(pStr.Substring(1, pStr.Length - 1))) { tempList.Add(pStr[0]+s); tempList.Add(s+ pStr[0]); } return(tempList); } There appears to be some mistake in my formulation of recursion.
c#
homework
null
null
null
02/23/2012 02:09:42
too localized
Finding all permutations of a string === I am attempting to write a function to generate all possible permutations of a string. However it is not working as expected. Can anyone help me find the problem? static List<string> GenerateAllPermutations(string pStr) { List<string> tempList = new List<string>(); if(pStr.Length == 1) { tempList.Add(pStr); return tempList; } foreach (string s in GenerateAllPermutations(pStr.Substring(1, pStr.Length - 1))) { tempList.Add(pStr[0]+s); tempList.Add(s+ pStr[0]); } return(tempList); } There appears to be some mistake in my formulation of recursion.
3
9,615,947
03/08/2012 10:13:53
569,654
01/10/2011 10:16:58
881
15
How to get jquery stars rel value?
On my page i have radio buttons... <div class="stars-wrapper1"> <input type="radio" rel="@Model.ThePhoto.ID" name="newrate" value="1" title="VeryPoor" @Html.Raw((Model.review == 1?"checked=\"checked\"":"")) /> <input type="radio" rel="@Model.ThePhoto.ID" name="newrate" value="2" title="Poor" @Html.Raw((Model.review == 2?"checked=\"checked\"":"")) /> They are radio buttons and when i use the function stars they turn into this.. <div class="stars-wrapper1"> <div class="ui-stars-cancel" style="opacity: 1; "> <a title="">0</a> </div> <div class="ui-stars-star ui-stars-star-on"> <a title="">1</a> </div> <div class="ui-stars-star ui-stars-star-on"> <a title="">2</a> </div> </div> When I click on a star i want to disable them and get the rel value so i can save into my db this is the rating this photo received jquery: $(document).ready(function () { $(".stars-wrapper1").stars(); $('.stars-wrapper1 a ').click(function () { alert($(this).attr('rel')); }); }); but the rel value disappears when stars() is applied...? There are many different images with these stars on one page, so the rel is how im trying to find out what image the user has rated.
jquery
null
null
null
null
null
open
How to get jquery stars rel value? === On my page i have radio buttons... <div class="stars-wrapper1"> <input type="radio" rel="@Model.ThePhoto.ID" name="newrate" value="1" title="VeryPoor" @Html.Raw((Model.review == 1?"checked=\"checked\"":"")) /> <input type="radio" rel="@Model.ThePhoto.ID" name="newrate" value="2" title="Poor" @Html.Raw((Model.review == 2?"checked=\"checked\"":"")) /> They are radio buttons and when i use the function stars they turn into this.. <div class="stars-wrapper1"> <div class="ui-stars-cancel" style="opacity: 1; "> <a title="">0</a> </div> <div class="ui-stars-star ui-stars-star-on"> <a title="">1</a> </div> <div class="ui-stars-star ui-stars-star-on"> <a title="">2</a> </div> </div> When I click on a star i want to disable them and get the rel value so i can save into my db this is the rating this photo received jquery: $(document).ready(function () { $(".stars-wrapper1").stars(); $('.stars-wrapper1 a ').click(function () { alert($(this).attr('rel')); }); }); but the rel value disappears when stars() is applied...? There are many different images with these stars on one page, so the rel is how im trying to find out what image the user has rated.
0
6,800,295
07/23/2011 12:18:41
798,417
06/14/2011 20:02:45
50
0
Java server application database options
I'm in the planning phase of a java server application specified for my needs. Basically, the server needs to check a database with usernames and passwords and some specified values for each user. As I'm new to java server applications, I'm wondering what the ideal choice for this would be. The database needs to be able to be saved when the server application closes and resumed at a later time. One option I've been thinking of is simply to have a .txt file as the database and upon server start, create a HashMap or something and use the data stored in the file. This makes it readable (cause of the .txt file) and I've heard that HashMaps are excellent choices for performance. I've read about HSQLDB but I'm unsure how to use this. Thanks. Mike.
java
database
application
options
null
07/25/2011 01:31:07
not a real question
Java server application database options === I'm in the planning phase of a java server application specified for my needs. Basically, the server needs to check a database with usernames and passwords and some specified values for each user. As I'm new to java server applications, I'm wondering what the ideal choice for this would be. The database needs to be able to be saved when the server application closes and resumed at a later time. One option I've been thinking of is simply to have a .txt file as the database and upon server start, create a HashMap or something and use the data stored in the file. This makes it readable (cause of the .txt file) and I've heard that HashMaps are excellent choices for performance. I've read about HSQLDB but I'm unsure how to use this. Thanks. Mike.
1
8,189,505
11/18/2011 21:39:50
985,832
10/08/2011 21:39:36
1
0
getting youtube rss info from video code
I need to get rss information of one particular video and I am using following rss address for getting the information. http://gdata.youtube.com/feeds/base/videos?q=[videoCode] This rss address is actually searching videos by keyword. But this does not return anything if I put a videocode that was not published to everyone or a videocode starting with "-" like "-EKGCBZ5i1Y" Can any1 tell me a good rss address that returns information of a particular video? Thanks!
xml
rss
youtube
feed
gdata
11/25/2011 00:09:31
off topic
getting youtube rss info from video code === I need to get rss information of one particular video and I am using following rss address for getting the information. http://gdata.youtube.com/feeds/base/videos?q=[videoCode] This rss address is actually searching videos by keyword. But this does not return anything if I put a videocode that was not published to everyone or a videocode starting with "-" like "-EKGCBZ5i1Y" Can any1 tell me a good rss address that returns information of a particular video? Thanks!
2
7,891,929
10/25/2011 15:44:33
272,706
02/14/2010 10:03:05
1,134
11
Silverlight for Beginners
I want to start learning **Silverlight** (4/5). Which resources (tutorials, books, videos, webcasts) would you recommend for an **XAML**-beginner but experienced windows/web developer? I want to learn it as fast as possible. I don't want to read 100 of pages of fat books.
.net
wpf
silverlight
xaml
null
10/25/2011 15:54:12
not constructive
Silverlight for Beginners === I want to start learning **Silverlight** (4/5). Which resources (tutorials, books, videos, webcasts) would you recommend for an **XAML**-beginner but experienced windows/web developer? I want to learn it as fast as possible. I don't want to read 100 of pages of fat books.
4
10,171,967
04/16/2012 09:53:24
1,329,042
04/12/2012 12:06:47
1
0
Super simple REST webservice
am looking for help to create a REST webservice on netbeans in java i tried looking for a simple tutorials but they all show complex stuff like entity classes etec i just want a simple little hello world or better yet , a webservice that takes a string and returns it back can anyone show me how to write it ? or a tutorial that does?
web-services
rest
null
null
null
null
open
Super simple REST webservice === am looking for help to create a REST webservice on netbeans in java i tried looking for a simple tutorials but they all show complex stuff like entity classes etec i just want a simple little hello world or better yet , a webservice that takes a string and returns it back can anyone show me how to write it ? or a tutorial that does?
0
9,171,880
02/07/2012 06:23:51
862,289
07/25/2011 20:10:27
1
0
Programaticaly Setting Bound Model Object Properties from View in EmberJS
QQ: How can I update an object's property to match the innerHtml of an element in a view when a button is clicked? I am working on building a content editing interface using EmberJS and the HTML5 contenteditable attribute (via the [Hallo editor][1]). This means that valueBinding doesn't do the trick, since we're dealing with the actual page HTML, not input/textarea value attributes. I've built a similar app in Backbone, which lacks dynamic bindings but allows you to set the model object as a property of the view. What's the best way to get this working with EmberJS? Should I set a property on the view to the entire model? Do I need to create some sort of innerHtml binding and view helper, modeled on valueBinding? I've set up a fiddle with an example of what I'm trying to do (with basic jQuery handling of the contentEditable attribute, instead of hallo): http://jsfiddle.net/W6gsW/2/ Thanks! [1]: https://github.com/bergie/hallo
html5
contenteditable
emberjs
null
null
null
open
Programaticaly Setting Bound Model Object Properties from View in EmberJS === QQ: How can I update an object's property to match the innerHtml of an element in a view when a button is clicked? I am working on building a content editing interface using EmberJS and the HTML5 contenteditable attribute (via the [Hallo editor][1]). This means that valueBinding doesn't do the trick, since we're dealing with the actual page HTML, not input/textarea value attributes. I've built a similar app in Backbone, which lacks dynamic bindings but allows you to set the model object as a property of the view. What's the best way to get this working with EmberJS? Should I set a property on the view to the entire model? Do I need to create some sort of innerHtml binding and view helper, modeled on valueBinding? I've set up a fiddle with an example of what I'm trying to do (with basic jQuery handling of the contentEditable attribute, instead of hallo): http://jsfiddle.net/W6gsW/2/ Thanks! [1]: https://github.com/bergie/hallo
0
8,483,592
12/13/2011 02:22:41
1,094,854
12/13/2011 01:42:56
1
0
How to protect research data on Sharepoint or other website
I am building a website for collecting research data from field workers, and I'm not sure what would be the best way to secure it. I'm very new to this and although I have done some research, I'm still not clear on how to think about this. I was looking at Firehost (firehost.com) to get an idea of what kind of security measures could be useful, and see that they are using SSL + VPN. If I'm understanding correctly, SSL is for encrypting transactions, and VPN is used in this case to protect access to servers "in the cloud." My organization uses Sharepoint, which I'm not too crazy about, but it will probably be easier to use it given the way our IT department works. I can create a Sharepoint site requiring users to login, and I can see that it's using SSL/TLS, since the site addresses begin with "https" (right?). As far as access to the server, I'm wondering if I should ask if we're hosting it on our own servers, and if that would make it more secure vs. being "in the cloud"? Or is there something else I should do or ask about it? Hope that makes sense. Any clarifying questions are appreciated. Thanks.
security
sharepoint
ssl
null
null
12/13/2011 13:09:12
off topic
How to protect research data on Sharepoint or other website === I am building a website for collecting research data from field workers, and I'm not sure what would be the best way to secure it. I'm very new to this and although I have done some research, I'm still not clear on how to think about this. I was looking at Firehost (firehost.com) to get an idea of what kind of security measures could be useful, and see that they are using SSL + VPN. If I'm understanding correctly, SSL is for encrypting transactions, and VPN is used in this case to protect access to servers "in the cloud." My organization uses Sharepoint, which I'm not too crazy about, but it will probably be easier to use it given the way our IT department works. I can create a Sharepoint site requiring users to login, and I can see that it's using SSL/TLS, since the site addresses begin with "https" (right?). As far as access to the server, I'm wondering if I should ask if we're hosting it on our own servers, and if that would make it more secure vs. being "in the cloud"? Or is there something else I should do or ask about it? Hope that makes sense. Any clarifying questions are appreciated. Thanks.
2
11,093,248
06/19/2012 01:27:26
260,533
01/27/2010 23:30:08
373
6
geom_vline with Character xintercept
I have some ggplot code that worked fine in 0.8.9 but not in 0.9.1. I am going to plot the data in `theDF` and would like to plot a vertical line at `xintercept="2010 Q1."` `theGrid` is merely used to create `theDF`. theGrid <- expand.grid(2009:2011, 1:4) theDF <- data.frame(YrQtr=sprintf("%s Q%s", theGrid$Var1, theGrid$Var2), Minutes=c(1000, 2200, 1450, 1825, 1970, 1770, 1640, 1920, 1790, 1800, 1750, 1600)) The code used is: g <- ggplot(theDF, aes(x=YrQtr, y=Minutes)) + geom_point() + opts(axis.text.x=theme_text(angle=90)) g + geom_vline(data=theVerts, aes(data=data.frame(Vert="2010 Q2"), xintercept=Vert)) Again, this worked fine in R 2.13.2 with ggplot2 0.8.9, but does not in R 2.14+ with ggplot2 0.9.1. A workaround is: g + geom_vline(data=theVerts, aes(data=data.frame(Vert=4), xintercept=Vert)) But that is not a good solution for my problem. Maybe messing around with `scale_x_discrete` might help?
r
plot
ggplot2
null
null
null
open
geom_vline with Character xintercept === I have some ggplot code that worked fine in 0.8.9 but not in 0.9.1. I am going to plot the data in `theDF` and would like to plot a vertical line at `xintercept="2010 Q1."` `theGrid` is merely used to create `theDF`. theGrid <- expand.grid(2009:2011, 1:4) theDF <- data.frame(YrQtr=sprintf("%s Q%s", theGrid$Var1, theGrid$Var2), Minutes=c(1000, 2200, 1450, 1825, 1970, 1770, 1640, 1920, 1790, 1800, 1750, 1600)) The code used is: g <- ggplot(theDF, aes(x=YrQtr, y=Minutes)) + geom_point() + opts(axis.text.x=theme_text(angle=90)) g + geom_vline(data=theVerts, aes(data=data.frame(Vert="2010 Q2"), xintercept=Vert)) Again, this worked fine in R 2.13.2 with ggplot2 0.8.9, but does not in R 2.14+ with ggplot2 0.9.1. A workaround is: g + geom_vline(data=theVerts, aes(data=data.frame(Vert=4), xintercept=Vert)) But that is not a good solution for my problem. Maybe messing around with `scale_x_discrete` might help?
0
6,981,899
08/08/2011 12:12:12
824,910
07/01/2011 13:04:53
1
0
How to get the client IP address from the request made to webservice
I have a webservice hosted in my IIS... I need to find out the clientIP address when the client use my service directly like http://MyIpAddress/MyApplication/MyWebServiceClass.asmx and is it possible to read file from the client machine? If so how can I do it?
c#
.net
web-services
file-upload
null
null
open
How to get the client IP address from the request made to webservice === I have a webservice hosted in my IIS... I need to find out the clientIP address when the client use my service directly like http://MyIpAddress/MyApplication/MyWebServiceClass.asmx and is it possible to read file from the client machine? If so how can I do it?
0
10,954,198
06/08/2012 18:28:57
1,246,574
03/03/2012 08:37:41
158
9
C# - WCF - How to use a custom type object at the client
I'm new to C# and to WCF, coming from a Java background. I'm have a solution with a WCF service hosted on IIS that has an Employee class, and a method... public Employee getEmployee(int loginId) This method takes the loginId, queries the database and creates an Employee object with the results, and then returns the Employee object. Simple enough. So I have a client, and thus far all it does is call a simple "Hello World" web method to prove to me that it's configured right to talk to the service. Now I want a login button to take the entered loginId, call getEmployee, and create a local Employee object with the returned value. So, I'm confused on the point of how I should define the Employee class at the client? There's not alot of info out there on how to do something so simple; like with AXIS2 and NetBeans for Java this would be utterly simple with lots of tutorials to show how, but for WCF it seems every tutorial just assumes certain knowledge that I don't have. So the post below says that this can be done by having my Employee class defined in a separate assembly, and reference the .dll from both the WCF Service project and the client project (both are in separate solutions by the way). http://stackoverflow.com/questions/7718875/wcf-passing-a-custom-object-to-client-and-running-its-methods It says "you can create a contracts assembly (an assembly that contains your thin domain models (e.g. Person etc) which you can add your own logic to.", but doesn't explain how to do this or give any reference to where I can find more information or instructions. My Employee class is already defined directly in the WCF Service project anyways. If someone can give any info on how to move it to a "contracts assembly" (I'm C# noob and haven't even ever created a DLL before; just Windows Forms projects), that would be much appreciated. Also, I see in another answer on the same post the following... "1.If you can't change sources of the dll and want to call public method of the dll, it is better to use reflection. So, you receive object from WCF, sets Person properties with values returned, call method." I understand the concept above; I would define a separate Employee class at the client, and then somehow use reflection to get the values from the object that the web method returns, and assign them to a new Employee object, right?. Only, I don't have any idea how to use reflection to get values for that. What's best practice? Should I define an IEmployee interface like this other post suggests, and then put it in a DLL with the regular Employee class, and reference that from both server and client, and return IEmployee instead of Employee from the web method? If that's the best thing to do, is there anything special that has to be done, or can I literally just do something like this so long as such a DLL is references on both sides? int loginId = Int32.Parse(this.loginInputTxt.Text); LaborService.LaborServiceClient proxy = new LaborService.LaborServiceClient(); Employee emp = (Employee)proxy.getEmployee(loginId);
c#
.net
wcf
web-services
iis
null
open
C# - WCF - How to use a custom type object at the client === I'm new to C# and to WCF, coming from a Java background. I'm have a solution with a WCF service hosted on IIS that has an Employee class, and a method... public Employee getEmployee(int loginId) This method takes the loginId, queries the database and creates an Employee object with the results, and then returns the Employee object. Simple enough. So I have a client, and thus far all it does is call a simple "Hello World" web method to prove to me that it's configured right to talk to the service. Now I want a login button to take the entered loginId, call getEmployee, and create a local Employee object with the returned value. So, I'm confused on the point of how I should define the Employee class at the client? There's not alot of info out there on how to do something so simple; like with AXIS2 and NetBeans for Java this would be utterly simple with lots of tutorials to show how, but for WCF it seems every tutorial just assumes certain knowledge that I don't have. So the post below says that this can be done by having my Employee class defined in a separate assembly, and reference the .dll from both the WCF Service project and the client project (both are in separate solutions by the way). http://stackoverflow.com/questions/7718875/wcf-passing-a-custom-object-to-client-and-running-its-methods It says "you can create a contracts assembly (an assembly that contains your thin domain models (e.g. Person etc) which you can add your own logic to.", but doesn't explain how to do this or give any reference to where I can find more information or instructions. My Employee class is already defined directly in the WCF Service project anyways. If someone can give any info on how to move it to a "contracts assembly" (I'm C# noob and haven't even ever created a DLL before; just Windows Forms projects), that would be much appreciated. Also, I see in another answer on the same post the following... "1.If you can't change sources of the dll and want to call public method of the dll, it is better to use reflection. So, you receive object from WCF, sets Person properties with values returned, call method." I understand the concept above; I would define a separate Employee class at the client, and then somehow use reflection to get the values from the object that the web method returns, and assign them to a new Employee object, right?. Only, I don't have any idea how to use reflection to get values for that. What's best practice? Should I define an IEmployee interface like this other post suggests, and then put it in a DLL with the regular Employee class, and reference that from both server and client, and return IEmployee instead of Employee from the web method? If that's the best thing to do, is there anything special that has to be done, or can I literally just do something like this so long as such a DLL is references on both sides? int loginId = Int32.Parse(this.loginInputTxt.Text); LaborService.LaborServiceClient proxy = new LaborService.LaborServiceClient(); Employee emp = (Employee)proxy.getEmployee(loginId);
0
3,269,174
07/16/2010 22:02:38
387,184
07/08/2010 21:42:48
1
1
Creating thumbnail from video - choosing the image to be used during preview
making a thumbnail from video using the picker is straight forward. However, when I press PLAY in the picker and then chose the video, my thumbnail is alway black. I was hoping it makes a screenshot - however this method only takes the first image of the video - and ONLY IF IT HASN'T BEEN PLAYED! How can I make a thumbnail at any position of the video? Here the "normal" code I use for thumbnails, where the video hasn't been played: - (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection { CGSize size = viewImage.size; CGFloat ratio = 0; if (size.width > size.height) { ratio = 80.0 / size.width; } else { ratio = 80.0 / size.height; } CGRect rectForthumbnail = CGRectMake(0.0, 0.0, ratio * size.width, ratio * size.height); UIGraphicsBeginImageContext(rectForthumbnail.size); CGRect clipRect = CGRectMake(0.0, 0.0,74,74); [viewImage drawInRect:clipRect]; dance.thumbnailImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); After having pressed "PLAY", unfortunately, the created thumbnail is black (only shows the top of the iphone screen where the video roll and the current play position is displayed), the remaining of the thumbnail is always black. As said, in other cases it works well. Thanks very much!
iphone
xcode
video
thumbnail
preview
null
open
Creating thumbnail from video - choosing the image to be used during preview === making a thumbnail from video using the picker is straight forward. However, when I press PLAY in the picker and then chose the video, my thumbnail is alway black. I was hoping it makes a screenshot - however this method only takes the first image of the video - and ONLY IF IT HASN'T BEEN PLAYED! How can I make a thumbnail at any position of the video? Here the "normal" code I use for thumbnails, where the video hasn't been played: - (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection { CGSize size = viewImage.size; CGFloat ratio = 0; if (size.width > size.height) { ratio = 80.0 / size.width; } else { ratio = 80.0 / size.height; } CGRect rectForthumbnail = CGRectMake(0.0, 0.0, ratio * size.width, ratio * size.height); UIGraphicsBeginImageContext(rectForthumbnail.size); CGRect clipRect = CGRectMake(0.0, 0.0,74,74); [viewImage drawInRect:clipRect]; dance.thumbnailImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); After having pressed "PLAY", unfortunately, the created thumbnail is black (only shows the top of the iphone screen where the video roll and the current play position is displayed), the remaining of the thumbnail is always black. As said, in other cases it works well. Thanks very much!
0
9,657,404
03/11/2012 17:59:55
1,095,159
12/13/2011 06:30:09
58
3
Confused why code will only work with ob_start();
I have added some server side validation to a dropdown box on one of my pages and when I did the page wouldn't work anymore. The code I added is as follows: $show_form = true; if (isset($_POST['submit'])) { //All of the server side validations $validator = new FormValidator(); $validator->addValidation("hospital_name","dontselect=000","No facility was chosen"); if ($validator->ValidateForm()) { // All the variables from the submission form $userid = $_SESSION['user_id']; $hosp = $_POST['hospital_name']; header('Location: ../site_hospital' . $hosp . '/hospital_submitform.php?usr=' . $userid . '&&hosp=' . $hosp); exit; $show_form = false; } else { echo "<B style='color:red;'>The following errors occurred:</B>"; $error_hash = $validator->GetErrors(); foreach ($error_hash as $inpname => $inp_err) { echo "<p style='color:red;'>$inp_err</p>\n"; } }} if (true == $show_form) { Through pure chance I added ob_start(); as part of my debugging to the beginning of the page and suddenly my code worked properly but I have no idea why and I was hoping the community could throw out an educated guess as to why. When the code stopped working it would not execute my header command above, the page would simply refresh and not change location, when I added ob_start(); to the top of the page the page redirected as planned. So the overall question is why would the page not direct using the header command without ob_start? I'm sure alot more detail and code is necessary for a definitive answer but I'm hoping someone has run into this before or has an educated guess that may lead me to my own answers. Thanks for any insight.
php
null
null
null
null
null
open
Confused why code will only work with ob_start(); === I have added some server side validation to a dropdown box on one of my pages and when I did the page wouldn't work anymore. The code I added is as follows: $show_form = true; if (isset($_POST['submit'])) { //All of the server side validations $validator = new FormValidator(); $validator->addValidation("hospital_name","dontselect=000","No facility was chosen"); if ($validator->ValidateForm()) { // All the variables from the submission form $userid = $_SESSION['user_id']; $hosp = $_POST['hospital_name']; header('Location: ../site_hospital' . $hosp . '/hospital_submitform.php?usr=' . $userid . '&&hosp=' . $hosp); exit; $show_form = false; } else { echo "<B style='color:red;'>The following errors occurred:</B>"; $error_hash = $validator->GetErrors(); foreach ($error_hash as $inpname => $inp_err) { echo "<p style='color:red;'>$inp_err</p>\n"; } }} if (true == $show_form) { Through pure chance I added ob_start(); as part of my debugging to the beginning of the page and suddenly my code worked properly but I have no idea why and I was hoping the community could throw out an educated guess as to why. When the code stopped working it would not execute my header command above, the page would simply refresh and not change location, when I added ob_start(); to the top of the page the page redirected as planned. So the overall question is why would the page not direct using the header command without ob_start? I'm sure alot more detail and code is necessary for a definitive answer but I'm hoping someone has run into this before or has an educated guess that may lead me to my own answers. Thanks for any insight.
0
6,044,876
05/18/2011 12:47:19
113,213
05/27/2009 14:43:57
496
40
SSO Between Websphere Portal and .NET Application
What's the best way to configure SSO between a WebSphere Portal Portlet and a .NET application? We are using WebSphere Portal 6.1.5 and the portlet should just redirect to the .NET application, but not require the user to login since they already did on portal. Both Portal and .NET app are using same Active Directory(LDAP) for authentication.
websphere
portal
websphere-portal
jsr286
jsr168
null
open
SSO Between Websphere Portal and .NET Application === What's the best way to configure SSO between a WebSphere Portal Portlet and a .NET application? We are using WebSphere Portal 6.1.5 and the portlet should just redirect to the .NET application, but not require the user to login since they already did on portal. Both Portal and .NET app are using same Active Directory(LDAP) for authentication.
0
9,902,695
03/28/2012 07:08:16
1,297,400
03/28/2012 07:02:17
1
0
( was unexpected at this time error
Code below contains outermost if-else loop, In the if block there is (1) if-else condition In its else block there is (1) if exist condition containing if-else condition (2) if not exist condition. if exist filename1.abc ( some code if "!line_count!"=="1" ( echo something ) else ( echo nothing ) ) else ( if exist filename2.xyz ( echo Today's files doesn't exist if "!line_count!"=="1" ( echo something ) else ( echo nothing )) if not exist d:\mailAutomation\test\*_AH_*.csv ( echo No file found )) The code produces correct output but shows an error “( was unexpected at this time” on the console. (All the opening round brackets in the code appear highlighted blue colour, closing brackets do not find their corressponding opening bracket). Please Help.
batch
batch-file
batch-script
null
null
05/21/2012 16:04:19
too localized
( was unexpected at this time error === Code below contains outermost if-else loop, In the if block there is (1) if-else condition In its else block there is (1) if exist condition containing if-else condition (2) if not exist condition. if exist filename1.abc ( some code if "!line_count!"=="1" ( echo something ) else ( echo nothing ) ) else ( if exist filename2.xyz ( echo Today's files doesn't exist if "!line_count!"=="1" ( echo something ) else ( echo nothing )) if not exist d:\mailAutomation\test\*_AH_*.csv ( echo No file found )) The code produces correct output but shows an error “( was unexpected at this time” on the console. (All the opening round brackets in the code appear highlighted blue colour, closing brackets do not find their corressponding opening bracket). Please Help.
3
129,071
09/24/2008 18:51:12
11,236
09/16/2008 06:29:28
347
17
A reliable HTTP library for .Net
.Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0, what's bugging me right now is that `HttpWebResponse.GetResponse()` with ReadTimeout **and** Timeout set to 5000 blocks for about 20 seconds before failing. I need a library with better protocol conformance and timeout control. Know any?
.net
http
timeout
null
null
06/08/2012 13:40:49
not constructive
A reliable HTTP library for .Net === .Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0, what's bugging me right now is that `HttpWebResponse.GetResponse()` with ReadTimeout **and** Timeout set to 5000 blocks for about 20 seconds before failing. I need a library with better protocol conformance and timeout control. Know any?
4
8,892,050
01/17/2012 09:14:30
349,760
05/25/2010 09:33:43
103
0
Should we rewrite a legacy php application in a framework?
I am currently working on a legacy PHP application. To give you an idea what the application is like: - The backend is about 14,000 LOC. The frontend is is about 3,000 LOC. - Each url is a php script, no use of classes. - Each of those php scripts has a smarty template associated with it. - It makes heavy use of PEAR form generation plugins. - Frontend is offered in two languages. This done by duplicating the php scripts + templates. - It does not follow many best practices, like escaping all sql parameters, redirecting on a post request, putting php scripts out of web root, XSS protection, CRSF protection. - App has two main developers, I am working on it temporarily to help out. Let's say you had two weeks, what would you do to fix this application? Is there there any framework you would recommend that work particularly well with this type of app and which can be introduced gradually? I was thinking maybe start by introducing ORM, to get rid of sql injection and improve spaghetti code.
php
security
null
null
null
01/17/2012 23:36:26
not constructive
Should we rewrite a legacy php application in a framework? === I am currently working on a legacy PHP application. To give you an idea what the application is like: - The backend is about 14,000 LOC. The frontend is is about 3,000 LOC. - Each url is a php script, no use of classes. - Each of those php scripts has a smarty template associated with it. - It makes heavy use of PEAR form generation plugins. - Frontend is offered in two languages. This done by duplicating the php scripts + templates. - It does not follow many best practices, like escaping all sql parameters, redirecting on a post request, putting php scripts out of web root, XSS protection, CRSF protection. - App has two main developers, I am working on it temporarily to help out. Let's say you had two weeks, what would you do to fix this application? Is there there any framework you would recommend that work particularly well with this type of app and which can be introduced gradually? I was thinking maybe start by introducing ORM, to get rid of sql injection and improve spaghetti code.
4
5,587,437
04/07/2011 20:46:39
113,571
05/28/2009 07:15:16
295
12
Troubleshooting database performance issues
I've a problem with database, and here is a scenario I'm dealing with every day: usually application can deal with traffic etc. but several times a day I'm dealing with performance issue. When it's happening stored procedures increase their execution time from 200%-1000% . I have one, described here: http://stackoverflow.com/questions/5585726/query-with-large-table-joins-optimization-techniques . Usually its execution takes about 6-8seconds (I've already optimized it from 20seconds cos at the beginning I thought the procedure is the culprit), but when **something** is happening, that procedure can execute even 60seconds. And today I realized that there are more places in application that freeze, and what is more, I accidentaly realized that sample queries issued from SQL Management Studio, that usually execute in the blink of an eye, start to slow down when **something** happens with database server. Good news is, that thanks to this finding I eliminated both application & web servers as bottlenecks. It's database server that's not able to handle requests. I wonder is there a way to troubleshoot live database and spot slow queries or other action like rebiulding indexes, statistics, memory problems etc. or perhaps other issues that could result in described performance decline? Thanks, Pawel
sql-server
sql-server-2005
database-connection
null
null
null
open
Troubleshooting database performance issues === I've a problem with database, and here is a scenario I'm dealing with every day: usually application can deal with traffic etc. but several times a day I'm dealing with performance issue. When it's happening stored procedures increase their execution time from 200%-1000% . I have one, described here: http://stackoverflow.com/questions/5585726/query-with-large-table-joins-optimization-techniques . Usually its execution takes about 6-8seconds (I've already optimized it from 20seconds cos at the beginning I thought the procedure is the culprit), but when **something** is happening, that procedure can execute even 60seconds. And today I realized that there are more places in application that freeze, and what is more, I accidentaly realized that sample queries issued from SQL Management Studio, that usually execute in the blink of an eye, start to slow down when **something** happens with database server. Good news is, that thanks to this finding I eliminated both application & web servers as bottlenecks. It's database server that's not able to handle requests. I wonder is there a way to troubleshoot live database and spot slow queries or other action like rebiulding indexes, statistics, memory problems etc. or perhaps other issues that could result in described performance decline? Thanks, Pawel
0
9,748,229
03/17/2012 07:37:38
732,264
04/30/2011 09:46:49
33
0
Laptop configuration / advice needed
I want to buy a laptop, but I'm very confused! I'm a web developer, and I use my PC for: - email (Thunderbird), lots of browsing, FTP, Firefox/Firebug plus several other browsers for browser testing, Photoshop, Windows 7 and Microsoft Office. I've been really tempted by the lightweight models such as Asus UX31. The Toshiba models are more expensive but have even better specs: Toshiba Z830 (1.1kg) - core i5 1.6Ghz, 128Gb SSD hard drive, 6gB RAM, Win 7 Professional, free external DVD drive. http://www.engadget.com/2011/09/01/toshibas-portege-z830-is-an-ultraslim-ultrasexy-ultrabook/ and a higher spec, heavier but still lightweight model: Toshiba R830 (1.4kg) - core i5 2.5Ghz, 500Gb SATA hard drive, 8Gb RAM, Win 7 Professional, dvd drive internal - I read some random reviews on this and it seems good, but some say that they can get much cheaper brands for the same spec, but at a slightly heavier build around 2kg. Also I read that the battery life is not so good (if someone can point me out to a good review URL of this model I'd appreciate it). I'm confused because the ultra-lightweight Z830 model seems great to me, but will it run Photoshop and my other (above) applications well? On a desktop level at office, I use an i3, 2Gb memory (but probably will soon need an upgrade), and the hard drive space is probably enough at 128Gb, but of course the more the better. However, if I get a laptop, I still plan to use my desktop at office but use the laptop from home (evenings), weekends or when travelling once in a while. If the laptop were that powerful for my needs, I would simply hook it up to my external keyboard, monitor and mouse at office, and give the PC to another member of staff, thereby using the laptop permanently (one machine only, work and home). My BIG question is, the price is the same for the above 2 models, and cheaper for the Asus..so do these specs match what I need? Does it make more sense to get the R830 since it's better spec, or does the SSD Z830 sound advanced as it is? I'm not sure if the SSD lighter hard drive would be an issue in the long term, or if the performance isn't so good, but if the R830 reviews arw NOT that good then I of course prefer to go for the lighter weight model Z830. I'd just like some opinions and advice urgently to help me make my decision :) Many thanks!
hardware
null
null
null
null
05/22/2012 13:00:05
off topic
Laptop configuration / advice needed === I want to buy a laptop, but I'm very confused! I'm a web developer, and I use my PC for: - email (Thunderbird), lots of browsing, FTP, Firefox/Firebug plus several other browsers for browser testing, Photoshop, Windows 7 and Microsoft Office. I've been really tempted by the lightweight models such as Asus UX31. The Toshiba models are more expensive but have even better specs: Toshiba Z830 (1.1kg) - core i5 1.6Ghz, 128Gb SSD hard drive, 6gB RAM, Win 7 Professional, free external DVD drive. http://www.engadget.com/2011/09/01/toshibas-portege-z830-is-an-ultraslim-ultrasexy-ultrabook/ and a higher spec, heavier but still lightweight model: Toshiba R830 (1.4kg) - core i5 2.5Ghz, 500Gb SATA hard drive, 8Gb RAM, Win 7 Professional, dvd drive internal - I read some random reviews on this and it seems good, but some say that they can get much cheaper brands for the same spec, but at a slightly heavier build around 2kg. Also I read that the battery life is not so good (if someone can point me out to a good review URL of this model I'd appreciate it). I'm confused because the ultra-lightweight Z830 model seems great to me, but will it run Photoshop and my other (above) applications well? On a desktop level at office, I use an i3, 2Gb memory (but probably will soon need an upgrade), and the hard drive space is probably enough at 128Gb, but of course the more the better. However, if I get a laptop, I still plan to use my desktop at office but use the laptop from home (evenings), weekends or when travelling once in a while. If the laptop were that powerful for my needs, I would simply hook it up to my external keyboard, monitor and mouse at office, and give the PC to another member of staff, thereby using the laptop permanently (one machine only, work and home). My BIG question is, the price is the same for the above 2 models, and cheaper for the Asus..so do these specs match what I need? Does it make more sense to get the R830 since it's better spec, or does the SSD Z830 sound advanced as it is? I'm not sure if the SSD lighter hard drive would be an issue in the long term, or if the performance isn't so good, but if the R830 reviews arw NOT that good then I of course prefer to go for the lighter weight model Z830. I'd just like some opinions and advice urgently to help me make my decision :) Many thanks!
2
4,553,094
12/29/2010 09:56:25
488,433
10/27/2010 06:53:55
431
31
Which IDE is best for IPhone development?
I'm going o develop IPhone application. Which IDE is best Eclipse or Netbeans?
iphone
eclipse
netbeans
mobile
null
09/02/2011 14:30:41
not constructive
Which IDE is best for IPhone development? === I'm going o develop IPhone application. Which IDE is best Eclipse or Netbeans?
4
6,800,627
07/23/2011 13:17:33
389,432
02/18/2010 19:55:31
558
23
cannot access xml entries of google analytics response xml using simplexml or xmldom
I am accessing the google analytics data using curl. Its response text contains some thing like the following. <entry gd:etag='W/&quot;A0EEQX47eSp7I2A9WhZSFU8.&quot;' gd:kind='analytics#datarow'> <id>http://www.google.com/analytics/feeds/data?ids=ga:176&amp;ga:pagePath=/indian-language-unicode-converter/punjabi-unicode-converter.html&amp;start-date=2011-03-01&amp;end-date=2011-03-31</id> <updated>2011-03-30T17:00:00.001-07:00</updated> <title>ga:pagePath=/indian-language-unicode-converter/punjabi-unicode-converter.html</title> <link rel='alternate' type='text/html' href='http://www.google.com/analytics'/> <dxp:dimension name='ga:pagePath' value='/indian-language-unicode-converter/punjabi-unicode-converter.html'/> <dxp:metric confidenceInterval='0.0' name='ga:pageviews' type='integer' value='1131'/> </entry> <entry gd:etag='W/&quot;A0EEQX47eSp7I2A9WhZSFU8.&quot;' gd:kind='analytics#datarow'> <id>http://www.google.com/analytics/feeds/data?ids=ga:76&amp;ga:pagePath=/indian-language-unicode-converter/hindi-unicode-converter.html&amp;start-date=2011-03-01&amp;end-date=2011-03-31</id> <updated>2011-03-30T17:00:00.001-07:00</updated> <title>ga:pagePath=/indian-language-unicode-converter/hindi-unicode-converter.html</title> <link rel='alternate' type='text/html' href='http://www.google.com/analytics'/> <dxp:dimension name='ga:pagePath' value='/indian-language-unicode-converter/hindi-unicode-converter.html'/> <dxp:metric confidenceInterval='0.0' name='ga:pageviews' type='integer' value='974'/> </entry> in the above i want to access the &lt;dxp:dimension and &lt;dxp:metric I tried using simplexml and phpdomxml using getglementsbytagname but still i couldnt reach that node. if somebody could help me with that then that would be nice.. just the logic.. and besides what is this notation in xml dxp:dimension ?
google-analytics
simplexml
xmldom
null
null
null
open
cannot access xml entries of google analytics response xml using simplexml or xmldom === I am accessing the google analytics data using curl. Its response text contains some thing like the following. <entry gd:etag='W/&quot;A0EEQX47eSp7I2A9WhZSFU8.&quot;' gd:kind='analytics#datarow'> <id>http://www.google.com/analytics/feeds/data?ids=ga:176&amp;ga:pagePath=/indian-language-unicode-converter/punjabi-unicode-converter.html&amp;start-date=2011-03-01&amp;end-date=2011-03-31</id> <updated>2011-03-30T17:00:00.001-07:00</updated> <title>ga:pagePath=/indian-language-unicode-converter/punjabi-unicode-converter.html</title> <link rel='alternate' type='text/html' href='http://www.google.com/analytics'/> <dxp:dimension name='ga:pagePath' value='/indian-language-unicode-converter/punjabi-unicode-converter.html'/> <dxp:metric confidenceInterval='0.0' name='ga:pageviews' type='integer' value='1131'/> </entry> <entry gd:etag='W/&quot;A0EEQX47eSp7I2A9WhZSFU8.&quot;' gd:kind='analytics#datarow'> <id>http://www.google.com/analytics/feeds/data?ids=ga:76&amp;ga:pagePath=/indian-language-unicode-converter/hindi-unicode-converter.html&amp;start-date=2011-03-01&amp;end-date=2011-03-31</id> <updated>2011-03-30T17:00:00.001-07:00</updated> <title>ga:pagePath=/indian-language-unicode-converter/hindi-unicode-converter.html</title> <link rel='alternate' type='text/html' href='http://www.google.com/analytics'/> <dxp:dimension name='ga:pagePath' value='/indian-language-unicode-converter/hindi-unicode-converter.html'/> <dxp:metric confidenceInterval='0.0' name='ga:pageviews' type='integer' value='974'/> </entry> in the above i want to access the &lt;dxp:dimension and &lt;dxp:metric I tried using simplexml and phpdomxml using getglementsbytagname but still i couldnt reach that node. if somebody could help me with that then that would be nice.. just the logic.. and besides what is this notation in xml dxp:dimension ?
0
7,988,605
11/02/2011 23:30:36
610,584
02/09/2011 23:14:23
68
3
Optimum number of virtual desktops -- Productivity
Being a relative newcomer to Linux, I stand in awe of the power of virtual desktops. I am experimenting with them, and would love to get some feedback. What is your preferred number of virtual desktops (e.g. 2x3), and do you tend to organize them in any particular way, or have any special tricks you use to squeeze extra productivity out of them? I currently spend a lot of my time coding, so anything relevant to that is welcome. Thanks for the help!
ubuntu
productivity
virtual-desktop
null
null
06/05/2012 01:16:54
off topic
Optimum number of virtual desktops -- Productivity === Being a relative newcomer to Linux, I stand in awe of the power of virtual desktops. I am experimenting with them, and would love to get some feedback. What is your preferred number of virtual desktops (e.g. 2x3), and do you tend to organize them in any particular way, or have any special tricks you use to squeeze extra productivity out of them? I currently spend a lot of my time coding, so anything relevant to that is welcome. Thanks for the help!
2
11,199,432
06/26/2012 00:51:19
1,090,995
12/10/2011 07:52:13
76
1
Looking for a specific type of E-commerce CMS
I'm looking for a shopping cart application that allows me to sell different formats of books. Some books come in hardcover, e-book, audiobook (with 4 different formats) and even iPad app. I've looked at pretty much every popular e-commerce platform and non of them allow me to properly group together different formats of the same product. [This page](www.harpercollins.com/books/Amy-My-Daughter-Mitch-Winehouse?isbn=9780062191380) is kind of an example of how it could look.
content-management-system
e-commerce
shopping-cart
null
null
null
open
Looking for a specific type of E-commerce CMS === I'm looking for a shopping cart application that allows me to sell different formats of books. Some books come in hardcover, e-book, audiobook (with 4 different formats) and even iPad app. I've looked at pretty much every popular e-commerce platform and non of them allow me to properly group together different formats of the same product. [This page](www.harpercollins.com/books/Amy-My-Daughter-Mitch-Winehouse?isbn=9780062191380) is kind of an example of how it could look.
0
366,334
12/14/2008 09:33:18
40,002
11/23/2008 01:27:37
187
7
What makes user interfaces appealing to humans?
This is a question for all the user interface engineers out there. There are numerous good user interface designs. Ranging from the iPhone UI (Black transparency w/blue highlights), to Windows XP (Blue and green fisher price), to Mac OS X (Blue/Grey matte), to the colourful World of Warcraft UI. What makes one user interface better than the next? Why do we find transparency appealing in the right context? There are various designs used in software that look VERY different from others. Yet, as vastly different as they are, we find them very appealing for some reason. What features do you believe make an excellent user interface?
user-interface
glossy
transparency
design
gui
10/18/2011 08:46:37
not constructive
What makes user interfaces appealing to humans? === This is a question for all the user interface engineers out there. There are numerous good user interface designs. Ranging from the iPhone UI (Black transparency w/blue highlights), to Windows XP (Blue and green fisher price), to Mac OS X (Blue/Grey matte), to the colourful World of Warcraft UI. What makes one user interface better than the next? Why do we find transparency appealing in the right context? There are various designs used in software that look VERY different from others. Yet, as vastly different as they are, we find them very appealing for some reason. What features do you believe make an excellent user interface?
4
4,140,986
11/10/2010 03:28:54
10,433
09/15/2008 23:06:36
1,460
55
How to run Sahi tests as part of a Hudson build?
In the [absence of a Maven plugin for Sahi][1], what's the easiest way to run Sahi tests from Hudson? [1]: http://sahi.co.in/forums/viewtopic.php?id=1328
continuous-integration
hudson
maven-plugin
sahi
null
null
open
How to run Sahi tests as part of a Hudson build? === In the [absence of a Maven plugin for Sahi][1], what's the easiest way to run Sahi tests from Hudson? [1]: http://sahi.co.in/forums/viewtopic.php?id=1328
0
9,197,905
02/08/2012 16:57:56
3,797
08/30/2008 21:52:47
3,368
231
Find Child by Class and remove all the elements except the first one jQuery
I have a TR row id (myRow) and it has a child table and that table has rows with class ".CONTENTROW". I am using the following code to remove all the rows with class ".CONTENTROW" except the first one. This is the code I am using: $(myRow).find(".CONTENTROW tr:gt(0)").remove(); The above does not seems to be working and does not remove any row. I tried using JSFiddle but JSFiddle is behaving in a strange way and not refreshing.
jquery
null
null
null
null
null
open
Find Child by Class and remove all the elements except the first one jQuery === I have a TR row id (myRow) and it has a child table and that table has rows with class ".CONTENTROW". I am using the following code to remove all the rows with class ".CONTENTROW" except the first one. This is the code I am using: $(myRow).find(".CONTENTROW tr:gt(0)").remove(); The above does not seems to be working and does not remove any row. I tried using JSFiddle but JSFiddle is behaving in a strange way and not refreshing.
0