PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
11,351,283
07/05/2012 19:32:32
513,672
11/19/2010 15:37:41
71
1
How can I change on Windows a registry value remotely
I want to run this command: reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /d newpasswd /t REG_SZ /f after connecting through the command line to a Windows host. Right now, I can connect through ssh to it as Administrator but running the command does not cause any changes to happen. Anyone knows why? What options do I have?
windows
ssh
null
null
null
null
open
How can I change on Windows a registry value remotely === I want to run this command: reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /d newpasswd /t REG_SZ /f after connecting through the command line to a Windows host. Right now, I can connect through ssh to it as Administrator but running the command does not cause any changes to happen. Anyone knows why? What options do I have?
0
11,351,219
07/05/2012 19:27:59
1,354,917
04/24/2012 23:27:37
19
0
Chrome extension with news ticker
Hello fellow programmers. I want to make a browser extension that will put a news ticker at the top of every page.I want to use the code here (as it will make coding easier): http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html. I would like to develop with crossrider. I am, admittedly, not very good with javascript but I deffinatley know enough to make a simple app like this. I was looking at the demos on the site and realized that they did not explain how to add something like a tool bar with an extension. I am lost, more or less. So I would appreciate it if someone could help me figure out what to do. btw- the news ticker will eventually connect to a server via ajax
plugins
cross-browser
browser-extension
news-ticker
crossrider
null
open
Chrome extension with news ticker === Hello fellow programmers. I want to make a browser extension that will put a news ticker at the top of every page.I want to use the code here (as it will make coding easier): http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html. I would like to develop with crossrider. I am, admittedly, not very good with javascript but I deffinatley know enough to make a simple app like this. I was looking at the demos on the site and realized that they did not explain how to add something like a tool bar with an extension. I am lost, more or less. So I would appreciate it if someone could help me figure out what to do. btw- the news ticker will eventually connect to a server via ajax
0
11,351,284
07/05/2012 19:32:37
1,038,038
11/09/2011 16:02:21
38
2
Linqdatasource : Insert into multiple tables in Inserting Event
How to insert into multiple tables inside Linqdatasource_Inserting event? Is it even possible? I need to write a custom query for insertion. Is there a way to tell inside Inserting event that the insertion has been handled and then manually do the insertion? (ex: e.Handled=true) Thank you.
asp.net
linqdatasource
null
null
null
null
open
Linqdatasource : Insert into multiple tables in Inserting Event === How to insert into multiple tables inside Linqdatasource_Inserting event? Is it even possible? I need to write a custom query for insertion. Is there a way to tell inside Inserting event that the insertion has been handled and then manually do the insertion? (ex: e.Handled=true) Thank you.
0
11,351,293
07/05/2012 19:33:03
998,537
10/17/2011 05:01:19
185
4
how to get a upsliding caption at bottom for the jquery accordion image slider of kwicks
I am using [this][1] accordion slider. Everything is okay except I need for each of the images , individual text that will sit at the bottom of the respective image on a certain background (i.e. gray). While an image is being displayed, that text with the background will just slide up on the image. The height of the text part will be small (if the image height is 250px , then the text part height can be 50 px ). Anybody out there just to tell which part of the js and html to be modified and in which way? Sliding up effect or placing a text over an image is quite easy but I am looking for the solution in the case of a not-so-small (in my view at least ) script . [1]: http://www.aoclarkejr.com/demos/accordion-slider.html
jquery
animation
slider
null
null
null
open
how to get a upsliding caption at bottom for the jquery accordion image slider of kwicks === I am using [this][1] accordion slider. Everything is okay except I need for each of the images , individual text that will sit at the bottom of the respective image on a certain background (i.e. gray). While an image is being displayed, that text with the background will just slide up on the image. The height of the text part will be small (if the image height is 250px , then the text part height can be 50 px ). Anybody out there just to tell which part of the js and html to be modified and in which way? Sliding up effect or placing a text over an image is quite easy but I am looking for the solution in the case of a not-so-small (in my view at least ) script . [1]: http://www.aoclarkejr.com/demos/accordion-slider.html
0
11,351,163
07/05/2012 19:24:35
1,461,999
06/17/2012 15:33:55
1
0
How to read email of facebook user using Facebook graph api for python-tornado?
I have included 'email' in extended parameters scope. How do I read the email in a tornado object? My LoginHandler looks like this: class LoginHandler(tornado.web.RequestHandler, tornado.auth.FacebookGraphMixin): @tornado.web.asynchronous def get(self): userID = self.get_secure_cookie('user_id') if self.get_argument('code', None): self.get_authenticated_user( redirect_uri='http://localhost:8000/auth/login', client_id=self.settings['facebook_api_key'], client_secret=self.settings['facebook_secret'], code=self.get_argument('code'), callback=self.async_callback(self._on_facebook_login)) return elif self.get_secure_cookie('access_token'): self.redirect('/') return self.authorize_redirect( redirect_uri='http://localhost:8000/auth/login', client_id=self.settings['facebook_api_key'], extra_params={'scope': 'email'} ) def _on_facebook_login(self, user): if not user: self.clear_all_cookies() raise tornado.web.HTTPError(500, 'Facebook authentication failed') self.set_secure_cookie('user_id', str(user['id'])) self.set_secure_cookie('user_name', str(user['name'])) self.set_secure_cookie('access_token', str(user['access_token'])) self.redirect('/') I need to collect the email in an object and insert it into the database.
facebook-graph-api
tornado
null
null
null
null
open
How to read email of facebook user using Facebook graph api for python-tornado? === I have included 'email' in extended parameters scope. How do I read the email in a tornado object? My LoginHandler looks like this: class LoginHandler(tornado.web.RequestHandler, tornado.auth.FacebookGraphMixin): @tornado.web.asynchronous def get(self): userID = self.get_secure_cookie('user_id') if self.get_argument('code', None): self.get_authenticated_user( redirect_uri='http://localhost:8000/auth/login', client_id=self.settings['facebook_api_key'], client_secret=self.settings['facebook_secret'], code=self.get_argument('code'), callback=self.async_callback(self._on_facebook_login)) return elif self.get_secure_cookie('access_token'): self.redirect('/') return self.authorize_redirect( redirect_uri='http://localhost:8000/auth/login', client_id=self.settings['facebook_api_key'], extra_params={'scope': 'email'} ) def _on_facebook_login(self, user): if not user: self.clear_all_cookies() raise tornado.web.HTTPError(500, 'Facebook authentication failed') self.set_secure_cookie('user_id', str(user['id'])) self.set_secure_cookie('user_name', str(user['name'])) self.set_secure_cookie('access_token', str(user['access_token'])) self.redirect('/') I need to collect the email in an object and insert it into the database.
0
11,351,296
07/05/2012 19:33:13
1,382,205
04/21/2010 04:54:32
78
4
Elastic Search date range query
I have an index in Elastic Search with the following mapping - "DocumentID" : { "type" : "string" }, "ContentSource" : { "type" : "integer" }, "Title" : { "type" : "string" }, "NavigationTitle" : { "type" : "string" }, "Abstract" : { "type" : "string" }, "MetaDescription" : { "type" : "string"}, "URL" : { "type" : "string" }, "CopyrightText" : { "type" : "string" }, "CopyrightYear" : { "type" : "string" }, "ImageLink" : { "type" : "string" }, "PublishTime" : { "type" : "date", "format" : "yyyyMMdd'T'HHmmss"}, "UpdateTime" : { "type" : "date", "format" : "yyyyMMdd'T'HHmmss"},} I have the following query that I am doing a 'GET' on but it's not returning any results for me. { "query" : { "range" : { "PublishTime" : { "from" : "20111201T000000", "to" : "20111203T235959" } } } } I am not sure what I am doing wrong. I am new to Elastic Search so I could use a second pair of eyes to point out any problems with my query. Thanks
query
date
elasticsearch
null
null
null
open
Elastic Search date range query === I have an index in Elastic Search with the following mapping - "DocumentID" : { "type" : "string" }, "ContentSource" : { "type" : "integer" }, "Title" : { "type" : "string" }, "NavigationTitle" : { "type" : "string" }, "Abstract" : { "type" : "string" }, "MetaDescription" : { "type" : "string"}, "URL" : { "type" : "string" }, "CopyrightText" : { "type" : "string" }, "CopyrightYear" : { "type" : "string" }, "ImageLink" : { "type" : "string" }, "PublishTime" : { "type" : "date", "format" : "yyyyMMdd'T'HHmmss"}, "UpdateTime" : { "type" : "date", "format" : "yyyyMMdd'T'HHmmss"},} I have the following query that I am doing a 'GET' on but it's not returning any results for me. { "query" : { "range" : { "PublishTime" : { "from" : "20111201T000000", "to" : "20111203T235959" } } } } I am not sure what I am doing wrong. I am new to Elastic Search so I could use a second pair of eyes to point out any problems with my query. Thanks
0
11,373,130
07/07/2012 07:25:32
806,106
06/20/2011 06:05:02
606
14
How to get FolderName and FileName from the DirectoryPath
I have DirectoryPath as "data/data/in.com.jotSmart/app_custom/folderName/FileName". Now from this path i want to get folderName, FileName and stored it into two string variable. I tried a lot, but not able to get the result. If any one knows help me to solve this out.
java
null
null
null
null
null
open
How to get FolderName and FileName from the DirectoryPath === I have DirectoryPath as "data/data/in.com.jotSmart/app_custom/folderName/FileName". Now from this path i want to get folderName, FileName and stored it into two string variable. I tried a lot, but not able to get the result. If any one knows help me to solve this out.
0
11,373,610
07/07/2012 08:48:14
1,391,685
05/13/2012 01:13:18
21
0
Save matplotlib file to a directory
Here is the simple code which generates and saves a plot image in the same directory as of the code. Now, is there a way through which I can save it in directory of choice? import matplotlib import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(100)) fig.savefig('graph.png')
python
matplotlib
null
null
null
null
open
Save matplotlib file to a directory === Here is the simple code which generates and saves a plot image in the same directory as of the code. Now, is there a way through which I can save it in directory of choice? import matplotlib import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(100)) fig.savefig('graph.png')
0
11,373,611
07/07/2012 08:48:20
1,508,466
07/07/2012 08:42:32
1
0
Wordpress comments box is not visible for recent posts
I have a problem with the integration of the facebook social plugin for worpress. I activate the FB comments for my posts but this box only appears on just some posts. for example : http://www.fredskitchen.fr/potatoes/ without comment box here http://www.fredskitchen.fr/margarita/ with comment box I cannot understand why I have this strange behaviour. Everything else in the plugin works fine. Thanks for your help
facebook
wordpress
comments
null
null
null
open
Wordpress comments box is not visible for recent posts === I have a problem with the integration of the facebook social plugin for worpress. I activate the FB comments for my posts but this box only appears on just some posts. for example : http://www.fredskitchen.fr/potatoes/ without comment box here http://www.fredskitchen.fr/margarita/ with comment box I cannot understand why I have this strange behaviour. Everything else in the plugin works fine. Thanks for your help
0
11,373,618
07/07/2012 08:49:31
749,156
05/11/2011 17:04:57
75
0
Unknown class CPTGraphHostingView in Interface Builder file
I'm using new core plot version. I'm stuck in this error. I googled and went through many same question on stackoverflow, but didn't find solution. I want to draw bar chart, I have done all the necessary setting and coding require to display bar chart, but got stuck in this error. I have checked the CPTGraphHostingView on view on XIB side. Did other linker flag seting and also wrote barChartView.hostedGraph = barChart. Target Memembership option is also checked. Please let me know if I'm missing anything.
ios
core-plot
null
null
null
null
open
Unknown class CPTGraphHostingView in Interface Builder file === I'm using new core plot version. I'm stuck in this error. I googled and went through many same question on stackoverflow, but didn't find solution. I want to draw bar chart, I have done all the necessary setting and coding require to display bar chart, but got stuck in this error. I have checked the CPTGraphHostingView on view on XIB side. Did other linker flag seting and also wrote barChartView.hostedGraph = barChart. Target Memembership option is also checked. Please let me know if I'm missing anything.
0
11,373,619
07/07/2012 08:49:33
711,662
04/16/2011 23:37:30
23
1
One Page fadeIn & fadeOut Transition Logic
I am making a one-page website for a client. There are 3 different menu groups, but in this example i simplified it to one menu and less content. I have this navigation: <nav> <ul id="main" class="toggle"> <li><a id="design" href="#">DESIGN</a></li> <li><a id="contactus" href="#">CONTACT US</a></li> <li><a id="aboutus" href="#">ABOUT US</a></li> <li><a id="news" href="#">NEWS</a></li> </ul> </nav> And Divs like that below: <div class="designcontent"> Design Content Here </div> <div class="aboutuscontent"> About us Content Here </div> So if i were to click on DESIGN it would show designcontent, and then if i were to click ABOUT US it would show aboutuscontent and so on. I am asking for a short-hand code of $("#design").click(function(){ $('.homecontent').fadeOut(500); $('.designcontent').delay(500).fadeIn(1000); return false; }); $("#home").click(function(){ $('.designcontent').fadeOut(500); $('.homecontent').delay(500).fadeIn(1000); return false; }); Because it gets more and more complicated if there are many pages, and if my client wants to add a new page. I have this jQuery code below to get id's and use them in Array and hide the contents on load: $('#main li a').each(function(){ liIds.push('.'+ $(this).attr('id')+'content'); $(''+liIds).hide(); }) What i am missing is, clicking on menu links and showing the correct content each time a menu is clicked. I hope my question is clear enough, if not i can provide visual examples on jsFiddle. Thanks for taking time to read my question
jquery
arrays
logic
null
null
null
open
One Page fadeIn & fadeOut Transition Logic === I am making a one-page website for a client. There are 3 different menu groups, but in this example i simplified it to one menu and less content. I have this navigation: <nav> <ul id="main" class="toggle"> <li><a id="design" href="#">DESIGN</a></li> <li><a id="contactus" href="#">CONTACT US</a></li> <li><a id="aboutus" href="#">ABOUT US</a></li> <li><a id="news" href="#">NEWS</a></li> </ul> </nav> And Divs like that below: <div class="designcontent"> Design Content Here </div> <div class="aboutuscontent"> About us Content Here </div> So if i were to click on DESIGN it would show designcontent, and then if i were to click ABOUT US it would show aboutuscontent and so on. I am asking for a short-hand code of $("#design").click(function(){ $('.homecontent').fadeOut(500); $('.designcontent').delay(500).fadeIn(1000); return false; }); $("#home").click(function(){ $('.designcontent').fadeOut(500); $('.homecontent').delay(500).fadeIn(1000); return false; }); Because it gets more and more complicated if there are many pages, and if my client wants to add a new page. I have this jQuery code below to get id's and use them in Array and hide the contents on load: $('#main li a').each(function(){ liIds.push('.'+ $(this).attr('id')+'content'); $(''+liIds).hide(); }) What i am missing is, clicking on menu links and showing the correct content each time a menu is clicked. I hope my question is clear enough, if not i can provide visual examples on jsFiddle. Thanks for taking time to read my question
0
11,373,621
07/07/2012 08:49:45
1,508,468
07/07/2012 08:44:21
1
0
Change default conflict behaviour in VS2010 Resource editor?
I'm trying to localize my Windows Phone 7 appiication, let's say I already have some strings in two language .resx files. When I add more to the default resource, and copy everything to the second language, all new strings show up, and the conflicting strings get a "1" at the end of their ID. Can I somehow change that behaviour? It would be perfect if conflicting string simply would not be copied, so only the new ones are added. Thanks in advance
visual-studio-2010
localization
resources
editor
resxfilecodegenerator
null
open
Change default conflict behaviour in VS2010 Resource editor? === I'm trying to localize my Windows Phone 7 appiication, let's say I already have some strings in two language .resx files. When I add more to the default resource, and copy everything to the second language, all new strings show up, and the conflicting strings get a "1" at the end of their ID. Can I somehow change that behaviour? It would be perfect if conflicting string simply would not be copied, so only the new ones are added. Thanks in advance
0
11,373,624
07/07/2012 08:50:38
1,049,123
11/16/2011 07:10:02
16
0
How to make text overlap
I want to make 2 DIV overlap horizontally. I want the content inside the DIV to overlap as well. In the below example, aaaaaaa wraps around block A and the expected behavior is to have aaaaaaa starts at the left border of div B. How can I achieve this ? `<div id="A" style="float:left;position:relative; background: #987321; width: 100px; height: 300px; z-index:5; "></div>` `<div id="B" style=" background: #555; width: 400px; height: 400px; ">aaaaaaaaaa</div>` [Fiddle][1] [1]: http://jsfiddle.net/queto_putito/8kJJa/
css
overlap
relative-positioning
null
null
null
open
How to make text overlap === I want to make 2 DIV overlap horizontally. I want the content inside the DIV to overlap as well. In the below example, aaaaaaa wraps around block A and the expected behavior is to have aaaaaaa starts at the left border of div B. How can I achieve this ? `<div id="A" style="float:left;position:relative; background: #987321; width: 100px; height: 300px; z-index:5; "></div>` `<div id="B" style=" background: #555; width: 400px; height: 400px; ">aaaaaaaaaa</div>` [Fiddle][1] [1]: http://jsfiddle.net/queto_putito/8kJJa/
0
11,373,630
07/07/2012 08:51:47
1,508,454
07/07/2012 08:28:35
1
0
null pointer exception on dao layer
I have developed the below program but it is throwing null pointer exception please advise below is the model class.. public class Circle { private int Id; public Circle(int id, String name) { super(); Id = id; this.name = name; } private String name; public int getId() { return Id; } public void setId(int id) { Id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } Below is the dao class.. public class jdbcdaoimpl { public Circle getCircle(int circleId) { Circle circle = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","saral","saral"); PreparedStatement stmt=con.prepareStatement("select * from CIRCLE where id = ?"); stmt.setInt(1,circleId); ResultSet rset=stmt.executeQuery(); while(rset.next()) { circle= new Circle(circleId, rset.getString("name") ); } rset.close(); stmt.close(); con.close(); } catch (Exception e) {e.printStackTrace(); } return circle; } } and finally the main class.. public class jdbcDemo { public static void main(String[] args) { Circle c = new jdbcdaoimpl().getCircle(1); System.out.println(c.getName()); } } please advise as on execution of main class it is throwing the null pointer exception
java
jdbc
dao
null
null
null
open
null pointer exception on dao layer === I have developed the below program but it is throwing null pointer exception please advise below is the model class.. public class Circle { private int Id; public Circle(int id, String name) { super(); Id = id; this.name = name; } private String name; public int getId() { return Id; } public void setId(int id) { Id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } Below is the dao class.. public class jdbcdaoimpl { public Circle getCircle(int circleId) { Circle circle = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","saral","saral"); PreparedStatement stmt=con.prepareStatement("select * from CIRCLE where id = ?"); stmt.setInt(1,circleId); ResultSet rset=stmt.executeQuery(); while(rset.next()) { circle= new Circle(circleId, rset.getString("name") ); } rset.close(); stmt.close(); con.close(); } catch (Exception e) {e.printStackTrace(); } return circle; } } and finally the main class.. public class jdbcDemo { public static void main(String[] args) { Circle c = new jdbcdaoimpl().getCircle(1); System.out.println(c.getName()); } } please advise as on execution of main class it is throwing the null pointer exception
0
11,373,631
07/07/2012 08:51:54
89,230
04/09/2009 19:58:28
291
9
Is it possible to change partitionkey on azure table enteties?
On my website the user will log in using Open ID and I'll store the claimed identifier as an entity in Azure Tables using a hash of the claimed identifier as the partition key. The work items that the user then creates on the site are also stored in Azure Tables using the same hash for the partition key. This seemed useful from a performance point since one user will always query their own partition key. But before I paint myself into a corner, how can I make it possible for the user to change their open id provider and the claimed identifier? Because if their claimed id changes, the hash for the partition key has to change. And I can't change it can I?
openid
azure-storage-tables
null
null
null
null
open
Is it possible to change partitionkey on azure table enteties? === On my website the user will log in using Open ID and I'll store the claimed identifier as an entity in Azure Tables using a hash of the claimed identifier as the partition key. The work items that the user then creates on the site are also stored in Azure Tables using the same hash for the partition key. This seemed useful from a performance point since one user will always query their own partition key. But before I paint myself into a corner, how can I make it possible for the user to change their open id provider and the claimed identifier? Because if their claimed id changes, the hash for the partition key has to change. And I can't change it can I?
0
11,373,634
07/07/2012 08:52:47
40,220
11/24/2008 08:56:26
796
41
Run some commands in Debian package script from current user
How to run some commands in my installations scripts of deb-package (preinst, postinst, prerm, postrm) not from root but from current user (user that invoked the installation)?
shell
package
debian
null
null
null
open
Run some commands in Debian package script from current user === How to run some commands in my installations scripts of deb-package (preinst, postinst, prerm, postrm) not from root but from current user (user that invoked the installation)?
0
11,373,636
07/07/2012 08:53:01
1,508,449
07/07/2012 08:28:05
1
0
CakePHP displaying "admi" at the top of any page
I'm trying to deal with some strange CakePHP behaviour. I enabled "admin" prefix in core.php and now I have "admi" at the top of any page... admi<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> Literally out of nowhere, no trace of it in layout @ default.ctp. Looks like some CakePHP bug, any ideas would be appreciated. Running on localhost, Apache 2.2.17, PHP 5.3.5, MySQL 5.1.63, Cake 2.o
cakephp
null
null
null
null
null
open
CakePHP displaying "admi" at the top of any page === I'm trying to deal with some strange CakePHP behaviour. I enabled "admin" prefix in core.php and now I have "admi" at the top of any page... admi<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> Literally out of nowhere, no trace of it in layout @ default.ctp. Looks like some CakePHP bug, any ideas would be appreciated. Running on localhost, Apache 2.2.17, PHP 5.3.5, MySQL 5.1.63, Cake 2.o
0
11,373,637
07/07/2012 08:53:08
1,256,811
03/08/2012 10:51:39
155
2
glm library ext.hpp compile issues (XCode iOS)
I'm trying to include the `glm/ext.hpp` extensions header to my project. Whereas `glm.hpp` can be included effortlessly and the project simply builds cleanly, the extensions for this library yield tons of compile time errors.. for example, there are some auxiliary inline header files (`.inl`) with some macro definitions that throw the errors: <ul> <li> int_10_10_2.inl : Semantic Issue <pre> GLM_FUNC_QUALIFIER dword uint10_10_10_2_cast ( glm::vec4 const & v ) //-> Expected a class or namespace | Expected ';' after top level declarator etc. </pre> </li> <li> type_vec2.hpp : <pre> union {value_type x, r, s;}; //Union member 'x' has a non-trivial copy constructor ..etc union {value_type y, g, t;}; </pre> </ul> What could be the conflicting construction (a hint on what files to analyze would be most helpful)? Has anyone else successfully include ext.hpp in an XCode project?
xcode
compiler-errors
glm
null
null
null
open
glm library ext.hpp compile issues (XCode iOS) === I'm trying to include the `glm/ext.hpp` extensions header to my project. Whereas `glm.hpp` can be included effortlessly and the project simply builds cleanly, the extensions for this library yield tons of compile time errors.. for example, there are some auxiliary inline header files (`.inl`) with some macro definitions that throw the errors: <ul> <li> int_10_10_2.inl : Semantic Issue <pre> GLM_FUNC_QUALIFIER dword uint10_10_10_2_cast ( glm::vec4 const & v ) //-> Expected a class or namespace | Expected ';' after top level declarator etc. </pre> </li> <li> type_vec2.hpp : <pre> union {value_type x, r, s;}; //Union member 'x' has a non-trivial copy constructor ..etc union {value_type y, g, t;}; </pre> </ul> What could be the conflicting construction (a hint on what files to analyze would be most helpful)? Has anyone else successfully include ext.hpp in an XCode project?
0
11,373,626
07/07/2012 08:51:02
1,503,582
07/05/2012 09:49:37
3
0
API Twitter + PHP + JSON_decode
Trying to do something with the api of twitter, i got a problem... i use this url: https://api.twitter.com/1/statuses/oembed.json?id=<id_of_tweet>&align=center i do file_get_contents to get the json and insert to BD, before insert, i see the json have slashes and can do json_decode, but, once the string was inserted, the slashes disappear! then i cant do json_decode when the query from sql, what can i do?? thank you!
php
json
api
twitter
null
null
open
API Twitter + PHP + JSON_decode === Trying to do something with the api of twitter, i got a problem... i use this url: https://api.twitter.com/1/statuses/oembed.json?id=<id_of_tweet>&align=center i do file_get_contents to get the json and insert to BD, before insert, i see the json have slashes and can do json_decode, but, once the string was inserted, the slashes disappear! then i cant do json_decode when the query from sql, what can i do?? thank you!
0
11,628,604
07/24/2012 10:08:54
1,444,128
06/08/2012 09:05:16
3
0
Using sharekit for twitter authentication only on my iphone app
i'm trying to implement sharekit twitter authentication on my app. I already installed sharekit on my app. And this is my current code on my "Log in page" - (void)viewDidLoad { [super viewDidLoad]; NSURL *url = [NSURL URLWithString:@"http://www.test.com"]; SHKItem *item = [SHKItem URL:url title:@"A title"]; } -(IBAction)SignInTwitter:(id)sender{ [SHKTwitter shareItem:item]; } with this, after tapping SignInTwitter, it redirects me to the twitter log in form, then after a successful log in, it returns me to the log in page of my app. I'm pretty sure this is not the right way to do, is there any way without using shareItem method? What i want is when the user taps SignInTwitter, it makes the user log in to his/her twitter account, and if successful it will redirect the user to the main page of the app, not back on the log in page. Also, is it possible to acquire the twitter username of the account that is logged in? Thanks!
xcode
twitter
twitter-api
sharekit
null
null
open
Using sharekit for twitter authentication only on my iphone app === i'm trying to implement sharekit twitter authentication on my app. I already installed sharekit on my app. And this is my current code on my "Log in page" - (void)viewDidLoad { [super viewDidLoad]; NSURL *url = [NSURL URLWithString:@"http://www.test.com"]; SHKItem *item = [SHKItem URL:url title:@"A title"]; } -(IBAction)SignInTwitter:(id)sender{ [SHKTwitter shareItem:item]; } with this, after tapping SignInTwitter, it redirects me to the twitter log in form, then after a successful log in, it returns me to the log in page of my app. I'm pretty sure this is not the right way to do, is there any way without using shareItem method? What i want is when the user taps SignInTwitter, it makes the user log in to his/her twitter account, and if successful it will redirect the user to the main page of the app, not back on the log in page. Also, is it possible to acquire the twitter username of the account that is logged in? Thanks!
0
11,628,617
07/24/2012 10:10:25
181,712
09/30/2009 10:08:56
521
6
Entity Framwork using Context and Compiled Queries
I have a winform-application and using EF 4.2. I read that in EF 4.2 the linq to entity-queries are autocompiled. When calling a query I do the following: using (BVSEntities bvsContext = new BVSEntities(ConnectionString)) { var person = (from sender in bvsContext.T_Absender where sender.Absender_ID == id select sender).First<T_Absender>(); return person; } Questions: 1) Is this query auto-compiled? 2) If it's autocompiled. Is the compiled query reused because the bvsContext is disposed after the using? 3) If not, how can I reuse it but don't get any concurrency-problems?
entity-framework
linq-to-entities
null
null
null
null
open
Entity Framwork using Context and Compiled Queries === I have a winform-application and using EF 4.2. I read that in EF 4.2 the linq to entity-queries are autocompiled. When calling a query I do the following: using (BVSEntities bvsContext = new BVSEntities(ConnectionString)) { var person = (from sender in bvsContext.T_Absender where sender.Absender_ID == id select sender).First<T_Absender>(); return person; } Questions: 1) Is this query auto-compiled? 2) If it's autocompiled. Is the compiled query reused because the bvsContext is disposed after the using? 3) If not, how can I reuse it but don't get any concurrency-problems?
0
11,628,618
07/24/2012 10:10:29
993,346
10/13/2011 11:30:21
283
13
Magmi Images not appearing
I am importing products with Magmi but I can't get the images appearing, I have gone through the other questions but with no luck. When I upload I dont get any images not found errors and it looks like it appears in the backend as it says hover to view image, but when I hover over it just dissapers like there is no image there. I've got this in my "Read Local Images From" `media/import` in Magmi I am assuming this is public_html/media/import? And I have the images in there and in my csv column I have `image-name.jpg` Has anyone had this issue before and found a fix?
magento
magmi
null
null
null
null
open
Magmi Images not appearing === I am importing products with Magmi but I can't get the images appearing, I have gone through the other questions but with no luck. When I upload I dont get any images not found errors and it looks like it appears in the backend as it says hover to view image, but when I hover over it just dissapers like there is no image there. I've got this in my "Read Local Images From" `media/import` in Magmi I am assuming this is public_html/media/import? And I have the images in there and in my csv column I have `image-name.jpg` Has anyone had this issue before and found a fix?
0
11,628,623
07/24/2012 10:10:47
507,313
11/14/2010 11:30:51
316
34
ObjectAnimator in API Level < 11
So I'm getting really frustrated with android and the fact half the stuff doesn't work when you roll back the API Level past 11. Why isn't it easy and well done like iOS?! **The Problem** I am using `ObjectAnimators` to animate the transitioning between `Fragments`. They work fine in anything with API Level 11 and above. As soon as I change the build target to less than 11 I get problems with it saying it can't found the resource identifiers for attributes such as `propertyName` and `valueType` in the xml file. **The Question** What should I use instead to animate my `Fragment` transitions that will work on API Levels > 7. Thanks in advance.
android
android-compatibility
null
null
null
null
open
ObjectAnimator in API Level < 11 === So I'm getting really frustrated with android and the fact half the stuff doesn't work when you roll back the API Level past 11. Why isn't it easy and well done like iOS?! **The Problem** I am using `ObjectAnimators` to animate the transitioning between `Fragments`. They work fine in anything with API Level 11 and above. As soon as I change the build target to less than 11 I get problems with it saying it can't found the resource identifiers for attributes such as `propertyName` and `valueType` in the xml file. **The Question** What should I use instead to animate my `Fragment` transitions that will work on API Levels > 7. Thanks in advance.
0
11,628,625
07/24/2012 10:10:55
864,699
07/27/2011 05:25:50
30
7
Monitor.Pulse() has no effect
Here is fragment of my code. I suppose, that one thread should work without waiting till previous thread is finished. But I recognized that all threads started in series and my pulse call has no effects on way how they work. class A { string path = "file.xml"; static public object _lock = new object(); static private int accessCounter = 0; public List<T> GetItems() { List<T> result = null; lock (_lock) { while (accessCounter < 0) Monitor.Wait(_lock); accessCounter++; Thread.Sleep(1000); Monitor.Pulse(_lock); Thread.Sleep(1000); using (Stream stream = File.OpenRead(path)) { XmlSerializer serializer = new XmlSerializer(typeof(List<T>), new Type[] { typeof(T) }); result = (List<T>)serializer.Deserialize(stream); } accessCounter--; Monitor.Pulse(_lock); } return result; } } I know that *if* condition is useless in current situation because is always *true*. And more so, they should work simultaneously, but do not.
c#
multithreading
monitor
null
null
null
open
Monitor.Pulse() has no effect === Here is fragment of my code. I suppose, that one thread should work without waiting till previous thread is finished. But I recognized that all threads started in series and my pulse call has no effects on way how they work. class A { string path = "file.xml"; static public object _lock = new object(); static private int accessCounter = 0; public List<T> GetItems() { List<T> result = null; lock (_lock) { while (accessCounter < 0) Monitor.Wait(_lock); accessCounter++; Thread.Sleep(1000); Monitor.Pulse(_lock); Thread.Sleep(1000); using (Stream stream = File.OpenRead(path)) { XmlSerializer serializer = new XmlSerializer(typeof(List<T>), new Type[] { typeof(T) }); result = (List<T>)serializer.Deserialize(stream); } accessCounter--; Monitor.Pulse(_lock); } return result; } } I know that *if* condition is useless in current situation because is always *true*. And more so, they should work simultaneously, but do not.
0
11,628,627
07/24/2012 10:11:06
154,896
08/12/2009 07:49:34
1,553
63
IIS Managed -> Unmanaged -> Managed -> StackOverflowException
I'll try to describe my problem as detailed as possible, but if more detailed explanation is needed, please let me know. To simplify let say I have 3 DLLs (actually I have more, but it is not very important, I guess): 1. `managed-1.dll` - Managed DLL (writen in C# .NET 4.0) - handles requests and during some requests invokes unmanaged code in second DLL 2. `unmanaged.dll` - Unmanaged DLL (writen in old school VC++ 6.0) - performs several operations and sometimes calls the third DLL 3. `managed-2.dll` - Managed DLL (writen in CLI/C++ .NET 3.5) - the root of my problem I run my code in 3 different scenarios: 1. I call `managed-1.dll` from console application - everything works well 2. I call `managed-1.dll` from `ASP.NET Development Server` - everything works well too 3. I call `managed-1.dll` from `IIS` - everything works well until whole sequence `managed-1.dll -> unmanaged.dll -> managed-2.dll` is involved. In scenario 3 the StackOverflowException is thrown. The debugger shows that no recursion is involved. Also it is clear that the exception is occured in the following type of call stack: - `managed-1.dll::CallUnmanagedCode()` - `unmanaged.dll::SomeMethod1()` - `unmanaged.dll::SomeMethod2()` - `unmanaged.dll::CallManagedCode()` - `managed-2.dll::CallUnmanagedCode()` __!! marked with `__declspec(dllexport)` and does not use any managed types !!__ - `managed-2.dll::FailingMethod()` __!! uses managed types; in a very beginning (even the first line of code is not performed) an exception is occured !!__ The one more interesting thing: the debugger shows not the same parameter values in the `FailingMethod` as compared to the values in the method calling point. If somebody has any clue, please advice.
.net
iis
pinvoke
stackoverflow
unmanaged
null
open
IIS Managed -> Unmanaged -> Managed -> StackOverflowException === I'll try to describe my problem as detailed as possible, but if more detailed explanation is needed, please let me know. To simplify let say I have 3 DLLs (actually I have more, but it is not very important, I guess): 1. `managed-1.dll` - Managed DLL (writen in C# .NET 4.0) - handles requests and during some requests invokes unmanaged code in second DLL 2. `unmanaged.dll` - Unmanaged DLL (writen in old school VC++ 6.0) - performs several operations and sometimes calls the third DLL 3. `managed-2.dll` - Managed DLL (writen in CLI/C++ .NET 3.5) - the root of my problem I run my code in 3 different scenarios: 1. I call `managed-1.dll` from console application - everything works well 2. I call `managed-1.dll` from `ASP.NET Development Server` - everything works well too 3. I call `managed-1.dll` from `IIS` - everything works well until whole sequence `managed-1.dll -> unmanaged.dll -> managed-2.dll` is involved. In scenario 3 the StackOverflowException is thrown. The debugger shows that no recursion is involved. Also it is clear that the exception is occured in the following type of call stack: - `managed-1.dll::CallUnmanagedCode()` - `unmanaged.dll::SomeMethod1()` - `unmanaged.dll::SomeMethod2()` - `unmanaged.dll::CallManagedCode()` - `managed-2.dll::CallUnmanagedCode()` __!! marked with `__declspec(dllexport)` and does not use any managed types !!__ - `managed-2.dll::FailingMethod()` __!! uses managed types; in a very beginning (even the first line of code is not performed) an exception is occured !!__ The one more interesting thing: the debugger shows not the same parameter values in the `FailingMethod` as compared to the values in the method calling point. If somebody has any clue, please advice.
0
11,628,631
07/24/2012 10:11:32
676,326
03/25/2011 08:06:05
326
22
paypal sandbox integration API credentials not found
am trying to integrate paypal sandbox with my web application. For that as per the documentation I had created an account in `https://developer.paypal.com/`. And after that I had created a Test Account also - that's a Business account. I had created that account by selecting the seller radio button in the below mentioned screen. ![Test Account User creation Screen][1] now when am clicking on my `Test Accounts` link, I can found a Business Test Account there as in the below mentioned figure. ![Showing Business User Test Account][2] After that when am trying to get the API Credentials by clicking on the link `API and Payment Card Credentials` , its saying `my test account do not have credentials and create a business Test Account to get the credentials`. See image below. ![Error showing Account is not having API Credentials][3] Actually I have created was a Business Test Account. Then why am not getting the API Credentials.Can anyone help me solve this.? [1]: http://i.stack.imgur.com/1S9To.png [2]: http://i.stack.imgur.com/dwLYg.png [3]: http://i.stack.imgur.com/MFesn.png
java
paypal
integration
paypal-sandbox
null
null
open
paypal sandbox integration API credentials not found === am trying to integrate paypal sandbox with my web application. For that as per the documentation I had created an account in `https://developer.paypal.com/`. And after that I had created a Test Account also - that's a Business account. I had created that account by selecting the seller radio button in the below mentioned screen. ![Test Account User creation Screen][1] now when am clicking on my `Test Accounts` link, I can found a Business Test Account there as in the below mentioned figure. ![Showing Business User Test Account][2] After that when am trying to get the API Credentials by clicking on the link `API and Payment Card Credentials` , its saying `my test account do not have credentials and create a business Test Account to get the credentials`. See image below. ![Error showing Account is not having API Credentials][3] Actually I have created was a Business Test Account. Then why am not getting the API Credentials.Can anyone help me solve this.? [1]: http://i.stack.imgur.com/1S9To.png [2]: http://i.stack.imgur.com/dwLYg.png [3]: http://i.stack.imgur.com/MFesn.png
0
11,628,633
07/24/2012 10:11:36
1,323,487
04/10/2012 07:59:07
20
0
How to send customer-defined type through MessageQueue
Given this event public class DummyEvent : EventDTO{ public CustomUUID Cid { get; set; } public DateTime Date { get; set; } public Guid Id { get; set; } } I'm sending messages via MSMQ: var de = new DummyEvent { Date = DateTime.UtcNow, Id = Guid.NewGuid(), Cid = Guid.NewGuid() }; var mq = new MessageQueue(AppSettings.EventQueue); mq.Formatter = new XmlMessageFormatter(new[]{de.GetType()}); mq.Send(de); var e = reciever.Receive().Body; Date is _System.DateTime_ so it gets deserialized **ok**. Id is _System.Guid_ so it gets deserialized **ok**. Cid is _CustomUUID_ which is a user defined type that **doesnt get deserialized**. I need to send customer-defined types as well, but there is scarce info on the net.
msmq
user-defined-types
null
null
null
null
open
How to send customer-defined type through MessageQueue === Given this event public class DummyEvent : EventDTO{ public CustomUUID Cid { get; set; } public DateTime Date { get; set; } public Guid Id { get; set; } } I'm sending messages via MSMQ: var de = new DummyEvent { Date = DateTime.UtcNow, Id = Guid.NewGuid(), Cid = Guid.NewGuid() }; var mq = new MessageQueue(AppSettings.EventQueue); mq.Formatter = new XmlMessageFormatter(new[]{de.GetType()}); mq.Send(de); var e = reciever.Receive().Body; Date is _System.DateTime_ so it gets deserialized **ok**. Id is _System.Guid_ so it gets deserialized **ok**. Cid is _CustomUUID_ which is a user defined type that **doesnt get deserialized**. I need to send customer-defined types as well, but there is scarce info on the net.
0
11,628,634
07/24/2012 10:11:38
298,195
03/20/2010 22:39:55
322
11
How to use CSS to make a line before and after span with text inside div
I have a span with text inside a div. In front of that span I want a 2 px line to go to the edge on the left. After the text I want a simular line to go to the right edge of the parent element. **Current markup:** <div style="width: 400px;"> <span class="label" style="padding-left: 40px;">This is my text</span> </div>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ **Expected result:** ----- This is my text -------------------------- **What is the best solution for my problem?** I have tried to use a extra span for the line after the text. Did not manage to get it right. It is based on http://stackoverflow.com/questions/3499314/let-span-fill-remaining-width. My attempt can be found at http://jsfiddle.net/yDLuK/1/
css
css3
null
null
null
null
open
How to use CSS to make a line before and after span with text inside div === I have a span with text inside a div. In front of that span I want a 2 px line to go to the edge on the left. After the text I want a simular line to go to the right edge of the parent element. **Current markup:** <div style="width: 400px;"> <span class="label" style="padding-left: 40px;">This is my text</span> </div>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ **Expected result:** ----- This is my text -------------------------- **What is the best solution for my problem?** I have tried to use a extra span for the line after the text. Did not manage to get it right. It is based on http://stackoverflow.com/questions/3499314/let-span-fill-remaining-width. My attempt can be found at http://jsfiddle.net/yDLuK/1/
0
11,411,366
07/10/2012 10:27:54
632,951
02/24/2011 19:10:47
6,275
29
How to get URL of parent window without javascript?
I have a HTML file *http://mydomain.com/page1.html*: <!doctype html> <html> <iframe src="http://mydomain.com/page2.php"></iframe> </html> In *page2.php*, I would like to get the url of the "container page", which in this case is the string `page1.html`. Is there anyway to do so **without javascript**?
php
null
null
null
null
null
open
How to get URL of parent window without javascript? === I have a HTML file *http://mydomain.com/page1.html*: <!doctype html> <html> <iframe src="http://mydomain.com/page2.php"></iframe> </html> In *page2.php*, I would like to get the url of the "container page", which in this case is the string `page1.html`. Is there anyway to do so **without javascript**?
0
11,411,367
07/10/2012 10:28:00
1,513,810
07/10/2012 05:56:23
1
0
Searching Jira for label !=
I have a label set for some of my issues. When searching labels="ab" I get the relevant ones, but I cannot seem to find the right syntax for asking labels!="ab". How can I query for the ones not equal to ab? Thanks
jira
labels
null
null
null
null
open
Searching Jira for label != === I have a label set for some of my issues. When searching labels="ab" I get the relevant ones, but I cannot seem to find the right syntax for asking labels!="ab". How can I query for the ones not equal to ab? Thanks
0
11,410,868
07/10/2012 10:00:06
555,948
12/28/2010 11:57:29
358
8
How to do NFC(Near Field Communication) in android
I just want to scan details from my bussiness card through NFC into my native app(like address,name,company name). I dont have much idea on this.What are the necessary steps i need to set up?How could i begin to do this app in android? And one more,QR scanner is something different from NFC? Thanks.
android
null
null
null
null
null
open
How to do NFC(Near Field Communication) in android === I just want to scan details from my bussiness card through NFC into my native app(like address,name,company name). I dont have much idea on this.What are the necessary steps i need to set up?How could i begin to do this app in android? And one more,QR scanner is something different from NFC? Thanks.
0
11,410,870
07/10/2012 10:00:15
468,202
10/06/2010 16:19:03
109
6
Referesh DIV after pageload in Jquery ajax
How can i refresh or reload the div using jquery ajax on page load
jquery
jquery-ajax
null
null
null
null
open
Referesh DIV after pageload in Jquery ajax === How can i refresh or reload the div using jquery ajax on page load
0
11,410,871
07/10/2012 10:00:26
983,666
10/07/2011 08:58:44
155
1
Animation for UIImageView rotation
In my application i want to rotate the image view in the direction of the tap. An also move the image view to the tap location. I have completed the code for moving the UIImageView but i am not able to figure out how to rotate the Image in the direction of tap.Any help is appreciated.
ios
cocoa-touch
animation
uiview
uiimageview
null
open
Animation for UIImageView rotation === In my application i want to rotate the image view in the direction of the tap. An also move the image view to the tap location. I have completed the code for moving the UIImageView but i am not able to figure out how to rotate the Image in the direction of tap.Any help is appreciated.
0
11,410,873
07/10/2012 10:00:27
1,157,916
01/19/2012 07:29:55
81
1
How to add Horizontal scrolling property in table using javascript or jquery
I am doing a site in php ,i have to display the data in table ,i can't display whole data on that table since the table is large and my div is so small , so i decided to add scroller in left side and right side of table.I have added the image of table. How can i scroll the table using javascript or jquery. ![enter image description here][1] [1]: http://i.stack.imgur.com/SoUc4.gif Thank you . Any help will be appeciated.
php
javascript
jquery
table
null
null
open
How to add Horizontal scrolling property in table using javascript or jquery === I am doing a site in php ,i have to display the data in table ,i can't display whole data on that table since the table is large and my div is so small , so i decided to add scroller in left side and right side of table.I have added the image of table. How can i scroll the table using javascript or jquery. ![enter image description here][1] [1]: http://i.stack.imgur.com/SoUc4.gif Thank you . Any help will be appeciated.
0
11,411,376
07/10/2012 10:28:40
450,215
09/17/2010 03:30:30
82
2
Debugging node.js by webkit-devtools-agent, ways to look at the content of objects in heap?
I am retrying to investigate memory leak problem in my nodejs program by webkit-devtools-agent ([https://github.com/c4milo/node-webkit-agent][1]). By taking heap snapshots, I can see the heap size keeps increasing. But due to complicated structure of my code. It seems that it is not easy to dig out what code generates those objects. In the profile page, I can only see something like this: (Array) [] @28631 [] @31853 (map descriptors)[] @44687 function NativeModule() @35997 Are there ways to find out the content of those objects and the source that generates those object? I read an article about node.js debugging ([http://dtrace.org/blogs/bmc/2012/05/05/debugging-node-js-memory-leaks/][2]). It is quite amazing. But I don't think it is available in linux server, unfortunately. Thanks! [1]: https://github.com/c4milo/node-webkit-agent [2]: http://dtrace.org/blogs/bmc/2012/05/05/debugging-node-js-memory-leaks/
debugging
node.js
memory-leaks
null
null
null
open
Debugging node.js by webkit-devtools-agent, ways to look at the content of objects in heap? === I am retrying to investigate memory leak problem in my nodejs program by webkit-devtools-agent ([https://github.com/c4milo/node-webkit-agent][1]). By taking heap snapshots, I can see the heap size keeps increasing. But due to complicated structure of my code. It seems that it is not easy to dig out what code generates those objects. In the profile page, I can only see something like this: (Array) [] @28631 [] @31853 (map descriptors)[] @44687 function NativeModule() @35997 Are there ways to find out the content of those objects and the source that generates those object? I read an article about node.js debugging ([http://dtrace.org/blogs/bmc/2012/05/05/debugging-node-js-memory-leaks/][2]). It is quite amazing. But I don't think it is available in linux server, unfortunately. Thanks! [1]: https://github.com/c4milo/node-webkit-agent [2]: http://dtrace.org/blogs/bmc/2012/05/05/debugging-node-js-memory-leaks/
0
11,411,380
07/10/2012 10:28:49
1,405,983
05/20/2012 07:49:40
53
11
android generate automatically xml file with .out
Hello i found most of the time that one xml file is generate automatically with filename.out.xml For example my file name is example.xml But when i edit and save it then example.out.xml file is created automatically. I don't know how it is happen? Please help me to find this. And what i have do with this file? Thanks in advance.
android
xml
android-xml
null
null
null
open
android generate automatically xml file with .out === Hello i found most of the time that one xml file is generate automatically with filename.out.xml For example my file name is example.xml But when i edit and save it then example.out.xml file is created automatically. I don't know how it is happen? Please help me to find this. And what i have do with this file? Thanks in advance.
0
11,411,383
07/10/2012 10:29:06
1,431,041
06/01/2012 15:31:24
1
0
Running rubygem (Middleman) on Azure
I have just signed up a trial account on Azure to see if it is a viable platform for me in long-term. Using a webworker role with a variety of CMD and startup scripts, I managed to get ruby working on the cloud - a simple "Hello world" message! However, I am unable to get [Middleman][1] started automatically and cannot see anything in the logs to indicate what's wrong. I just get a "Page unavailable" when I navigate to the app. Maybe I am using the Azure in the wrong way. Any ideas? Also is there anything on Azure to allow me to debug issues via RDC or similar? Many thanks in advance. [1]: https://github.com/middleman/middleman
ruby
azure
middleman
null
null
null
open
Running rubygem (Middleman) on Azure === I have just signed up a trial account on Azure to see if it is a viable platform for me in long-term. Using a webworker role with a variety of CMD and startup scripts, I managed to get ruby working on the cloud - a simple "Hello world" message! However, I am unable to get [Middleman][1] started automatically and cannot see anything in the logs to indicate what's wrong. I just get a "Page unavailable" when I navigate to the app. Maybe I am using the Azure in the wrong way. Any ideas? Also is there anything on Azure to allow me to debug issues via RDC or similar? Many thanks in advance. [1]: https://github.com/middleman/middleman
0
11,411,384
07/10/2012 10:29:09
1,182,140
02/01/2012 07:29:48
68
7
How to create a new folder in Phone memory Nokia Qt
I am using the following code to create a new folder in the existing "Games" folder, but it just isnt making the folder. QDir dir("C:/Games/MyGame"); if(!dir.exists()) { dir.mkdir("C:/Games/MyGame"); } else { qDebug()<<dir.absolutePath() + " exists"; }
qt
folder
createfile
null
null
null
open
How to create a new folder in Phone memory Nokia Qt === I am using the following code to create a new folder in the existing "Games" folder, but it just isnt making the folder. QDir dir("C:/Games/MyGame"); if(!dir.exists()) { dir.mkdir("C:/Games/MyGame"); } else { qDebug()<<dir.absolutePath() + " exists"; }
0
11,411,385
07/10/2012 10:29:13
1,464,883
06/18/2012 21:25:18
1
0
parser just worked fine with FF just for two times then it dont work?
## it worked fine when i clicked two times but i dont know why it dont work now, i think the code is fine as it already worked before## //open the document xml $(document).ready(function() { $.ajax({ type: "GET", url: "hello.xml", dataType: ($.browser.msie) ? "text" : "xml", success: parseXml }); }); //pasre the document function parseXml(xml) { if($.browser.msie) { var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.loadXML(xml); xml = xmlDoc; } //find head and its text in the line breaks $(xml).find("head").each(function() { $("#output").append($(this).find("lb").text() + "<br />"); }); }
javascript
jquery
xml-parsing
null
null
null
open
parser just worked fine with FF just for two times then it dont work? === ## it worked fine when i clicked two times but i dont know why it dont work now, i think the code is fine as it already worked before## //open the document xml $(document).ready(function() { $.ajax({ type: "GET", url: "hello.xml", dataType: ($.browser.msie) ? "text" : "xml", success: parseXml }); }); //pasre the document function parseXml(xml) { if($.browser.msie) { var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.loadXML(xml); xml = xmlDoc; } //find head and its text in the line breaks $(xml).find("head").each(function() { $("#output").append($(this).find("lb").text() + "<br />"); }); }
0
11,411,387
07/10/2012 10:29:20
382,115
07/02/2010 14:04:27
95
5
Isnt TargetApi annotation part of api level 16(Android 4.1)?
So i update to the last v0.8 and it seems i get errors on the android.annotation.TargetApi import. It seems this belongs to the Api level 16 which isnt out yet. Or is there some package to get this? regards,
commonsware
cwac-endless
null
null
null
null
open
Isnt TargetApi annotation part of api level 16(Android 4.1)? === So i update to the last v0.8 and it seems i get errors on the android.annotation.TargetApi import. It seems this belongs to the Api level 16 which isnt out yet. Or is there some package to get this? regards,
0
11,411,391
07/10/2012 10:29:53
1,495,756
07/02/2012 10:18:01
35
1
Coding path to file when it is called using registry and context menu
I have c# console application, that takes string arguments. I have a context menu item for images, that calls "myexe.exe %1", so path to file becomes argument for application. Even if path to file contains spaces, when I watch, what argument my application takes, I can see something like "VISUAL~3/...."(it is example when path to file contains "visual stuido", it has space). But my application should understand how many arguments are given, so if it is called from context menu, everything is ok, because result argument has no spaces. But I need call exe file from other application and give string arguments with spaces too. When I just give argument with spaces, my application splits it, so I don't know how to code spaces in argument to give it to exe file, like context menu does. How to do it?
c#
registry
arguments
contextmenu
console-application
null
open
Coding path to file when it is called using registry and context menu === I have c# console application, that takes string arguments. I have a context menu item for images, that calls "myexe.exe %1", so path to file becomes argument for application. Even if path to file contains spaces, when I watch, what argument my application takes, I can see something like "VISUAL~3/...."(it is example when path to file contains "visual stuido", it has space). But my application should understand how many arguments are given, so if it is called from context menu, everything is ok, because result argument has no spaces. But I need call exe file from other application and give string arguments with spaces too. When I just give argument with spaces, my application splits it, so I don't know how to code spaces in argument to give it to exe file, like context menu does. How to do it?
0
11,411,395
07/10/2012 10:30:01
1,244,529
03/02/2012 07:22:11
21
0
How to get current foreground activity context in android?
Whenever my broadcast is executed I want to show alert to foreground activity.
android
null
null
null
null
null
open
How to get current foreground activity context in android? === Whenever my broadcast is executed I want to show alert to foreground activity.
0
11,430,186
07/11/2012 10:02:59
1,490,278
06/29/2012 04:50:25
6
0
Internal Repository Setup
I have jumped on the GIT bandwagon lately. I am confused about which DVCS hosting to use. I am in a notion that i can setup my own thing on a dedicated/vps server. So, my question is that, how to setup my own internal remote repository management system on the dedicated server that i have? Please guide. Regards
git
dvcs
null
null
null
null
open
Internal Repository Setup === I have jumped on the GIT bandwagon lately. I am confused about which DVCS hosting to use. I am in a notion that i can setup my own thing on a dedicated/vps server. So, my question is that, how to setup my own internal remote repository management system on the dedicated server that i have? Please guide. Regards
0
11,430,187
07/11/2012 10:03:00
571,507
01/11/2011 16:14:04
2,384
94
TSQL where on xml data type
How does one execute where clause command on a xml data type in Sql Server 2005 ? ###Xml Structure <User UserId="1" UserName="x"> <User UserId="2" UserName="y"> ###Query SELECT XmlColumn from Table where XmlColumn.query('/User[@UserId'+ @dynamicValue +']') ###Intended Output Get all the user tags where the attribute UserId = input variable
xml
tsql
where-clause
null
null
null
open
TSQL where on xml data type === How does one execute where clause command on a xml data type in Sql Server 2005 ? ###Xml Structure <User UserId="1" UserName="x"> <User UserId="2" UserName="y"> ###Query SELECT XmlColumn from Table where XmlColumn.query('/User[@UserId'+ @dynamicValue +']') ###Intended Output Get all the user tags where the attribute UserId = input variable
0
11,430,628
07/11/2012 10:26:08
1,509,785
07/08/2012 09:04:45
3
0
Using DOM for first time to change color of unanswered questions in form onSubmit
Here is my form: <form id="Test" action="index.php?course=4" method="post" name="Test" onSubmit="IsFormComplete(12)"> Inside the form is a table dynamically generated with id=Qx class=Qx where x is 1 through 12: <tr id="Q2" class="Q2"> <td width="5%">2) </td> <td colspan="2">According to the Institute of Medicine study the number of deaths from medical errors per year is between</td> Here is my javascript function: function IsFormComplete(iQuestions) { var questionNum = iQuestions; itemOkay=true; for (var i=1;i<questionNum;i++) { for (var j=0;j<4;j++) { var thisItem = eval("document.Test.Q" + i + "[" + j + "].checked"); if (!thisItem) { itemOkay = false; document.getElementById(eval("Q" + i)).style.color = "red"; } } } alert("item okay = " + itemOkay); if (itemOkay) { return true; } else { return false; } } Not working PLEASE help. New to DOM and have tried various tags: document.getElementById(eval("Q" + i)).style.color = "red"; document.Test.getElementById(eval("Q" + i)).style.color = "red"; document.getElementById("Q1").style.color = "red"; //To try literal instead of variable etc.
javascript
dom
getelementbyid
null
null
null
open
Using DOM for first time to change color of unanswered questions in form onSubmit === Here is my form: <form id="Test" action="index.php?course=4" method="post" name="Test" onSubmit="IsFormComplete(12)"> Inside the form is a table dynamically generated with id=Qx class=Qx where x is 1 through 12: <tr id="Q2" class="Q2"> <td width="5%">2) </td> <td colspan="2">According to the Institute of Medicine study the number of deaths from medical errors per year is between</td> Here is my javascript function: function IsFormComplete(iQuestions) { var questionNum = iQuestions; itemOkay=true; for (var i=1;i<questionNum;i++) { for (var j=0;j<4;j++) { var thisItem = eval("document.Test.Q" + i + "[" + j + "].checked"); if (!thisItem) { itemOkay = false; document.getElementById(eval("Q" + i)).style.color = "red"; } } } alert("item okay = " + itemOkay); if (itemOkay) { return true; } else { return false; } } Not working PLEASE help. New to DOM and have tried various tags: document.getElementById(eval("Q" + i)).style.color = "red"; document.Test.getElementById(eval("Q" + i)).style.color = "red"; document.getElementById("Q1").style.color = "red"; //To try literal instead of variable etc.
0
11,430,632
07/11/2012 10:26:20
1,450,460
02/08/2012 09:16:49
1
0
Missing application launcher after deployment
this week i got my new Samsung S3 and wanted to deploy an developed Eclipse project to my phone. After deploying it with Eclipse it starts up normally and works. But I then can't find a launcher in the main menu. :-/ (Last time i rebooted the device and then it was there, but i think that's no solution) In Settings - Application Manager - Installed Applications i can find the application. OS: Ubuntu 12.04 LTS Android 4.0.4 Eclipse Indigo Latest SDK installed Here is my android manifest file. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.uniba.wiai.ktr" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="15" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/> <uses-permission android:name="android.permission.BATTERY_STATS"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.GET_TASKS"/> <application android:icon="@drawable/ktr" android:label="@string/app_name" android:logo="@drawable/ktr" android:debuggable="true"> <activity android:name=".KTRStreamServiceActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="KTRStreamConfiguration"></activity> <service android:name="KTRStreamService" android:icon="@drawable/ic_launcher" android:logo="@drawable/ic_launcher" android:exported="false"> </service> </application> </manifest> Thanks
android
android-manifest
null
null
null
null
open
Missing application launcher after deployment === this week i got my new Samsung S3 and wanted to deploy an developed Eclipse project to my phone. After deploying it with Eclipse it starts up normally and works. But I then can't find a launcher in the main menu. :-/ (Last time i rebooted the device and then it was there, but i think that's no solution) In Settings - Application Manager - Installed Applications i can find the application. OS: Ubuntu 12.04 LTS Android 4.0.4 Eclipse Indigo Latest SDK installed Here is my android manifest file. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.uniba.wiai.ktr" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="15" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/> <uses-permission android:name="android.permission.BATTERY_STATS"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.GET_TASKS"/> <application android:icon="@drawable/ktr" android:label="@string/app_name" android:logo="@drawable/ktr" android:debuggable="true"> <activity android:name=".KTRStreamServiceActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="KTRStreamConfiguration"></activity> <service android:name="KTRStreamService" android:icon="@drawable/ic_launcher" android:logo="@drawable/ic_launcher" android:exported="false"> </service> </application> </manifest> Thanks
0
11,430,635
07/11/2012 10:26:26
1,517,434
07/11/2012 10:19:07
1
0
PHP with Python
This is my Python Code : import threading import time import MySQLdb import sys conn=MySQLdb.connect (host = "localhost", user = "root", passwd = "", db = "profiles_sheduleit") cur = conn.cursor() def activation(): while True: time.sleep(1) print time.time() t = threading.Thread(name='activation', target=activation) t.start() I am calling this page from my php page by: $result = exec("c:/python27/python f:/python/hello.py"); I have one few buttons in php when this button is clicked a new thread should me created and that thread should run for 10 seconds. but when i click the button m not able to click another button because python script goes into sleep mode thanx
php
null
null
null
null
null
open
PHP with Python === This is my Python Code : import threading import time import MySQLdb import sys conn=MySQLdb.connect (host = "localhost", user = "root", passwd = "", db = "profiles_sheduleit") cur = conn.cursor() def activation(): while True: time.sleep(1) print time.time() t = threading.Thread(name='activation', target=activation) t.start() I am calling this page from my php page by: $result = exec("c:/python27/python f:/python/hello.py"); I have one few buttons in php when this button is clicked a new thread should me created and that thread should run for 10 seconds. but when i click the button m not able to click another button because python script goes into sleep mode thanx
0
11,430,637
07/11/2012 10:26:34
230,567
12/13/2009 05:45:53
137
3
Need help in a specific way to restore postgres database
<p> Following is the scenario. We have two dev servers set up to be run on postgres. I will call Web server1- pguser1 is the associated user who creates all tables and everything required for a functional database to work with the web application. Similarly we have the second server2 - pguser2 is the associated user who creates data for Web server 2. </p> <p> I have taken a schema backup (custom option in the backup window from pgadmin) from server 1. Lets say the schema name is schema1. I restore it on server 2. During/after restoration I all elements/objects ownership to be with pguser2 and nothing with pguser1. How can this be achieved? <b>If it is easier to be done during the restore (pg_restore command) restore option is preferred.</b> </p> Thanks,<br> rockbala
postgresql-9.0
pg-restore
null
null
null
null
open
Need help in a specific way to restore postgres database === <p> Following is the scenario. We have two dev servers set up to be run on postgres. I will call Web server1- pguser1 is the associated user who creates all tables and everything required for a functional database to work with the web application. Similarly we have the second server2 - pguser2 is the associated user who creates data for Web server 2. </p> <p> I have taken a schema backup (custom option in the backup window from pgadmin) from server 1. Lets say the schema name is schema1. I restore it on server 2. During/after restoration I all elements/objects ownership to be with pguser2 and nothing with pguser1. How can this be achieved? <b>If it is easier to be done during the restore (pg_restore command) restore option is preferred.</b> </p> Thanks,<br> rockbala
0
11,430,645
07/11/2012 10:26:49
1,461,637
06/17/2012 09:27:50
111
1
How to transform php array with objects into simple array?
I have a function that returns an array like this Array ( [0] => stdClass Object ( [tid] => 1 [vid] => 2 [name] => About Us [description] => [format] => wysiwyg_editor [weight] => 0 [depth] => 0 [parents] => Array ( [0] => 0 ) ) [1] => stdClass Object ( [tid] => 200 [vid] => 2 [name] => Stories [description] => [format] => wysiwyg_editor [weight] => 0 [depth] => 0 [parents] => Array ( [0] => 0 ) ) ) To simplify it for further use I would like to convert this array into simple one with keys as [tid] and values as [name] So it would be smth like this: Array ( [1] => About Us [200] => Stories ) Any tips or help with proper code syntax would be great. Thanks
php
drupal
null
null
null
null
open
How to transform php array with objects into simple array? === I have a function that returns an array like this Array ( [0] => stdClass Object ( [tid] => 1 [vid] => 2 [name] => About Us [description] => [format] => wysiwyg_editor [weight] => 0 [depth] => 0 [parents] => Array ( [0] => 0 ) ) [1] => stdClass Object ( [tid] => 200 [vid] => 2 [name] => Stories [description] => [format] => wysiwyg_editor [weight] => 0 [depth] => 0 [parents] => Array ( [0] => 0 ) ) ) To simplify it for further use I would like to convert this array into simple one with keys as [tid] and values as [name] So it would be smth like this: Array ( [1] => About Us [200] => Stories ) Any tips or help with proper code syntax would be great. Thanks
0
11,430,648
07/11/2012 10:26:51
576,510
01/15/2011 05:51:55
626
0
How to use let with this LINQ query?
Here is my LINQ query with multiple joins: it is working good but I need to do an enhancement in its working. var selectedResults= from InvoiceSet in Invoices join BookedAreaSet in BookedAreas on InvoiceSet.InvoiceID equals BookedAreaSet.InvoiceID join AreaSet in Areas on BookedAreaSet.AreaID equals AreaSet.AreaID join ContactSet in Contacts on InvoiceSet.ContactID equals ContactSet.ContactID join Contacts_ObjectsSet in Contacts_Objects on ContactSet.ContactID equals Contacts_ObjectsSet.ContactID join CompanySet in Companies on Contacts_ObjectsSet.ObjectReferenceID equals CompanySet.CompanyID join Customer_CustomerGroupSet in Customer_CustomerGroup on Contacts_ObjectsSet.ObjectReferenceID equals Customer_CustomerGroupSet.CustomerID join CustomerGroupDiscountsSet in CustomerGroupDiscounts on Customer_CustomerGroupSet.CustomerGroupID equals CustomerGroupDiscountsSet.ID join InvoiceStatusSet in InvoiceStatus on InvoiceSet.InvoiceStatusID equals InvoiceStatusSet.ID where Contacts_ObjectsSet.ObjectReference=="Company" //let minDate=(BookedAreaSet.LeasedDate).Min() where BookedAreaSet.InvoiceID=InvoiceSet.InvoiceID select new {licensee=(CompanySet.CompanyName),CustomerGroupDiscountsSet.CustomerGroup,AreaSet.Location,InvoiceSet.InvoiceNumber,InvoiceSet.Amount,InvoiceSet.TotalDiscount,InvoiceSet.GST, Paid=(InvoiceSet.InvoiceStatusID==2 ? "Paid":"UnPaid"), datePaid=(InvoiceSet.PaymentDate),InvoiceSet.PaymentDate//,miDate }; In query I have commented what I want to add as well as commented in Select. From BookedArea table I want to get Minimum Leased Date for every invoiceID. I just have started using LINQ so dont know how to do this. Please guide me. Thanks
linq
entity-framework
linq-to-sql
c#-4.0
null
null
open
How to use let with this LINQ query? === Here is my LINQ query with multiple joins: it is working good but I need to do an enhancement in its working. var selectedResults= from InvoiceSet in Invoices join BookedAreaSet in BookedAreas on InvoiceSet.InvoiceID equals BookedAreaSet.InvoiceID join AreaSet in Areas on BookedAreaSet.AreaID equals AreaSet.AreaID join ContactSet in Contacts on InvoiceSet.ContactID equals ContactSet.ContactID join Contacts_ObjectsSet in Contacts_Objects on ContactSet.ContactID equals Contacts_ObjectsSet.ContactID join CompanySet in Companies on Contacts_ObjectsSet.ObjectReferenceID equals CompanySet.CompanyID join Customer_CustomerGroupSet in Customer_CustomerGroup on Contacts_ObjectsSet.ObjectReferenceID equals Customer_CustomerGroupSet.CustomerID join CustomerGroupDiscountsSet in CustomerGroupDiscounts on Customer_CustomerGroupSet.CustomerGroupID equals CustomerGroupDiscountsSet.ID join InvoiceStatusSet in InvoiceStatus on InvoiceSet.InvoiceStatusID equals InvoiceStatusSet.ID where Contacts_ObjectsSet.ObjectReference=="Company" //let minDate=(BookedAreaSet.LeasedDate).Min() where BookedAreaSet.InvoiceID=InvoiceSet.InvoiceID select new {licensee=(CompanySet.CompanyName),CustomerGroupDiscountsSet.CustomerGroup,AreaSet.Location,InvoiceSet.InvoiceNumber,InvoiceSet.Amount,InvoiceSet.TotalDiscount,InvoiceSet.GST, Paid=(InvoiceSet.InvoiceStatusID==2 ? "Paid":"UnPaid"), datePaid=(InvoiceSet.PaymentDate),InvoiceSet.PaymentDate//,miDate }; In query I have commented what I want to add as well as commented in Select. From BookedArea table I want to get Minimum Leased Date for every invoiceID. I just have started using LINQ so dont know how to do this. Please guide me. Thanks
0
11,430,651
07/11/2012 10:27:13
767,561
05/24/2011 10:35:47
545
34
resize form in panel not working
I am loading a form into a panel by using the below code, problem is if the main window is resized the form doesn't resize with it. frm = new frmShopFloorMonitor(); frm.TopLevel = false; frm.Dock = DockStyle.Fill; frm.AutoSize = true; pnlMain.Controls.Add(frm); pnlMain.Dock = DockStyle.Fill; frm.Show(); frm.BringToFront(); any suggestions?
c#
winforms
panel
null
null
null
open
resize form in panel not working === I am loading a form into a panel by using the below code, problem is if the main window is resized the form doesn't resize with it. frm = new frmShopFloorMonitor(); frm.TopLevel = false; frm.Dock = DockStyle.Fill; frm.AutoSize = true; pnlMain.Controls.Add(frm); pnlMain.Dock = DockStyle.Fill; frm.Show(); frm.BringToFront(); any suggestions?
0
11,430,652
07/11/2012 10:27:21
1,517,428
07/11/2012 10:18:03
1
0
DIsplay employee working status per day of week
I have a query: SELECT users.name AS USER, TIMESHEET.timesheet_date AS DAY, TIMESHEET.STATUS AS STATUS FROM TIMESHEET JOIN users ON TIMESHEET.`rep_id` = users.`id` WHERE WEEK(TIMESHEET.timesheet_date) = WEEK(CURDATE()) - 1 that returns the following: per employee, the working status for each date of LAST WEEK: (sample) USER DAY STATUS Lee Fenelon 2012-07-02 Working Tom Price 2012-07-02 Working Kevin Duffy 2012-07-02 Working Keith Donnelly 2012-07-02 Working Graham Foley 2012-07-02 Sick Leave - No Medical Cert Dominic Mallinson 2012-07-04 1/2 Day Sick Leave - No Medical Cert What I'd like to do is modify the above so that I get 5 status per employee per week, ie STATUS_MONDAY = Working, STATUS_TUESDAY=Sick leave etc etc The overall required output will be a report showing, for each employee, one columne per day with their working staus for that day. Any assistance is greatly appreciated?
mysql
null
null
null
null
null
open
DIsplay employee working status per day of week === I have a query: SELECT users.name AS USER, TIMESHEET.timesheet_date AS DAY, TIMESHEET.STATUS AS STATUS FROM TIMESHEET JOIN users ON TIMESHEET.`rep_id` = users.`id` WHERE WEEK(TIMESHEET.timesheet_date) = WEEK(CURDATE()) - 1 that returns the following: per employee, the working status for each date of LAST WEEK: (sample) USER DAY STATUS Lee Fenelon 2012-07-02 Working Tom Price 2012-07-02 Working Kevin Duffy 2012-07-02 Working Keith Donnelly 2012-07-02 Working Graham Foley 2012-07-02 Sick Leave - No Medical Cert Dominic Mallinson 2012-07-04 1/2 Day Sick Leave - No Medical Cert What I'd like to do is modify the above so that I get 5 status per employee per week, ie STATUS_MONDAY = Working, STATUS_TUESDAY=Sick leave etc etc The overall required output will be a report showing, for each employee, one columne per day with their working staus for that day. Any assistance is greatly appreciated?
0
11,430,653
07/11/2012 10:27:26
1,517,441
07/11/2012 10:22:39
1
0
Create dynamic TextField on Bezier Curve - AS3
I'm trying to place a dynamic generated text on a bezier curve - the text can be up to 12 charcters long, so it will need to adjust to the center. I can't find any attempt to do this on google. my only guess is reading a bezier curves xy, then placing the textfield on that, but how would i get the Textfield to fit to the curve? Thanks! Marcus
actionscript-3
flash
textfield
bezier
bezier-curve
null
open
Create dynamic TextField on Bezier Curve - AS3 === I'm trying to place a dynamic generated text on a bezier curve - the text can be up to 12 charcters long, so it will need to adjust to the center. I can't find any attempt to do this on google. my only guess is reading a bezier curves xy, then placing the textfield on that, but how would i get the Textfield to fit to the curve? Thanks! Marcus
0
11,679,286
07/26/2012 23:03:23
1,425,279
05/30/2012 06:05:47
15
1
changing image on UIImageView before segue
I'm making a game that asks the user a series of questions and each time the user gets it right, a UIImageView will change its image. The code I have works except when the game reaches the last question, I call for a segue onto another view controller.... I still want the image to change before it segues but it will not...
ios
uiimageview
segue
null
null
null
open
changing image on UIImageView before segue === I'm making a game that asks the user a series of questions and each time the user gets it right, a UIImageView will change its image. The code I have works except when the game reaches the last question, I call for a segue onto another view controller.... I still want the image to change before it segues but it will not...
0
11,679,290
07/26/2012 23:03:47
1,546,955
07/23/2012 20:59:33
2
0
Binary tree C++ basics
void BinarySearchTree::insert(int d) { tree_node* t = new tree_node; tree_node* parent; t->data = d; t->left = NULL; t->right = NULL; parent = NULL; // is this a new tree? if(isEmpty()) root = t; else { //Note: ALL insertions are as leaf nodes tree_node* curr; curr = root; // Find the Node's parent while(curr) { parent = curr; if(t->data > curr->data) curr = curr->right; else curr = curr->left; } if(t->data < parent->data) parent->left = t; else parent->right = t; } } Questions: 1. Why do I need to allocate memory for **tree_node* t;** using new but not for **tree_node* parent;**? 2. What exactly is tree_node* what does it look like in memory and what does it do? 2. Can someone explain to me the -> operator and how it works?
c++
null
null
null
null
null
open
Binary tree C++ basics === void BinarySearchTree::insert(int d) { tree_node* t = new tree_node; tree_node* parent; t->data = d; t->left = NULL; t->right = NULL; parent = NULL; // is this a new tree? if(isEmpty()) root = t; else { //Note: ALL insertions are as leaf nodes tree_node* curr; curr = root; // Find the Node's parent while(curr) { parent = curr; if(t->data > curr->data) curr = curr->right; else curr = curr->left; } if(t->data < parent->data) parent->left = t; else parent->right = t; } } Questions: 1. Why do I need to allocate memory for **tree_node* t;** using new but not for **tree_node* parent;**? 2. What exactly is tree_node* what does it look like in memory and what does it do? 2. Can someone explain to me the -> operator and how it works?
0
7,707,738
10/10/2011 01:28:54
730,381
04/29/2011 02:37:52
26
0
Jquery delay to stop code like an alert box does
If I use an alert to stop the code running the ddl ‘Suburb1' is populated with the correct value if I use ‘delay’ the value is not set. I need some way of stopping the code running after ‘change’ so that $('#Suburb1').val(SuburbVC); is not fired straight away when the ddl Suburb1 is getting populated from the DB. if ($(this).attr("checked") == true) { var PostCode = $('#PostCode').val(); var SuburbVC = $('#SuburbVC').val(); $('#PostCode1').val(PostCode); // Another function is called which populates Dropdown list from DB // If I use delay Suburb1 is not populated $('#PostCode1').change().delay(5000); //If I use an alert Suburb1 is populated // alert('delay'); $('#Suburb1').val(SuburbVC); } else { $('#PostCode1').val(""); } Thanks
javascript
jquery
null
null
null
null
open
Jquery delay to stop code like an alert box does === If I use an alert to stop the code running the ddl ‘Suburb1' is populated with the correct value if I use ‘delay’ the value is not set. I need some way of stopping the code running after ‘change’ so that $('#Suburb1').val(SuburbVC); is not fired straight away when the ddl Suburb1 is getting populated from the DB. if ($(this).attr("checked") == true) { var PostCode = $('#PostCode').val(); var SuburbVC = $('#SuburbVC').val(); $('#PostCode1').val(PostCode); // Another function is called which populates Dropdown list from DB // If I use delay Suburb1 is not populated $('#PostCode1').change().delay(5000); //If I use an alert Suburb1 is populated // alert('delay'); $('#Suburb1').val(SuburbVC); } else { $('#PostCode1').val(""); } Thanks
0
11,679,292
07/26/2012 23:03:56
897,369
08/16/2011 19:26:17
45
0
Read byte array from file inside of zip
I've spent the several last days creating a program which will host game servers from my dedicated server. The users input which WAD/PK3 (files that store map info, music, etc.), several other things, and are able to host the server. I have a friend who made a method which will go through the WAD file and collect information, which then will call getLevelNames() and will return the level names in an array, which I then add to the server host command line and add the appropriate maps. Here is the part of the code that I believe is important: public static byte[] getByteArrayFromFile(String filePath) throws IOException { return Files.readAllBytes(new File(filePath).toPath()); } /** * Given a path to the file, this will extract the information into a byte array, * and then it will read it, index the file locations and pass the appropriate byte * data to other objects which will index the data in a useful way that the engine * can read/use. * Ideally after the data has been passed and indexed, the Wad object should be nullified and * set for garbage collection. * @param path The full path on the disk to the wad to be read from * @throws IOException If the path to the file has an error */ public Wad(String path) throws IOException { // Load wad data wadData = ByteData.getByteArrayFromFile(path); // Setup pointers headerType = ByteData.bytesToString(Arrays.copyOfRange(wadData, 0, 4)); headerTotalLumps = ByteData.bytesToInt(wadData[4], wadData[5], wadData[6], wadData[7]); headerPointerToDirectory = ByteData.bytesToInt(wadData[8], wadData[9], wadData[10], wadData[11]); System.out.println("Wad data: " + headerType + ", " + headerTotalLumps + " total lumps, " + headerPointerToDirectory + " directory offset"); // Setup offset data parseDirectory(); getLevelNames(); } public void getLevelNames() { String[] temp = new String[lumpName.length]; // Maybe I can divide this by 2, or 5 or something to save space since they all shouldn't be a map... Arrays.fill(temp, ""); int tempIndex = 0; List<String> listMapNames = Arrays.asList(lumpMapNames); for (int i = 0; i < lumpName.length; i++) // Make sure: 1) were not at an end piece, 2) its actually a marker, 3) the next lump contains a map file (like SEGS), 4) The marker itself isn't something like an empty reject table, 5) doesn't contain GL_xyzab if (i != lumpName.length - 1 && fileSize[i] == 0 && listMapNames.contains(lumpName[i+1]) && !listMapNames.contains(lumpName[i]) && !lumpName[i].startsWith("GL_")) { temp[tempIndex] = lumpName[i]; tempIndex++; } // If there's no levels if (tempIndex == 0) { levelNames = new String[0]; return; } levelNames = new String[tempIndex]; // We should be at levels + 1, or at least a proper length for (int j = 0; j < tempIndex; j++) levelNames[j] = temp[j]; // Sort the array just to make the server execution cleaner Arrays.sort(levelNames); } private void parseDirectory() { fileOffset = new int[headerTotalLumps]; fileSize = new int[headerTotalLumps]; lumpName = new String[headerTotalLumps]; int c = 0; // Counter for starting at index 0 and going upwards System.out.println("Pointer: " + headerPointerToDirectory + ", total length: " + wadData.length + ", difference = " + (wadData.length - headerPointerToDirectory)); for (int off = headerPointerToDirectory; off < wadData.length; off += 16) { fileOffset[c] = ByteData.bytesToInt(wadData[off], wadData[off+1], wadData[off+2], wadData[off+3]); fileSize[c] = ByteData.bytesToInt(wadData[off+4], wadData[off+5], wadData[off+6], wadData[off+7]); lumpName[c] = new String(Arrays.copyOfRange(wadData, off+8, off+16)).trim(); c++; } } However, I have run into a dilemma. Since PK3 files are completely different in the fact that they are basically .zip files that store seperate .WADs for each map in the maps/ directory, I have no idea how I would be able to access them. Here is an example of the file structure: 1. Level.pk3: - MUSIC - MAPS - d2dm01.wad - map01 - d2dm02.wad - map02 - d2dm03.wad - map03 - EXTRAS I have no idea how I would access the file inside the wads inside the pk3 without extracting them one by one and checking the levels in a for loop. Admittedly, I also have no idea what I'm doing, so what I'd like to know is how I could read the files inside the pk3 and get the maps (map01, map02, map03). Also, if anyone knows a good resource for reading and parsing bytes in a file to get information, that would be really helpful. I feel pretty clueless right now.
java
bytearray
null
null
null
null
open
Read byte array from file inside of zip === I've spent the several last days creating a program which will host game servers from my dedicated server. The users input which WAD/PK3 (files that store map info, music, etc.), several other things, and are able to host the server. I have a friend who made a method which will go through the WAD file and collect information, which then will call getLevelNames() and will return the level names in an array, which I then add to the server host command line and add the appropriate maps. Here is the part of the code that I believe is important: public static byte[] getByteArrayFromFile(String filePath) throws IOException { return Files.readAllBytes(new File(filePath).toPath()); } /** * Given a path to the file, this will extract the information into a byte array, * and then it will read it, index the file locations and pass the appropriate byte * data to other objects which will index the data in a useful way that the engine * can read/use. * Ideally after the data has been passed and indexed, the Wad object should be nullified and * set for garbage collection. * @param path The full path on the disk to the wad to be read from * @throws IOException If the path to the file has an error */ public Wad(String path) throws IOException { // Load wad data wadData = ByteData.getByteArrayFromFile(path); // Setup pointers headerType = ByteData.bytesToString(Arrays.copyOfRange(wadData, 0, 4)); headerTotalLumps = ByteData.bytesToInt(wadData[4], wadData[5], wadData[6], wadData[7]); headerPointerToDirectory = ByteData.bytesToInt(wadData[8], wadData[9], wadData[10], wadData[11]); System.out.println("Wad data: " + headerType + ", " + headerTotalLumps + " total lumps, " + headerPointerToDirectory + " directory offset"); // Setup offset data parseDirectory(); getLevelNames(); } public void getLevelNames() { String[] temp = new String[lumpName.length]; // Maybe I can divide this by 2, or 5 or something to save space since they all shouldn't be a map... Arrays.fill(temp, ""); int tempIndex = 0; List<String> listMapNames = Arrays.asList(lumpMapNames); for (int i = 0; i < lumpName.length; i++) // Make sure: 1) were not at an end piece, 2) its actually a marker, 3) the next lump contains a map file (like SEGS), 4) The marker itself isn't something like an empty reject table, 5) doesn't contain GL_xyzab if (i != lumpName.length - 1 && fileSize[i] == 0 && listMapNames.contains(lumpName[i+1]) && !listMapNames.contains(lumpName[i]) && !lumpName[i].startsWith("GL_")) { temp[tempIndex] = lumpName[i]; tempIndex++; } // If there's no levels if (tempIndex == 0) { levelNames = new String[0]; return; } levelNames = new String[tempIndex]; // We should be at levels + 1, or at least a proper length for (int j = 0; j < tempIndex; j++) levelNames[j] = temp[j]; // Sort the array just to make the server execution cleaner Arrays.sort(levelNames); } private void parseDirectory() { fileOffset = new int[headerTotalLumps]; fileSize = new int[headerTotalLumps]; lumpName = new String[headerTotalLumps]; int c = 0; // Counter for starting at index 0 and going upwards System.out.println("Pointer: " + headerPointerToDirectory + ", total length: " + wadData.length + ", difference = " + (wadData.length - headerPointerToDirectory)); for (int off = headerPointerToDirectory; off < wadData.length; off += 16) { fileOffset[c] = ByteData.bytesToInt(wadData[off], wadData[off+1], wadData[off+2], wadData[off+3]); fileSize[c] = ByteData.bytesToInt(wadData[off+4], wadData[off+5], wadData[off+6], wadData[off+7]); lumpName[c] = new String(Arrays.copyOfRange(wadData, off+8, off+16)).trim(); c++; } } However, I have run into a dilemma. Since PK3 files are completely different in the fact that they are basically .zip files that store seperate .WADs for each map in the maps/ directory, I have no idea how I would be able to access them. Here is an example of the file structure: 1. Level.pk3: - MUSIC - MAPS - d2dm01.wad - map01 - d2dm02.wad - map02 - d2dm03.wad - map03 - EXTRAS I have no idea how I would access the file inside the wads inside the pk3 without extracting them one by one and checking the levels in a for loop. Admittedly, I also have no idea what I'm doing, so what I'd like to know is how I could read the files inside the pk3 and get the maps (map01, map02, map03). Also, if anyone knows a good resource for reading and parsing bytes in a file to get information, that would be really helpful. I feel pretty clueless right now.
0
11,679,257
07/26/2012 23:00:26
1,178,586
01/30/2012 17:11:58
12
1
Audio out of sync - AVMutableComposition
I'm using an AVMutableComposition to chop up a video and rearrange the pieces after it has been captured with the camera. My problem is that the audio gets out of sync (>2 seconds) when playing the composition (using AVPlayer). Here's how I set up the composition: -(void)initComposition { AVMutableComposition *composition = [AVMutableComposition composition]; AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; AVURLAsset *video = [assetDictionary objectForKey:asset]; AVAssetTrack *videoTrack = [[video tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; AVURLAsset *audio = [assetDictionary objectForKey:asset]; AVAssetTrack *audioTrack = [[audio tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; for (int i = 0; i < 8; i++) { NSString *iAsString = [[NSString alloc] initWithFormat:@"%i",i]; if ([cuePointsDictionary objectForKey:iAsString]) { NSValue *rangeAsValue = [cuePointsDictionary objectForKey:iAsString]; CMTimeRange range = [rangeAsValue CMTimeRangeValue]; [compositionVideoTrack insertTimeRange:range ofTrack:videoTrack atTime:composition.duration error:nil]; [compositionAudioTrack insertTimeRange:range ofTrack:audioTrack atTime:composition.duration error:nil]; } } } Any input is greatly appreciated.
xcode
avmutablecomposition
null
null
null
null
open
Audio out of sync - AVMutableComposition === I'm using an AVMutableComposition to chop up a video and rearrange the pieces after it has been captured with the camera. My problem is that the audio gets out of sync (>2 seconds) when playing the composition (using AVPlayer). Here's how I set up the composition: -(void)initComposition { AVMutableComposition *composition = [AVMutableComposition composition]; AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; AVURLAsset *video = [assetDictionary objectForKey:asset]; AVAssetTrack *videoTrack = [[video tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; AVURLAsset *audio = [assetDictionary objectForKey:asset]; AVAssetTrack *audioTrack = [[audio tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; for (int i = 0; i < 8; i++) { NSString *iAsString = [[NSString alloc] initWithFormat:@"%i",i]; if ([cuePointsDictionary objectForKey:iAsString]) { NSValue *rangeAsValue = [cuePointsDictionary objectForKey:iAsString]; CMTimeRange range = [rangeAsValue CMTimeRangeValue]; [compositionVideoTrack insertTimeRange:range ofTrack:videoTrack atTime:composition.duration error:nil]; [compositionAudioTrack insertTimeRange:range ofTrack:audioTrack atTime:composition.duration error:nil]; } } } Any input is greatly appreciated.
0
11,679,258
07/26/2012 23:00:28
706,836
04/13/2011 21:01:55
1,967
123
Can you have a incrimentor and a decrimentor on the same variable in the same statement in c
Is --foo++; a valid statement in C? (Will it compile/run) And is there any practical application for this?
c
null
null
null
null
null
open
Can you have a incrimentor and a decrimentor on the same variable in the same statement in c === Is --foo++; a valid statement in C? (Will it compile/run) And is there any practical application for this?
0
11,679,259
07/26/2012 23:00:35
509,600
11/16/2010 14:03:23
2,357
82
Trying to understand if I need WakeLock
Disclaimer: My app already working without any Wake Locks for 1+ year and all is well for _most_ devices. I'm tracking GPS and it works like this: 1. AlarmReceiver starts Service every 5/10/15 minutes (as user wishes) 2. Service subscribes for Location updates and waits MAX 1 minute for good GPS. 3. Wrap up, send data to server and shut down service. Due to bad connections and bad locations - whole thing take up to 2-3 minutes sometimes. And it works. No matter if phone is sleeping or not. Now I'm reading about WakeLock and it doesn't make sense to me. How come my stuff is working? Is that coincidence?
java
android
null
null
null
null
open
Trying to understand if I need WakeLock === Disclaimer: My app already working without any Wake Locks for 1+ year and all is well for _most_ devices. I'm tracking GPS and it works like this: 1. AlarmReceiver starts Service every 5/10/15 minutes (as user wishes) 2. Service subscribes for Location updates and waits MAX 1 minute for good GPS. 3. Wrap up, send data to server and shut down service. Due to bad connections and bad locations - whole thing take up to 2-3 minutes sometimes. And it works. No matter if phone is sleeping or not. Now I'm reading about WakeLock and it doesn't make sense to me. How come my stuff is working? Is that coincidence?
0
11,679,295
07/26/2012 23:04:35
718,990
04/21/2011 13:04:47
507
6
Fetch the body height of a person from IMDb
I'm trying to fetch a persons body height from IMDb but the line for it contains a `#` which indicate a comment in PHP (for example `# The comment as follows`). Here is how it looks like from IMDb's source code: <h4 class="inline">Height:</h4> 5' 7&#34; (1.70 m) Here is my attempted regular expression: `<h4 class="inline">Height:</h4>\n([0-9' &#;(.)m]+)` What should I do to prevent it to comment the rest of the regular expression after the `#` character? Thanks in advance!
php
regex
imdb
null
null
null
open
Fetch the body height of a person from IMDb === I'm trying to fetch a persons body height from IMDb but the line for it contains a `#` which indicate a comment in PHP (for example `# The comment as follows`). Here is how it looks like from IMDb's source code: <h4 class="inline">Height:</h4> 5' 7&#34; (1.70 m) Here is my attempted regular expression: `<h4 class="inline">Height:</h4>\n([0-9' &#;(.)m]+)` What should I do to prevent it to comment the rest of the regular expression after the `#` character? Thanks in advance!
0
11,679,297
07/26/2012 23:04:50
1,541,749
07/20/2012 20:35:05
15
0
Losing 'FormattedID' link after applying style changes
I have a rallygrid object set up with the following settings for columnCfgs: columnCfgs: [ 'FormattedID', 'Name', 'PlanEstimate' ] Which gives me a nice formatted link to the UserStory in the "FormattedID" field. The problem is, I don't like the way the columns are laid out on the page so I changed the FormattedID column to: { text: 'ID', dataIndex: 'FormattedID', width: 60 } This gives me the correct column spacing but the field text is no longer linked directly to the user story it references. How can I alter the column width, but also keep the nice formatting?
javascript
rally
null
null
null
null
open
Losing 'FormattedID' link after applying style changes === I have a rallygrid object set up with the following settings for columnCfgs: columnCfgs: [ 'FormattedID', 'Name', 'PlanEstimate' ] Which gives me a nice formatted link to the UserStory in the "FormattedID" field. The problem is, I don't like the way the columns are laid out on the page so I changed the FormattedID column to: { text: 'ID', dataIndex: 'FormattedID', width: 60 } This gives me the correct column spacing but the field text is no longer linked directly to the user story it references. How can I alter the column width, but also keep the nice formatting?
0
11,679,299
07/26/2012 23:04:52
216,363
11/22/2009 05:41:57
989
11
Setting up a continuous deployment environment for efficient scaling
I'm nearly ready to launch my rails app, which I have been testing using a single linode box. My git repo is also currently hosted on the same box, which also includes the application and the database. I want to split these into 3 entities -- a database server, and application server (with the option to easily add more), and a repo hosted on bitbucket. Ideally, I'd like to be able to commit my code to bitbucket, and then setup a post-commit hook push POSTS to the app server to pull new changes from the repo and automatically start serving them. I've spent a whole lot of time reading about Puppet, Chef, Passenger, etc and I'm pretty overwhelmed. My setup is working fine as is, but I know that it won't scale well when the time comes, so I need to make a switch. What I'd like help with is determining what tools I ought to be using in addition to what I already have setup in order to make the process as smooth as possible. Thanks
ruby-on-rails
ruby-on-rails-3
continuous-integration
continuous-deployment
null
null
open
Setting up a continuous deployment environment for efficient scaling === I'm nearly ready to launch my rails app, which I have been testing using a single linode box. My git repo is also currently hosted on the same box, which also includes the application and the database. I want to split these into 3 entities -- a database server, and application server (with the option to easily add more), and a repo hosted on bitbucket. Ideally, I'd like to be able to commit my code to bitbucket, and then setup a post-commit hook push POSTS to the app server to pull new changes from the repo and automatically start serving them. I've spent a whole lot of time reading about Puppet, Chef, Passenger, etc and I'm pretty overwhelmed. My setup is working fine as is, but I know that it won't scale well when the time comes, so I need to make a switch. What I'd like help with is determining what tools I ought to be using in addition to what I already have setup in order to make the process as smooth as possible. Thanks
0
11,679,300
07/26/2012 23:05:02
1,552,069
07/25/2012 15:11:50
1
0
Using tutorials with xib and changing to storyboards
I'm doing the following tutorial (this is just one example): http://www.raywenderlich.com/1040/ipad-for-iphone-developers-101-uisplitview-tutorial I start things off by creating a new project called MathMonsters. Xcode then creates files for both iPad and iPhone (no option of creating only for the iPad). I then go on and create the files for LeftViewController and RightViewController. I then change the relevant attributes from the MainStoryboard_iPad.storyboard by selecting the views and changing the classes they correspond to new ones created above. I then add: @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController; @property (nonatomic, retain) IBOutlet LeftViewController *leftViewController; @property (nonatomic, retain) IBOutlet RightViewController *rightViewController; In the app delegate file. Now it asks me to control drag and connect the outlets. Hard as I try, I cannot find anywhere in the storyboard that I can connect these to. I tried looking at different files, like in LeftViewController.h,RightViewController.h and MathMonstersAppDelegate.h. In this last file I see there are empty circles to the left of each outlet but I'm not able to connect them. I've started working on apps only after Xcode 4.2 came out and I'm not familiar with the xib tutorials and I'm having a hard time in general to look at the older tutorials and adapt them to the new way of coding. Help is therefore greatly appreciated! If it would help to post other parts of the code, please let me know and I will do so. Thanks everyone.
ios
storyboard
xib
null
null
null
open
Using tutorials with xib and changing to storyboards === I'm doing the following tutorial (this is just one example): http://www.raywenderlich.com/1040/ipad-for-iphone-developers-101-uisplitview-tutorial I start things off by creating a new project called MathMonsters. Xcode then creates files for both iPad and iPhone (no option of creating only for the iPad). I then go on and create the files for LeftViewController and RightViewController. I then change the relevant attributes from the MainStoryboard_iPad.storyboard by selecting the views and changing the classes they correspond to new ones created above. I then add: @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController; @property (nonatomic, retain) IBOutlet LeftViewController *leftViewController; @property (nonatomic, retain) IBOutlet RightViewController *rightViewController; In the app delegate file. Now it asks me to control drag and connect the outlets. Hard as I try, I cannot find anywhere in the storyboard that I can connect these to. I tried looking at different files, like in LeftViewController.h,RightViewController.h and MathMonstersAppDelegate.h. In this last file I see there are empty circles to the left of each outlet but I'm not able to connect them. I've started working on apps only after Xcode 4.2 came out and I'm not familiar with the xib tutorials and I'm having a hard time in general to look at the older tutorials and adapt them to the new way of coding. Help is therefore greatly appreciated! If it would help to post other parts of the code, please let me know and I will do so. Thanks everyone.
0
11,679,302
07/26/2012 23:05:20
534,936
12/08/2010 11:58:40
40
0
Rails, Heroku and assets without the asset pipeline
I'm actually not sure if this is a rails thing or a heroku thing but I need to know how I can serve up static assets without the asset pipleline. I do want to use the asset pipeline for most of my javascript but I have some files that I want to exclude and serve at my own choosing. I am new to Rails and Heroku so I am a bit lost. Any help would be greatly appreciated.
ruby-on-rails
heroku
asset-pipeline
null
null
null
open
Rails, Heroku and assets without the asset pipeline === I'm actually not sure if this is a rails thing or a heroku thing but I need to know how I can serve up static assets without the asset pipleline. I do want to use the asset pipeline for most of my javascript but I have some files that I want to exclude and serve at my own choosing. I am new to Rails and Heroku so I am a bit lost. Any help would be greatly appreciated.
0
11,734,723
07/31/2012 06:55:14
1,564,923
07/31/2012 06:52:09
1
0
C# to VB.NET function
I'm having a problem in this function in C#. I want to convert it to VB.NET This code is C# public Frm_Sched() { dayView1.NewAppointment += new Calendar.NewAppointmentEventHandler(dayView1_NewAppointment); } void dayView1_NewAppointment(object sender, Calendar.NewAppointmentEventArgs args) { Calendar.Appointment m_Appointment = new Calendar.Appointment(); m_Appointment.StartDate = args.StartDate; m_Appointment.EndDate = args.EndDate; m_Appointment.Title = args.Title; oApp.Add(m_Appointment); } How can I convert it to VB.NET? I want to call this event in my Form Load Private Sub Frm_Sched_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Please help.
c#
vb.net
null
null
null
null
open
C# to VB.NET function === I'm having a problem in this function in C#. I want to convert it to VB.NET This code is C# public Frm_Sched() { dayView1.NewAppointment += new Calendar.NewAppointmentEventHandler(dayView1_NewAppointment); } void dayView1_NewAppointment(object sender, Calendar.NewAppointmentEventArgs args) { Calendar.Appointment m_Appointment = new Calendar.Appointment(); m_Appointment.StartDate = args.StartDate; m_Appointment.EndDate = args.EndDate; m_Appointment.Title = args.Title; oApp.Add(m_Appointment); } How can I convert it to VB.NET? I want to call this event in my Form Load Private Sub Frm_Sched_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Please help.
0
11,734,824
07/31/2012 07:03:28
1,488,501
06/28/2012 12:11:41
6
0
AOSP build failing with File not recognized : File truncated on various executables
I've run this build a few times, with make clean in between and even removing the entire 'out' folder but it fails with different errors each time. Here are a few of the last segments of the output I got. make: *** [out/host/linux-x86/obj/EXECUTABLES/zipalign_intermediates/zipalign] Error 1 make: *** Waiting for unfinished jobs.... true preparing StaticLib: libc [including out/target/product/wingray/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a] target StaticLib: libdrmframeworkcommon (out/target/product/wingray/obj/STATIC_LIBRARIES/libdrmframeworkcommon_intermediates/libdrmframeworkcommon.a) target StaticLib: libc (out/target/product/wingray/obj/STATIC_LIBRARIES/libc_intermediates/libc.a) 1. next ` external/valgrind/tsan/thread_sanitizer.cc:3257: warning: unused parameter 'create_new_if_need' In file included from external/stlport/stlport/stl/_algobase.h:721, from external/stlport/stlport/stl/_tree.h:55, from external/stlport/stlport/stl/_set.h:35, from external/stlport/stlport/set:37, from external/valgrind/tsan/ts_util.h:128, from external/valgrind/tsan/thread_sanitizer.h:34, from external/valgrind/tsan/thread_sanitizer.cc:35: external/stlport/stlport/stl/_algobase.c: In instantiation of '_ForwardIter std::priv::__lower_bound(_ForwardIter, _ForwardIter, const _Tp&, _Compare1, _Compare2, _Distance*) [with _ForwardIter = const LID*, _Tp = LID, _Compare1 = std::priv::__less_2<LID, LID>, _Compare2 = std::priv::__less_2<LID, LID>, _Distance = ptrdiff_t]': external/stlport/stlport/stl/_algo.h:487: instantiated from '_ForwardIter std::lower_bound(_ForwardIter, _ForwardIter, const _Tp&) [with _ForwardIter = const LID*, _Tp = LID]' external/valgrind/tsan/dense_multimap.h:67: instantiated from 'DenseMultimap<T, kPreallocatedElements>::DenseMultimap(const DenseMultimap<T, kPreallocatedElements>&, const T&) [with T = LID, int kPreallocatedElements = 3]' external/valgrind/tsan/thread_sanitizer.cc:867: instantiated from here external/stlport/stlport/stl/_algobase.c:454: warning: unused parameter '__comp2' external/stlport/stlport/stl/_algobase.c: In instantiation of '_ForwardIter std::priv::__lower_bound(_ForwardIter, _ForwardIter, const _Tp&, _Compare1, _Compare2, _Distance*) [with _ForwardIter = const size_t*, _Tp = size_t, _Compare1 = std::less<unsigned int>, _Compare2 = std::less<unsigned int>, _Distance = ptrdiff_t]': external/stlport/stlport/stl/_hashtable.c:74: instantiated from 'static size_t std::priv::_Stl_prime<_Dummy>::_S_next_size(size_t) [with _Dummy = bool]' external/stlport/stlport/stl/_hashtable.h:596: instantiated from 'void std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::_M_initialize_buckets(size_t) [with _Val = std::pair<SegmentSet* const, SSID>, _Key = SegmentSet*, _HF = SegmentSet::SSHash, _Traits = std::priv::_UnorderedMapTraitsT<std::pair<SegmentSet* const, SSID> >, _ExK = std::priv::_Select1st<std::pair<SegmentSet* const, SSID> >, _EqK = SegmentSet::SSEq, _All = std::allocator<std::pair<SegmentSet* const, SSID> >]' external/stlport/stlport/stl/_hashtable.h:330: instantiated from 'std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::hashtable(size_t, const _HF&, const _EqK&, const _All&) [with _Val = std::pair<SegmentSet* const, SSID>, _Key = SegmentSet*, _HF = SegmentSet::SSHash, _Traits = std::priv::_UnorderedMapTraitsT<std::pair<SegmentSet* const, SSID> >, _ExK = std::priv::_Select1st<std::pair<SegmentSet* const, SSID> >, _EqK = SegmentSet::SSEq, _All = std::allocator<std::pair<SegmentSet* const, SSID> >]' external/stlport/stlport/stl/_unordered_map.h:86: instantiated from 'std::tr1::unordered_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>::unordered_map(typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::size_type, const typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::hasher&, const typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::key_equal&, const typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::allocator_type&) [with _Key = SegmentSet*, _Tp = SSID, _HashFcn = SegmentSet::SSHash, _EqualKey = SegmentSet::SSEq, _Alloc = std::allocator<std::pair<SegmentSet* const, SSID> >]' external/valgrind/tsan/thread_sanitizer.cc:2404: instantiated from here external/stlport/stlport/stl/_algobase.c:454: warning: unused parameter '__comp2' `
android
compiler-errors
android-source
null
null
null
open
AOSP build failing with File not recognized : File truncated on various executables === I've run this build a few times, with make clean in between and even removing the entire 'out' folder but it fails with different errors each time. Here are a few of the last segments of the output I got. make: *** [out/host/linux-x86/obj/EXECUTABLES/zipalign_intermediates/zipalign] Error 1 make: *** Waiting for unfinished jobs.... true preparing StaticLib: libc [including out/target/product/wingray/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a] target StaticLib: libdrmframeworkcommon (out/target/product/wingray/obj/STATIC_LIBRARIES/libdrmframeworkcommon_intermediates/libdrmframeworkcommon.a) target StaticLib: libc (out/target/product/wingray/obj/STATIC_LIBRARIES/libc_intermediates/libc.a) 1. next ` external/valgrind/tsan/thread_sanitizer.cc:3257: warning: unused parameter 'create_new_if_need' In file included from external/stlport/stlport/stl/_algobase.h:721, from external/stlport/stlport/stl/_tree.h:55, from external/stlport/stlport/stl/_set.h:35, from external/stlport/stlport/set:37, from external/valgrind/tsan/ts_util.h:128, from external/valgrind/tsan/thread_sanitizer.h:34, from external/valgrind/tsan/thread_sanitizer.cc:35: external/stlport/stlport/stl/_algobase.c: In instantiation of '_ForwardIter std::priv::__lower_bound(_ForwardIter, _ForwardIter, const _Tp&, _Compare1, _Compare2, _Distance*) [with _ForwardIter = const LID*, _Tp = LID, _Compare1 = std::priv::__less_2<LID, LID>, _Compare2 = std::priv::__less_2<LID, LID>, _Distance = ptrdiff_t]': external/stlport/stlport/stl/_algo.h:487: instantiated from '_ForwardIter std::lower_bound(_ForwardIter, _ForwardIter, const _Tp&) [with _ForwardIter = const LID*, _Tp = LID]' external/valgrind/tsan/dense_multimap.h:67: instantiated from 'DenseMultimap<T, kPreallocatedElements>::DenseMultimap(const DenseMultimap<T, kPreallocatedElements>&, const T&) [with T = LID, int kPreallocatedElements = 3]' external/valgrind/tsan/thread_sanitizer.cc:867: instantiated from here external/stlport/stlport/stl/_algobase.c:454: warning: unused parameter '__comp2' external/stlport/stlport/stl/_algobase.c: In instantiation of '_ForwardIter std::priv::__lower_bound(_ForwardIter, _ForwardIter, const _Tp&, _Compare1, _Compare2, _Distance*) [with _ForwardIter = const size_t*, _Tp = size_t, _Compare1 = std::less<unsigned int>, _Compare2 = std::less<unsigned int>, _Distance = ptrdiff_t]': external/stlport/stlport/stl/_hashtable.c:74: instantiated from 'static size_t std::priv::_Stl_prime<_Dummy>::_S_next_size(size_t) [with _Dummy = bool]' external/stlport/stlport/stl/_hashtable.h:596: instantiated from 'void std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::_M_initialize_buckets(size_t) [with _Val = std::pair<SegmentSet* const, SSID>, _Key = SegmentSet*, _HF = SegmentSet::SSHash, _Traits = std::priv::_UnorderedMapTraitsT<std::pair<SegmentSet* const, SSID> >, _ExK = std::priv::_Select1st<std::pair<SegmentSet* const, SSID> >, _EqK = SegmentSet::SSEq, _All = std::allocator<std::pair<SegmentSet* const, SSID> >]' external/stlport/stlport/stl/_hashtable.h:330: instantiated from 'std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::hashtable(size_t, const _HF&, const _EqK&, const _All&) [with _Val = std::pair<SegmentSet* const, SSID>, _Key = SegmentSet*, _HF = SegmentSet::SSHash, _Traits = std::priv::_UnorderedMapTraitsT<std::pair<SegmentSet* const, SSID> >, _ExK = std::priv::_Select1st<std::pair<SegmentSet* const, SSID> >, _EqK = SegmentSet::SSEq, _All = std::allocator<std::pair<SegmentSet* const, SSID> >]' external/stlport/stlport/stl/_unordered_map.h:86: instantiated from 'std::tr1::unordered_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>::unordered_map(typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::size_type, const typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::hasher&, const typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::key_equal&, const typename std::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::priv::_UnorderedMapTraitsT<std::pair<const _Key, _Tp> >, std::priv::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::allocator_type&) [with _Key = SegmentSet*, _Tp = SSID, _HashFcn = SegmentSet::SSHash, _EqualKey = SegmentSet::SSEq, _Alloc = std::allocator<std::pair<SegmentSet* const, SSID> >]' external/valgrind/tsan/thread_sanitizer.cc:2404: instantiated from here external/stlport/stlport/stl/_algobase.c:454: warning: unused parameter '__comp2' `
0
11,734,767
07/31/2012 06:58:21
351,614
05/27/2010 05:42:00
1,386
106
imageresizer mangling images
We are using the image resizer from imageresizing.net and are seeing some weird behaviour. When we read an image in from a stream and then resize the image we can no longer access the properties of the original image. The following code will reproduce the issue. static void Main(string[] args) { using(var httpPostedFileBaseImage = new FileStream(@"C:\test.jpg",FileMode.Open, FileAccess.Read, FileShare.Read)) { using(var uploadedImage = Image.FromStream(httpPostedFileBaseImage)) { Console.WriteLine(uploadedImage.Width); var resizedImage = ImageBuilder.Current.Build(uploadedImage, new ResizeSettings("width=110;height=83")); Console.WriteLine(uploadedImage.Width); } } } Before the ImageBuilder line we are able to see the uploadedImage.Width fine but afterwards it throws an exception: System.ArgumentException was unhandled HResult=-2147024809 Message=Parameter is not valid. Source=System.Drawing StackTrace: at System.Drawing.Image.get_Width() at ConsoleApplication6.Program.Main(String[] args) in C:\Users\Daniel\Desktop\ConsoleApplication6\ConsoleApplication6\Program.cs:line 25 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: Is there something that we are doing wrong here or could this possibly be a bug in the image resizer? Note: the problem was originally from an asp.net mvc app that has images uploaded which is why the variable is called httpPostedFileBaseImage and we are using Image.FromStream instead of perhaps Image.FromFile The image is ![enter image description here][1] but it appears to happen on most images. [1]: http://i.stack.imgur.com/vxPHL.png
.net
image-processing
null
null
null
null
open
imageresizer mangling images === We are using the image resizer from imageresizing.net and are seeing some weird behaviour. When we read an image in from a stream and then resize the image we can no longer access the properties of the original image. The following code will reproduce the issue. static void Main(string[] args) { using(var httpPostedFileBaseImage = new FileStream(@"C:\test.jpg",FileMode.Open, FileAccess.Read, FileShare.Read)) { using(var uploadedImage = Image.FromStream(httpPostedFileBaseImage)) { Console.WriteLine(uploadedImage.Width); var resizedImage = ImageBuilder.Current.Build(uploadedImage, new ResizeSettings("width=110;height=83")); Console.WriteLine(uploadedImage.Width); } } } Before the ImageBuilder line we are able to see the uploadedImage.Width fine but afterwards it throws an exception: System.ArgumentException was unhandled HResult=-2147024809 Message=Parameter is not valid. Source=System.Drawing StackTrace: at System.Drawing.Image.get_Width() at ConsoleApplication6.Program.Main(String[] args) in C:\Users\Daniel\Desktop\ConsoleApplication6\ConsoleApplication6\Program.cs:line 25 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: Is there something that we are doing wrong here or could this possibly be a bug in the image resizer? Note: the problem was originally from an asp.net mvc app that has images uploaded which is why the variable is called httpPostedFileBaseImage and we are using Image.FromStream instead of perhaps Image.FromFile The image is ![enter image description here][1] but it appears to happen on most images. [1]: http://i.stack.imgur.com/vxPHL.png
0
11,734,828
07/31/2012 07:03:36
464,885
10/02/2010 23:15:31
451
32
MySQL PHP match words in query with database column
I have the following structure of a table [id - title - tag - ..] I want to achieve the following: If there is a record in table with title "I love my job and it is my hobby" If a query is submitted having two words from the sentence then this sentence should be selected. E.g. query "love hobby". It should give me the above title and not for example "I love my job". At least the sentence with more words matching the query keywords first then the less ones later. how can I do this search on the title column of my table? I apologize if explanation not clear...more than happy to help clarify. Thank you all
php
mysql
null
null
null
null
open
MySQL PHP match words in query with database column === I have the following structure of a table [id - title - tag - ..] I want to achieve the following: If there is a record in table with title "I love my job and it is my hobby" If a query is submitted having two words from the sentence then this sentence should be selected. E.g. query "love hobby". It should give me the above title and not for example "I love my job". At least the sentence with more words matching the query keywords first then the less ones later. how can I do this search on the title column of my table? I apologize if explanation not clear...more than happy to help clarify. Thank you all
0
11,734,833
07/31/2012 07:04:00
1,396,210
05/15/2012 12:54:28
1
0
Avoid last event while page refersh
I have some problem in refreshing the page. while i refresh the page Last events were reload and try to insert same data. How can i avoid this via C# code.. Thanks advance. Kindly give a clear solution about this.. Thanks and regards udhayakumar/
asp.net
null
null
null
null
null
open
Avoid last event while page refersh === I have some problem in refreshing the page. while i refresh the page Last events were reload and try to insert same data. How can i avoid this via C# code.. Thanks advance. Kindly give a clear solution about this.. Thanks and regards udhayakumar/
0
11,734,834
07/31/2012 07:04:02
1,477,675
06/24/2012 05:22:43
1
1
curl unescape output file name
if URL has %20 in file name, specify -O will keep it, while space is preferred. libcurl has curl_easy_unescape, but the curl binary in bash doesn't seem to have an easy way to unescape output file name. currently I extract file name from url, unescape it, then use -o. would like to know if an easier way exists.
bash
curl
escaping
null
null
null
open
curl unescape output file name === if URL has %20 in file name, specify -O will keep it, while space is preferred. libcurl has curl_easy_unescape, but the curl binary in bash doesn't seem to have an easy way to unescape output file name. currently I extract file name from url, unescape it, then use -o. would like to know if an easier way exists.
0
11,734,836
07/31/2012 07:04:14
1,084,732
12/07/2011 02:13:02
178
0
cocoa: confused by apple reference: cocoa view guide
The cocoa view guide describe how to create a custom view. but I'm confused whether the cocoa will call the initWithFrame: method of a view. ![enter image description here][1] How to create a custom view. ![how to create a custom view][2] [1]: http://i.stack.imgur.com/BbQSY.png [2]: http://i.stack.imgur.com/QobGc.png
cocoa
null
null
null
null
null
open
cocoa: confused by apple reference: cocoa view guide === The cocoa view guide describe how to create a custom view. but I'm confused whether the cocoa will call the initWithFrame: method of a view. ![enter image description here][1] How to create a custom view. ![how to create a custom view][2] [1]: http://i.stack.imgur.com/BbQSY.png [2]: http://i.stack.imgur.com/QobGc.png
0
11,734,831
07/31/2012 07:03:48
1,397,924
05/16/2012 07:16:06
23
0
oracle trigger query
I have a trigger which is sending data from a table to another table in another database. all s working fine. The prob is that there is a new concept of END DATE, in which, if END DATE is present for a person, the row should reach the other table on that particular date.. eg.: if someones end date is 31st august, it should go on that day only, but ofcourse, my trigger is firing on event change (when enddate is set to 31st august).. Could you please suggest me what I can do to SET the row to go on ENDDATE.?
oracle
triggers
plsql
jobs
procedure
null
open
oracle trigger query === I have a trigger which is sending data from a table to another table in another database. all s working fine. The prob is that there is a new concept of END DATE, in which, if END DATE is present for a person, the row should reach the other table on that particular date.. eg.: if someones end date is 31st august, it should go on that day only, but ofcourse, my trigger is firing on event change (when enddate is set to 31st august).. Could you please suggest me what I can do to SET the row to go on ENDDATE.?
0
11,725,029
07/30/2012 15:53:44
220,040
11/27/2009 13:35:42
316
36
jqgrid filter strange behaviour
Looking at [Oleg solution][1] for jqgrid filtering, I wrote a code to filter my jqgrid. It has the difference to have 3 differents fields of research but only one button to execute the global search. It works quite good but even if the first search is executed correctly, the second search is executed 2 timese, the third search 4 times, the fourth 8 times and so on, causing several issues if I make a lot of searches. Here's the code: var grid= $("#mygrid"); function executeSearchInSoftgrid() { $("#executeSearch").click(function() { f = {groupOp:"AND",rules:[]}; var searchFiler = $("#filterField1").val(), f; var searchFiler2 = $("#filterField2").val(), f; var searchFiler3 = $("#filterField3").val(), f; if (searchFiler.length === 0) { grid[0].p.search = false; $.extend(grid[0].p.postData,{filters:""}); } if (searchFiler2.length === 0) { grid[0].p.search = false; $.extend(grid[0].p.postData,{filters:""}); } if (searchFiler3.length === 0) { grid[0].p.search = false; $.extend(grid[0].p.postData,{filters:""}); } f.rules.push({field:"field1",op:"cn",data:searchFiler}); f.rules.push({field:"field2",op:"cn",data:searchFiler2}); f.rules.push({field:"field3",op:"cn",data:searchFiler3}); grid[0].p.search = true; $.extend(grid[0].p.postData,{filters:JSON.stringify(f)}); grid.trigger("reloadGrid",[{page:1,current:true}]); alert("searching"); }); } Wherever I call the function (loadcomplete, gridcomplete, readyfunction) the behaviour is the same. Any ideas??? Thanks [1]: http://stackoverflow.com/questions/5749723/jqgrid-filtering-records
jquery
jqgrid
filtering
null
null
null
open
jqgrid filter strange behaviour === Looking at [Oleg solution][1] for jqgrid filtering, I wrote a code to filter my jqgrid. It has the difference to have 3 differents fields of research but only one button to execute the global search. It works quite good but even if the first search is executed correctly, the second search is executed 2 timese, the third search 4 times, the fourth 8 times and so on, causing several issues if I make a lot of searches. Here's the code: var grid= $("#mygrid"); function executeSearchInSoftgrid() { $("#executeSearch").click(function() { f = {groupOp:"AND",rules:[]}; var searchFiler = $("#filterField1").val(), f; var searchFiler2 = $("#filterField2").val(), f; var searchFiler3 = $("#filterField3").val(), f; if (searchFiler.length === 0) { grid[0].p.search = false; $.extend(grid[0].p.postData,{filters:""}); } if (searchFiler2.length === 0) { grid[0].p.search = false; $.extend(grid[0].p.postData,{filters:""}); } if (searchFiler3.length === 0) { grid[0].p.search = false; $.extend(grid[0].p.postData,{filters:""}); } f.rules.push({field:"field1",op:"cn",data:searchFiler}); f.rules.push({field:"field2",op:"cn",data:searchFiler2}); f.rules.push({field:"field3",op:"cn",data:searchFiler3}); grid[0].p.search = true; $.extend(grid[0].p.postData,{filters:JSON.stringify(f)}); grid.trigger("reloadGrid",[{page:1,current:true}]); alert("searching"); }); } Wherever I call the function (loadcomplete, gridcomplete, readyfunction) the behaviour is the same. Any ideas??? Thanks [1]: http://stackoverflow.com/questions/5749723/jqgrid-filtering-records
0
11,351,301
07/05/2012 19:33:46
768,145
05/24/2011 16:44:56
27
3
Using Jquery and AJAX to pass parameters to VB.NET webmethod
I've been searching the internet for hours trying to pass parameters to my code behind using JQUERY $.ajax. I've tried a ton of different things, but nothing has worked. When I don't pass any parameters and set the vb.net function to not receive parameters the functions will get called. But once I try adding parameters, the function never gets called. Client Side: $("#<%=saveResource2.clientID %>").click(function() { var parDesc = $("#<%=ddlPDesc.clientID %> option:selected").text(); $("#<%=Button1.clientID %>").click(); $.ajax({ type: "POST", url: "Projects.aspx/btnSaveResource", data: JSON.stringify({Desc: parDesc}), contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { $("#<%=lblPerson.clientID %>").text(msg); // Do something interesting here. } }); }); Server Side: > <WebMethod()> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Public Shared Function btnSaveResource(ByVal parDesc As String) As String Dim d As String = parDesc Return d + "test" End Function
jquery
ajax
vb.net
webmethod
null
null
open
Using Jquery and AJAX to pass parameters to VB.NET webmethod === I've been searching the internet for hours trying to pass parameters to my code behind using JQUERY $.ajax. I've tried a ton of different things, but nothing has worked. When I don't pass any parameters and set the vb.net function to not receive parameters the functions will get called. But once I try adding parameters, the function never gets called. Client Side: $("#<%=saveResource2.clientID %>").click(function() { var parDesc = $("#<%=ddlPDesc.clientID %> option:selected").text(); $("#<%=Button1.clientID %>").click(); $.ajax({ type: "POST", url: "Projects.aspx/btnSaveResource", data: JSON.stringify({Desc: parDesc}), contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { $("#<%=lblPerson.clientID %>").text(msg); // Do something interesting here. } }); }); Server Side: > <WebMethod()> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Public Shared Function btnSaveResource(ByVal parDesc As String) As String Dim d As String = parDesc Return d + "test" End Function
0
11,351,302
07/05/2012 19:33:46
259,731
01/27/2010 02:23:52
126
24
Hide/show TRs from a table keeping zebra striping
I have a table which is zebra-striped: tr:nth-child(even) { background-color: red; } tr:nth-child(odd) { background-color: blue; } I want to show/hide its rows, keeping the table striped (recolored from a changed row to the last one). I see 2 ways to do this: 1. Create an invisible table and move `<TR>`s with jQuery `after()` to/from it. I've tested detaching and it works (the table is being recolored on detaching), but inserting the detached (to nowhere) rows doesn't, so moving to another table should help, I guess. 2. Call jQuery `toggle()` along with creating/removing invisible `<TR>` right after the one we are toggling. Which one is better? Maybe, there is even a better way? Regards,
html5
css3
zebra-striping
null
null
null
open
Hide/show TRs from a table keeping zebra striping === I have a table which is zebra-striped: tr:nth-child(even) { background-color: red; } tr:nth-child(odd) { background-color: blue; } I want to show/hide its rows, keeping the table striped (recolored from a changed row to the last one). I see 2 ways to do this: 1. Create an invisible table and move `<TR>`s with jQuery `after()` to/from it. I've tested detaching and it works (the table is being recolored on detaching), but inserting the detached (to nowhere) rows doesn't, so moving to another table should help, I guess. 2. Call jQuery `toggle()` along with creating/removing invisible `<TR>` right after the one we are toggling. Which one is better? Maybe, there is even a better way? Regards,
0
11,351,174
07/05/2012 19:25:11
832,306
07/06/2011 19:58:52
61
5
Outdated results from NHibernate queries, QueryCache can't be disabled (bug?)
When doing a criteria query with NHibernate, I want to get fresh results and not old ones from a cache. The process is basically: 1. Query persistent objects into NHibernate application. 2. Change database entries externally (another program, manual edit in SSMS / MSSQL etc.). 3. Query persistence objects (with same query code), previously loaded objects shall be refreshed from database. Here's the code (slightly changed object names): public IOrder GetOrderByOrderId(int orderId) { ... IList result; var query = session.CreateCriteria(typeof(Order)) .SetFetchMode("Products", FetchMode.Eager) .SetFetchMode("Customer", FetchMode.Eager) .SetFetchMode("OrderItems", FetchMode.Eager) .Add(Restrictions.Eq("OrderId", orderId)); query.SetCacheMode(CacheMode.Ignore); query.SetCacheable(false); result = query.List(); ... } The SetCacheMode and SetCacheable have been added by me to disable the cache. Also, the NHibernate factory is set up with config parameter UseQueryCache=false: Cfg.SetProperty(NHibernate.Cfg.Environment.UseQueryCache, "false"); No matter what I do, including Put/Refresh cache modes, for query or session: NHibernate keeps returning me outdated objects the second time the query is called, without the externally committed changes. Info btw.: the outdated value in this case is the value of a Version column (to test if a stale object state can be detected before saving). But I need fresh query results for multiple reasons! NHibernate even generates an SQL query, but it is never used for the values returned. Keeping the sessions open is neccessary to do dynamic updates on dirty columns only (also no stateless sessions for solution!); I don't want to add Clear(), Evict() or such everywhere in code, especially since the query is on a lower level and doesn't remember the objects previously loaded. Pessimistic locking would kill performance (multi-user environment!) Is there any way to force NHibernate, by configuration, to send queries directly to the DB and get fresh results, not using unwanted caching functions?
query
nhibernate
session
caching
null
null
open
Outdated results from NHibernate queries, QueryCache can't be disabled (bug?) === When doing a criteria query with NHibernate, I want to get fresh results and not old ones from a cache. The process is basically: 1. Query persistent objects into NHibernate application. 2. Change database entries externally (another program, manual edit in SSMS / MSSQL etc.). 3. Query persistence objects (with same query code), previously loaded objects shall be refreshed from database. Here's the code (slightly changed object names): public IOrder GetOrderByOrderId(int orderId) { ... IList result; var query = session.CreateCriteria(typeof(Order)) .SetFetchMode("Products", FetchMode.Eager) .SetFetchMode("Customer", FetchMode.Eager) .SetFetchMode("OrderItems", FetchMode.Eager) .Add(Restrictions.Eq("OrderId", orderId)); query.SetCacheMode(CacheMode.Ignore); query.SetCacheable(false); result = query.List(); ... } The SetCacheMode and SetCacheable have been added by me to disable the cache. Also, the NHibernate factory is set up with config parameter UseQueryCache=false: Cfg.SetProperty(NHibernate.Cfg.Environment.UseQueryCache, "false"); No matter what I do, including Put/Refresh cache modes, for query or session: NHibernate keeps returning me outdated objects the second time the query is called, without the externally committed changes. Info btw.: the outdated value in this case is the value of a Version column (to test if a stale object state can be detected before saving). But I need fresh query results for multiple reasons! NHibernate even generates an SQL query, but it is never used for the values returned. Keeping the sessions open is neccessary to do dynamic updates on dirty columns only (also no stateless sessions for solution!); I don't want to add Clear(), Evict() or such everywhere in code, especially since the query is on a lower level and doesn't remember the objects previously loaded. Pessimistic locking would kill performance (multi-user environment!) Is there any way to force NHibernate, by configuration, to send queries directly to the DB and get fresh results, not using unwanted caching functions?
0
11,351,290
07/05/2012 19:32:58
697,364
04/07/2011 18:20:08
337
10
nltk tokenization and contractions
I'm tokenizing text with nltk, just sentences fed to wordpunct_tokenizer. This splits contractions (e.g. 'don't', 'she's', etc.) but I want to keep them as one word. I'm refining my methods for a more measured and precise tokenization of text, so I need to delve deeper into the nltk tokenization module beyond simple tokenization. I'm guessing this is common and I'd like feedback from others who've maybe had to deal with the particular issue before.
python
nlp
nltk
null
null
null
open
nltk tokenization and contractions === I'm tokenizing text with nltk, just sentences fed to wordpunct_tokenizer. This splits contractions (e.g. 'don't', 'she's', etc.) but I want to keep them as one word. I'm refining my methods for a more measured and precise tokenization of text, so I need to delve deeper into the nltk tokenization module beyond simple tokenization. I'm guessing this is common and I'd like feedback from others who've maybe had to deal with the particular issue before.
0
11,351,324
07/05/2012 19:34:47
1,432,980
06/02/2012 23:11:08
16
0
get only symbols and companies' names from nasdaq
I can get information from nasdaq with this request http://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download and the result will have this columns `Symbol,Name,LastSale,MarketCap,ADR TSO,IPOyear,Sector,industry,Summary Quote` but in my database I've got table with columns - `Symbol`and `Name`. Is it possible to get only symbols and names from request(because then I can easy read all data from .csv result to database)?
finance
null
null
null
null
null
open
get only symbols and companies' names from nasdaq === I can get information from nasdaq with this request http://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download and the result will have this columns `Symbol,Name,LastSale,MarketCap,ADR TSO,IPOyear,Sector,industry,Summary Quote` but in my database I've got table with columns - `Symbol`and `Name`. Is it possible to get only symbols and names from request(because then I can easy read all data from .csv result to database)?
0
11,568,080
07/19/2012 19:39:15
1,165,832
01/23/2012 21:36:14
176
9
Giving an option tag the "selected" attribute with jQuery
According to [w3schools](http://www.w3schools.com/html5/att_option_selected.asp) HTML5 syntax allows you to write the selected attribute like so: - `<option selected>` - `<option selected="selected">` - `<option selected="">` I prefer the first. Is there a way to apply that syntax with `attr()` in jQuery? - `<option selected>` ? - `<option selected="selected">` would be `attr('selected', true)` or `('selected', 'selected')` - `<option selected="">` ? Obviously it doesn't really matter, but I'm curious! Thanks!
jquery
html5
null
null
null
null
open
Giving an option tag the "selected" attribute with jQuery === According to [w3schools](http://www.w3schools.com/html5/att_option_selected.asp) HTML5 syntax allows you to write the selected attribute like so: - `<option selected>` - `<option selected="selected">` - `<option selected="">` I prefer the first. Is there a way to apply that syntax with `attr()` in jQuery? - `<option selected>` ? - `<option selected="selected">` would be `attr('selected', true)` or `('selected', 'selected')` - `<option selected="">` ? Obviously it doesn't really matter, but I'm curious! Thanks!
0
11,568,084
07/19/2012 19:39:25
1,535,963
07/18/2012 19:51:34
5
0
Are struct in c++ similar to enum or classes?
Wonder if struct has like the same idea of enum in c++ if someone can explain will be grateful im trying to lear
c++
null
null
null
null
null
open
Are struct in c++ similar to enum or classes? === Wonder if struct has like the same idea of enum in c++ if someone can explain will be grateful im trying to lear
0
11,568,091
07/19/2012 19:40:00
1,459,606
06/15/2012 19:17:45
19
4
copying rows from one worksheet to another in excel using macro
I have an excel worksheet with whole bunch of rows and several columns in it. The 1st column contains the manufacturer's name, the 2nd column contains the product codes for all the products, the 3rd column contains the description and etc. What I want to do is to copy the rows that corresponds to certain product codes. For example: **Manufacturer Product code Description** abc B010 blah blah dgh A012 hgy X010 eut B013 uru B014 eut B015 asd G012 sof B016 uet B016 etc Is there a way to copy the rows that has the product codes in between B010 - B016? There might be double/matching product codes too, and it is totally fine to copy them too. Makes sense? Sorry, i have no vba code to put in here yet. Thanks in advance.
excel
vba
macros
null
null
null
open
copying rows from one worksheet to another in excel using macro === I have an excel worksheet with whole bunch of rows and several columns in it. The 1st column contains the manufacturer's name, the 2nd column contains the product codes for all the products, the 3rd column contains the description and etc. What I want to do is to copy the rows that corresponds to certain product codes. For example: **Manufacturer Product code Description** abc B010 blah blah dgh A012 hgy X010 eut B013 uru B014 eut B015 asd G012 sof B016 uet B016 etc Is there a way to copy the rows that has the product codes in between B010 - B016? There might be double/matching product codes too, and it is totally fine to copy them too. Makes sense? Sorry, i have no vba code to put in here yet. Thanks in advance.
0
11,568,093
07/19/2012 19:40:18
283,296
02/28/2010 23:05:44
2,060
7
Syntax highlighting on GitHub's Wiki: Specifying the programming language
GitHub uses something known as the "GitHub Flavored Markdown" for messages, issues and comments. My questions are: * Does GitHub also use this syntax for their Wiki? * From what I understand one can specify the programming language for syntax highlighting using the following syntax: ``````ruby require 'redcarpet' markdown = Redcarpet.new("Hello World!") puts markdown.to_html ``` Where one can specify the programming language after the ``````` ```` string (e.g. ````ruby`) My question is: What is the list of programming language identifyiers supported by this syntax? How do I look up the specifier for a programming language? (e.g. `C` does not seem to work for the C programming language)
github
null
null
null
null
null
open
Syntax highlighting on GitHub's Wiki: Specifying the programming language === GitHub uses something known as the "GitHub Flavored Markdown" for messages, issues and comments. My questions are: * Does GitHub also use this syntax for their Wiki? * From what I understand one can specify the programming language for syntax highlighting using the following syntax: ``````ruby require 'redcarpet' markdown = Redcarpet.new("Hello World!") puts markdown.to_html ``` Where one can specify the programming language after the ``````` ```` string (e.g. ````ruby`) My question is: What is the list of programming language identifyiers supported by this syntax? How do I look up the specifier for a programming language? (e.g. `C` does not seem to work for the C programming language)
0
11,568,094
07/19/2012 19:40:22
1,470,260
06/20/2012 19:21:12
1
0
Plotting uneven row sizes in R
I have data in tab delimited rows of uneven length and I want to make a histogram for each row: 1    23    352    4    12    94    0    2 434    13    29 5    93    93    34 (...more rows) This is what I currently have (no fanciness included): data = read.delim(file.txt,header = F, sep="\t") for (j in 1:nrow(data)) { #loop over each row hist(data[j,]) But when I try to make the histogram, I think it tries to include the NA's in the row of the data frame, since R gives me the error message: "Error in hist.default(data[2, ]) : 'x' must be numeric". When I try to use: read.scan("file.txt, sep="\t") I'm left with something I don't know how to separate by rows. Do I have a better option than splitting the file into one row per file and then reading in each row separately? (I am running into the same problem with uneven column size...)
r
data
columns
plot
row
null
open
Plotting uneven row sizes in R === I have data in tab delimited rows of uneven length and I want to make a histogram for each row: 1    23    352    4    12    94    0    2 434    13    29 5    93    93    34 (...more rows) This is what I currently have (no fanciness included): data = read.delim(file.txt,header = F, sep="\t") for (j in 1:nrow(data)) { #loop over each row hist(data[j,]) But when I try to make the histogram, I think it tries to include the NA's in the row of the data frame, since R gives me the error message: "Error in hist.default(data[2, ]) : 'x' must be numeric". When I try to use: read.scan("file.txt, sep="\t") I'm left with something I don't know how to separate by rows. Do I have a better option than splitting the file into one row per file and then reading in each row separately? (I am running into the same problem with uneven column size...)
0
11,568,095
07/19/2012 19:40:24
675,383
03/24/2011 17:29:12
3,135
141
Nested weights in appwidget layout
I've got the following layout file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <View android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/red" /> <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/yellow" /> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> </LinearLayout> It uses nested weights, and I'm aware of the performance issues. I want to show this layout in an appwidget, but when I load the appwidget, the message "could not load the widget" appears. I think that's because of the nested weights (not sure). When I use a `RelativeLayout` for the base layout, I have the following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <View android:id="@+id/top" android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> <View android:id="@+id/bottom" android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@id/bottom" android:layout_below="@id/top" > <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/red" /> <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/yellow" /> </LinearLayout> </RelativeLayout> When I use this layout, the red and yellow views don't show, I guess the height stays at `0dp`. How can I achieve my goal? To be clear: I want to have a view at the top and the bottom, fixed height. Between them I want to have a couple of views of the same height, filling the gap.
android
android-layout
null
null
null
null
open
Nested weights in appwidget layout === I've got the following layout file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <View android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/red" /> <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/yellow" /> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> </LinearLayout> It uses nested weights, and I'm aware of the performance issues. I want to show this layout in an appwidget, but when I load the appwidget, the message "could not load the widget" appears. I think that's because of the nested weights (not sure). When I use a `RelativeLayout` for the base layout, I have the following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <View android:id="@+id/top" android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> <View android:id="@+id/bottom" android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/blue" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@id/bottom" android:layout_below="@id/top" > <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/red" /> <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@color/yellow" /> </LinearLayout> </RelativeLayout> When I use this layout, the red and yellow views don't show, I guess the height stays at `0dp`. How can I achieve my goal? To be clear: I want to have a view at the top and the bottom, fixed height. Between them I want to have a couple of views of the same height, filling the gap.
0
11,568,098
07/19/2012 19:40:43
1,480,797
06/25/2012 18:32:55
42
0
API to obtain open and click rates of recipient lists in Sendgrid
In Sendgrid, when viewing the recipient lists, it shows the open and click rates of each of the individual lists. Is there an API I can use to get those values? I tried using the Stats API but it shows per day, not per list. So is there an API to show the rates of each list?
api
smtp
statistics
sendgrid
null
null
open
API to obtain open and click rates of recipient lists in Sendgrid === In Sendgrid, when viewing the recipient lists, it shows the open and click rates of each of the individual lists. Is there an API I can use to get those values? I tried using the Stats API but it shows per day, not per list. So is there an API to show the rates of each list?
0
11,472,864
07/13/2012 14:48:45
185,840
10/07/2009 18:22:05
2,663
111
Avoid caching failed operations
Caching is good, but caching failed operations is bad Cache.orElse("directory.active") { Ok( dao.findAll(active = true) as json ) } The DAO database lookup could fail (in this case an empty List is returned on database/query failure) which would result in caching bad data. How to workaround this? We only want to run the query once and then cache for further requests. In Scala you can do lazy initiliazation, but that would make a permanent cache which is also not desirable (need to clear the cache on member directory addition/edit). Assume this applies to any platform: basically need to perform an operation once and cache it *on successful outcome*.
java
ruby-on-rails
scala
caching
playframework-2.0
null
open
Avoid caching failed operations === Caching is good, but caching failed operations is bad Cache.orElse("directory.active") { Ok( dao.findAll(active = true) as json ) } The DAO database lookup could fail (in this case an empty List is returned on database/query failure) which would result in caching bad data. How to workaround this? We only want to run the query once and then cache for further requests. In Scala you can do lazy initiliazation, but that would make a permanent cache which is also not desirable (need to clear the cache on member directory addition/edit). Assume this applies to any platform: basically need to perform an operation once and cache it *on successful outcome*.
0
11,472,865
07/13/2012 14:48:46
699,915
04/09/2011 12:00:53
6
2
RestKit Mapping objects within a default relationship using a specified primary key reference
I am currently developing an iOS Messenger application and I would like to talk about these two classes relationship: `MessengerConversation` and `MessengerMessage`. Supposing that I already have a local MessengerConversation instance which can have many MessengerMessage instances related into its `messages` relationship property, I would like to request and mapping the following JSON payload: Request: GET /conversations/:conversationID/msgs <br> Response: { "messages": [ { ... "messageid": n, "content": "..." ... }, ... ] } As the response JSON payload didn't indicate which conversation the delivered messages are from. I used the following approach to fix this issue into my `MessengerManager` class (Responsible for interacting with the shared RKObjectManager instance): - (void)objectLoader:(RKObjectLoader *)objectLoader willMapData:(inout id *)mappableData { // // GETs Resource Paths. if ([objectLoader method] == RKRequestMethodGET) { if ([pathMatcherConversationsMessagesGET matchesPath:objectLoader.resourcePath tokenizeQueryStrings:NO parsedArguments:Nil]) { // // Get requested conversationID from the following resource path Pattern: // kMessengerManagerResourcePathMessages: /conversations/:conversationID/msgs NSNumber *currentConversationID = Nil; NSDictionary *arguments = Nil; BOOL isMatchingPattern = [pathMatcherConversationsMessagesGET matchesPattern:kMessengerManagerResourcePathConversationsMessagesGET tokenizeQueryStrings:YES parsedArguments:&arguments]; if (isMatchingPattern) { currentConversationID = [arguments objectForKey:@"conversationID"]; // // Get the original returned array of messages: NSArray *origMessagesArray = [*mappableData valueForKeyPath:@"messages"]; NSMutableArray *reformattedData = [NSMutableArray arrayWithCapacity:[origMessagesArray count]]; // // Create copies of objects adding the already knew reference. for (NSDictionary *origMessagesArrayObject in origMessagesArray) { NSMutableDictionary *newMessagesArrayObject = [origMessagesArrayObject mutableCopy]; [newMessagesArrayObject setObject:currentConversationID forKey:@"conversationid"]; [reformattedData addObject:newMessagesArrayObject]; } // // Replace the new objects instead of the response objects [*mappableData setObject:reformattedData forKey:@"messages"]; } } } } And so everything worked properly. That is, all loaded MessengerMessages from the specified MessengerConversation (into the RKObjectLoader resource path) are being inserted into the wanted relationship. Now comes the real problem, as I am working with my MessengerManager class which adopts the RKObjectLoaderProtocol, I could implement the `objectLoader:willMapData:` method. But as my View classes are using the `RKFetchedResultsTableController` and every table controller instance is also its RKObjectLoader delegate, I don't know which would be the best practice to enable a RKFetchedResultsTableController instance to update a received JSON payload before the mapping operation. Shall I subclass it? And are there better ways to map received objects into a pre-defined object specified by a RKObjectLoader resource path (e.g: GET /conversations/2/msg where all resulted messages should be mapped inside the defined MessengerConversation object with its primary key value equal to 2)? Best regards,<br> Piva
mapping
restkit
null
null
null
null
open
RestKit Mapping objects within a default relationship using a specified primary key reference === I am currently developing an iOS Messenger application and I would like to talk about these two classes relationship: `MessengerConversation` and `MessengerMessage`. Supposing that I already have a local MessengerConversation instance which can have many MessengerMessage instances related into its `messages` relationship property, I would like to request and mapping the following JSON payload: Request: GET /conversations/:conversationID/msgs <br> Response: { "messages": [ { ... "messageid": n, "content": "..." ... }, ... ] } As the response JSON payload didn't indicate which conversation the delivered messages are from. I used the following approach to fix this issue into my `MessengerManager` class (Responsible for interacting with the shared RKObjectManager instance): - (void)objectLoader:(RKObjectLoader *)objectLoader willMapData:(inout id *)mappableData { // // GETs Resource Paths. if ([objectLoader method] == RKRequestMethodGET) { if ([pathMatcherConversationsMessagesGET matchesPath:objectLoader.resourcePath tokenizeQueryStrings:NO parsedArguments:Nil]) { // // Get requested conversationID from the following resource path Pattern: // kMessengerManagerResourcePathMessages: /conversations/:conversationID/msgs NSNumber *currentConversationID = Nil; NSDictionary *arguments = Nil; BOOL isMatchingPattern = [pathMatcherConversationsMessagesGET matchesPattern:kMessengerManagerResourcePathConversationsMessagesGET tokenizeQueryStrings:YES parsedArguments:&arguments]; if (isMatchingPattern) { currentConversationID = [arguments objectForKey:@"conversationID"]; // // Get the original returned array of messages: NSArray *origMessagesArray = [*mappableData valueForKeyPath:@"messages"]; NSMutableArray *reformattedData = [NSMutableArray arrayWithCapacity:[origMessagesArray count]]; // // Create copies of objects adding the already knew reference. for (NSDictionary *origMessagesArrayObject in origMessagesArray) { NSMutableDictionary *newMessagesArrayObject = [origMessagesArrayObject mutableCopy]; [newMessagesArrayObject setObject:currentConversationID forKey:@"conversationid"]; [reformattedData addObject:newMessagesArrayObject]; } // // Replace the new objects instead of the response objects [*mappableData setObject:reformattedData forKey:@"messages"]; } } } } And so everything worked properly. That is, all loaded MessengerMessages from the specified MessengerConversation (into the RKObjectLoader resource path) are being inserted into the wanted relationship. Now comes the real problem, as I am working with my MessengerManager class which adopts the RKObjectLoaderProtocol, I could implement the `objectLoader:willMapData:` method. But as my View classes are using the `RKFetchedResultsTableController` and every table controller instance is also its RKObjectLoader delegate, I don't know which would be the best practice to enable a RKFetchedResultsTableController instance to update a received JSON payload before the mapping operation. Shall I subclass it? And are there better ways to map received objects into a pre-defined object specified by a RKObjectLoader resource path (e.g: GET /conversations/2/msg where all resulted messages should be mapped inside the defined MessengerConversation object with its primary key value equal to 2)? Best regards,<br> Piva
0
11,472,866
07/13/2012 14:48:50
265,261
02/03/2010 12:50:17
1,130
28
Twitter Bootstrap changes rendering of fieldset legend, why?
In this ASP.NET MVC 3 project, I've just started experimenting with Twitter Bootstrap, but I notice it messes with the rendering of `<fieldset>` legends. What is happening to the legend rendering here, and how do I get it back to normal? That is, I want the right line to be vertically aligned with the left line again. The standard legend rendering, pre-Bootstrap, to the left, Bootstrap-affected rendering to the right: ![Normal legend](http://i.imgur.com/pNvft.png) ![Twitter Bootstrap legend](http://i.imgur.com/A0OTC.png)
css
asp.net-mvc
asp.net-mvc-3
twitter-bootstrap
null
null
open
Twitter Bootstrap changes rendering of fieldset legend, why? === In this ASP.NET MVC 3 project, I've just started experimenting with Twitter Bootstrap, but I notice it messes with the rendering of `<fieldset>` legends. What is happening to the legend rendering here, and how do I get it back to normal? That is, I want the right line to be vertically aligned with the left line again. The standard legend rendering, pre-Bootstrap, to the left, Bootstrap-affected rendering to the right: ![Normal legend](http://i.imgur.com/pNvft.png) ![Twitter Bootstrap legend](http://i.imgur.com/A0OTC.png)
0
11,472,867
07/13/2012 14:48:52
1,495,863
07/02/2012 11:02:29
44
0
C++ Winsock Server with Multiple Clients?
I have written a program that talks to a Bittorrent tracker via a TCP connection. I want to expand it's functionality to talk to multiple trackers at the same time via winsock in C++. Do I need to have multiple sockets? If so, do I need to initialize a WSADATA structure for each socket?
c++
sockets
tcp
winsock
bittorrent
null
open
C++ Winsock Server with Multiple Clients? === I have written a program that talks to a Bittorrent tracker via a TCP connection. I want to expand it's functionality to talk to multiple trackers at the same time via winsock in C++. Do I need to have multiple sockets? If so, do I need to initialize a WSADATA structure for each socket?
0
11,472,874
07/13/2012 14:49:08
1,114,555
12/24/2011 12:27:47
52
3
Setting size of hint window (THintWindow) in Delphi/Lazarus
I am trying to make a custom hint in Lazarus. So far I have dynamically loaded the text in the hint, and customized the font face, font size, and font color. I would like to limit the width of the hint window. Any ideas? Here is my code. type TExHint = class(THintWindow) constructor Create(AOwner: TComponent); override; ... constructor TExHint.Create(AOwner: TComponent); begin inherited Create(AOwner); with Canvas.Font do begin Name := 'Hanuman'; Size := Size + 3; end; //Canvas.Width := ; end; Thanks for any help.
delphi
freepascal
lazarus
hint
null
null
open
Setting size of hint window (THintWindow) in Delphi/Lazarus === I am trying to make a custom hint in Lazarus. So far I have dynamically loaded the text in the hint, and customized the font face, font size, and font color. I would like to limit the width of the hint window. Any ideas? Here is my code. type TExHint = class(THintWindow) constructor Create(AOwner: TComponent); override; ... constructor TExHint.Create(AOwner: TComponent); begin inherited Create(AOwner); with Canvas.Font do begin Name := 'Hanuman'; Size := Size + 3; end; //Canvas.Width := ; end; Thanks for any help.
0
11,472,233
07/13/2012 14:13:43
1,112,613
12/22/2011 23:00:48
20
0
php IPC script simply quits
I needed a simple php IRC bot that takes messages through POST requests and sends that message to an irc channel. For this purpose I adapted the bot from http://stackoverflow.com/questions/4227518/php-irc-bot-not-sending-message-help. Then I used message queues to send the POST message to the bot from http://stackoverflow.com/questions/4220905/irc-related-help. However when I run the php script through start.html, the bot doesn't even join the channel. irc.php -> <?php $ircServer = "irc.freenode.net"; $ircPort = "6667"; $ircChannel = "##my-channel"; set_time_limit(0); $ircSocket = fsockopen($ircServer, $ircPort, $eN, $eS); $msg = $_POST['msg']; if ($ircSocket) { fwrite($ircSocket, "USER EDI Normandy-SR2 Alliance Dr-Eva\n"); fwrite($ircSocket, "NICK Hit-Hi-Fit-Hai\n"); fwrite($ircSocket, "JOIN " . $ircChannel . "\n"); fwrite($ircSocket, "PRIVMSG $ircChannel :$msg\n"); $queueKey = 123321; $queue = false; // Join the IPC queue $queue = msg_get_queue($queueKey); if(!$queue) echo "ERROR: Could not join IPC queue. Form data will not be received"; while(1) { while($data = fgets($ircSocket, 128)) { echo nl2br($data); flush(); $ex = explode(' ', $data); if($ex[0] == "PING") fputs($socket, "PONG ".$ex[1]."\n"); if (msg_receive($queue, 0, $msgType, 1024, $msgData, true, MSG_IPC_NOWAIT)) { //fwrite($ircSocket, "PRIVMSG $ircChannel :$msgData\n"); echo "callback working"; } } } } ?> Hers's how I am calling this script. start.html -> <html><body> <h4>Start Bot</h4> <form action="irc.php" method="post"> Command: <input type="text" name="msg" /> <input type="submit" /> </form> </body></html> If I remove the code for message queues, the bot does join the channel.
php
message-queue
irc
null
null
null
open
php IPC script simply quits === I needed a simple php IRC bot that takes messages through POST requests and sends that message to an irc channel. For this purpose I adapted the bot from http://stackoverflow.com/questions/4227518/php-irc-bot-not-sending-message-help. Then I used message queues to send the POST message to the bot from http://stackoverflow.com/questions/4220905/irc-related-help. However when I run the php script through start.html, the bot doesn't even join the channel. irc.php -> <?php $ircServer = "irc.freenode.net"; $ircPort = "6667"; $ircChannel = "##my-channel"; set_time_limit(0); $ircSocket = fsockopen($ircServer, $ircPort, $eN, $eS); $msg = $_POST['msg']; if ($ircSocket) { fwrite($ircSocket, "USER EDI Normandy-SR2 Alliance Dr-Eva\n"); fwrite($ircSocket, "NICK Hit-Hi-Fit-Hai\n"); fwrite($ircSocket, "JOIN " . $ircChannel . "\n"); fwrite($ircSocket, "PRIVMSG $ircChannel :$msg\n"); $queueKey = 123321; $queue = false; // Join the IPC queue $queue = msg_get_queue($queueKey); if(!$queue) echo "ERROR: Could not join IPC queue. Form data will not be received"; while(1) { while($data = fgets($ircSocket, 128)) { echo nl2br($data); flush(); $ex = explode(' ', $data); if($ex[0] == "PING") fputs($socket, "PONG ".$ex[1]."\n"); if (msg_receive($queue, 0, $msgType, 1024, $msgData, true, MSG_IPC_NOWAIT)) { //fwrite($ircSocket, "PRIVMSG $ircChannel :$msgData\n"); echo "callback working"; } } } } ?> Hers's how I am calling this script. start.html -> <html><body> <h4>Start Bot</h4> <form action="irc.php" method="post"> Command: <input type="text" name="msg" /> <input type="submit" /> </form> </body></html> If I remove the code for message queues, the bot does join the channel.
0
11,472,234
07/13/2012 14:13:48
1,504,940
07/05/2012 18:54:29
3
0
How to run a program automatically when just glassfish server is started?
I want my java web application run a program automatically when i start or deploy the program in glassfish server. My web application need to run a mail program inside glassfish when just deployed.
java
glassfish-3
null
null
null
null
open
How to run a program automatically when just glassfish server is started? === I want my java web application run a program automatically when i start or deploy the program in glassfish server. My web application need to run a mail program inside glassfish when just deployed.
0
11,451,972
07/12/2012 12:34:13
1,322,011
04/09/2012 14:05:37
1
1
open single activity from appwidgetprovider without using singleinstance or singletask
I'm writing an app in which I have different activities. In addition to that we can launch activities from app-widget. <p>Ex : Activities A->B->C->D. <p><b>Requirements : </b> <p>Can launch Activity C from appwidget provider and should show home screen when pressed back or home. <p>Should start from "activity A" when launched application( When user is activity "D" and pressed home button, relaunching app should start from "Activity A"). <p><b>Followed approach:</b> <p>I used singleInstance/singletask for the same so that as to clear activity stack to satisfy requirement. <p> But onActivityResult(), "android:activityOpenEnterAnimation", "android:activityOpenExitAnimation", "android:activityCloseEnterAnimation", "android:activityCloseExitAnimation" etc... are not working when used singleTask/singleInstance mode. Is there any alternative to requirements. Please suggest. Many many thanks in advance
android
android-layout
android-widget
null
null
null
open
open single activity from appwidgetprovider without using singleinstance or singletask === I'm writing an app in which I have different activities. In addition to that we can launch activities from app-widget. <p>Ex : Activities A->B->C->D. <p><b>Requirements : </b> <p>Can launch Activity C from appwidget provider and should show home screen when pressed back or home. <p>Should start from "activity A" when launched application( When user is activity "D" and pressed home button, relaunching app should start from "Activity A"). <p><b>Followed approach:</b> <p>I used singleInstance/singletask for the same so that as to clear activity stack to satisfy requirement. <p> But onActivityResult(), "android:activityOpenEnterAnimation", "android:activityOpenExitAnimation", "android:activityCloseEnterAnimation", "android:activityCloseExitAnimation" etc... are not working when used singleTask/singleInstance mode. Is there any alternative to requirements. Please suggest. Many many thanks in advance
0
11,472,548
07/13/2012 14:29:59
656,912
03/12/2011 19:54:30
335
4
How to I provide securely request a required password from an AppleScript?
I have a simple AppleScript (application) that runs a shell script: do shell script "sudo killall -TERM java" which fails with "*sudo no tty present and no askpass program specified*". The desired behavior here is to have the OS X [password dialog open][1] (hopefully with an offer to save in the Keychain for future use), but (I'm guessing) I'm missing a step that tells the script to launch the necessary "asker" (which surprisingly, doesn't happen by default). I've [tried][2] do shell script "ssh-askpass Sudo Password | sudo killall -TERM java" but get an error with that too. What is the correct way to invoke the OS X password dialing from AppleScript? [1]: http://stackoverflow.com/q/7059655/656912 [2]: http://stackoverflow.com/a/10668693/656912
applescript
sudo
null
null
null
null
open
How to I provide securely request a required password from an AppleScript? === I have a simple AppleScript (application) that runs a shell script: do shell script "sudo killall -TERM java" which fails with "*sudo no tty present and no askpass program specified*". The desired behavior here is to have the OS X [password dialog open][1] (hopefully with an offer to save in the Keychain for future use), but (I'm guessing) I'm missing a step that tells the script to launch the necessary "asker" (which surprisingly, doesn't happen by default). I've [tried][2] do shell script "ssh-askpass Sudo Password | sudo killall -TERM java" but get an error with that too. What is the correct way to invoke the OS X password dialing from AppleScript? [1]: http://stackoverflow.com/q/7059655/656912 [2]: http://stackoverflow.com/a/10668693/656912
0
11,472,549
07/13/2012 14:30:01
1,523,818
07/13/2012 14:21:45
1
0
use spreadsheet input to run a query and return the URL of the first result in google
I am looking for an automated solution that will use the content of a spreadsheet cell, will run a query (via google) and will return the url of the website of the first result (of the google search). More specifically: in a cell in spreadsheet, I have the word "Google". Expected scenario: I run the tool and in the neighboring cell, the tool returns "www.google.com" and so on for a few thousands of cells, always the most likely website (= the first website in Google search). Thanks for ideas. Bob
query
search
google-spreadsheet
null
null
null
open
use spreadsheet input to run a query and return the URL of the first result in google === I am looking for an automated solution that will use the content of a spreadsheet cell, will run a query (via google) and will return the url of the website of the first result (of the google search). More specifically: in a cell in spreadsheet, I have the word "Google". Expected scenario: I run the tool and in the neighboring cell, the tool returns "www.google.com" and so on for a few thousands of cells, always the most likely website (= the first website in Google search). Thanks for ideas. Bob
0
11,594,645
07/21/2012 18:04:41
1,541,239
07/20/2012 15:45:26
6
0
android app crashes when moving objects in main.xml
I have a simple application containing a single activity and a single layout. Whenever i'm trying to move an object in the layout to another place either through the graphical editor or through code, the application crashes when compiled and ran. The layout contains 2 labels, a button and a text box, nothing special, I can't understand what is the cause of this.
xml
android-layout
null
null
null
null
open
android app crashes when moving objects in main.xml === I have a simple application containing a single activity and a single layout. Whenever i'm trying to move an object in the layout to another place either through the graphical editor or through code, the application crashes when compiled and ran. The layout contains 2 labels, a button and a text box, nothing special, I can't understand what is the cause of this.
0
11,594,650
07/21/2012 18:05:10
1,356,735
04/25/2012 16:18:55
191
17
TSQL query optimization on denormalization
I have two tables: `boughtItems(buyerId,ItemId)` and `denormalized(buyerId,item1,item2,item3,item4,item5)` Let's assume that in `boughtItems` table each buyer has no more than five items. So I am trying to insert data from first table into second. I am doing like this, selecting all rows from first table for each buyer as SELECT itemId FROM boughtItems where buyerId=1 and then when all rows are read, I executing corresponding insert command for second table. Is there any way to speed up this process? If needed, I can post my program code as well.
c#
database
null
null
null
null
open
TSQL query optimization on denormalization === I have two tables: `boughtItems(buyerId,ItemId)` and `denormalized(buyerId,item1,item2,item3,item4,item5)` Let's assume that in `boughtItems` table each buyer has no more than five items. So I am trying to insert data from first table into second. I am doing like this, selecting all rows from first table for each buyer as SELECT itemId FROM boughtItems where buyerId=1 and then when all rows are read, I executing corresponding insert command for second table. Is there any way to speed up this process? If needed, I can post my program code as well.
0
11,594,651
07/21/2012 18:05:12
1,035,817
11/08/2011 14:46:46
144
0
Gcc error while compiling option -fPIC
I'm reading a book but I get one error while compiling with this code. $ rm -f injection.dylib $ export PLATFORM=/Developer/Platforms/iPhoneOS.platform $ $PLATFORM/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 \ -c -o injection.o injection.c \ -isysroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk \ -fPIC $ $PLATFORM/Developer/usr/bin/ld \ -dylib -lsystem -lobjc \ -o injection.dylib injection.o \ -syslibroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk/ I've some trouble especially in this line: $PLATFORM/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 \ -c -o injection.o injection.c \ -isysroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk \ -fPIC This is the error arm-apple-darwin10-llvm-gcc-4.2: -fPIC: No such file or directory how can I solve... what does it means?
objective-c
ios
gcc
null
null
null
open
Gcc error while compiling option -fPIC === I'm reading a book but I get one error while compiling with this code. $ rm -f injection.dylib $ export PLATFORM=/Developer/Platforms/iPhoneOS.platform $ $PLATFORM/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 \ -c -o injection.o injection.c \ -isysroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk \ -fPIC $ $PLATFORM/Developer/usr/bin/ld \ -dylib -lsystem -lobjc \ -o injection.dylib injection.o \ -syslibroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk/ I've some trouble especially in this line: $PLATFORM/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 \ -c -o injection.o injection.c \ -isysroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk \ -fPIC This is the error arm-apple-darwin10-llvm-gcc-4.2: -fPIC: No such file or directory how can I solve... what does it means?
0
11,594,652
07/21/2012 18:05:13
1,208,289
02/14/2012 04:13:42
678
31
Put a tabbar across the top in a metro app?
I want to make a WinRT Metro app that has similar functionality to this: http://learn.knockoutjs.com/WebmailExampleStandalone.html#Inbox How does a tab bar with links to each of the various pages of the application fit into a Metro-styled app? Would you use the AppBar? On the top or the left? Would you use a radio button for each page? Would you use a FlipView to change pages? What examples exist for this type of metro app?
c#
microsoft-metro
winrt
tabcontrol
winrt-xaml
null
open
Put a tabbar across the top in a metro app? === I want to make a WinRT Metro app that has similar functionality to this: http://learn.knockoutjs.com/WebmailExampleStandalone.html#Inbox How does a tab bar with links to each of the various pages of the application fit into a Metro-styled app? Would you use the AppBar? On the top or the left? Would you use a radio button for each page? Would you use a FlipView to change pages? What examples exist for this type of metro app?
0