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,541,715
07/18/2012 12:45:17
1,479,422
06/25/2012 08:41:46
3
0
Get data from input stream to nsstring objective-c
I have some problem with getting data from input stream in TCP/IP client in iPhone app. When I connect to the system it shows me info from input stream in output Xcode. I want to have this information shown in textfield.text as NSString is it possible. My tcp connection looks like that: - (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { NSLog(@"stream event %i", streamEvent); switch (streamEvent) { case NSStreamEventOpenCompleted: NSLog(@"Stream opened"); break; case NSStreamEventHasBytesAvailable: if (theStream == inputStream) { uint8_t buffer[1024]; int len; while ([inputStream hasBytesAvailable]) { len = [inputStream read:buffer maxLength:sizeof(buffer)]; if (len > 0) { NSString *output = [[NSString alloc] initWithBytes:buffer length:len encoding:NSASCIIStringEncoding]; if (nil != output) { NSLog(@"server said: %@", output); } } } } break;
objective-c
cocos2d-iphone
tcpclient
null
null
null
open
Get data from input stream to nsstring objective-c === I have some problem with getting data from input stream in TCP/IP client in iPhone app. When I connect to the system it shows me info from input stream in output Xcode. I want to have this information shown in textfield.text as NSString is it possible. My tcp connection looks like that: - (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { NSLog(@"stream event %i", streamEvent); switch (streamEvent) { case NSStreamEventOpenCompleted: NSLog(@"Stream opened"); break; case NSStreamEventHasBytesAvailable: if (theStream == inputStream) { uint8_t buffer[1024]; int len; while ([inputStream hasBytesAvailable]) { len = [inputStream read:buffer maxLength:sizeof(buffer)]; if (len > 0) { NSString *output = [[NSString alloc] initWithBytes:buffer length:len encoding:NSASCIIStringEncoding]; if (nil != output) { NSLog(@"server said: %@", output); } } } } break;
0
11,541,638
07/18/2012 12:41:11
1,103,874
12/17/2011 20:20:55
26
2
UI gets stuck even if I use GCD
When I go back from my secondView to my mainView I'm processing something in the viewDidDisappear method of my secondView. The problem is, my mainView gets stuck due to the work the app has to do. Here is what I do: -(void)viewDidDisappear:(BOOL)animated { dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); dispatch_async(queue, ^{ dbq = [[dbqueries alloc] init]; [[NSNotificationCenter defaultCenter] postNotificationName:@"abc" object:nil]; //the notification should start a progressView, but because the whole view gets stuck, I can't see it working, because it stops as soon as the work is done dispatch_sync(dispatch_get_main_queue(), ^{ //work }); }); What am I doing wrong? Thanks in advance!
ios
xcode
gcd
null
null
null
open
UI gets stuck even if I use GCD === When I go back from my secondView to my mainView I'm processing something in the viewDidDisappear method of my secondView. The problem is, my mainView gets stuck due to the work the app has to do. Here is what I do: -(void)viewDidDisappear:(BOOL)animated { dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); dispatch_async(queue, ^{ dbq = [[dbqueries alloc] init]; [[NSNotificationCenter defaultCenter] postNotificationName:@"abc" object:nil]; //the notification should start a progressView, but because the whole view gets stuck, I can't see it working, because it stops as soon as the work is done dispatch_sync(dispatch_get_main_queue(), ^{ //work }); }); What am I doing wrong? Thanks in advance!
0
11,387,186
07/08/2012 22:18:58
1,510,625
07/08/2012 22:04:27
1
0
iPad pushing a split view in navigator-based application
I had read a lot of post from the web, but I still cannot find out how can I make this out. Please help me in detail. I need to make a split-view inside a navigation because I need to make a login system. After login, then we can see the split view. I found that someone say must need to set it to be root view, some say do not need. However I cannot do it in both way. Can anyone teach me how to do that step by step?? Here is what I did. `- (void)viewDidLoad { [super viewDidLoad]; GOTSorOE_EN *gotsORoeEN = [[[GOTSorOE_EN alloc]initWithNibName:@"GOTSorOE_EN" bundle:nil]autorelease]; OEFileList_EN *oeFileListEN = [[[OEFileList_EN alloc]initWithNibName:@"OEFileList_EN" bundle:nil]autorelease]; gotsORoeEN.oeFileListEN = oeFileListEN; splitViewController = [[[UISplitViewController alloc]init]autorelease]; splitViewController.viewControllers = [NSArray arrayWithObjects:gotsORoeEN, oeFileListEN, nil]; self.view = splitViewController.view; }`
ipad
uinavigationcontroller
uisplitview
null
null
null
open
iPad pushing a split view in navigator-based application === I had read a lot of post from the web, but I still cannot find out how can I make this out. Please help me in detail. I need to make a split-view inside a navigation because I need to make a login system. After login, then we can see the split view. I found that someone say must need to set it to be root view, some say do not need. However I cannot do it in both way. Can anyone teach me how to do that step by step?? Here is what I did. `- (void)viewDidLoad { [super viewDidLoad]; GOTSorOE_EN *gotsORoeEN = [[[GOTSorOE_EN alloc]initWithNibName:@"GOTSorOE_EN" bundle:nil]autorelease]; OEFileList_EN *oeFileListEN = [[[OEFileList_EN alloc]initWithNibName:@"OEFileList_EN" bundle:nil]autorelease]; gotsORoeEN.oeFileListEN = oeFileListEN; splitViewController = [[[UISplitViewController alloc]init]autorelease]; splitViewController.viewControllers = [NSArray arrayWithObjects:gotsORoeEN, oeFileListEN, nil]; self.view = splitViewController.view; }`
0
11,387,188
07/08/2012 22:19:20
1,431,074
06/01/2012 15:46:30
100
0
Clang boost oddities
I am doing a pet project and am using clang++ (specifically MacPorts clang 3.1). So I decided to switch over to libc++ (to use std::array and such) but I was using boost (specifically asio and regex), so I had to recompile boost using libc++. I removed boost which was installed in macports and build boost from source and now is installed in /usr/local/include and /usr/local/lib. Ever since then, I cannot compile. Here are the oddities I am encountering: When executing: clang++ -g -std=c++11 -stdlib=libc++ -c main.cpp I get a weird compile error having to do with the move constructor (there's more to this error, but as you can see it is coming from boost): /usr/include/c++/v1/string:1952:10: error: overload resolution selected implicitly-deleted copy assignment operator __r_ = _STD::move(__str.__r_); ^ /usr/include/c++/v1/string:1942:9: note: in instantiation of member function 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__move_assign' requested here __move_assign(__str, true_type()); ^ /usr/include/c++/v1/string:1961:5: note: in instantiation of member function 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__move_assign' requested here __move_assign(__str, integral_constant<bool, ^ /usr/local/include/boost/regex/v4/perl_matcher.hpp:207:16: note: in instantiation of member function 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=' requested here s1 = traits_inst.transform(a, a + 1); However, when I execute (please note the "-I", and it must be in that exact position): clang++ -I -std=c++11 -stdlib=libc++ -g -c main.cpp This compiles (but linking fails later on). Why is this? What does -I do without a path? Must -stdlib= be preceded with -I? Now the fun part: Even though, everything compiles now, it won't link. When executing: clang++ main.o FTPClient.o FTPConnection.o -lboost_system -lboost_regex -std=c++11 -stdlib=libc++ -g -o cli I get the message: Undefined symbols for architecture x86_64: "__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_", referenced from: boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o) boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname_imp(char const*, char const*) const in libboost_regex.a(instances.o) boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o) boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname(char const*, char const*) const in libboost_regex.a(instances.o) ld: symbol(s) not found for architecture x86_64 Now I am thinking maybe I a missing some -lboost flag but I am not sure what it is. What could be the reason for this? Thanks very much!
osx
boost
clang
macports
null
null
open
Clang boost oddities === I am doing a pet project and am using clang++ (specifically MacPorts clang 3.1). So I decided to switch over to libc++ (to use std::array and such) but I was using boost (specifically asio and regex), so I had to recompile boost using libc++. I removed boost which was installed in macports and build boost from source and now is installed in /usr/local/include and /usr/local/lib. Ever since then, I cannot compile. Here are the oddities I am encountering: When executing: clang++ -g -std=c++11 -stdlib=libc++ -c main.cpp I get a weird compile error having to do with the move constructor (there's more to this error, but as you can see it is coming from boost): /usr/include/c++/v1/string:1952:10: error: overload resolution selected implicitly-deleted copy assignment operator __r_ = _STD::move(__str.__r_); ^ /usr/include/c++/v1/string:1942:9: note: in instantiation of member function 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__move_assign' requested here __move_assign(__str, true_type()); ^ /usr/include/c++/v1/string:1961:5: note: in instantiation of member function 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__move_assign' requested here __move_assign(__str, integral_constant<bool, ^ /usr/local/include/boost/regex/v4/perl_matcher.hpp:207:16: note: in instantiation of member function 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=' requested here s1 = traits_inst.transform(a, a + 1); However, when I execute (please note the "-I", and it must be in that exact position): clang++ -I -std=c++11 -stdlib=libc++ -g -c main.cpp This compiles (but linking fails later on). Why is this? What does -I do without a path? Must -stdlib= be preceded with -I? Now the fun part: Even though, everything compiles now, it won't link. When executing: clang++ main.o FTPClient.o FTPConnection.o -lboost_system -lboost_regex -std=c++11 -stdlib=libc++ -g -o cli I get the message: Undefined symbols for architecture x86_64: "__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_", referenced from: boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o) boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname_imp(char const*, char const*) const in libboost_regex.a(instances.o) boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o) boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname(char const*, char const*) const in libboost_regex.a(instances.o) ld: symbol(s) not found for architecture x86_64 Now I am thinking maybe I a missing some -lboost flag but I am not sure what it is. What could be the reason for this? Thanks very much!
0
11,387,190
07/08/2012 22:19:41
1,510,603
07/08/2012 21:34:29
1
0
How add image, showing in PagerView, to background?
***It is necessary download the image (on SDcard) and then just use it? If no, how do this ?*** I have image store and images shows in PagerView (images load from internet). I need to select a picture from PagerView and put it on the background (wallpaper). I can not add a button in ImagePagerActivity for adding image to background. Error: E/AndroidRuntime(14608): java.lang.RuntimeException: Unable to start activity ComponentInfo{down.load.ascetix/down.load.ascetix.ImagePagerActivity}: java.lang.ClassCastException: down.load.ascetix.ImagePagerActivity. ---------- ImagePagerActivity: ---------- public class ImagePagerActivity extends BaseActivity { private ViewPager pager; private DisplayImageOptions options; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_image_pager); Bundle bundle = getIntent().getExtras(); String[] imageUrls = bundle.getStringArray(Extra.IMAGES); int pagerPosition = bundle.getInt(Extra.IMAGE_POSITION, 0); options = new DisplayImageOptions.Builder() .showImageForEmptyUri(R.drawable.image_for_empty_url) .cacheOnDisc() .imageScaleType(ImageScaleType.EXACT) .build(); pager = (ViewPager) findViewById(R.id.pager); pager.setAdapter(new ImagePagerAdapter(imageUrls)); pager.setCurrentItem(pagerPosition); } @Override protected void onStop() { imageLoader.stop(); super.onStop(); } private class ImagePagerAdapter extends PagerAdapter { private String[] images; private LayoutInflater inflater; ImagePagerAdapter(String[] images) { this.images = images; inflater = getLayoutInflater(); } public void destroyItem(View container, int position, Object object) { ((ViewPager) container).removeView((View) object); } public void finishUpdate(View container) { } public int getCount() { return images.length; } public Object instantiateItem(View view, int position) { final FrameLayout imageLayout = (FrameLayout) inflater.inflate(R.layout.item_pager_image, null); final ImageView imageView = (ImageView) imageLayout.findViewById(R.id.image); final ProgressBar spinner = (ProgressBar) imageLayout.findViewById(R.id.loading); imageLoader.displayImage(images[position], imageView, options, new ImageLoadingListener() { public void onLoadingStarted() { spinner.setVisibility(View.VISIBLE); } public void onLoadingFailed(FailReason failReason) { String message = null; switch (failReason) { case IO_ERROR: message = "Input/Output error"; break; case OUT_OF_MEMORY: message = "Out Of Memory error"; break; case UNKNOWN: message = "Unknown error"; break; } Toast.makeText(ImagePagerActivity.this, message, Toast.LENGTH_SHORT).show(); spinner.setVisibility(View.GONE); imageView.setImageResource(android.R.drawable.ic_delete); } public void onLoadingComplete() { spinner.setVisibility(View.GONE); Animation anim = AnimationUtils.loadAnimation(ImagePagerActivity.this, R.anim.fade_in); imageView.setAnimation(anim); anim.start(); } public void onLoadingCancelled() { // Do nothing } }); ((ViewPager) view).addView(imageLayout, 0); return imageLayout; } public boolean isViewFromObject(View view, Object object) { return view.equals(object); } public void restoreState(Parcelable state, ClassLoader loader) { } public Parcelable saveState() { return null; } public void startUpdate(View container) { } } } ---------- My .xml file: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="1dip"> <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustViewBounds="true" /> <ProgressBar android:id="@+id/loading" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:visibility="gone" /> </FrameLayout> Thanks.
android
image
background
wallpaper
null
null
open
How add image, showing in PagerView, to background? === ***It is necessary download the image (on SDcard) and then just use it? If no, how do this ?*** I have image store and images shows in PagerView (images load from internet). I need to select a picture from PagerView and put it on the background (wallpaper). I can not add a button in ImagePagerActivity for adding image to background. Error: E/AndroidRuntime(14608): java.lang.RuntimeException: Unable to start activity ComponentInfo{down.load.ascetix/down.load.ascetix.ImagePagerActivity}: java.lang.ClassCastException: down.load.ascetix.ImagePagerActivity. ---------- ImagePagerActivity: ---------- public class ImagePagerActivity extends BaseActivity { private ViewPager pager; private DisplayImageOptions options; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_image_pager); Bundle bundle = getIntent().getExtras(); String[] imageUrls = bundle.getStringArray(Extra.IMAGES); int pagerPosition = bundle.getInt(Extra.IMAGE_POSITION, 0); options = new DisplayImageOptions.Builder() .showImageForEmptyUri(R.drawable.image_for_empty_url) .cacheOnDisc() .imageScaleType(ImageScaleType.EXACT) .build(); pager = (ViewPager) findViewById(R.id.pager); pager.setAdapter(new ImagePagerAdapter(imageUrls)); pager.setCurrentItem(pagerPosition); } @Override protected void onStop() { imageLoader.stop(); super.onStop(); } private class ImagePagerAdapter extends PagerAdapter { private String[] images; private LayoutInflater inflater; ImagePagerAdapter(String[] images) { this.images = images; inflater = getLayoutInflater(); } public void destroyItem(View container, int position, Object object) { ((ViewPager) container).removeView((View) object); } public void finishUpdate(View container) { } public int getCount() { return images.length; } public Object instantiateItem(View view, int position) { final FrameLayout imageLayout = (FrameLayout) inflater.inflate(R.layout.item_pager_image, null); final ImageView imageView = (ImageView) imageLayout.findViewById(R.id.image); final ProgressBar spinner = (ProgressBar) imageLayout.findViewById(R.id.loading); imageLoader.displayImage(images[position], imageView, options, new ImageLoadingListener() { public void onLoadingStarted() { spinner.setVisibility(View.VISIBLE); } public void onLoadingFailed(FailReason failReason) { String message = null; switch (failReason) { case IO_ERROR: message = "Input/Output error"; break; case OUT_OF_MEMORY: message = "Out Of Memory error"; break; case UNKNOWN: message = "Unknown error"; break; } Toast.makeText(ImagePagerActivity.this, message, Toast.LENGTH_SHORT).show(); spinner.setVisibility(View.GONE); imageView.setImageResource(android.R.drawable.ic_delete); } public void onLoadingComplete() { spinner.setVisibility(View.GONE); Animation anim = AnimationUtils.loadAnimation(ImagePagerActivity.this, R.anim.fade_in); imageView.setAnimation(anim); anim.start(); } public void onLoadingCancelled() { // Do nothing } }); ((ViewPager) view).addView(imageLayout, 0); return imageLayout; } public boolean isViewFromObject(View view, Object object) { return view.equals(object); } public void restoreState(Parcelable state, ClassLoader loader) { } public Parcelable saveState() { return null; } public void startUpdate(View container) { } } } ---------- My .xml file: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="1dip"> <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustViewBounds="true" /> <ProgressBar android:id="@+id/loading" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:visibility="gone" /> </FrameLayout> Thanks.
0
11,387,195
07/08/2012 22:20:20
435,426
08/30/2010 23:15:57
118
2
Creating a pointer to a templated class
I know that if I use a base class, I can effectively create a pointer to a templated class. Is there an easier way? So. Here is an example using a base class class A {} template <class T> class B : public A {} Now, I can create an instance of B<T> and point to it using the base class A. Is there an easier way? A more direct way? One that doesn't involve creating a "dummy" base class. Thanks in advance.
templates
c++11
null
null
null
null
open
Creating a pointer to a templated class === I know that if I use a base class, I can effectively create a pointer to a templated class. Is there an easier way? So. Here is an example using a base class class A {} template <class T> class B : public A {} Now, I can create an instance of B<T> and point to it using the base class A. Is there an easier way? A more direct way? One that doesn't involve creating a "dummy" base class. Thanks in advance.
0
11,387,198
07/08/2012 22:20:41
1,510,634
07/08/2012 22:12:20
1
0
WiFi connection beetween a few devices and Android tablet
I need some theoretical knowledge about this kind of connection. I've got a router with open wifi. I have also two (this number can change up to 15) devices connected to that network and one android tablet. The main point is to show on a tablet data from these 2 devices at the same time. So, what's the best idea to develop that idea on Android(API 2.3)? Using sockets or wifi connection( each in one thread)? Thanks for all solutions. Cheers.
java
android
wifi
null
null
null
open
WiFi connection beetween a few devices and Android tablet === I need some theoretical knowledge about this kind of connection. I've got a router with open wifi. I have also two (this number can change up to 15) devices connected to that network and one android tablet. The main point is to show on a tablet data from these 2 devices at the same time. So, what's the best idea to develop that idea on Android(API 2.3)? Using sockets or wifi connection( each in one thread)? Thanks for all solutions. Cheers.
0
11,387,201
07/08/2012 22:20:58
429,377
05/18/2010 13:03:58
1,979
60
Can't use @Autowired in desktop application
i am trying to use spring in desktop application, but i am facing a problem with autowiring in action methods of my **JPanel**. i am loading the applicationContext in my main method as follows: public static void main(String[] args) { new ClassPathXmlApplicationContext( "classpath:/META-INF/spring/applicationContext.xml"); } and i can see that it's loaded with no problems. **my panel code:** @Component public class Signup extends JPanel { @Autowired private UserDao userDao; public Signup() { JButton btn_submit = new JButton("Submit"); btn_submit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { registerUser(); } }); } private void registerUser() { User newUser = new User(); newUser.setName(username); newUser.setSalary(salary); userDao.addUser(newUser); } } the `context:component-scan` is configured properly, and i am using `context:annotation-config` too but i always gets **NullPointerException** in `userDao.addUser(newUser);` which means that the Dependency Injection is not working as it should. please advise how to fix this issue.
spring
dependency-injection
desktop-application
null
null
null
open
Can't use @Autowired in desktop application === i am trying to use spring in desktop application, but i am facing a problem with autowiring in action methods of my **JPanel**. i am loading the applicationContext in my main method as follows: public static void main(String[] args) { new ClassPathXmlApplicationContext( "classpath:/META-INF/spring/applicationContext.xml"); } and i can see that it's loaded with no problems. **my panel code:** @Component public class Signup extends JPanel { @Autowired private UserDao userDao; public Signup() { JButton btn_submit = new JButton("Submit"); btn_submit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { registerUser(); } }); } private void registerUser() { User newUser = new User(); newUser.setName(username); newUser.setSalary(salary); userDao.addUser(newUser); } } the `context:component-scan` is configured properly, and i am using `context:annotation-config` too but i always gets **NullPointerException** in `userDao.addUser(newUser);` which means that the Dependency Injection is not working as it should. please advise how to fix this issue.
0
11,387,206
07/08/2012 22:22:12
1,276,567
03/18/2012 05:51:22
101
6
Yahoo Finance API with Json/Jquery isn't working well?
I am learning how to parse json and query and was looking at other questions: I saw that someone was using the below URL to get ticker symbols and values. I also wanted to get the actual stock value, but I will figure that out later. My jquery code is supposed to parse the JSON format that it gives but I am new at this and it doesn't seem to be working the way I understand it to work. Sorry if this is a bit of a "nooby" question. http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=yahoo&callback=YAHOO.Finance.SymbolSuggest.ssCallback It returns this, I reformatted it and validated it to make it readable and to check it: YAHOO.Finance.SymbolSuggest.ssCallback({ "ResultSet":{ "Query":"google", "Result":[ { "symbol":"GOOG", "name":"Google Inc.", "exch":"NMS", "type":"S", "exchDisp":"NASDAQ", "typeDisp":"Equity" }, { "symbol":"GOOG.MX", "name":"Google Inc.", "exch":"MEX", "type":"S", "exchDisp":"Mexico", "typeDisp":"Equity" }, { "symbol":"GGQ1.DE", "name":"GOOGLE-A", "exch":"GER", "type":"S", "exchDisp":"XETRA", "typeDisp":"Equity" }, { "symbol":"GGQ1.SG", "name":"GOOGLE-A", "exch":"STU", "type":"S", "exchDisp":"Stuttgart", "typeDisp":"Equity" }, { "symbol":"GGQ1.HA", "name":"GOOGLE-A", "exch":"HAN", "type":"S", "exchDisp":"Hanover", "typeDisp":"Equity" }, { "symbol":"GGQ1.MU", "name":"GOOGLE-A", "exch":"MUN", "type":"S", "exchDisp":"Munich", "typeDisp":"Equity" }, { "symbol":"GGQ1.F", "name":"GOOGLE-A", "exch":"FRA", "type":"S", "exchDisp":"Frankfurt", "typeDisp":"Equity" }, { "symbol":"GOOG11BF.SA", "name":"GOOGLE -DRN MB", "exch":"SAO", "type":"S", "exchDisp":"Sao Paolo", "typeDisp":"Equity" }, { "symbol":"GOOF.EX", "name":"GOOGLE-A", "exch":"EUX", "type":"S", "exchDisp":"EUREX Futures and Options Exchange ", "typeDisp":"Equity" }, { "symbol":"GGQ1.HM", "name":"GOOGLE-A", "exch":"HAM", "type":"S", "exchDisp":"Hamburg", "typeDisp":"Equity" } ] } }) this is the part of my code to parse that url exactly: function(data) { $("#quotes").empty(); $.each(data.query.search, function(i, Result){ $("#quotes").append("<div>" + ResultSet.Result.symbol + "</a><br>" + ResultSet.Result.name + "<br><br></div>"); }); });
jquery
json
search
yahoo
finance
null
open
Yahoo Finance API with Json/Jquery isn't working well? === I am learning how to parse json and query and was looking at other questions: I saw that someone was using the below URL to get ticker symbols and values. I also wanted to get the actual stock value, but I will figure that out later. My jquery code is supposed to parse the JSON format that it gives but I am new at this and it doesn't seem to be working the way I understand it to work. Sorry if this is a bit of a "nooby" question. http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=yahoo&callback=YAHOO.Finance.SymbolSuggest.ssCallback It returns this, I reformatted it and validated it to make it readable and to check it: YAHOO.Finance.SymbolSuggest.ssCallback({ "ResultSet":{ "Query":"google", "Result":[ { "symbol":"GOOG", "name":"Google Inc.", "exch":"NMS", "type":"S", "exchDisp":"NASDAQ", "typeDisp":"Equity" }, { "symbol":"GOOG.MX", "name":"Google Inc.", "exch":"MEX", "type":"S", "exchDisp":"Mexico", "typeDisp":"Equity" }, { "symbol":"GGQ1.DE", "name":"GOOGLE-A", "exch":"GER", "type":"S", "exchDisp":"XETRA", "typeDisp":"Equity" }, { "symbol":"GGQ1.SG", "name":"GOOGLE-A", "exch":"STU", "type":"S", "exchDisp":"Stuttgart", "typeDisp":"Equity" }, { "symbol":"GGQ1.HA", "name":"GOOGLE-A", "exch":"HAN", "type":"S", "exchDisp":"Hanover", "typeDisp":"Equity" }, { "symbol":"GGQ1.MU", "name":"GOOGLE-A", "exch":"MUN", "type":"S", "exchDisp":"Munich", "typeDisp":"Equity" }, { "symbol":"GGQ1.F", "name":"GOOGLE-A", "exch":"FRA", "type":"S", "exchDisp":"Frankfurt", "typeDisp":"Equity" }, { "symbol":"GOOG11BF.SA", "name":"GOOGLE -DRN MB", "exch":"SAO", "type":"S", "exchDisp":"Sao Paolo", "typeDisp":"Equity" }, { "symbol":"GOOF.EX", "name":"GOOGLE-A", "exch":"EUX", "type":"S", "exchDisp":"EUREX Futures and Options Exchange ", "typeDisp":"Equity" }, { "symbol":"GGQ1.HM", "name":"GOOGLE-A", "exch":"HAM", "type":"S", "exchDisp":"Hamburg", "typeDisp":"Equity" } ] } }) this is the part of my code to parse that url exactly: function(data) { $("#quotes").empty(); $.each(data.query.search, function(i, Result){ $("#quotes").append("<div>" + ResultSet.Result.symbol + "</a><br>" + ResultSet.Result.name + "<br><br></div>"); }); });
0
11,728,282
07/30/2012 19:31:23
1,563,820
07/30/2012 18:35:21
1
0
Django Messaging Framework not displaying message despite RequestContext
here's a conundrum for you, Using Django 1.4, I cannot get messages set through the messages middleware to display in my templates. I have combed through the [Django docs][1] and ensured that my settings.py file referenced the relevant apps, context-processors and middleware. **I have ensured that my view is rendering with the RequestContext instance.** Yet, I still cannot get any of the messages to appear in the template. **settings.py:** MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) ... TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.request', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.contrib.messages.context_processors.messages', 'tekextensions.context_processors.admin_media_prefix', ) ... INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', #Admin interface 'django.contrib.admindocs', #Admin docs ... My messages error_level is set to 20 (i.e. 'info' and above). I am using the default mappings. **views.py:** from django.contrib import messages def index(request, *args, **kwargs): #Do some funky jazz which works like build the timeline & page vars ... messages.error = (request,"Horsey Bollox!") messages.add_message = (request, messages.ERROR,"Why won't this f***ing thing work?") #Attempting alternate method return render_to_response('funkyjazzdirectory/index.html', { 'page': page, 'timeline': timeline, }, context_instance=RequestContext(request)) **template: (funkyjazzdirectory/index.html)** {% extends "base.html" %} {% if messages.error %} <div class="messages-errors"> Error: <ul> {% for msg in messages %} <li>{{msg}}</li> {% endfor %} </ul> </div> {% endif %} <p> Other stuff such as iterating through {{timeline}} which renders absolutely fine </p> I have also tried substituting {{msg}} with: <li>{{msg.message}}</li> with no success. The rest of the page outputs fine, Django does not throw an error. The console does not contain anything abnormal. The HTML code produced does not contain the div, nor the list tags anywhere. The template which this one extends (base.html) does not use the {{messages}} variable nor call a template tag which uses it. I have tried passing the {{messages}} into a custom template tag for testing in the top of the index.html template. Here I can do: def __init__(self, messages): self.messages = messages def render(self, context): l = dir(context[self.messages]) print(l) ...which produces a list of methods / properties presumably of the message object. Yet, I cannot iterate over this at all, as "for m in messages:" does not run even once. Attempting to discover the size of this entity by: print(len(context[self.messages])) gives me nothing in the console. The only time I've got it to actually output anything was when I manually passed the messages object into the template within the render_to_response tag then iterated over messages.error ({% for msg in messages.error %}) which produced two bullet points in the correct div: the first being filled with what looks like a var dump: "<WSGIRequest path:/admissions/, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken':"... the second bullet point containing just the last error message: "Why won't this f***ing thing work?". (Obviously this was just a test and I have not kept messages in the dict passed via render_to_response as I know it should arrive in the template via the context) So, where did I go wrong? Why can I not see my error messages in my template? Why can I not even get the messages to appear in the console? Any light someone smarter than me can shed would be extremely helpful! [1]: https://docs.djangoproject.com/en/1.4/ref/contrib/messages/
django
django-templates
django-middleware
null
null
null
open
Django Messaging Framework not displaying message despite RequestContext === here's a conundrum for you, Using Django 1.4, I cannot get messages set through the messages middleware to display in my templates. I have combed through the [Django docs][1] and ensured that my settings.py file referenced the relevant apps, context-processors and middleware. **I have ensured that my view is rendering with the RequestContext instance.** Yet, I still cannot get any of the messages to appear in the template. **settings.py:** MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) ... TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.request', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.contrib.messages.context_processors.messages', 'tekextensions.context_processors.admin_media_prefix', ) ... INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', #Admin interface 'django.contrib.admindocs', #Admin docs ... My messages error_level is set to 20 (i.e. 'info' and above). I am using the default mappings. **views.py:** from django.contrib import messages def index(request, *args, **kwargs): #Do some funky jazz which works like build the timeline & page vars ... messages.error = (request,"Horsey Bollox!") messages.add_message = (request, messages.ERROR,"Why won't this f***ing thing work?") #Attempting alternate method return render_to_response('funkyjazzdirectory/index.html', { 'page': page, 'timeline': timeline, }, context_instance=RequestContext(request)) **template: (funkyjazzdirectory/index.html)** {% extends "base.html" %} {% if messages.error %} <div class="messages-errors"> Error: <ul> {% for msg in messages %} <li>{{msg}}</li> {% endfor %} </ul> </div> {% endif %} <p> Other stuff such as iterating through {{timeline}} which renders absolutely fine </p> I have also tried substituting {{msg}} with: <li>{{msg.message}}</li> with no success. The rest of the page outputs fine, Django does not throw an error. The console does not contain anything abnormal. The HTML code produced does not contain the div, nor the list tags anywhere. The template which this one extends (base.html) does not use the {{messages}} variable nor call a template tag which uses it. I have tried passing the {{messages}} into a custom template tag for testing in the top of the index.html template. Here I can do: def __init__(self, messages): self.messages = messages def render(self, context): l = dir(context[self.messages]) print(l) ...which produces a list of methods / properties presumably of the message object. Yet, I cannot iterate over this at all, as "for m in messages:" does not run even once. Attempting to discover the size of this entity by: print(len(context[self.messages])) gives me nothing in the console. The only time I've got it to actually output anything was when I manually passed the messages object into the template within the render_to_response tag then iterated over messages.error ({% for msg in messages.error %}) which produced two bullet points in the correct div: the first being filled with what looks like a var dump: "<WSGIRequest path:/admissions/, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken':"... the second bullet point containing just the last error message: "Why won't this f***ing thing work?". (Obviously this was just a test and I have not kept messages in the dict passed via render_to_response as I know it should arrive in the template via the context) So, where did I go wrong? Why can I not see my error messages in my template? Why can I not even get the messages to appear in the console? Any light someone smarter than me can shed would be extremely helpful! [1]: https://docs.djangoproject.com/en/1.4/ref/contrib/messages/
0
11,728,286
07/30/2012 19:31:38
1,470,313
06/20/2012 19:44:43
1
0
android: state_pressed works only on second try
Sry for posting that again, but this error occurs in eclipse API15(Android 4.0.3) again : I've one menu button and a motion class for a longer state_pressed state (0,5 sec.). So long all works fine, but one problem occurs : I've to press first time on my button, state_pressed doesn't work at this first time then I'm pressing the back button and on the second attempt my code works correctly and state_pressed works with 0,5 seconds duration. How can I make it that it works on the first press? I think there is a problem with the hover.xml file and in combination with the setBackgroundDrawable? Thanks all in advance for ur help! **This is my hover.XML drawable** <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/buttonstyle_pressed" /> <item android:drawable="@drawable/buttonstyle" /> </selector> **And this is my java code** Button menubutton_start; menubutton_start = (Button) FindViewById(R.id.menustart); menubutton_start.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { menubutton_start.setBackgroundDrawable(getResources().getDrawable(R.drawable.hover)); final Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { Intent myIntent = new Intent(GameActivity.this, NextActivity.class); GameActivity.this.startActivity(myIntent); } }, 500); // end of Handler new Runnable() } // end of OnClick() }); // end of setOnClickListener
android
null
null
null
null
null
open
android: state_pressed works only on second try === Sry for posting that again, but this error occurs in eclipse API15(Android 4.0.3) again : I've one menu button and a motion class for a longer state_pressed state (0,5 sec.). So long all works fine, but one problem occurs : I've to press first time on my button, state_pressed doesn't work at this first time then I'm pressing the back button and on the second attempt my code works correctly and state_pressed works with 0,5 seconds duration. How can I make it that it works on the first press? I think there is a problem with the hover.xml file and in combination with the setBackgroundDrawable? Thanks all in advance for ur help! **This is my hover.XML drawable** <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/buttonstyle_pressed" /> <item android:drawable="@drawable/buttonstyle" /> </selector> **And this is my java code** Button menubutton_start; menubutton_start = (Button) FindViewById(R.id.menustart); menubutton_start.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { menubutton_start.setBackgroundDrawable(getResources().getDrawable(R.drawable.hover)); final Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { Intent myIntent = new Intent(GameActivity.this, NextActivity.class); GameActivity.this.startActivity(myIntent); } }, 500); // end of Handler new Runnable() } // end of OnClick() }); // end of setOnClickListener
0
11,728,289
07/30/2012 19:31:50
1,352,530
04/23/2012 23:58:25
404
15
Block mouse input in Java Swing
I have a testing FEST app which uses an AWT robot for simulating certain actions over a Swing interface. My problem is that it seems like moving the mouse pointer during the robot-test execution cancels some of the programatic actions, like pressing a column header. If you dont touh anything during execution, then the ursor moves alone to the target and hits it. Is there any way to block mouse user input for that app until test is finished?
java
swing
robot
mouse-cursor
fest
null
open
Block mouse input in Java Swing === I have a testing FEST app which uses an AWT robot for simulating certain actions over a Swing interface. My problem is that it seems like moving the mouse pointer during the robot-test execution cancels some of the programatic actions, like pressing a column header. If you dont touh anything during execution, then the ursor moves alone to the target and hits it. Is there any way to block mouse user input for that app until test is finished?
0
11,728,290
07/30/2012 19:31:54
1,526,781
07/15/2012 11:07:44
29
0
Searching a file and returning value - Super Fast
I have a set of data which has a name, some sub values and then a associative numeric value. For example: James Value1 Value2 "1.232323/1.232334" Jim Value1 Value2 "1.245454/1.232999" Dave Value1 Value2 "1.267623/1.277777" There will be around 100,000 entries like this stored in either a file or database. I would like to know, what is the quickest way of being able to return the results which match a search, along with their associated numeric value. For example, a query of "J" would return both James and Jim results which the numeric values in the last column. I've heard people mention binary tree searching, dictionary searching, indexed searching. I have no idea which is a good route to peruse.
c
search
null
null
null
null
open
Searching a file and returning value - Super Fast === I have a set of data which has a name, some sub values and then a associative numeric value. For example: James Value1 Value2 "1.232323/1.232334" Jim Value1 Value2 "1.245454/1.232999" Dave Value1 Value2 "1.267623/1.277777" There will be around 100,000 entries like this stored in either a file or database. I would like to know, what is the quickest way of being able to return the results which match a search, along with their associated numeric value. For example, a query of "J" would return both James and Jim results which the numeric values in the last column. I've heard people mention binary tree searching, dictionary searching, indexed searching. I have no idea which is a good route to peruse.
0
11,728,292
07/30/2012 19:32:07
1,269,365
03/14/2012 15:13:01
8
0
Bulk rewrite post slugs based on custom field value in Wordpress
Basically I have a custom post type setup called "Parts" with over 5,000 posts currently in it. There are a number of custom fields associated with each part, including a "part number". Currently, the URL for each part is: http://site.com/parts/name-of-part/ What I would rather have is: http://site.com/parts/XXXX-608-AB/ (That's a part number, stored as a custom field "partno".) I believe I need to do two things: 1) Make a script to bulk edit all the slugs for each existing part, based on the custom field "partno". 2) Hook into a Wordpress function to trigger it to always create the slug for new parts based on the custom field "partno". Does anyone have any knowledge on how to accomplish one or both of these aspects?
php
wordpress
custom-fields
custom-post-type
slug
null
open
Bulk rewrite post slugs based on custom field value in Wordpress === Basically I have a custom post type setup called "Parts" with over 5,000 posts currently in it. There are a number of custom fields associated with each part, including a "part number". Currently, the URL for each part is: http://site.com/parts/name-of-part/ What I would rather have is: http://site.com/parts/XXXX-608-AB/ (That's a part number, stored as a custom field "partno".) I believe I need to do two things: 1) Make a script to bulk edit all the slugs for each existing part, based on the custom field "partno". 2) Hook into a Wordpress function to trigger it to always create the slug for new parts based on the custom field "partno". Does anyone have any knowledge on how to accomplish one or both of these aspects?
0
11,728,296
07/30/2012 19:32:30
1,524,378
07/13/2012 18:40:32
30
2
force password change every 6 months in Plone
Is there a way to force all the users to change their password once every six months?. I am using Plone 4.2 on a linux box.This is primarily for security purposes. Help will be appreciated. Thanks
plone
change-password
null
null
null
null
open
force password change every 6 months in Plone === Is there a way to force all the users to change their password once every six months?. I am using Plone 4.2 on a linux box.This is primarily for security purposes. Help will be appreciated. Thanks
0
11,728,015
07/30/2012 19:09:57
1,435,947
06/04/2012 20:05:02
12
0
Visual C++ Opening a second form
I have a project that contains two forms, Form1.h and Form2.h. The .cpp files of each is test.cpp and Form2.cpp. I want to open the second form from the first through a button click, of which I already have the code for, placed inside the button1_Click method: Form2 ^ form = gcnew Form2; form->Show(); I have furthermore placed the include file in Form1.h (#include "Form2.h"), however I keep getting the following errors: error C2065: 'Form2' : undeclared identifier error C2065: 'form' : undeclared identifier error C2061: syntax error : identifier 'Form2' error C2065: 'form' : undeclared identifier error C2227: left of '->Show' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1> Generating Code... ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I have been searching a solution for a couple of days... none of which worked. Any help would be appreciated.
forms
visual-c++
button
null
null
null
open
Visual C++ Opening a second form === I have a project that contains two forms, Form1.h and Form2.h. The .cpp files of each is test.cpp and Form2.cpp. I want to open the second form from the first through a button click, of which I already have the code for, placed inside the button1_Click method: Form2 ^ form = gcnew Form2; form->Show(); I have furthermore placed the include file in Form1.h (#include "Form2.h"), however I keep getting the following errors: error C2065: 'Form2' : undeclared identifier error C2065: 'form' : undeclared identifier error C2061: syntax error : identifier 'Form2' error C2065: 'form' : undeclared identifier error C2227: left of '->Show' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1> Generating Code... ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I have been searching a solution for a couple of days... none of which worked. Any help would be appreciated.
0
11,728,139
07/30/2012 19:19:47
510,008
11/16/2010 20:21:00
1
0
Redirect URI mismatch iOS soundcloud
I'm developping an iOS app which use soundcloud API. I followed this tutorial : https://github.com/soundcloud/CocoaSoundCloudAPI Everything was fine until the login step.. I try to upload a song (just to try something different), but I had the same result... No fields to logged in. Sometimes the soundcloud popup disappear after 1 second, other times, nothing appends, the UI stay in this state (with the spinner active). In the console, I've got this error message : > Ooops, something went wrong: Redirect URI mismatch On the soundcloud website I put an URI like this one myApp://oauth2, and I wrote the same in the initialize method. I'm not sure it worked, because when I refresh the editing page, the redirect URI field is blank... Any idea ? I'm trying to login to soundcloud with this code : [SCSoundCloud requestAccessWithPreparedAuthorizationURLHandler:^(NSURL *preparedURL){ SCLoginViewController *loginViewController; loginViewController = [SCLoginViewController loginViewControllerWithPreparedURL:preparedURL completionHandler:^(NSError *error){ if (SC_CANCELED(error)) { NSLog(@"Canceled!"); } else if (error) { NSLog(@"Ooops, something went wrong: %@", [error localizedDescription]); } else { NSLog(@"Done!"); } }]; [self presentModalViewController:loginViewController animated:YES]; }]; Thanks ! [1]: http://i.stack.imgur.com/F878c.png
ios
oauth
soundcloud
null
null
null
open
Redirect URI mismatch iOS soundcloud === I'm developping an iOS app which use soundcloud API. I followed this tutorial : https://github.com/soundcloud/CocoaSoundCloudAPI Everything was fine until the login step.. I try to upload a song (just to try something different), but I had the same result... No fields to logged in. Sometimes the soundcloud popup disappear after 1 second, other times, nothing appends, the UI stay in this state (with the spinner active). In the console, I've got this error message : > Ooops, something went wrong: Redirect URI mismatch On the soundcloud website I put an URI like this one myApp://oauth2, and I wrote the same in the initialize method. I'm not sure it worked, because when I refresh the editing page, the redirect URI field is blank... Any idea ? I'm trying to login to soundcloud with this code : [SCSoundCloud requestAccessWithPreparedAuthorizationURLHandler:^(NSURL *preparedURL){ SCLoginViewController *loginViewController; loginViewController = [SCLoginViewController loginViewControllerWithPreparedURL:preparedURL completionHandler:^(NSError *error){ if (SC_CANCELED(error)) { NSLog(@"Canceled!"); } else if (error) { NSLog(@"Ooops, something went wrong: %@", [error localizedDescription]); } else { NSLog(@"Done!"); } }]; [self presentModalViewController:loginViewController animated:YES]; }]; Thanks ! [1]: http://i.stack.imgur.com/F878c.png
0
11,348,936
07/05/2012 16:50:03
797,423
06/14/2011 09:57:23
1,078
38
scrolling the background image in android java while adding a view to screen
I want to scroll the background in android. I have a scrollview which has many views. I need to implement a way wherein i need to scroll only the background while adding the views. I came across many forums but none of them are very clear. Please give an idea or references to implement it. To give more idea for what i am looking for is, Just consider a bike game wherein the background road image moves while riding the bike. I just need similar implementation while scrolling the screen.
android
view
background
scrolling
null
null
open
scrolling the background image in android java while adding a view to screen === I want to scroll the background in android. I have a scrollview which has many views. I need to implement a way wherein i need to scroll only the background while adding the views. I came across many forums but none of them are very clear. Please give an idea or references to implement it. To give more idea for what i am looking for is, Just consider a bike game wherein the background road image moves while riding the bike. I just need similar implementation while scrolling the screen.
0
11,349,769
07/05/2012 17:50:40
1,169,604
01/25/2012 16:12:58
106
1
block direct execution (C#)
i have a "Main app" that runs an external process like this: sortProcess = new Process(); sortProcess.StartInfo.FileName = "app.exe"; sortProcess.StartInfo.UseShellExecute = false; sortProcess.StartInfo.RedirectStandardOutput = true; sortProcess.StartInfo.RedirectStandardError = true; sortProcess.OutputDataReceived += new DataReceivedEventHandler(SortOutputHandler); sortProcess.ErrorDataReceived += new DataReceivedEventHandler(sortProcess_ErrorDataReceived); sortProcess.Start(); sortProcess.BeginOutputReadLine(); sortProcess.BeginErrorReadLine(); sortProcess.WaitForExit(); sortProcess.Close(); the external process needs to be very simple to communicate to main app and multilingual, something console like, like this: Console.WriteLine(@"started"); //do stuff Console.WriteLine(@"something done"); //try to do more stuff throw new System.InvalidOperationException("Logfile cannot be read-only"); //could do Console.WriteLine(@"done without errors"); the app.exe has the `Output type` as `Windows Application`, how can i on the app.exe(C#) block the execution of the exe from any other place unless it's ran by my main app
c#
process
block
null
null
null
open
block direct execution (C#) === i have a "Main app" that runs an external process like this: sortProcess = new Process(); sortProcess.StartInfo.FileName = "app.exe"; sortProcess.StartInfo.UseShellExecute = false; sortProcess.StartInfo.RedirectStandardOutput = true; sortProcess.StartInfo.RedirectStandardError = true; sortProcess.OutputDataReceived += new DataReceivedEventHandler(SortOutputHandler); sortProcess.ErrorDataReceived += new DataReceivedEventHandler(sortProcess_ErrorDataReceived); sortProcess.Start(); sortProcess.BeginOutputReadLine(); sortProcess.BeginErrorReadLine(); sortProcess.WaitForExit(); sortProcess.Close(); the external process needs to be very simple to communicate to main app and multilingual, something console like, like this: Console.WriteLine(@"started"); //do stuff Console.WriteLine(@"something done"); //try to do more stuff throw new System.InvalidOperationException("Logfile cannot be read-only"); //could do Console.WriteLine(@"done without errors"); the app.exe has the `Output type` as `Windows Application`, how can i on the app.exe(C#) block the execution of the exe from any other place unless it's ran by my main app
0
11,372,933
07/07/2012 06:50:55
353,829
04/08/2009 18:25:48
371
14
Prevent non-US Letters in Form Submit (java)
I have a java JSP/servlet application in a Tomcat, and fronted by an Apache. The server side checks to make sure only letters in ranges [A..Z][a..z], digits, and punctuation symbols are accepted. However, when a, for example, chinese character is entered, the value in the server-side looks something like '&#5960". Hence, as far as the server-side is concerned, these are valid punctuation symbols and digits. Any pointers that can help? Driving me insane after a 10 coding marathon.
java
jsp
tomcat
servlets
null
null
open
Prevent non-US Letters in Form Submit (java) === I have a java JSP/servlet application in a Tomcat, and fronted by an Apache. The server side checks to make sure only letters in ranges [A..Z][a..z], digits, and punctuation symbols are accepted. However, when a, for example, chinese character is entered, the value in the server-side looks something like '&#5960". Hence, as far as the server-side is concerned, these are valid punctuation symbols and digits. Any pointers that can help? Driving me insane after a 10 coding marathon.
0
11,372,953
07/07/2012 06:53:43
1,132,774
01/05/2012 17:53:54
21
0
Google maps DirectionsRenderer
I'm looking to change the marker icons of the google map, while creating a path using DirectionsRenderer. Trying to do that, i followed following steps. - created two icons for the start point and the end point. - in rendererOptions set suppressMarkers: false - then placed those two marker to the start point and the end point of the path So now I have my customary created icons at the two ends. But my requirement is these markers should be draggable. so i set the **draggable: true** and now its working fine. But now my problem is while dragging the icon, the path should be changed dynamically, which should be similar to that of https://google-developers.appspot.com/maps/documentation/javascript/examples/directions-draggable I tried to do this by adding listeners to those two markers : "drag" event - and while dragging a marker, draw the path at the same time. But the result I'm getting is not similar to the "directions-draggable" example. In facts, although i can render paths, previously drawn paths still exist on the map. But clearing all the paths exist on the map and then re-draw all is not my requirement. So is there a way to get the same result/effect like the "directions-draggable" while changing the marker icons. thanks in advance...
google-maps
marker
null
null
null
null
open
Google maps DirectionsRenderer === I'm looking to change the marker icons of the google map, while creating a path using DirectionsRenderer. Trying to do that, i followed following steps. - created two icons for the start point and the end point. - in rendererOptions set suppressMarkers: false - then placed those two marker to the start point and the end point of the path So now I have my customary created icons at the two ends. But my requirement is these markers should be draggable. so i set the **draggable: true** and now its working fine. But now my problem is while dragging the icon, the path should be changed dynamically, which should be similar to that of https://google-developers.appspot.com/maps/documentation/javascript/examples/directions-draggable I tried to do this by adding listeners to those two markers : "drag" event - and while dragging a marker, draw the path at the same time. But the result I'm getting is not similar to the "directions-draggable" example. In facts, although i can render paths, previously drawn paths still exist on the map. But clearing all the paths exist on the map and then re-draw all is not my requirement. So is there a way to get the same result/effect like the "directions-draggable" while changing the marker icons. thanks in advance...
0
11,372,964
07/07/2012 06:55:06
266,003
02/04/2010 08:30:38
177
3
C# - capture the webcam and adding the frames
I looked for frequently and didn't find any example I needed. What I need is to capture webcam video and change it by adding my own frames (in other words, overlay images) using C# and frame for it. Any suggestions?
c#
webcam
null
null
null
null
open
C# - capture the webcam and adding the frames === I looked for frequently and didn't find any example I needed. What I need is to capture webcam video and change it by adding my own frames (in other words, overlay images) using C# and frame for it. Any suggestions?
0
11,372,965
07/07/2012 06:55:08
1,508,367
07/07/2012 06:44:00
1
0
Preloader while generating PDF using response object
I am generating the PDF using the response object. code is actually render the html to the pdf. PDF generattion time is not fix so i want to show the preloader process (processing/loading) during this time using Ajax. When i start the pdf generation process on button click then it will start the preloader process but after the completion of pdf getting generated the preloader process is not getting stopped. and suppose i want to clear the data of the textboxes on the page then that also not getting cleared. so what i need to do in this problem. Here is code... Dim Response As System.Web.HttpResponse = System.Web.HttpContext.Current.Response Response.Clear() Response.ClearHeaders() Response.ClearContent() Response.ContentType = "application/pdf" Response.AppendHeader("Content-Disposition", "attachment; filename=" + Me.txtReportSetPDFName.Text.Replace(" ", "_") + ".pdf") Response.AppendHeader("Content-Length", FileLen(sFilePath).ToString) Response.WriteFile(sFilePath)
asp.net
ajax
pdf-generation
response
preloader
null
open
Preloader while generating PDF using response object === I am generating the PDF using the response object. code is actually render the html to the pdf. PDF generattion time is not fix so i want to show the preloader process (processing/loading) during this time using Ajax. When i start the pdf generation process on button click then it will start the preloader process but after the completion of pdf getting generated the preloader process is not getting stopped. and suppose i want to clear the data of the textboxes on the page then that also not getting cleared. so what i need to do in this problem. Here is code... Dim Response As System.Web.HttpResponse = System.Web.HttpContext.Current.Response Response.Clear() Response.ClearHeaders() Response.ClearContent() Response.ContentType = "application/pdf" Response.AppendHeader("Content-Disposition", "attachment; filename=" + Me.txtReportSetPDFName.Text.Replace(" ", "_") + ".pdf") Response.AppendHeader("Content-Length", FileLen(sFilePath).ToString) Response.WriteFile(sFilePath)
0
11,372,966
07/07/2012 06:55:18
1,426,295
05/30/2012 14:37:26
13
0
Jboss starting a new session at every jsp page and servlet
I have developed a simple web application where I start a new session after login just by using `request.getSession.invalidate()` . Then I intend to use the new session after login till the logout (where I invalidate the session). Further more in order to avoid CSRF attacks I generate a random number and store it in the session as well as request. In the servlet which receives the subsequent request I try to match the random number stored in the session with that which is coming from request. Now two questions: 1) Is this the right approach to prevent a CSRF attack .Please point if there are any vulnerabilities still lurking or some pitfalls present. 2) I use JBoss version 5 to deploy the project . The problem is that this server starts up a new session everytime it reaches to a servlet which I verifies using (`request.getSession.isNew()` which returns true at each servlet.). I there some settings in jBoss which can prevent this from happening? Please do point me to any identical questions in this forum.
web-security
jboss5.x
csrf
csrf-protection
null
null
open
Jboss starting a new session at every jsp page and servlet === I have developed a simple web application where I start a new session after login just by using `request.getSession.invalidate()` . Then I intend to use the new session after login till the logout (where I invalidate the session). Further more in order to avoid CSRF attacks I generate a random number and store it in the session as well as request. In the servlet which receives the subsequent request I try to match the random number stored in the session with that which is coming from request. Now two questions: 1) Is this the right approach to prevent a CSRF attack .Please point if there are any vulnerabilities still lurking or some pitfalls present. 2) I use JBoss version 5 to deploy the project . The problem is that this server starts up a new session everytime it reaches to a servlet which I verifies using (`request.getSession.isNew()` which returns true at each servlet.). I there some settings in jBoss which can prevent this from happening? Please do point me to any identical questions in this forum.
0
11,372,968
07/07/2012 06:55:28
1,195,046
02/07/2012 15:44:11
11
0
get weather forecast and nearby airport and railway stations
<br/> I am working on a web project and i need to display some information on webpage regarding weather forecast and nearby airport or railway station for give set of longitude and latitude can any one tell me anything about that. Is there any web service or google map api for that. Thank You<br/> Gourav
api
service
web
null
null
07/28/2012 09:53:07
off topic
get weather forecast and nearby airport and railway stations === <br/> I am working on a web project and i need to display some information on webpage regarding weather forecast and nearby airport or railway station for give set of longitude and latitude can any one tell me anything about that. Is there any web service or google map api for that. Thank You<br/> Gourav
2
11,372,958
07/07/2012 06:53:59
1,132,871
12/26/2011 11:36:15
451
15
Reading frame from raw video fails on OpenCV 2.4.2
I have a problem with reading frames from the CIF file (see [here](http://stackoverflow.com/questions/11369271/reading-frames-from-cif-video-in-opencv-2-4-2)). I have found that I can to convert the CIF file to the raw video format using `ffmpeg`: ffmpeg -s cif -i ./infile.cif -vcodec rawvideo ./outfile.avi But unfortunately I am facing another one issue - the following part of code raises exception: cv::VideoCapture cap("outfile.avi"); if(!cap.isOpened()) { std::cout << "Open file error" << std::endl; return -1; // check if we succeeded } cv::Mat frame; cap >> frame; <------ exception raised here What can cause this issue and how can it be solved?
c++
opencv
ffmpeg
avi
null
null
open
Reading frame from raw video fails on OpenCV 2.4.2 === I have a problem with reading frames from the CIF file (see [here](http://stackoverflow.com/questions/11369271/reading-frames-from-cif-video-in-opencv-2-4-2)). I have found that I can to convert the CIF file to the raw video format using `ffmpeg`: ffmpeg -s cif -i ./infile.cif -vcodec rawvideo ./outfile.avi But unfortunately I am facing another one issue - the following part of code raises exception: cv::VideoCapture cap("outfile.avi"); if(!cap.isOpened()) { std::cout << "Open file error" << std::endl; return -1; // check if we succeeded } cv::Mat frame; cap >> frame; <------ exception raised here What can cause this issue and how can it be solved?
0
11,372,969
07/07/2012 06:55:41
1,508,372
07/07/2012 06:52:32
1
0
C# textbox keydown triggered twice in metro applications
I m working on C# and XAML for metro applications. I have a textbox and I want that once enter is pressed in that textbox a new textbox appears. But instead of just one textbox, I m getting two textboxes. I did debugging also n realized that its triggerd twice. Not able to figure out why it is triggerd twice. here is some code of my application private void TextBox_KeyDown_1(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Enter) { //code for producing textbox } } when i m debugging, once the above block is executed, it going to LayoutAwarePage.cs and the control is sent to ths code snippet private void CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher sender, AcceleratorKeyEventArgs args) { var virtualKey = args.VirtualKey; if ((args.EventType == CoreAcceleratorKeyEventType.SystemKeyDown || args.EventType == CoreAcceleratorKeyEventType.KeyDown) && (virtualKey == VirtualKey.Left || virtualKey == VirtualKey.Right || (int)virtualKey == 166 || (int)virtualKey == 167)) { var coreWindow = Window.Current.CoreWindow; var downState = CoreVirtualKeyStates.Down; bool menuKey = (coreWindow.GetKeyState(VirtualKey.Menu) & downState) == downState; bool controlKey = (coreWindow.GetKeyState(VirtualKey.Control) & downState) == downState; bool shiftKey = (coreWindow.GetKeyState(VirtualKey.Shift) & downState) == downState; bool noModifiers = !menuKey && !controlKey && !shiftKey; bool onlyAlt = menuKey && !controlKey && !shiftKey; if (((int)virtualKey == 166 && noModifiers) || (virtualKey == VirtualKey.Left && onlyAlt)) { // When the previous key or Alt+Left are pressed navigate back args.Handled = true; this.GoBack(this, new RoutedEventArgs()); } else if (((int)virtualKey == 167 && noModifiers) || (virtualKey == VirtualKey.Right && onlyAlt)) { // When the next key or Alt+Right are pressed navigate forward args.Handled = true; this.GoForward(this, new RoutedEventArgs()); } } } once ths code block is done, the control is sent back to the function TextBox_KeyDown_1. I m nt able to understand why on the first place control is sent to layoutawarepage.cs . This code was generated when i added SplitPage in my project.
xaml
application
microsoft-metro
null
null
null
open
C# textbox keydown triggered twice in metro applications === I m working on C# and XAML for metro applications. I have a textbox and I want that once enter is pressed in that textbox a new textbox appears. But instead of just one textbox, I m getting two textboxes. I did debugging also n realized that its triggerd twice. Not able to figure out why it is triggerd twice. here is some code of my application private void TextBox_KeyDown_1(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Enter) { //code for producing textbox } } when i m debugging, once the above block is executed, it going to LayoutAwarePage.cs and the control is sent to ths code snippet private void CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher sender, AcceleratorKeyEventArgs args) { var virtualKey = args.VirtualKey; if ((args.EventType == CoreAcceleratorKeyEventType.SystemKeyDown || args.EventType == CoreAcceleratorKeyEventType.KeyDown) && (virtualKey == VirtualKey.Left || virtualKey == VirtualKey.Right || (int)virtualKey == 166 || (int)virtualKey == 167)) { var coreWindow = Window.Current.CoreWindow; var downState = CoreVirtualKeyStates.Down; bool menuKey = (coreWindow.GetKeyState(VirtualKey.Menu) & downState) == downState; bool controlKey = (coreWindow.GetKeyState(VirtualKey.Control) & downState) == downState; bool shiftKey = (coreWindow.GetKeyState(VirtualKey.Shift) & downState) == downState; bool noModifiers = !menuKey && !controlKey && !shiftKey; bool onlyAlt = menuKey && !controlKey && !shiftKey; if (((int)virtualKey == 166 && noModifiers) || (virtualKey == VirtualKey.Left && onlyAlt)) { // When the previous key or Alt+Left are pressed navigate back args.Handled = true; this.GoBack(this, new RoutedEventArgs()); } else if (((int)virtualKey == 167 && noModifiers) || (virtualKey == VirtualKey.Right && onlyAlt)) { // When the next key or Alt+Right are pressed navigate forward args.Handled = true; this.GoForward(this, new RoutedEventArgs()); } } } once ths code block is done, the control is sent back to the function TextBox_KeyDown_1. I m nt able to understand why on the first place control is sent to layoutawarepage.cs . This code was generated when i added SplitPage in my project.
0
11,713,675
07/29/2012 22:53:54
705,725
04/13/2011 09:40:45
559
5
How to deal with a large amount of logs and redis?
Say I have about 150 requests coming in every second to an api (node.js) which are then logged in Redis. At that rate, the moderately priced [RedisToGo][1] instance will fill up every hour or so. The logs are only necessary to generate daily\monthly\annual statistics: which was the top requested keyword, which was the top requested url, total number of requests daily, etc. No super heavy calculations, but a somewhat time-consuming run through arrays to see which is the most frequent element in each. If I analyze and then dump this data (with a setInterval function in node maybe?), say, every 30 minutes, it doesn't seem like such a big deal. But what if all of sudden I have to deal with, say, 2500 requests per second? All of a sudden I'm dealing with 4.5 ~Gb of data per hour. About 2.25Gb every 30 minutes. Even with how fast redis\node are, it'd still take a minute to calculate the most frequent requests. Questions: What will happen to the redis instance while 2.25 gb worth of dada is being processed? (from a list, I imagine) Is there a better way to deal with potentially large amounts of log data than moving it to redis and then flushing it out periodically? [1]: https://addons.heroku.com/redistogo
performance
logging
data
heroku
redis
null
open
How to deal with a large amount of logs and redis? === Say I have about 150 requests coming in every second to an api (node.js) which are then logged in Redis. At that rate, the moderately priced [RedisToGo][1] instance will fill up every hour or so. The logs are only necessary to generate daily\monthly\annual statistics: which was the top requested keyword, which was the top requested url, total number of requests daily, etc. No super heavy calculations, but a somewhat time-consuming run through arrays to see which is the most frequent element in each. If I analyze and then dump this data (with a setInterval function in node maybe?), say, every 30 minutes, it doesn't seem like such a big deal. But what if all of sudden I have to deal with, say, 2500 requests per second? All of a sudden I'm dealing with 4.5 ~Gb of data per hour. About 2.25Gb every 30 minutes. Even with how fast redis\node are, it'd still take a minute to calculate the most frequent requests. Questions: What will happen to the redis instance while 2.25 gb worth of dada is being processed? (from a list, I imagine) Is there a better way to deal with potentially large amounts of log data than moving it to redis and then flushing it out periodically? [1]: https://addons.heroku.com/redistogo
0
11,713,676
07/29/2012 22:54:08
485,406
10/24/2010 02:10:28
1,556
78
Inline navigation with hashbang pages
In the past, I used to rely on hash for inline navigation, for example: http://url?Category=a&item=3#Paragrah1 (Pointing to Paragraph1 within the `http://url?Category=a&item=3` page) With the widespread use of ajax, the hash tag has switched to a different purpose, allowing page refresh without full page reload. For example: http://url#!Category=a&item=3 http://url#!Category=a&item=4 (the page switches to item 4, no full page reload) My question: how can I make inline navigation work in such pages? To take the above example, how can I point to Paragraph1 in the `http://url#!Category=a&item=4` page?
url
hash
hashbang
null
null
null
open
Inline navigation with hashbang pages === In the past, I used to rely on hash for inline navigation, for example: http://url?Category=a&item=3#Paragrah1 (Pointing to Paragraph1 within the `http://url?Category=a&item=3` page) With the widespread use of ajax, the hash tag has switched to a different purpose, allowing page refresh without full page reload. For example: http://url#!Category=a&item=3 http://url#!Category=a&item=4 (the page switches to item 4, no full page reload) My question: how can I make inline navigation work in such pages? To take the above example, how can I point to Paragraph1 in the `http://url#!Category=a&item=4` page?
0
11,713,677
07/29/2012 22:54:11
164,506
08/27/2009 21:01:57
1,855
45
AngularJS - Can you reference a repeater variable in a block of javascript?
Simply put, I'm using AngularJS trying to do something like this: <ul> <li ng-repeat="thing in things"> <a href="link{{thing.Id}}">Click</a> <script type="text/javascript"> alert("Id: " + {{thing.Id}}); </script> </li> </ul> Both that, and alert("Id: " + thing.Id); yield errors (unespected token '{' and 'thing' is not defined, respectively). Is there a way that I can access that Id from a block of javascript within the repeater's scope?
javascript
angulerjs
null
null
null
null
open
AngularJS - Can you reference a repeater variable in a block of javascript? === Simply put, I'm using AngularJS trying to do something like this: <ul> <li ng-repeat="thing in things"> <a href="link{{thing.Id}}">Click</a> <script type="text/javascript"> alert("Id: " + {{thing.Id}}); </script> </li> </ul> Both that, and alert("Id: " + thing.Id); yield errors (unespected token '{' and 'thing' is not defined, respectively). Is there a way that I can access that Id from a block of javascript within the repeater's scope?
0
11,713,682
07/29/2012 22:56:01
1,311,390
04/03/2012 20:44:44
1,388
5
A Unified Theory of Keyboard Expert Interfaces (i.e. VIM/Emacs)
## Problem: I'm designing a new piece of software, designed for technical experts (i.e. programmers to use). The goal is not to be as user friendly as possible; the goal is to make experts as efficient as possible. ## Question: There's much research done on UI / Design, but most of it focuses on GUI. Are there any interesting resources (besides the way VIM/Emacs has evolved) designed to making user interfaces optimized for expert use? Thanks!
vim
emacs
cli
null
null
07/30/2012 03:21:45
not constructive
A Unified Theory of Keyboard Expert Interfaces (i.e. VIM/Emacs) === ## Problem: I'm designing a new piece of software, designed for technical experts (i.e. programmers to use). The goal is not to be as user friendly as possible; the goal is to make experts as efficient as possible. ## Question: There's much research done on UI / Design, but most of it focuses on GUI. Are there any interesting resources (besides the way VIM/Emacs has evolved) designed to making user interfaces optimized for expert use? Thanks!
4
11,713,668
07/29/2012 22:52:08
1,544,890
07/23/2012 03:51:52
6
0
Update a component of parent jsf page
I have a main jsf page, it contains a link to a popup window. I want to update a component of the main jsf page. when i close the popup window. popup.xhtml: <h:commandButton value="close" onclick="return window.close();" action="showDevoir.xhtml"> <f:ajax execute="@form" render=":devoirForm" /> </h:commandButton> main.xhtml <form id="devoirForm" > <p:panel id="devoir" /> </form> When i close the popup, i want to update the panel component of the form with id="devoirForm"
jsf-2.0
null
null
null
null
null
open
Update a component of parent jsf page === I have a main jsf page, it contains a link to a popup window. I want to update a component of the main jsf page. when i close the popup window. popup.xhtml: <h:commandButton value="close" onclick="return window.close();" action="showDevoir.xhtml"> <f:ajax execute="@form" render=":devoirForm" /> </h:commandButton> main.xhtml <form id="devoirForm" > <p:panel id="devoir" /> </form> When i close the popup, i want to update the panel component of the form with id="devoirForm"
0
11,713,686
07/29/2012 22:56:28
1,551,227
07/25/2012 10:00:18
8
0
forge.facebook.authorize not redirecting for website
I have a trigger.io app working fine using facebook authentication on Android and iPhone, however, when I publish it locally for web via Chrome clicking on the "Connect to facebook" button does not call the forge.facebook.authorize function. There is no output of it failing either. Help? forge.logging.info("Facebook pressed!"); forge.facebook.authorize(['email', 'user_birthday', 'user_about_me'], function () { forge.logging.info("Facebook success"); forge.facebook.api('/me', function (response) { FBLoginOrCreateAccount(response); }, function () { forge.logging.info("facebook graph call failed."); $(".loading").hide(); }); }, function (e) { forge.logging.info("facebook failed: " + JSON.stringify(e)); $(".loading").hide(); });
facebook
trigger.io
forge
null
null
null
open
forge.facebook.authorize not redirecting for website === I have a trigger.io app working fine using facebook authentication on Android and iPhone, however, when I publish it locally for web via Chrome clicking on the "Connect to facebook" button does not call the forge.facebook.authorize function. There is no output of it failing either. Help? forge.logging.info("Facebook pressed!"); forge.facebook.authorize(['email', 'user_birthday', 'user_about_me'], function () { forge.logging.info("Facebook success"); forge.facebook.api('/me', function (response) { FBLoginOrCreateAccount(response); }, function () { forge.logging.info("facebook graph call failed."); $(".loading").hide(); }); }, function (e) { forge.logging.info("facebook failed: " + JSON.stringify(e)); $(".loading").hide(); });
0
11,713,690
07/29/2012 22:57:16
1,490,558
06/29/2012 07:26:58
1
0
Modal session requires modal window
I'm trying to open a window like a sheet so that it appears down below the toolbar. I've used the O'Reilly tutorial to do this. However, I can get past this error: Modal session requires modal window. The window loads as a window if I have "Visible At Launch" checked. Whether it is checked or not I get the "Modal session requires modal window" error. I have a Window.xib, ProgressModal.xib. In the Window implementation file I use: -(IBAction)loadProgress:(id)sender{ [self progressStatus:progressWindow]; } - (void)progressStatus:(NSWindow *)window { [NSApp beginSheet: window modalForWindow: mainWindow modalDelegate: nil didEndSelector: nil contextInfo: nil]; [NSApp runModalForWindow: window]; [NSApp endSheet: window]; [window orderOut: self]; } - (IBAction)cancelProgressScrollView:(id)sender { [NSApp stopModal]; } I may have the ProgressModal.xib setup wrong. I have an NSObject in it that has "Window" as its class. All the connections are made through that. But again, it loads the window just won't load it as a modal. Any ideas?
cocoa
modal
null
null
null
null
open
Modal session requires modal window === I'm trying to open a window like a sheet so that it appears down below the toolbar. I've used the O'Reilly tutorial to do this. However, I can get past this error: Modal session requires modal window. The window loads as a window if I have "Visible At Launch" checked. Whether it is checked or not I get the "Modal session requires modal window" error. I have a Window.xib, ProgressModal.xib. In the Window implementation file I use: -(IBAction)loadProgress:(id)sender{ [self progressStatus:progressWindow]; } - (void)progressStatus:(NSWindow *)window { [NSApp beginSheet: window modalForWindow: mainWindow modalDelegate: nil didEndSelector: nil contextInfo: nil]; [NSApp runModalForWindow: window]; [NSApp endSheet: window]; [window orderOut: self]; } - (IBAction)cancelProgressScrollView:(id)sender { [NSApp stopModal]; } I may have the ProgressModal.xib setup wrong. I have an NSObject in it that has "Window" as its class. All the connections are made through that. But again, it loads the window just won't load it as a modal. Any ideas?
0
11,470,935
07/13/2012 12:53:55
822,580
06/30/2011 07:49:40
133
28
Is their any tool/site that converts css for IE compatible?
My site works fine for all browsers but for IE it disturbs boards and many effects. So is their any website/tool that converts the css for IE compatible?
css
plugins
null
null
null
07/13/2012 13:55:22
not a real question
Is their any tool/site that converts css for IE compatible? === My site works fine for all browsers but for IE it disturbs boards and many effects. So is their any website/tool that converts the css for IE compatible?
1
11,471,467
07/13/2012 13:28:20
1,523,572
07/13/2012 12:44:50
1
0
magento - overriding adminhtml block template in community pool
Is it possible to override template located here **/app/design/adminhtml/default/default/template/ (e.g. /app/design/adminhtml/default/default/template/customer/edit/js.phtml)** by creating a new module **in community pool**? So the thing is that I **don't want** to override it by placing the file (or anything) in local pool. Is it possible to do that by extending of appropriate block class or something like that? I've created the same file in **/app/design/adminhtml/default/my_directory/template/** and extended **Mage_Adminhtml_Block_Customer_Edit** class in **/app/code/community/MyCompany/MyModule/Block/Adminhtml/Customer/Edit.php** and don't have an idea of how to solve this.
templates
magento
override
block
adminhtml
null
open
magento - overriding adminhtml block template in community pool === Is it possible to override template located here **/app/design/adminhtml/default/default/template/ (e.g. /app/design/adminhtml/default/default/template/customer/edit/js.phtml)** by creating a new module **in community pool**? So the thing is that I **don't want** to override it by placing the file (or anything) in local pool. Is it possible to do that by extending of appropriate block class or something like that? I've created the same file in **/app/design/adminhtml/default/my_directory/template/** and extended **Mage_Adminhtml_Block_Customer_Edit** class in **/app/code/community/MyCompany/MyModule/Block/Adminhtml/Customer/Edit.php** and don't have an idea of how to solve this.
0
11,471,469
07/13/2012 13:28:24
1,523,661
07/13/2012 13:23:14
1
0
Average spinning animation time of a UIPickerView
What is the average spinning animation time of a UIPickerView when we select a certain value in a specific component of a UIPicker?? Moreover I am facing a problem that I am setting some values in all components of a UIPicker view in a loop. So some times the last value I set in it is displayed and some times not. I think by the time picker select a value in its component if its selection delegate is agin called it never act upon it thats why it some times dont display the last value I set in it....Is it true????Plz help
objective-c
xcode
uipickerview
uipicker
null
null
open
Average spinning animation time of a UIPickerView === What is the average spinning animation time of a UIPickerView when we select a certain value in a specific component of a UIPicker?? Moreover I am facing a problem that I am setting some values in all components of a UIPicker view in a loop. So some times the last value I set in it is displayed and some times not. I think by the time picker select a value in its component if its selection delegate is agin called it never act upon it thats why it some times dont display the last value I set in it....Is it true????Plz help
0
11,471,470
07/13/2012 13:28:26
1,521,975
07/12/2012 20:29:59
8
0
validationEngine not submitting form using onValidationComplete
$(document).ready(function(){ jQuery("#bbSignup").validationEngine('attach', { onValidationComplete: function(form, status){ if ( status == "true" ) { $("#bbSignup").submit(); $("#bbSignup").hide(); $("#bbRegister").insertAfter("Form Submitted"); } else { } } }); }); Nothing happens if I fill out all of the forms and hit submit. Even pressing it multiple times does nothing. Any ideas?
jquery
jquery-validate
validationengine
null
null
null
open
validationEngine not submitting form using onValidationComplete === $(document).ready(function(){ jQuery("#bbSignup").validationEngine('attach', { onValidationComplete: function(form, status){ if ( status == "true" ) { $("#bbSignup").submit(); $("#bbSignup").hide(); $("#bbRegister").insertAfter("Form Submitted"); } else { } } }); }); Nothing happens if I fill out all of the forms and hit submit. Even pressing it multiple times does nothing. Any ideas?
0
11,455,978
07/12/2012 16:05:24
1,092,456
12/11/2011 16:59:37
395
17
Dynamics CRM 2011 Mocking
I have been setting up some unit tests for a service which surfaces Dynamics CRM 2011 data via the SDK and using Mocks to simulate the transactions. This works ok for most of the simple transactions, however, now I need to test a method which utilises the RetrieveAttributeRequest message from the SDK to retrieve OptionSetValue labels. To be able to Mock the returned object would require knowledge of exactly how this method is retrieving the attribute data, but I have not been able to find this information. 1) Is this the correct way to approach this problem, or are we left with an integration test as the main option. 2) If this is valid then which table is the data requested from? Thanks.
unit-testing
mocking
dynamics-crm
dynamics-crm-2011
crm
null
open
Dynamics CRM 2011 Mocking === I have been setting up some unit tests for a service which surfaces Dynamics CRM 2011 data via the SDK and using Mocks to simulate the transactions. This works ok for most of the simple transactions, however, now I need to test a method which utilises the RetrieveAttributeRequest message from the SDK to retrieve OptionSetValue labels. To be able to Mock the returned object would require knowledge of exactly how this method is retrieving the attribute data, but I have not been able to find this information. 1) Is this the correct way to approach this problem, or are we left with an integration test as the main option. 2) If this is valid then which table is the data requested from? Thanks.
0
11,471,801
07/13/2012 13:48:25
613,114
02/11/2011 13:34:03
65
4
Java: swing worker thread synchronization
In my application, I have one text field and a button. After focus lost from text field first swing worker (lets assume it as sw1) is called. Which opens a pop-up to populate value to put in text field. Second swing worker (lets assume it as sw2) is called after user clicks a button. Now the issue is that if I write something in text field and then click on button, sw1 is started first to calculate the value to put in text field and at the same time sw2 is also started. And sw2 finishes first and then sw1 populates result. What I want is sw2 should wait for sw1 to finish. Once sw1 finishes its task, it will notify sw2. I referred so many references over the internet and stackoverflow. [This](http://stackoverflow.com/questions/915873/scheduling-swingworker-threads) is the one which almost matches to my requirement. I tried to create a static final object inside class which starts sw1: public final static Object lockObject = new Object(); Then inside done() method of sw1, I have written code like: synchronized(lockObject) { sw1.notifyAll(); } Inside doInBackground() method, of the second class, on first line, I have written code like: synchronized(FirstClass.lockObject) { try { sw2.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } But I am getting java.lang.IllegalMonitorStateException, at java.lang.Object.notifyAll(Native Method). Can anybody tell me what is the issue and how to make it work the way I want. Thanks.
java
multithreading
synchronization
swingworker
null
null
open
Java: swing worker thread synchronization === In my application, I have one text field and a button. After focus lost from text field first swing worker (lets assume it as sw1) is called. Which opens a pop-up to populate value to put in text field. Second swing worker (lets assume it as sw2) is called after user clicks a button. Now the issue is that if I write something in text field and then click on button, sw1 is started first to calculate the value to put in text field and at the same time sw2 is also started. And sw2 finishes first and then sw1 populates result. What I want is sw2 should wait for sw1 to finish. Once sw1 finishes its task, it will notify sw2. I referred so many references over the internet and stackoverflow. [This](http://stackoverflow.com/questions/915873/scheduling-swingworker-threads) is the one which almost matches to my requirement. I tried to create a static final object inside class which starts sw1: public final static Object lockObject = new Object(); Then inside done() method of sw1, I have written code like: synchronized(lockObject) { sw1.notifyAll(); } Inside doInBackground() method, of the second class, on first line, I have written code like: synchronized(FirstClass.lockObject) { try { sw2.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } But I am getting java.lang.IllegalMonitorStateException, at java.lang.Object.notifyAll(Native Method). Can anybody tell me what is the issue and how to make it work the way I want. Thanks.
0
11,471,318
07/13/2012 13:18:54
472,084
10/11/2010 08:29:15
4,940
184
CakePHP showing blank page
I have a website that is finished and uploaded, at first it works fine but after a while it stops working. By stops working I mean whatever page I go to just shows a blank page, empty source. To fix this all I need to do is change debug to 2, refresh and then change it back to 0. I do not now what triggers this to happen, I have tried clearing the cache folders. Any ideas would be great. Thanks.
php
cakephp
cakephp-2.1
null
null
null
open
CakePHP showing blank page === I have a website that is finished and uploaded, at first it works fine but after a while it stops working. By stops working I mean whatever page I go to just shows a blank page, empty source. To fix this all I need to do is change debug to 2, refresh and then change it back to 0. I do not now what triggers this to happen, I have tried clearing the cache folders. Any ideas would be great. Thanks.
0
11,471,319
07/13/2012 13:19:06
1,233,873
02/26/2012 13:54:02
13
0
Spring JMS: How to add new listeners in Java to configured in app context listener-container
I've got the following Spring JMS client config: <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" p:brokerURL="tcp://10.20.1.1:9091" /> <bean id="messageHandler" class="my.package.MessageHandlerImpl"/> <bean id="jmsMessageListener" class="my.package.MessageListenerImpl"> <property name="messageHandler" ref="messageHandler"/> </bean> <jms:listener-container container-type="default" connection-factory="jmsConnectionFactory" acknowledge="auto" destination-type="topic"> <jms:listener destination="my.package.all" ref="jmsMessageListener"/> <jms:listener destination="my.package.1" ref="jmsMessageListener"/> </jms:listener-container> How can I add new destination listener to "listener-container" programmatically in my Java code depending on some circumstances.Thanks in advance!
spring
jms
activemq
spring-jms
null
null
open
Spring JMS: How to add new listeners in Java to configured in app context listener-container === I've got the following Spring JMS client config: <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" p:brokerURL="tcp://10.20.1.1:9091" /> <bean id="messageHandler" class="my.package.MessageHandlerImpl"/> <bean id="jmsMessageListener" class="my.package.MessageListenerImpl"> <property name="messageHandler" ref="messageHandler"/> </bean> <jms:listener-container container-type="default" connection-factory="jmsConnectionFactory" acknowledge="auto" destination-type="topic"> <jms:listener destination="my.package.all" ref="jmsMessageListener"/> <jms:listener destination="my.package.1" ref="jmsMessageListener"/> </jms:listener-container> How can I add new destination listener to "listener-container" programmatically in my Java code depending on some circumstances.Thanks in advance!
0
11,471,816
07/13/2012 13:49:08
505,726
11/12/2010 12:21:29
564
24
Zend Framework autoloader in Doctrine 2 repositories
I use Zend Framework and Doctrine 2 in my project. Everything works fine except, that autoloader doesn't load Zend classes from Doctrine repositories. Here is my bootstrap part for Zend autoloader: /** * Register namespace Default_ * @return Zend_Application_Module_Autoloader */ protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Default_', 'basePath' => dirname(__FILE__), )); return $autoloader; } Here is my bootstrap part for Doctrine initialization: /** * Initialize Doctrine * @return Doctrine_Manager */ public function _initDoctrine() { // include and register Doctrine's class loader require_once('Doctrine/Common/ClassLoader.php'); $classLoader = new \Doctrine\Common\ClassLoader( 'Doctrine', APPLICATION_PATH . '/../library/' ); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader( 'Repositories', APPLICATION_PATH . '/../library/Model' ); $classLoader->register(); // create the Doctrine configuration $config = new \Doctrine\ORM\Configuration(); // setting the cache ( to ArrayCache. Take a look at // the Doctrine manual for different options ! ) $cache = new \Doctrine\Common\Cache\ApcCache; $config->setMetadataCacheImpl($cache); $config->setQueryCacheImpl($cache); // choosing the driver for our database schema // we'll use annotations $driver = $config->newDefaultAnnotationDriver( APPLICATION_PATH . '/../library/Model' ); $config->setMetadataDriverImpl($driver); // set the proxy dir and set some options $config->setProxyDir(APPLICATION_PATH . '/../library/Model/Proxies'); $config->setAutoGenerateProxyClasses(true); $config->setProxyNamespace('Model\Proxies'); // now create the entity manager and use the connection // settings we defined in our application.ini $connectionSettings = $this->getOption('doctrine'); $conn = array( 'driver' => $connectionSettings['conn']['driv'], 'user' => $connectionSettings['conn']['user'], 'password' => $connectionSettings['conn']['pass'], 'dbname' => $connectionSettings['conn']['dbname'], 'host' => $connectionSettings['conn']['host'] ); $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config); // push the entity manager into our registry for later use $registry = Zend_Registry::getInstance(); $registry->entitymanager = $entityManager; return $entityManager; } How could i fix this?
zend-framework
doctrine2
null
null
null
null
open
Zend Framework autoloader in Doctrine 2 repositories === I use Zend Framework and Doctrine 2 in my project. Everything works fine except, that autoloader doesn't load Zend classes from Doctrine repositories. Here is my bootstrap part for Zend autoloader: /** * Register namespace Default_ * @return Zend_Application_Module_Autoloader */ protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Default_', 'basePath' => dirname(__FILE__), )); return $autoloader; } Here is my bootstrap part for Doctrine initialization: /** * Initialize Doctrine * @return Doctrine_Manager */ public function _initDoctrine() { // include and register Doctrine's class loader require_once('Doctrine/Common/ClassLoader.php'); $classLoader = new \Doctrine\Common\ClassLoader( 'Doctrine', APPLICATION_PATH . '/../library/' ); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader( 'Repositories', APPLICATION_PATH . '/../library/Model' ); $classLoader->register(); // create the Doctrine configuration $config = new \Doctrine\ORM\Configuration(); // setting the cache ( to ArrayCache. Take a look at // the Doctrine manual for different options ! ) $cache = new \Doctrine\Common\Cache\ApcCache; $config->setMetadataCacheImpl($cache); $config->setQueryCacheImpl($cache); // choosing the driver for our database schema // we'll use annotations $driver = $config->newDefaultAnnotationDriver( APPLICATION_PATH . '/../library/Model' ); $config->setMetadataDriverImpl($driver); // set the proxy dir and set some options $config->setProxyDir(APPLICATION_PATH . '/../library/Model/Proxies'); $config->setAutoGenerateProxyClasses(true); $config->setProxyNamespace('Model\Proxies'); // now create the entity manager and use the connection // settings we defined in our application.ini $connectionSettings = $this->getOption('doctrine'); $conn = array( 'driver' => $connectionSettings['conn']['driv'], 'user' => $connectionSettings['conn']['user'], 'password' => $connectionSettings['conn']['pass'], 'dbname' => $connectionSettings['conn']['dbname'], 'host' => $connectionSettings['conn']['host'] ); $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config); // push the entity manager into our registry for later use $registry = Zend_Registry::getInstance(); $registry->entitymanager = $entityManager; return $entityManager; } How could i fix this?
0
11,401,308
07/09/2012 18:56:48
985,737
10/08/2011 19:45:26
1
0
Would a physical keyboard present a inputAccessoryView from appearing?
I've added an inputAccessoryView to the iOS keyboard for certain UITextFields in my app. This accessory view provides essential functionality to the user (some buttons that are displayed nowhere else in my app). My understanding (which could be completely wrong) is that if a physical (bluetooth) keyboard is available iOS will not clutter the screen with the software keyboard. If that's the case, users of my app with a physical keyboard will be missing some functionality and I'll need to account for that. So the first question is, is that something I have to worry about? Thanks.
ios
null
null
null
null
null
open
Would a physical keyboard present a inputAccessoryView from appearing? === I've added an inputAccessoryView to the iOS keyboard for certain UITextFields in my app. This accessory view provides essential functionality to the user (some buttons that are displayed nowhere else in my app). My understanding (which could be completely wrong) is that if a physical (bluetooth) keyboard is available iOS will not clutter the screen with the software keyboard. If that's the case, users of my app with a physical keyboard will be missing some functionality and I'll need to account for that. So the first question is, is that something I have to worry about? Thanks.
0
11,401,309
07/09/2012 18:56:50
1,221,941
02/20/2012 20:16:36
176
10
Properly subclassing the EKEvent Class
I have been having a bit of trouble sublclassing the EKEvent Class. The scenario is this, I am pulling all my events from an external database using a webservice, so all the events come with an ID. I then want to put these events into the device calendar and retrieve them later. The problem is, when I retrieve the event I need it to have the same id as the event on the server so I can do a quick look up to get additional info on the event. I am aware that the identifier property of EKEvent is read only, hence the reason I want to create a subclass of the class where I can add an additional property called something like myid and store the id of the event (the one from the server) with it in the eventstore. I have tried to create a subclass and everything seems to work fine and compiles, but on runtime I get an error when I try to set the extra eventid proporty that I add in the subclass, the error message is: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[EKEvent setEventId:]: unrecognized selector sent to instance 0x83c0770' This is some test code I use to create the event from my EKEvent subclass: SectureEvent *myEvent = (SectureEvent*)[EKEvent eventWithEventStore:eventDB]; myEvent.title = self.evento; myEvent.startDate =[[NSDate alloc] init]; myEvent.startDate=[NSDate date]; myEvent.endDate = [[NSDate alloc] init]; myEvent.endDate = [[NSDate alloc]init]; myEvent.allDay = YES; myEvent.eventId = self.eventId; The error occurs on the last line ` myEvent.eventId = self.eventId;` and app crashes. So my question essentailly if I can effectively subclass the EKEvent class and if so what am I doing wrong here? Thanks in advance!
iphone
objective-c
ios
ios4
null
null
open
Properly subclassing the EKEvent Class === I have been having a bit of trouble sublclassing the EKEvent Class. The scenario is this, I am pulling all my events from an external database using a webservice, so all the events come with an ID. I then want to put these events into the device calendar and retrieve them later. The problem is, when I retrieve the event I need it to have the same id as the event on the server so I can do a quick look up to get additional info on the event. I am aware that the identifier property of EKEvent is read only, hence the reason I want to create a subclass of the class where I can add an additional property called something like myid and store the id of the event (the one from the server) with it in the eventstore. I have tried to create a subclass and everything seems to work fine and compiles, but on runtime I get an error when I try to set the extra eventid proporty that I add in the subclass, the error message is: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[EKEvent setEventId:]: unrecognized selector sent to instance 0x83c0770' This is some test code I use to create the event from my EKEvent subclass: SectureEvent *myEvent = (SectureEvent*)[EKEvent eventWithEventStore:eventDB]; myEvent.title = self.evento; myEvent.startDate =[[NSDate alloc] init]; myEvent.startDate=[NSDate date]; myEvent.endDate = [[NSDate alloc] init]; myEvent.endDate = [[NSDate alloc]init]; myEvent.allDay = YES; myEvent.eventId = self.eventId; The error occurs on the last line ` myEvent.eventId = self.eventId;` and app crashes. So my question essentailly if I can effectively subclass the EKEvent class and if so what am I doing wrong here? Thanks in advance!
0
11,401,310
07/09/2012 18:56:55
1,512,738
07/09/2012 17:51:48
1
0
What is the best url structure for SEO?
I am working on a new web site for used cars, lets say we have a page to display car details in this physical path (www.sitename.com/car-details.aspx) and its only needs a car-id parameter to grab car details in display. I installed an URL forwording system like this www.sitename.com/used/cars/{make-name}/{model-name}/{car-id}/{add-title} www.sitename.com/used/cars/skoda/octavia/123456/car-for-sell-in-a-good-condition my question is what is the best structure for my urls (and why please), I have some examples: <b>less depth</b> - > www.sitename.com/used-cars/{make-name}-{model-name}-{car-id}/{add-title} <b>with .html</b> - > www.sitename.com/used/cars/{make-name}/{model-name}/{car-id}/{add-title}.html <b>without add-title</b> - > www.sitename.com/used-cars/{make-name}-{model-name}-{car-id} <b>or somthing else..</b> note: all url parts can grab related data - for example www.sitename.com/used/cars/ - will forward to a page contains all used cars www.sitename.com/used/cars/{make-name}/ - will forward to a page contain all cars from this maker only etc.. for all url parts. Thanks
seo
null
null
null
null
null
open
What is the best url structure for SEO? === I am working on a new web site for used cars, lets say we have a page to display car details in this physical path (www.sitename.com/car-details.aspx) and its only needs a car-id parameter to grab car details in display. I installed an URL forwording system like this www.sitename.com/used/cars/{make-name}/{model-name}/{car-id}/{add-title} www.sitename.com/used/cars/skoda/octavia/123456/car-for-sell-in-a-good-condition my question is what is the best structure for my urls (and why please), I have some examples: <b>less depth</b> - > www.sitename.com/used-cars/{make-name}-{model-name}-{car-id}/{add-title} <b>with .html</b> - > www.sitename.com/used/cars/{make-name}/{model-name}/{car-id}/{add-title}.html <b>without add-title</b> - > www.sitename.com/used-cars/{make-name}-{model-name}-{car-id} <b>or somthing else..</b> note: all url parts can grab related data - for example www.sitename.com/used/cars/ - will forward to a page contains all used cars www.sitename.com/used/cars/{make-name}/ - will forward to a page contain all cars from this maker only etc.. for all url parts. Thanks
0
11,401,315
07/09/2012 18:57:02
859,317
07/23/2011 12:59:56
236
4
Deploy Play 2.0.2 to Heroku
I try to push my application to heroku. I followed the instructions at https://github.com/playframework/Play20/wiki/ProductionHeroku When I run git push heroku master it fails with the following message: > [error] {file:/tmp/build_21x20nx2i16sz/}projecttrunk/compile:sources: scala.tools.nsc.interactive.FreshRunReq [error] Total time: 48 s, completed Jul 9, 2012 6:46:55 PM I dont now where the issue is as the app is running fine on my machine. My procfile: > web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -DapplyEvolutions.default=true -Ddb.default.url=${DATABASE_URL} -Ddb.default.driver=org.postgresql.Driver Thanks for your help!
heroku
playframework
null
null
null
null
open
Deploy Play 2.0.2 to Heroku === I try to push my application to heroku. I followed the instructions at https://github.com/playframework/Play20/wiki/ProductionHeroku When I run git push heroku master it fails with the following message: > [error] {file:/tmp/build_21x20nx2i16sz/}projecttrunk/compile:sources: scala.tools.nsc.interactive.FreshRunReq [error] Total time: 48 s, completed Jul 9, 2012 6:46:55 PM I dont now where the issue is as the app is running fine on my machine. My procfile: > web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -DapplyEvolutions.default=true -Ddb.default.url=${DATABASE_URL} -Ddb.default.driver=org.postgresql.Driver Thanks for your help!
0
11,401,303
07/09/2012 18:56:23
107,236
05/14/2009 17:53:32
331
14
Infragistics webpercenteditor control is not being consistent.
**Here's a code that I have in two different web applications:** <ig:WebPercentEditor MaxValue="100" ID="InterchangePlus" runat="server" ValueText="0" MinDecimalPlaces="2" Width="85px"> </ig:WebPercentEditor> They both save the data to the same place and retrieve it from the same place. The control in one web application shows the information as 1.75%, the other shows it as 175.00%. Again, the same markup is used in both web applications.
asp.net
infragistics
null
null
null
null
open
Infragistics webpercenteditor control is not being consistent. === **Here's a code that I have in two different web applications:** <ig:WebPercentEditor MaxValue="100" ID="InterchangePlus" runat="server" ValueText="0" MinDecimalPlaces="2" Width="85px"> </ig:WebPercentEditor> They both save the data to the same place and retrieve it from the same place. The control in one web application shows the information as 1.75%, the other shows it as 175.00%. Again, the same markup is used in both web applications.
0
11,401,305
07/09/2012 18:56:38
792,971
06/10/2011 15:21:31
50
0
FTPS site set up
I am trying to set up FTPS site and use certificate authentication to authenticate request coming to the site. I have create one local user account and map one-to-one certificate mapping and gave appropraite previlage to the folder. and I send a request using Alex's ftp client as follows ftps -h devftp.mysite.com -port 21 -ssl All -sslClientCertPath TestCert.cer -l But I am getting an error "ERROR: Login with user first" I have already spent hours and hours trying to figure out what the problem is and almost giving up. Any help please?
ftp
null
null
null
null
null
open
FTPS site set up === I am trying to set up FTPS site and use certificate authentication to authenticate request coming to the site. I have create one local user account and map one-to-one certificate mapping and gave appropraite previlage to the folder. and I send a request using Alex's ftp client as follows ftps -h devftp.mysite.com -port 21 -ssl All -sslClientCertPath TestCert.cer -l But I am getting an error "ERROR: Login with user first" I have already spent hours and hours trying to figure out what the problem is and almost giving up. Any help please?
0
11,401,313
07/09/2012 18:57:01
702,948
04/11/2011 20:59:45
881
38
why does my notify() not wake a waiting thread?
I have a simple multithreaded algorithm designed to load a series of files in a background thread, and have a JPanel display the first image as soon as it is done loading. In the constructor of the JPanel, I start the loader, then wait on the list of images, as follows: //MyPanel.java public ArrayList<BufferedImage> images = new ArrayList<BufferedImage>(); int frame; public MyPanel(String dir){ Thread loader = new thread (new Loader(dir, this)); loader.start(); frame = 0; //miscellaneous stuff synchronized(images){ while (images.isEmpty()){ images.wait(); } } this.setPrefferedSize(new Dimension(800,800)); } @Override public void paintComponent(Graphics g){ super.paintComponent(g) g.drawImage(images.get(frame), 0, 0, 800, 800, null); } my Loader thread looks like this: //Loader.java String dir; MyPanel caller; public Loader(String dir, MyPanel caller){ this.dir = dir; this.caller = caller; } @Override public void run(){ File dirFile = new File(dir); File[] files = dirFile.listFiles(); Arrays.sort(files); for (File f : files) { try { synchronized (caller.images) { BufferedImage buffImage = ImageIO.read(f); caller.images.add(buffImage); caller.images.notifyAll(); } } catch (IOException e) { } } } I have verified that execution passes through `notifyAll()` several times (usually >20) before the calling thread wakes up and displays the image in the frame. I have also verified that the images object is in fact the same object as the one being waited on. I have attempted adding a `yield()`, but that did not help. why does the call to `notifyAll()` not wake the waiting thread immediately?
java
multithreading
null
null
null
null
open
why does my notify() not wake a waiting thread? === I have a simple multithreaded algorithm designed to load a series of files in a background thread, and have a JPanel display the first image as soon as it is done loading. In the constructor of the JPanel, I start the loader, then wait on the list of images, as follows: //MyPanel.java public ArrayList<BufferedImage> images = new ArrayList<BufferedImage>(); int frame; public MyPanel(String dir){ Thread loader = new thread (new Loader(dir, this)); loader.start(); frame = 0; //miscellaneous stuff synchronized(images){ while (images.isEmpty()){ images.wait(); } } this.setPrefferedSize(new Dimension(800,800)); } @Override public void paintComponent(Graphics g){ super.paintComponent(g) g.drawImage(images.get(frame), 0, 0, 800, 800, null); } my Loader thread looks like this: //Loader.java String dir; MyPanel caller; public Loader(String dir, MyPanel caller){ this.dir = dir; this.caller = caller; } @Override public void run(){ File dirFile = new File(dir); File[] files = dirFile.listFiles(); Arrays.sort(files); for (File f : files) { try { synchronized (caller.images) { BufferedImage buffImage = ImageIO.read(f); caller.images.add(buffImage); caller.images.notifyAll(); } } catch (IOException e) { } } } I have verified that execution passes through `notifyAll()` several times (usually >20) before the calling thread wakes up and displays the image in the frame. I have also verified that the images object is in fact the same object as the one being waited on. I have attempted adding a `yield()`, but that did not help. why does the call to `notifyAll()` not wake the waiting thread immediately?
0
11,401,327
07/09/2012 18:57:56
1,512,815
07/09/2012 18:27:36
1
0
SQL Update based on and Select Result From Same Table
I am going to do my best to clearly describe what I am trying to do. I am using a DBISAM SQL database. We sell t-shirts, and lots of different kinds. I am trying to update our product database with values from other products in the database. here is an sample: Products Table SKU Product LongDesc 01-S 01 Great Looking T-Shirt 01-M 01 01-L 01 02-S 01 02-M 01 Amazing Ladies T 02-L 01 03-32 03 Long t 03-34 03 03-36 03 I would like to write an update script that will update the **LongDesc** field on all **SKU**'s that don't have a **LongDesc** but I would like that to get there **LongDesc** from other **SKU**'s with the same **Product** IN THE END I WOULD LIKE THE TABLE TO LOOK LIKE THIS: SKU Product LongDesc 01-S 01 Great Looking T-Shirt 01-M 01 Great Looking T-Shirt 01-L 01 Great Looking T-Shirt 02-S 01 Amazing Ladies T 02-M 01 Amazing Ladies T 02-L 01 Amazing Ladies T 03-32 03 Long t 03-34 03 Long t 03-36 03 Long t Thanks in advance for your help!
sql
select
update
nested
dbisam
null
open
SQL Update based on and Select Result From Same Table === I am going to do my best to clearly describe what I am trying to do. I am using a DBISAM SQL database. We sell t-shirts, and lots of different kinds. I am trying to update our product database with values from other products in the database. here is an sample: Products Table SKU Product LongDesc 01-S 01 Great Looking T-Shirt 01-M 01 01-L 01 02-S 01 02-M 01 Amazing Ladies T 02-L 01 03-32 03 Long t 03-34 03 03-36 03 I would like to write an update script that will update the **LongDesc** field on all **SKU**'s that don't have a **LongDesc** but I would like that to get there **LongDesc** from other **SKU**'s with the same **Product** IN THE END I WOULD LIKE THE TABLE TO LOOK LIKE THIS: SKU Product LongDesc 01-S 01 Great Looking T-Shirt 01-M 01 Great Looking T-Shirt 01-L 01 Great Looking T-Shirt 02-S 01 Amazing Ladies T 02-M 01 Amazing Ladies T 02-L 01 Amazing Ladies T 03-32 03 Long t 03-34 03 Long t 03-36 03 Long t Thanks in advance for your help!
0
11,401,328
07/09/2012 18:57:59
1,182,434
02/01/2012 10:23:12
8
0
php curl upload speed very slow
I have issues with the upload speed from curl (php 5.3). On my development environment (laptop) the upload is very fast. But when I deploy it on the server, it is very slow. This is from the curl_getinfo() function on my laptop: [url] => http://mylaptop.com [content_type] => text/html; charset=ISO-8859-1 [http_code] => 200 [header_size] => 406 [request_size] => 559 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.203 [namelookup_time] => 0 [connect_time] => 0.031 [pretransfer_time] => 0.031 [size_upload] => 283 [size_download] => 15564 [speed_download] => 76669 [speed_upload] => 1394 [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 0.172 [redirect_time] => 0 [certinfo] => Array ( ) And this from server. It makes the total time for the curl > 5 secs. [url] => http://myserver.com [content_type] => text/html; charset=ISO-8859-1 [http_code] => 200 [header_size] => 403 [request_size] => 424 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 5.005475 [namelookup_time] => 0.014625 [connect_time] => 0.036776 [pretransfer_time] => 0.036777 [size_upload] => 164 [size_download] => 9690 [speed_download] => 1935 **[speed_upload] => 32** [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 0.125857 [redirect_time] => 0 [certinfo] => Array ( ) How is this possible? I have noticed a difference in curl versions (7.19.7 on server, 7.20.0 on laptop). Also I tested the server upload speed by downloading 10mb.bin (speed is fine). Thanks in advance for your replies.
php
curl
null
null
null
null
open
php curl upload speed very slow === I have issues with the upload speed from curl (php 5.3). On my development environment (laptop) the upload is very fast. But when I deploy it on the server, it is very slow. This is from the curl_getinfo() function on my laptop: [url] => http://mylaptop.com [content_type] => text/html; charset=ISO-8859-1 [http_code] => 200 [header_size] => 406 [request_size] => 559 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.203 [namelookup_time] => 0 [connect_time] => 0.031 [pretransfer_time] => 0.031 [size_upload] => 283 [size_download] => 15564 [speed_download] => 76669 [speed_upload] => 1394 [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 0.172 [redirect_time] => 0 [certinfo] => Array ( ) And this from server. It makes the total time for the curl > 5 secs. [url] => http://myserver.com [content_type] => text/html; charset=ISO-8859-1 [http_code] => 200 [header_size] => 403 [request_size] => 424 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 5.005475 [namelookup_time] => 0.014625 [connect_time] => 0.036776 [pretransfer_time] => 0.036777 [size_upload] => 164 [size_download] => 9690 [speed_download] => 1935 **[speed_upload] => 32** [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 0.125857 [redirect_time] => 0 [certinfo] => Array ( ) How is this possible? I have noticed a difference in curl versions (7.19.7 on server, 7.20.0 on laptop). Also I tested the server upload speed by downloading 10mb.bin (speed is fine). Thanks in advance for your replies.
0
11,401,329
07/09/2012 18:58:04
458,960
09/26/2010 21:45:36
2,131
32
CSS load animation on UIWebView
I have a very simple `CSS` opacity animation that animates some text in a `UIWebView` when the web view loads. It works great when the body of the HTML is small and quick to render, but for larger bodies, you'll find that the animation runs immediately when the content loads, but the `UIWebView` is not painted on to the view for another second or so, which means the user misses the animation completely. So my question is, rather than have the fade animation occur on load, I want it to occur when the web view is actually drawn on to my view, and I don't think there are any Objective-C delegate methods that are called when the web view is drawn, so I'm not sure if this can be done on the Objective-C side. Is there anyway I can call some Javascript (this way I can add the animation manually) immediately when the the web view is actually drawn on my device, rather than when `webViewDidload`?
javascript
css
ios
uiwebview
null
null
open
CSS load animation on UIWebView === I have a very simple `CSS` opacity animation that animates some text in a `UIWebView` when the web view loads. It works great when the body of the HTML is small and quick to render, but for larger bodies, you'll find that the animation runs immediately when the content loads, but the `UIWebView` is not painted on to the view for another second or so, which means the user misses the animation completely. So my question is, rather than have the fade animation occur on load, I want it to occur when the web view is actually drawn on to my view, and I don't think there are any Objective-C delegate methods that are called when the web view is drawn, so I'm not sure if this can be done on the Objective-C side. Is there anyway I can call some Javascript (this way I can add the animation manually) immediately when the the web view is actually drawn on my device, rather than when `webViewDidload`?
0
11,349,774
07/05/2012 17:50:58
213,901
11/18/2009 16:28:04
2,342
99
oracle.xml.parser.v2.XSLProcessor.processXSL overload seems to do nothing
I'm trying to chain multiple XSL transforms together using the Oracle [XSLProcessor][1]. The first transform runs fine. The second transform also appears to run, but does not change the output at all. This is the code I'm using for the first transform. private static XMLDocumentFragment Transform(InputStream xslt_stream, InputStream src_xml_stream) throws XSLException, MalformedURLException{ XSLProcessor proc = new XSLProcessor(); XSLStylesheet stylesheet = proc.newXSLStylesheet(xslt_stream); XMLDocumentFragment frag = proc.processXSL(stylesheet, src_xml_stream, null); return frag; } I take the output of that transform and pipe it into the second method. private static XMLDocumentFragment Transform(InputStream xslt_stream, XMLDocumentFragment src_frag) throws XSLException, MalformedURLException{ XSLProcessor proc = new XSLProcessor(); XSLStylesheet stylesheet = proc.newXSLStylesheet(xslt_stream); XMLDocumentFragment frag = proc.processXSL(stylesheet, src_frag); return frag; } Here is the flow. // get XSL input stream from ZD xslt_stream = getFromZD(conn, "SELECTFF", zd_xslt_chain_1); // first overload XMLDocumentFragment transformed = Transform(xslt_stream, xml_stream); if (zd_xslt_chain_2 != null){ // run second in transform chian xslt_stream = getFromZD(conn, "SELECTFF", zd_xslt_chain_2); // second overload transformed = Transform(xslt_stream, transformed); } Am I doing something obviously wrong and is there a better way to run an XSLT chain? Lets pretend like I have use Oracle's XSL processor, because I do. [1]: http://docs.oracle.com/cd/B28359_01/appdev.111/b28391/oracle/xml/parser/v2/XSLProcessor.html
java
oracle
xslt
null
null
null
open
oracle.xml.parser.v2.XSLProcessor.processXSL overload seems to do nothing === I'm trying to chain multiple XSL transforms together using the Oracle [XSLProcessor][1]. The first transform runs fine. The second transform also appears to run, but does not change the output at all. This is the code I'm using for the first transform. private static XMLDocumentFragment Transform(InputStream xslt_stream, InputStream src_xml_stream) throws XSLException, MalformedURLException{ XSLProcessor proc = new XSLProcessor(); XSLStylesheet stylesheet = proc.newXSLStylesheet(xslt_stream); XMLDocumentFragment frag = proc.processXSL(stylesheet, src_xml_stream, null); return frag; } I take the output of that transform and pipe it into the second method. private static XMLDocumentFragment Transform(InputStream xslt_stream, XMLDocumentFragment src_frag) throws XSLException, MalformedURLException{ XSLProcessor proc = new XSLProcessor(); XSLStylesheet stylesheet = proc.newXSLStylesheet(xslt_stream); XMLDocumentFragment frag = proc.processXSL(stylesheet, src_frag); return frag; } Here is the flow. // get XSL input stream from ZD xslt_stream = getFromZD(conn, "SELECTFF", zd_xslt_chain_1); // first overload XMLDocumentFragment transformed = Transform(xslt_stream, xml_stream); if (zd_xslt_chain_2 != null){ // run second in transform chian xslt_stream = getFromZD(conn, "SELECTFF", zd_xslt_chain_2); // second overload transformed = Transform(xslt_stream, transformed); } Am I doing something obviously wrong and is there a better way to run an XSLT chain? Lets pretend like I have use Oracle's XSL processor, because I do. [1]: http://docs.oracle.com/cd/B28359_01/appdev.111/b28391/oracle/xml/parser/v2/XSLProcessor.html
0
11,349,778
07/05/2012 17:51:14
1,380,918
05/08/2012 00:33:23
78
0
Bash: How to create a Bash listener to receive PHP requests?
I'm currently using an Apache server with PHP to listen for requests from another server. The server either loads a page with arguments (GET) or posts values to a page (POST) to trigger an event. I'm wondering if I could make a Bash listener to listen for requests instead of having a whole Apache server to listen. If this is possible, how would I do so? It would have to be able to execute other Bash scripts. My current method uses PHP's exec function, which I don't think is speed optimized.
bash
null
null
null
null
null
open
Bash: How to create a Bash listener to receive PHP requests? === I'm currently using an Apache server with PHP to listen for requests from another server. The server either loads a page with arguments (GET) or posts values to a page (POST) to trigger an event. I'm wondering if I could make a Bash listener to listen for requests instead of having a whole Apache server to listen. If this is possible, how would I do so? It would have to be able to execute other Bash scripts. My current method uses PHP's exec function, which I don't think is speed optimized.
0
11,349,779
07/05/2012 17:51:15
487,328
10/26/2010 08:03:15
596
14
jQuery selector for a checkbox that contains certain text in its name attribute
I'm trying to find a selector in jQuery that select all inputs that are checkboxes and their name contains a specific word like "top" or "Top". Having trouble b/c its selecting other checkboxes. Is it possible to use something like: $("input[name*='top'] type:checkbox").each etc? Top 1<input type="checkbox" name="Top1" /><br /> Top 2<input type="checkbox" name="Top2" /><br /> Top 3<input type="checkbox" name="Top3" /><br /> Top 4<input type="checkbox" name="Top4" /><br /> Bottom 1<input type="checkbox" name="Bottom1" /><br /> Bottom 2<input type="checkbox" name="Bottom1" /><br /> Bottom 3<input type="checkbox" name="Bottom1" /><br /> Bottom 4<input type="checkbox" name="Bottom1" /><br /> I only want to select the check boxes which contian the word "top" in its name.
jquery
null
null
null
null
null
open
jQuery selector for a checkbox that contains certain text in its name attribute === I'm trying to find a selector in jQuery that select all inputs that are checkboxes and their name contains a specific word like "top" or "Top". Having trouble b/c its selecting other checkboxes. Is it possible to use something like: $("input[name*='top'] type:checkbox").each etc? Top 1<input type="checkbox" name="Top1" /><br /> Top 2<input type="checkbox" name="Top2" /><br /> Top 3<input type="checkbox" name="Top3" /><br /> Top 4<input type="checkbox" name="Top4" /><br /> Bottom 1<input type="checkbox" name="Bottom1" /><br /> Bottom 2<input type="checkbox" name="Bottom1" /><br /> Bottom 3<input type="checkbox" name="Bottom1" /><br /> Bottom 4<input type="checkbox" name="Bottom1" /><br /> I only want to select the check boxes which contian the word "top" in its name.
0
11,349,784
07/05/2012 17:51:34
391,179
07/14/2010 04:24:00
42
0
Facebook repost existing post from facebook APIs
I have a webapplication based on FB APIs I need to repost existing post using the APIs how to do so? I already know how to repost on FB any text but the problem is as far I know that each FB Status or post has an ID and whe nI repost it it gots a new ID the is it possible if I have the post ID is to repost it and get the new ID ?
facebook-graph-api
null
null
null
null
null
open
Facebook repost existing post from facebook APIs === I have a webapplication based on FB APIs I need to repost existing post using the APIs how to do so? I already know how to repost on FB any text but the problem is as far I know that each FB Status or post has an ID and whe nI repost it it gots a new ID the is it possible if I have the post ID is to repost it and get the new ID ?
0
11,349,793
07/05/2012 17:52:05
1,284,460
03/21/2012 20:45:15
46
3
is it possible to have controls in tablix - ssrs
I wanted to have a drop down box for user to select for each row and based on that the row will be visible or not visible. When an option is selected in dropdown a textbox should appear which allow user to type free text. is this possible in ssrs? if not what are the other ways to handle this scenario.
reporting-services
null
null
null
null
null
open
is it possible to have controls in tablix - ssrs === I wanted to have a drop down box for user to select for each row and based on that the row will be visible or not visible. When an option is selected in dropdown a textbox should appear which allow user to type free text. is this possible in ssrs? if not what are the other ways to handle this scenario.
0
11,349,794
07/05/2012 17:52:06
613,326
02/11/2011 16:09:38
49
2
how to get out of a loop
a newbie question about c# i want to write a program that monitors a serial com port I have some code that works but it was written for a dos console box, i want a windows app. And be able based on a radiobutton to log data or not. Now the problem is if i write a simple loop like that, the program gets into a continuous loop. I cannt click on radiobutton1 to get out of this loop. is there some kind of c# keyword to check for other program/computer events ? private void radioButton2_CheckedChanged(object sender, EventArgs e) {int i=0; i++; textBox1.Text = i.ToString(); textBox1.Show(); textBox1.Update(); }
c#
infinite-loop
null
null
null
07/08/2012 20:00:44
not a real question
how to get out of a loop === a newbie question about c# i want to write a program that monitors a serial com port I have some code that works but it was written for a dos console box, i want a windows app. And be able based on a radiobutton to log data or not. Now the problem is if i write a simple loop like that, the program gets into a continuous loop. I cannt click on radiobutton1 to get out of this loop. is there some kind of c# keyword to check for other program/computer events ? private void radioButton2_CheckedChanged(object sender, EventArgs e) {int i=0; i++; textBox1.Text = i.ToString(); textBox1.Show(); textBox1.Update(); }
1
11,347,727
07/05/2012 15:34:10
74,310
03/05/2009 16:13:56
334
7
issue enabling dataDetectorTypes on a UITextView in a UITableViewCell
I have a UITextView inside a UITableViewCell in a table. "editable" for the UITextView is turned off, which allows me to set dataDetectorTypes to UIDataDetectorTypeAll, which is exactly what I want. The app now detects when the user touches a link in the UITextView, and does the appropriate thing. The problem arises when the user touches on part of the UITextView where there is no link. I want the didSelectRowAtIndexPath in the UITableView delegate to be called. But it isn't, because the UITextView is trapping the touch, even when no link is detected. My first guess was to turn userInteractionEnabled on the UITextView to NO. This means that didSelectRowAtIndexPath will get called, but then the UITextView can't detect links. It's a catch-22. Any ideas on how to fix this? Thanks for any help.
iphone
uitableview
uitableviewcell
uitextview
datadetectortypes
null
open
issue enabling dataDetectorTypes on a UITextView in a UITableViewCell === I have a UITextView inside a UITableViewCell in a table. "editable" for the UITextView is turned off, which allows me to set dataDetectorTypes to UIDataDetectorTypeAll, which is exactly what I want. The app now detects when the user touches a link in the UITextView, and does the appropriate thing. The problem arises when the user touches on part of the UITextView where there is no link. I want the didSelectRowAtIndexPath in the UITableView delegate to be called. But it isn't, because the UITextView is trapping the touch, even when no link is detected. My first guess was to turn userInteractionEnabled on the UITextView to NO. This means that didSelectRowAtIndexPath will get called, but then the UITextView can't detect links. It's a catch-22. Any ideas on how to fix this? Thanks for any help.
0
11,347,730
07/05/2012 15:34:21
252,000
01/16/2010 02:41:04
43,646
728
overloaded operators for bind placeholders
`boost::bind` overloads several operators for its placeholders: > For convenience, the function objects produced by `bind` overload the logical not operator `!` and the relational and logical operators `==`, `!=`, `<`, `<=`, `>`, `>=`, `&&`, `||`. For example, this allows me to pass `_1 == desired_value` as a predicate to STL algorithms. Unfortunately, `std::bind` does not seem to overload these operators :( 1. Why is that? 2. What is a good workaround to simulate `_1 == desired_value` with `std::bind`?
c++
boost
stl
operator-overloading
bind
null
open
overloaded operators for bind placeholders === `boost::bind` overloads several operators for its placeholders: > For convenience, the function objects produced by `bind` overload the logical not operator `!` and the relational and logical operators `==`, `!=`, `<`, `<=`, `>`, `>=`, `&&`, `||`. For example, this allows me to pass `_1 == desired_value` as a predicate to STL algorithms. Unfortunately, `std::bind` does not seem to overload these operators :( 1. Why is that? 2. What is a good workaround to simulate `_1 == desired_value` with `std::bind`?
0
11,349,797
07/05/2012 17:52:44
75,836
03/09/2009 21:10:27
958
64
ListBox showing previous selected items after updating
I have a user control, which contains a repeater. Within this repeater I have a ListBox control. I'm binding a list of Applicaitons to the ListBox, and then I'm binding a list of Roles for the application to the ListBox. Still with me? I also have another user control (basically an auto complete) that lets me search for a user and on selected fires a selection changed event. This event then calls `SetUser` on my user control with the associated ID of the user. `SetUser` is doing all the binding for my repeater. It gets the list of applications, the list of associated roles, and selects the appropriate roles the user has currently. I can step through and see all is working fine in the code behind. First time through, I select a user, and their roles are loaded and appropriate ListBox items are selected. If I search for another user and select them, the code behind still looks to be executing properly, but the view is not updated. I've tried setting `EnableViewState="False"` on many of the controls, but that doesn't appear to have any effect. User control markup <asp:Repeater ID="rptApplications" runat="server" onitemdatabound="rptApplications_ItemDataBound"> <HeaderTemplate> <table> <tr> <th style="text-align: left">Application</th> <th style="text-align: left">Roles</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <%# ((CIApplication)Container.DataItem).Name %> </td> <td> <asp:ListBox SelectionMode="Multiple" ID="AppRoles" runat="server" CssClass="multiselect" DataSource="<%# ((CIApplication)Container.DataItem).Roles %>" DataTextField="Description" DataValueField="ID" /> </td> </tr> </ItemTemplate> <FooterTemplate> </table><br /> </FooterTemplate> </asp:Repeater> User control code behind protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } } public void SetUser(int userId) { _userRoles = _applicationManager.GetApplicationRolesForUser(userId); var appList = GetApplications(); rptApplications.DataSource = appList; rptApplications.DataBind(); } // this is where I can bind the user's current roles protected void rptApplications_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var appId = ((CIApplication)e.Item.DataItem).ID; { var appRoles = (ListBox) e.Item.FindControl("AppRoles"); var roles = _userRoles.FindAll(r => r.AppId == appId); MapRoles(appRoles, roles); } } } private void MapRoles(ListControl list, IEnumerable<UserApplicationRole> roles ) { foreach (var role in roles) { list.Items.FindByValue(role.RoleId.ToString()).Selected = true; } } Event handler on containing page protected void HandleUserSearchSelectedIndexChanged(int selectedValue) { ApplcationEdit.SetUser(selectedValue); }
c#
asp.net
usercontrols
listbox
viewstate
null
open
ListBox showing previous selected items after updating === I have a user control, which contains a repeater. Within this repeater I have a ListBox control. I'm binding a list of Applicaitons to the ListBox, and then I'm binding a list of Roles for the application to the ListBox. Still with me? I also have another user control (basically an auto complete) that lets me search for a user and on selected fires a selection changed event. This event then calls `SetUser` on my user control with the associated ID of the user. `SetUser` is doing all the binding for my repeater. It gets the list of applications, the list of associated roles, and selects the appropriate roles the user has currently. I can step through and see all is working fine in the code behind. First time through, I select a user, and their roles are loaded and appropriate ListBox items are selected. If I search for another user and select them, the code behind still looks to be executing properly, but the view is not updated. I've tried setting `EnableViewState="False"` on many of the controls, but that doesn't appear to have any effect. User control markup <asp:Repeater ID="rptApplications" runat="server" onitemdatabound="rptApplications_ItemDataBound"> <HeaderTemplate> <table> <tr> <th style="text-align: left">Application</th> <th style="text-align: left">Roles</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <%# ((CIApplication)Container.DataItem).Name %> </td> <td> <asp:ListBox SelectionMode="Multiple" ID="AppRoles" runat="server" CssClass="multiselect" DataSource="<%# ((CIApplication)Container.DataItem).Roles %>" DataTextField="Description" DataValueField="ID" /> </td> </tr> </ItemTemplate> <FooterTemplate> </table><br /> </FooterTemplate> </asp:Repeater> User control code behind protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } } public void SetUser(int userId) { _userRoles = _applicationManager.GetApplicationRolesForUser(userId); var appList = GetApplications(); rptApplications.DataSource = appList; rptApplications.DataBind(); } // this is where I can bind the user's current roles protected void rptApplications_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var appId = ((CIApplication)e.Item.DataItem).ID; { var appRoles = (ListBox) e.Item.FindControl("AppRoles"); var roles = _userRoles.FindAll(r => r.AppId == appId); MapRoles(appRoles, roles); } } } private void MapRoles(ListControl list, IEnumerable<UserApplicationRole> roles ) { foreach (var role in roles) { list.Items.FindByValue(role.RoleId.ToString()).Selected = true; } } Event handler on containing page protected void HandleUserSearchSelectedIndexChanged(int selectedValue) { ApplcationEdit.SetUser(selectedValue); }
0
11,393,421
07/09/2012 10:41:04
48,256
12/22/2008 03:54:20
521
10
Changing the JVM command line program in GlassFish
I'm trying out the Link to Oracle Solaris Studio 12.2: Performance Analyzer http://docs.oracle.com/cd/E18659_01/html/821-1379/afabb.html It requires you to use a `collect -j` command to run the `java` JVM. Unfortunately, GlassFish appears to allow you to change only the Java home. In `./config/asenv.conf` there is an entry for `AS_JAVA`. I tried to `start-domain` and capture the long Java command line there. However, it appears to hang. Is there a way to change the JVM command line program? Hopefully, without hacking on the GlassFish scripts.
java
glassfish
profiling
null
null
null
open
Changing the JVM command line program in GlassFish === I'm trying out the Link to Oracle Solaris Studio 12.2: Performance Analyzer http://docs.oracle.com/cd/E18659_01/html/821-1379/afabb.html It requires you to use a `collect -j` command to run the `java` JVM. Unfortunately, GlassFish appears to allow you to change only the Java home. In `./config/asenv.conf` there is an entry for `AS_JAVA`. I tried to `start-domain` and capture the long Java command line there. However, it appears to hang. Is there a way to change the JVM command line program? Hopefully, without hacking on the GlassFish scripts.
0
11,443,290
07/11/2012 23:57:46
1,118,919
12/28/2011 08:04:43
765
26
Do I always need to move Database queries from the UI thread to a separate thread?
This question comes from an issue I am having, or really confusion on something. So its frowned upon to query databases on the UI thread. But my issue is, what if what appears on the screen relies on what the result is. Should you still run it in the background, or should you halt the screens output until you know the info you need from the database?
android
sqlite
background
null
null
null
open
Do I always need to move Database queries from the UI thread to a separate thread? === This question comes from an issue I am having, or really confusion on something. So its frowned upon to query databases on the UI thread. But my issue is, what if what appears on the screen relies on what the result is. Should you still run it in the background, or should you halt the screens output until you know the info you need from the database?
0
11,443,291
07/11/2012 23:57:48
1,293,859
03/26/2012 19:31:48
185
0
How do you add an item into an array if passes the logical statement?
I would like to create a new array `B_array` based on an existing array A `A_array`. If that item in `A_array` has a certain field then add it into `B_array`. Currently this is what I have and its putting everything into `B_array`: B_array = A_array.map {|item| if item.name == 'Josh'} A_array: [id:0,name:"Josh",email:"josh@[email protected]"], [id:1,name:"Scott",email:"scott@[email protected]"], [id:2,name:"Josh",email:"dan@[email protected]"] Desired output for `B_array`: [id:0,name:"Josh",email:"josh@[email protected]"], [id:2,name:"Josh",email:"dan@[email protected]"] Thanks!
ruby-on-rails
ruby
null
null
null
null
open
How do you add an item into an array if passes the logical statement? === I would like to create a new array `B_array` based on an existing array A `A_array`. If that item in `A_array` has a certain field then add it into `B_array`. Currently this is what I have and its putting everything into `B_array`: B_array = A_array.map {|item| if item.name == 'Josh'} A_array: [id:0,name:"Josh",email:"josh@[email protected]"], [id:1,name:"Scott",email:"scott@[email protected]"], [id:2,name:"Josh",email:"dan@[email protected]"] Desired output for `B_array`: [id:0,name:"Josh",email:"josh@[email protected]"], [id:2,name:"Josh",email:"dan@[email protected]"] Thanks!
0
11,443,245
07/11/2012 23:51:52
108,102
05/16/2009 09:25:52
47
5
sudo /etc/init.d/celeryd start generates a "Unknown command: 'celeryd_multi'"
I'm setting up celery to run daemonized, using the variables from my virtual environment. But when I run `$ sudo /etc/init.d/celeryd start`, I get `Unknown command: 'celeryd_multi' Type 'manage.py help' for usage.` I have set the following: > CELERYD_CHDIR="/home/myuser/projects/myproject" > ENV_PYTHON="/home/myuser/.virtualenvs/myproject/bin/python" > CELERYD_MULTI="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryd_multi" When I run `$ /home/myuser/.virtualenvs/myproject/bin/python /home/myuser/projects/myproject/manage.py celeryd_multi` from the command line, it works fine. Any ideas? I will gladly post any other code you need :) Thank you!
django
celery
django-celery
null
null
null
open
sudo /etc/init.d/celeryd start generates a "Unknown command: 'celeryd_multi'" === I'm setting up celery to run daemonized, using the variables from my virtual environment. But when I run `$ sudo /etc/init.d/celeryd start`, I get `Unknown command: 'celeryd_multi' Type 'manage.py help' for usage.` I have set the following: > CELERYD_CHDIR="/home/myuser/projects/myproject" > ENV_PYTHON="/home/myuser/.virtualenvs/myproject/bin/python" > CELERYD_MULTI="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryd_multi" When I run `$ /home/myuser/.virtualenvs/myproject/bin/python /home/myuser/projects/myproject/manage.py celeryd_multi` from the command line, it works fine. Any ideas? I will gladly post any other code you need :) Thank you!
0
11,571,616
07/20/2012 01:23:56
47,825
12/19/2008 16:48:57
809
4
Django @login_required dropping https
I'm trying to test my Django app locally using SSL. I have a view with the `@login_required` decorator. So when I hit `/locker`, I get redirected to `/locker/login?next=/locker`. This works fine with http. However, whenever I use https, the redirect somehow drops the secure connection, so I get something like `https://cumulus.dev/locker -> http://cumulus.dev/locker/login?next=/locker` If I go directly to `https://cumulus.dev/locker/login?next=locker` the page opens fine over a secure connection. But once I enter the username and password, I go back to `http://cumulus.dev/locker`. I'm using Nginx to handle the SSL, which then talks to `runserver`. My nginx config is upstream app_server_djangoapp { server localhost:8000 fail_timeout=0; } server { listen 80; server_name cumulus.dev; access_log /var/log/nginx/cumulus-dev-access.log; error_log /var/log/nginx/cumulus-dev-error.log info; keepalive_timeout 5; # path for static files root /home/gaurav/www/Cumulus/cumulus_lightbox/static; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://app_server_djangoapp; break; } } } server { listen 443; server_name cumulus.dev; ssl on; ssl_certificate /etc/ssl/cacert-cumulus.pem; ssl_certificate_key /etc/ssl/privkey.pem; access_log /var/log/nginx/cumulus-dev-access.log; error_log /var/log/nginx/cumulus-dev-error.log info; keepalive_timeout 5; # path for static files root /home/gaurav/www/Cumulus/cumulus_lightbox/static; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Ssl on; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://app_server_djangoapp; break; } } }
django
ssl
https
nginx
null
null
open
Django @login_required dropping https === I'm trying to test my Django app locally using SSL. I have a view with the `@login_required` decorator. So when I hit `/locker`, I get redirected to `/locker/login?next=/locker`. This works fine with http. However, whenever I use https, the redirect somehow drops the secure connection, so I get something like `https://cumulus.dev/locker -> http://cumulus.dev/locker/login?next=/locker` If I go directly to `https://cumulus.dev/locker/login?next=locker` the page opens fine over a secure connection. But once I enter the username and password, I go back to `http://cumulus.dev/locker`. I'm using Nginx to handle the SSL, which then talks to `runserver`. My nginx config is upstream app_server_djangoapp { server localhost:8000 fail_timeout=0; } server { listen 80; server_name cumulus.dev; access_log /var/log/nginx/cumulus-dev-access.log; error_log /var/log/nginx/cumulus-dev-error.log info; keepalive_timeout 5; # path for static files root /home/gaurav/www/Cumulus/cumulus_lightbox/static; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://app_server_djangoapp; break; } } } server { listen 443; server_name cumulus.dev; ssl on; ssl_certificate /etc/ssl/cacert-cumulus.pem; ssl_certificate_key /etc/ssl/privkey.pem; access_log /var/log/nginx/cumulus-dev-access.log; error_log /var/log/nginx/cumulus-dev-error.log info; keepalive_timeout 5; # path for static files root /home/gaurav/www/Cumulus/cumulus_lightbox/static; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Ssl on; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://app_server_djangoapp; break; } } }
0
11,571,619
07/20/2012 01:24:32
1,537,641
07/19/2012 10:47:55
11
0
What is the appropriate usage of these profiling switches?
I'm still pretty new to GCC and I'm wondering how exactly do I use certain profiling switches. I've read the GCC manual entries for `-ftree-loop-ivcanon` and `-fivopts` (neither of which are implied by `-fprofiled-generate/use`) and while I have a (relatively) good idea of what they do I don't know where I should use them or if I should use them at all. Should I use the flags in a combined compilation? `g++ Example.cxx -o Example.exe -Wall -ftree-loop-ivcanon -fivopts` A compilation only? `g++ Example.cxx -o Example.o -c -Wall -ftree-loop-ivcanon -fivopts` Or a linking only? `g++ Example.o -o Example.exe -Wall -ftree-loop-ivcanon -fivopts` Should I only use these flags when profiling is enabled or can I use them with -On? And lastly if I do use these when profiling should I use them with the generate switch or the use switch, or both?
gcc
g++
profiling
compiler-flags
null
null
open
What is the appropriate usage of these profiling switches? === I'm still pretty new to GCC and I'm wondering how exactly do I use certain profiling switches. I've read the GCC manual entries for `-ftree-loop-ivcanon` and `-fivopts` (neither of which are implied by `-fprofiled-generate/use`) and while I have a (relatively) good idea of what they do I don't know where I should use them or if I should use them at all. Should I use the flags in a combined compilation? `g++ Example.cxx -o Example.exe -Wall -ftree-loop-ivcanon -fivopts` A compilation only? `g++ Example.cxx -o Example.o -c -Wall -ftree-loop-ivcanon -fivopts` Or a linking only? `g++ Example.o -o Example.exe -Wall -ftree-loop-ivcanon -fivopts` Should I only use these flags when profiling is enabled or can I use them with -On? And lastly if I do use these when profiling should I use them with the generate switch or the use switch, or both?
0
11,571,620
07/20/2012 01:24:41
864,381
07/26/2011 22:14:15
6
0
unity3d + monoDevelop error
i am having trouble with Unity/keep getting this error when i try to save a mono-script: "UnauthorizedAccessException: Access to the path "/Users/Deenie/Desktop/unityTests/newTst/Assets/NewBehaviourScript.js" is denied." i have tried re-installing unity twice/setting permissions in both unity + mono, nothing works! (the path above is to where my project files reside) (i am using unity 3.5x--on Mac OS 10.7) -please any help ?! how to fix? this is perhaps some kind of config problem i can't understand.
monodevelop
unity3d
null
null
null
null
open
unity3d + monoDevelop error === i am having trouble with Unity/keep getting this error when i try to save a mono-script: "UnauthorizedAccessException: Access to the path "/Users/Deenie/Desktop/unityTests/newTst/Assets/NewBehaviourScript.js" is denied." i have tried re-installing unity twice/setting permissions in both unity + mono, nothing works! (the path above is to where my project files reside) (i am using unity 3.5x--on Mac OS 10.7) -please any help ?! how to fix? this is perhaps some kind of config problem i can't understand.
0
11,571,632
07/20/2012 01:26:03
1,539,467
07/20/2012 01:07:12
1
0
Can two different strings when encoded with different encodings have the same byte sequence?
Can two different strings when encoded with different encodings have the same byte sequence? i.e. some "string one" and "string two" in the example below when encoded using two different encodings (Cp1252 and UTF-8 are just examples) will cause the test to pass? import java.io.UnsupportedEncodingException; import java.util.Arrays; import org.junit.Assert; import org.junit.Test; public class EncodingTest { @Test public void test() throws UnsupportedEncodingException { final byte[] sequence1 = "string one".getBytes("Cp1252"); final byte[] sequence2 = "string two".getBytes("UTF-8"); Assert.assertTrue(Arrays.equals(sequence1, sequence2)); } } A bug in my code hashes byte sequence generated from a String with JVM's default encoding and I need to verify whether that will cause hash collisions when the code is run with different strings and different JVM file encodings (which can happen when run on Windows and Linux for example). Since an encoding is a mapping between byte sequences and characters, I think there may be some strings and encodings that pass the above test. But just wanted to know if there are any well known examples or some good reasons for why I shouldn't be relying on hash collisions not happening. Thanks PS: This is only for encodings supported by JDK 1.6 and not by some made up ones.
java
encoding
hash
character-encoding
hashing
null
open
Can two different strings when encoded with different encodings have the same byte sequence? === Can two different strings when encoded with different encodings have the same byte sequence? i.e. some "string one" and "string two" in the example below when encoded using two different encodings (Cp1252 and UTF-8 are just examples) will cause the test to pass? import java.io.UnsupportedEncodingException; import java.util.Arrays; import org.junit.Assert; import org.junit.Test; public class EncodingTest { @Test public void test() throws UnsupportedEncodingException { final byte[] sequence1 = "string one".getBytes("Cp1252"); final byte[] sequence2 = "string two".getBytes("UTF-8"); Assert.assertTrue(Arrays.equals(sequence1, sequence2)); } } A bug in my code hashes byte sequence generated from a String with JVM's default encoding and I need to verify whether that will cause hash collisions when the code is run with different strings and different JVM file encodings (which can happen when run on Windows and Linux for example). Since an encoding is a mapping between byte sequences and characters, I think there may be some strings and encodings that pass the above test. But just wanted to know if there are any well known examples or some good reasons for why I shouldn't be relying on hash collisions not happening. Thanks PS: This is only for encodings supported by JDK 1.6 and not by some made up ones.
0
11,571,645
07/20/2012 01:27:52
1,408,986
05/21/2012 23:12:42
3
0
Set Soap Header ksoap2 android
First, I apologize for asking a question that is already common here in the SOF. But I am a beginner and I'm certainly cruel. I am creating an android application that communicates with a WS. So I can make requests to the WS, I have to add a value to the header of the envelope, but I can not add. I found some answers about it here in the SOF, however, could not fully understand how it works. Perhaps, my doubts are due to the nodes of the header, which ended up confusing me even more. One of the answers I found I ended up not helping: "[How to set soap header using ksoap2 android][1]" Below is the XML request that needs to be done: ?xml version="1.0" encoding="utf-8"? soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:Header ValidationSoapHeader xmlns="http://tempuri.org/" DevToken>string/DevToken /ValidationSoapHeader /soap:Header soap:Body ListaCidades xmlns="http://tempuri.org/" / /soap:Body /soap:Envelope And my code below: SoapObject request = new SoapObject(ApplicationData.NAMESPACE, ApplicationData.METHOD_NAME_LISTA_CIDADES); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); How exactly do I use the envelope.HeaderOut? Is it really necessary to create a helper method to build an Element even having to pass only one parameter (DevToken)? Thank you for your attention! [1]: http://stackoverflow.com/questions/5613675/how-to-set-soap-header-using-ksoap2-android
android
soap
header
ksoap2
null
null
open
Set Soap Header ksoap2 android === First, I apologize for asking a question that is already common here in the SOF. But I am a beginner and I'm certainly cruel. I am creating an android application that communicates with a WS. So I can make requests to the WS, I have to add a value to the header of the envelope, but I can not add. I found some answers about it here in the SOF, however, could not fully understand how it works. Perhaps, my doubts are due to the nodes of the header, which ended up confusing me even more. One of the answers I found I ended up not helping: "[How to set soap header using ksoap2 android][1]" Below is the XML request that needs to be done: ?xml version="1.0" encoding="utf-8"? soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:Header ValidationSoapHeader xmlns="http://tempuri.org/" DevToken>string/DevToken /ValidationSoapHeader /soap:Header soap:Body ListaCidades xmlns="http://tempuri.org/" / /soap:Body /soap:Envelope And my code below: SoapObject request = new SoapObject(ApplicationData.NAMESPACE, ApplicationData.METHOD_NAME_LISTA_CIDADES); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); How exactly do I use the envelope.HeaderOut? Is it really necessary to create a helper method to build an Element even having to pass only one parameter (DevToken)? Thank you for your attention! [1]: http://stackoverflow.com/questions/5613675/how-to-set-soap-header-using-ksoap2-android
0
11,571,646
07/20/2012 01:28:13
505,810
11/12/2010 13:49:23
722
20
Data structure with user specified order
I have this class : public class Item { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } } I want to store instances of `Item` in a list, and keep it ordered like the user has ordered them (Likely to be in a GUI with up-down arrows while selecting an Item)... Should I be adding an order member to my `Item` class, or is there a specific datastructure that can keep an arbitrary user-specified order. Note: I'm going to use this to keep a list of items, in the order a person has seen them, walking in a store.
c#
list
order-by
order
null
null
open
Data structure with user specified order === I have this class : public class Item { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } } I want to store instances of `Item` in a list, and keep it ordered like the user has ordered them (Likely to be in a GUI with up-down arrows while selecting an Item)... Should I be adding an order member to my `Item` class, or is there a specific datastructure that can keep an arbitrary user-specified order. Note: I'm going to use this to keep a list of items, in the order a person has seen them, walking in a store.
0
11,571,649
07/20/2012 01:28:39
1,509,425
07/08/2012 00:32:43
3
1
Ajax and Django render_to_response (How to render to response inside success function)
Currently I am trying to implement a login validation system. I am using ajax so that I can users can get response without being redirected to another page. My ajax function sends eamil and password that user has inputted, and get message in call back function, which can be in three types: email, password, or the actual HttpResponse object. But I have no idea how to render the given http response object using ajax and jquery. Is location.href an option? I am pasting the code below. In javascript function loginSubmit(email, password) { var d= "email=" + email + "&password=" + password; $.ajax({ url: "/login", type: "POST", dataType: "text", data: d, success: function(m) { if (m == "email") { $("#emailMessage").html("There is no account associated with this email address."); $("#emailError").show(); $("#emailError").fadeOut(5000, function() {}); } else if (m == "password") { $("#emailMessage").html("There is no account associated with this email address."); $("#emailError").show(); $("#emailError").fadeOut(5000, function() {}); } else { } } }); } in view function.. def login(request): json = request.POST e = json['email'] p = json['password'] u = User.objects.filter(email=e) if (len(u)): up = User.objects.filter(email=e, password=p) if (len(up)): return render_to_response('profile.html', context_instance=RequestContext(request)) else: data = "password" c = RequestContext(request, {'result':data}) t = Template("{{result}}") datatype=u"application/javascript" return HttpResponse(t.render(c), datatype) else: data = "email" c = RequestContext(request, {'result':data}) t = Template("{{result}}") datatype=u"application/javascript" return HttpResponse(t.render(c), datatype) p.s. Currently I am using a dummy template and HttpResponse to send data to the ajax success callback function. Is there a more efficient way to accomplish this (send back json data)? I will wait for your replies guys!
ajax
django
null
null
null
null
open
Ajax and Django render_to_response (How to render to response inside success function) === Currently I am trying to implement a login validation system. I am using ajax so that I can users can get response without being redirected to another page. My ajax function sends eamil and password that user has inputted, and get message in call back function, which can be in three types: email, password, or the actual HttpResponse object. But I have no idea how to render the given http response object using ajax and jquery. Is location.href an option? I am pasting the code below. In javascript function loginSubmit(email, password) { var d= "email=" + email + "&password=" + password; $.ajax({ url: "/login", type: "POST", dataType: "text", data: d, success: function(m) { if (m == "email") { $("#emailMessage").html("There is no account associated with this email address."); $("#emailError").show(); $("#emailError").fadeOut(5000, function() {}); } else if (m == "password") { $("#emailMessage").html("There is no account associated with this email address."); $("#emailError").show(); $("#emailError").fadeOut(5000, function() {}); } else { } } }); } in view function.. def login(request): json = request.POST e = json['email'] p = json['password'] u = User.objects.filter(email=e) if (len(u)): up = User.objects.filter(email=e, password=p) if (len(up)): return render_to_response('profile.html', context_instance=RequestContext(request)) else: data = "password" c = RequestContext(request, {'result':data}) t = Template("{{result}}") datatype=u"application/javascript" return HttpResponse(t.render(c), datatype) else: data = "email" c = RequestContext(request, {'result':data}) t = Template("{{result}}") datatype=u"application/javascript" return HttpResponse(t.render(c), datatype) p.s. Currently I am using a dummy template and HttpResponse to send data to the ajax success callback function. Is there a more efficient way to accomplish this (send back json data)? I will wait for your replies guys!
0
11,387,208
07/08/2012 22:23:11
1,230,155
02/24/2012 07:05:53
127
11
Qualcomm SDK customization?
I am trying to edit multi targets and image targets sample app of qualcomm sdk so that instead of using openGL , I can only overlay UIKit contents such as buttons text etc just for a simple demo. But I am unable to do so till now. Please guide me where to make any changes or how to go about it? I have also referred to the forums and tried to examples but they all are using openGL which i want to get rid of. Please help me out
iphone
objective-c
ios
qcar-sdk
null
null
open
Qualcomm SDK customization? === I am trying to edit multi targets and image targets sample app of qualcomm sdk so that instead of using openGL , I can only overlay UIKit contents such as buttons text etc just for a simple demo. But I am unable to do so till now. Please guide me where to make any changes or how to go about it? I have also referred to the forums and tried to examples but they all are using openGL which i want to get rid of. Please help me out
0
11,387,209
07/08/2012 22:23:19
78,967
03/17/2009 11:16:02
101
3
Generic Operator in Scala
Is it possible to define generic operators in Scala? Scala lets me map arbitrary operators on functions, which is incredibly useful. It seems restrictive however, in a case where I might want the operators to change given the state of the application.
scala
generics
operators
null
null
null
open
Generic Operator in Scala === Is it possible to define generic operators in Scala? Scala lets me map arbitrary operators on functions, which is incredibly useful. It seems restrictive however, in a case where I might want the operators to change given the state of the application.
0
11,387,219
07/08/2012 22:25:08
1,510,636
07/08/2012 22:16:56
1
0
Xcode 4.3.2 - Admob banner is showing behind iPhone app menu
I have integrated Admob with my iPhone app. However the banner is displaying underneath the apps menu. Here is the screenshot of what I'm trying to explain. http://i.stack.imgur.com/MucWJ.jpg Can anyone help me with this? I've tried everything for it come to front. Thanks!
iphone
xcode
admob
null
null
null
open
Xcode 4.3.2 - Admob banner is showing behind iPhone app menu === I have integrated Admob with my iPhone app. However the banner is displaying underneath the apps menu. Here is the screenshot of what I'm trying to explain. http://i.stack.imgur.com/MucWJ.jpg Can anyone help me with this? I've tried everything for it come to front. Thanks!
0
11,387,220
07/08/2012 22:25:13
1,459,142
06/15/2012 15:41:11
17
4
Options Menu not Inflating from xml
I am having trouble inflating an options menu from xml. Here is my code: @Override public boolean onCreateOptionsMenu(Menu menu) { // TODO Auto-generated method stub super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } It runs fine when I press the menu button on the emulator but there is no menu bar when I run it on an actual device running ics.
android
menubar
android-inflate
null
null
null
open
Options Menu not Inflating from xml === I am having trouble inflating an options menu from xml. Here is my code: @Override public boolean onCreateOptionsMenu(Menu menu) { // TODO Auto-generated method stub super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } It runs fine when I press the menu button on the emulator but there is no menu bar when I run it on an actual device running ics.
0
11,387,221
07/08/2012 22:25:16
315,200
03/11/2010 11:14:26
631
23
Store Ajax response to display to other users
Some guys made a api which display some Battlefield stats, and requested people to not call the API for every visit to the site, but cache the response and make real calls on a defined interval. How do I approach this? How can I store data to other users in the frontend? Thank you for your time... :-)
javascript
jquery
ajax
caching
null
null
open
Store Ajax response to display to other users === Some guys made a api which display some Battlefield stats, and requested people to not call the API for every visit to the site, but cache the response and make real calls on a defined interval. How do I approach this? How can I store data to other users in the frontend? Thank you for your time... :-)
0
11,387,226
07/08/2012 22:26:20
486,818
10/25/2010 19:13:42
495
7
TSQL update Datetime with Random Value
What's the easiest way to update a table that contains a DATETIME column on TSQL with RANDOM value? I see various post related to that but their Random values are really sequential when you ORDER BY DATE after the update. Any help will be truly appreciated...
tsql
null
null
null
null
null
open
TSQL update Datetime with Random Value === What's the easiest way to update a table that contains a DATETIME column on TSQL with RANDOM value? I see various post related to that but their Random values are really sequential when you ORDER BY DATE after the update. Any help will be truly appreciated...
0
11,387,228
07/08/2012 22:26:32
1,508,609
07/07/2012 11:07:24
11
1
App Crashes, if Broadcast is receivt
Why does these App crash everytime, when the Bradcast is received? [Alarm-Receiver][1] [Alarm-Sender][2] [1]: http://pastebin.com/sEa9YD8B [2]: http://pastebin.com/s3dwAGfB
android
android-intent
android-alarms
null
null
null
open
App Crashes, if Broadcast is receivt === Why does these App crash everytime, when the Bradcast is received? [Alarm-Receiver][1] [Alarm-Sender][2] [1]: http://pastebin.com/sEa9YD8B [2]: http://pastebin.com/s3dwAGfB
0
11,387,229
07/08/2012 22:26:36
795,319
06/13/2011 02:49:32
2,246
78
Why am getting deadlock upon trying to run a Java AppEngine application?
I made an application Guestbook to learn Google App Engine with Java. However, when I try to run it as a web application, Eclipse stalls on building the application because it is apparently waiting for the workspace to build. ![enter image description here][1] I tried canceling the building of the workspace by clicking on the red box to the right to no avail. I have also tried canceling the entire run and re-running, which produced the same scenario. Why can't I run the web application? [1]: http://i.stack.imgur.com/5vHSk.png
eclipse
google-app-engine
null
null
null
null
open
Why am getting deadlock upon trying to run a Java AppEngine application? === I made an application Guestbook to learn Google App Engine with Java. However, when I try to run it as a web application, Eclipse stalls on building the application because it is apparently waiting for the workspace to build. ![enter image description here][1] I tried canceling the building of the workspace by clicking on the red box to the right to no avail. I have also tried canceling the entire run and re-running, which produced the same scenario. Why can't I run the web application? [1]: http://i.stack.imgur.com/5vHSk.png
0
11,387,231
07/08/2012 22:27:23
1,497,900
07/03/2012 06:33:53
1
1
Creating array list of java objects from JSON URL with Gson
I am able to parse the following data into a java object: {"name":"testname","address":"1337 455 ftw","type":"sometype","notes":"cheers mate"} using this code: public class Test `{` `public static void main (String[] args) throws Exception` { `URL objectGet = new URL("http://10.0.0.4/file.json"); URLConnection yc = objectGet.openConnection(); BufferedReader in = new BufferedReader( new InputStreamReader( yc.getInputStream())); Gson gson = new Gson(); try { DataO data = new Gson().fromJson(in, DataO.class); System.out.println(data.getName()); } catch (Exception e) { e.printStackTrace(); } } } But now I want to store a list of these objects out of the following JSON String: [{"name":"testname","address":"1337 455 ftw","type":"sometype","notes":"cheers mate"},{"name":"SumYumStuff","address":"no need","type":"clunkdroid","notes":"Very inefficient but high specs so no problem."}] Could someone help me modify my code to do this?
java
json
list
parsing
gson
null
open
Creating array list of java objects from JSON URL with Gson === I am able to parse the following data into a java object: {"name":"testname","address":"1337 455 ftw","type":"sometype","notes":"cheers mate"} using this code: public class Test `{` `public static void main (String[] args) throws Exception` { `URL objectGet = new URL("http://10.0.0.4/file.json"); URLConnection yc = objectGet.openConnection(); BufferedReader in = new BufferedReader( new InputStreamReader( yc.getInputStream())); Gson gson = new Gson(); try { DataO data = new Gson().fromJson(in, DataO.class); System.out.println(data.getName()); } catch (Exception e) { e.printStackTrace(); } } } But now I want to store a list of these objects out of the following JSON String: [{"name":"testname","address":"1337 455 ftw","type":"sometype","notes":"cheers mate"},{"name":"SumYumStuff","address":"no need","type":"clunkdroid","notes":"Very inefficient but high specs so no problem."}] Could someone help me modify my code to do this?
0
11,387,232
07/08/2012 22:27:32
627,356
02/21/2011 21:52:38
128
11
How do I display data that crosses 180 degree meridian
I'm using the Map control in SSRS to display data (geography type, not geometry type) that extends from 80 to -120 (80E to 120W). The default view in the control puts -180 on the left and 180 on the right. This gives me a huge gap in the middle of the map _and_ a discontinuity at the left and right margins. I've tried changing the Viewport and the planar system, but it deals with the change in a naive fashion. Setting an appropriate minimum (80E) discards the data from 180W to 120W. This happens regardless of coordinate system and/or map projection.
reporting-services
ssrs-2008
gis
null
null
null
open
How do I display data that crosses 180 degree meridian === I'm using the Map control in SSRS to display data (geography type, not geometry type) that extends from 80 to -120 (80E to 120W). The default view in the control puts -180 on the left and 180 on the right. This gives me a huge gap in the middle of the map _and_ a discontinuity at the left and right margins. I've tried changing the Viewport and the planar system, but it deals with the change in a naive fashion. Setting an appropriate minimum (80E) discards the data from 180W to 120W. This happens regardless of coordinate system and/or map projection.
0
11,541,720
07/18/2012 12:45:35
1,275,413
03/17/2012 06:39:34
6
0
VB.NET Reference/point to a variable
I am aware that I can't dynamically refer to a variable (eg. 'txt & num.Close()'). Can I somehow have a variable that can point to another variable by name? My current code is (where func() requires an array): Dim playerNum As String = “P1” Select Case playerNum As String = "P1" Case “P1” Func(P1(x, xx)) Case “P2” Func(P2(x, xx)) ......... End select Can something along these lines be done? Dim playerNum As varNameRef = P1(,) Func(playerNum(x, xx)) Really anything to stop so much repetition would be greatly appreciated. Cheers.
vb.net
variables
null
null
null
null
open
VB.NET Reference/point to a variable === I am aware that I can't dynamically refer to a variable (eg. 'txt & num.Close()'). Can I somehow have a variable that can point to another variable by name? My current code is (where func() requires an array): Dim playerNum As String = “P1” Select Case playerNum As String = "P1" Case “P1” Func(P1(x, xx)) Case “P2” Func(P2(x, xx)) ......... End select Can something along these lines be done? Dim playerNum As varNameRef = P1(,) Func(playerNum(x, xx)) Really anything to stop so much repetition would be greatly appreciated. Cheers.
0
11,541,498
07/18/2012 12:35:00
1,534,761
07/18/2012 12:20:16
1
0
Error when read receipt file in OSX
I have an receipt file, and I want read it to verify a Receipt with the App Store, but I can't read it. Please help me. I'm following the subject: "[Verifying a Receipt with the App Store][1]" for this message in apple developer, and they said: *To verify the receipt, perform the following steps: Retrieve the receipt data from the transaction’s transactionReceipt property (on iOS) or **from the receipt file inside the application bundle (on Mac OS X)** and encode it using base64 encoding. Create a JSON object with a single key named receipt-data and the string you created in step 1* Thanks for help. [1]: http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html#//apple_ref/doc/uid/TP40008267-CH104
osx-lion
null
null
null
null
null
open
Error when read receipt file in OSX === I have an receipt file, and I want read it to verify a Receipt with the App Store, but I can't read it. Please help me. I'm following the subject: "[Verifying a Receipt with the App Store][1]" for this message in apple developer, and they said: *To verify the receipt, perform the following steps: Retrieve the receipt data from the transaction’s transactionReceipt property (on iOS) or **from the receipt file inside the application bundle (on Mac OS X)** and encode it using base64 encoding. Create a JSON object with a single key named receipt-data and the string you created in step 1* Thanks for help. [1]: http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html#//apple_ref/doc/uid/TP40008267-CH104
0
11,541,502
07/18/2012 12:35:08
344,881
05/19/2010 09:06:57
130
1
How do I log a message when I run a method in a class?
I wrote the following code. When I run `Hello.run` I want to log a message, but this does not work. Why does not this work? class Hello def initialize @logger = Logger.new STDOUT end def self.run self.new @logger.warn 'Hello' end end Hello.run This is the error message I get when running `Hello.run` NoMethodError: private method `warn' called for nil:NilClass
ruby
logging
instance-variables
self
null
null
open
How do I log a message when I run a method in a class? === I wrote the following code. When I run `Hello.run` I want to log a message, but this does not work. Why does not this work? class Hello def initialize @logger = Logger.new STDOUT end def self.run self.new @logger.warn 'Hello' end end Hello.run This is the error message I get when running `Hello.run` NoMethodError: private method `warn' called for nil:NilClass
0
11,541,729
07/18/2012 12:46:04
779,023
06/01/2011 08:47:28
113
3
Hibernate Criteria Query in Grails ON Subclasses field When superclass field is abstract
My class design is as follows: @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "dtype") public abstract class MetaFieldValue<T> implements Serializable { private Integer id; private MetaField field; @Transient abstract public T getValue(); abstract public void setValue(T value); } public class StringMetaFieldValue extends MetaFieldValue<String> { private String value; } Although, I have a large query querying with the help of hibernate, in nutshell it is doing the following MetaFieldValue.createCriteria().list(max: 10, offset: 0){ ilike("value", "100"); } which does not seem to get the desired effect as the query StringMetaFieldValue.createCriteria().list(max: 10, offset: 0){ ilike("value", "100"); } The first query gives me an exception groovy.lang.MissingMethodException: No signature of method: static com.sapienter.jbilling.server.metafields.db.MetaFieldValue.createCriteria() is applicable for argument types: () values: [] But the second query gives the result [MetaFieldValue{name=MetaField{id=1, name='partner.prompt.fee', entityType=CUSTOMER, dataType=STRING}, value=100}] which is the result I want. So, my question is that how can I achieve the same effect using the **superclass** rather than any of its **sub-classes** ?
hibernate
grails
criteria
null
null
null
open
Hibernate Criteria Query in Grails ON Subclasses field When superclass field is abstract === My class design is as follows: @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "dtype") public abstract class MetaFieldValue<T> implements Serializable { private Integer id; private MetaField field; @Transient abstract public T getValue(); abstract public void setValue(T value); } public class StringMetaFieldValue extends MetaFieldValue<String> { private String value; } Although, I have a large query querying with the help of hibernate, in nutshell it is doing the following MetaFieldValue.createCriteria().list(max: 10, offset: 0){ ilike("value", "100"); } which does not seem to get the desired effect as the query StringMetaFieldValue.createCriteria().list(max: 10, offset: 0){ ilike("value", "100"); } The first query gives me an exception groovy.lang.MissingMethodException: No signature of method: static com.sapienter.jbilling.server.metafields.db.MetaFieldValue.createCriteria() is applicable for argument types: () values: [] But the second query gives the result [MetaFieldValue{name=MetaField{id=1, name='partner.prompt.fee', entityType=CUSTOMER, dataType=STRING}, value=100}] which is the result I want. So, my question is that how can I achieve the same effect using the **superclass** rather than any of its **sub-classes** ?
0
11,541,730
07/18/2012 12:46:06
997,633
10/16/2011 08:30:47
68
0
ByteArray to BitmapData AS3
I'm using com.adobe.images.PNGEncoder to encode bitmapData to a byteArray. Is there a way to convert the byteArray back to bitmapData NOT using a Loader? thanks. EDIT: the reason i don't want to use a Loader is it being Asynchronous, and I don't want to implement eventlisteners.
actionscript-3
bytearray
convert
bitmapdata
null
null
open
ByteArray to BitmapData AS3 === I'm using com.adobe.images.PNGEncoder to encode bitmapData to a byteArray. Is there a way to convert the byteArray back to bitmapData NOT using a Loader? thanks. EDIT: the reason i don't want to use a Loader is it being Asynchronous, and I don't want to implement eventlisteners.
0
11,541,731
07/18/2012 12:46:09
1,534,775
07/18/2012 12:26:27
1
0
How to protect some sectors to be written in NTFS
I'm trying to implement an anti-forensics tool on an ntfs partition. I need to preserve 1GB (in a precise pysical location) of space from being written by the filesystem. My ideas: - Try to create a 1gb file in a specific location (how?) so it will be considered used - Try to manually edit the MFT and insert a fake entry to mark that zone as used (how?) Any suggestion about how to implement this two ideas or something else?
ntfs
mft
null
null
null
null
open
How to protect some sectors to be written in NTFS === I'm trying to implement an anti-forensics tool on an ntfs partition. I need to preserve 1GB (in a precise pysical location) of space from being written by the filesystem. My ideas: - Try to create a 1gb file in a specific location (how?) so it will be considered used - Try to manually edit the MFT and insert a fake entry to mark that zone as used (how?) Any suggestion about how to implement this two ideas or something else?
0
11,541,743
07/18/2012 12:46:40
1,015,904
10/27/2011 05:32:18
32
0
CSS Same Height Columns with One Column Containg Bottom Div
I'm desperate to not use tables (not that tables will work) but we have a situation where the user wants 3 column divs floating with one div having two divs, one of which needs to be displayed at bottom of the div. Maybe I need to rethink the whole process and persuade user to keep it simple. Anyway here is my code: <style> #outer-div { overflow: hidden; background-color: grey; } #column-one { padding-bottom: 500em; margin-bottom: -500em; background-color: red; width: 200px; float: left; } #column-two { padding-bottom: 500em; margin-bottom: -500em; background-color: green; width: 200px; float: left; } #column-three { padding-bottom: 500em; margin-bottom: -500em; background-color: blue; width: 200px; float: left; } #column-one-bottom { position: absolute; bottom: 0; background-color: pink; } </style> <div id="outer-div"> <div id="column-one"> <div id="column-one-top"> Column One Top Data<br/> Column One Top Data<br/> Column One Top Data<br/> Column One Top Data<br/> Column One Top Data<br/> </div> <div id="column-one-bottom"> Column One Bottom Data </div> </div> <div id="column-two"> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> </div> <div id="column-three"> Column Three Data<br/> Column Three Data<br/> Column Three Data<br/> Column Three Data<br/> </div> <br style="clear: both;"/> </div> </body> Hope someone can help.
html
css
null
null
null
null
open
CSS Same Height Columns with One Column Containg Bottom Div === I'm desperate to not use tables (not that tables will work) but we have a situation where the user wants 3 column divs floating with one div having two divs, one of which needs to be displayed at bottom of the div. Maybe I need to rethink the whole process and persuade user to keep it simple. Anyway here is my code: <style> #outer-div { overflow: hidden; background-color: grey; } #column-one { padding-bottom: 500em; margin-bottom: -500em; background-color: red; width: 200px; float: left; } #column-two { padding-bottom: 500em; margin-bottom: -500em; background-color: green; width: 200px; float: left; } #column-three { padding-bottom: 500em; margin-bottom: -500em; background-color: blue; width: 200px; float: left; } #column-one-bottom { position: absolute; bottom: 0; background-color: pink; } </style> <div id="outer-div"> <div id="column-one"> <div id="column-one-top"> Column One Top Data<br/> Column One Top Data<br/> Column One Top Data<br/> Column One Top Data<br/> Column One Top Data<br/> </div> <div id="column-one-bottom"> Column One Bottom Data </div> </div> <div id="column-two"> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> Column Two Data<br/> </div> <div id="column-three"> Column Three Data<br/> Column Three Data<br/> Column Three Data<br/> Column Three Data<br/> </div> <br style="clear: both;"/> </div> </body> Hope someone can help.
0
11,541,744
07/18/2012 12:46:40
1,485,500
06/27/2012 11:37:36
1
3
Integrate java console in a GUI
i've a GUI (done with eclipse and windowbuilder), i would like to open (in a jframe or in a new window near from my GUI) a console which displays my System.out.println and my printstacktrace (inter alia). How can i do that? Do i really have to develop a console? (I don't want to be sure that the user launched my jar from his cmd.exe)
java
eclipse
console
windowbuilder
null
null
open
Integrate java console in a GUI === i've a GUI (done with eclipse and windowbuilder), i would like to open (in a jframe or in a new window near from my GUI) a console which displays my System.out.println and my printstacktrace (inter alia). How can i do that? Do i really have to develop a console? (I don't want to be sure that the user launched my jar from his cmd.exe)
0
11,541,710
07/18/2012 12:45:08
1,208,512
02/14/2012 07:12:39
119
6
ExtJS:: How to add specific "specialkey event" for comma to numberfield?
If want to my nubmerfield take "," and covert it to "." on key up. Numberfield doesn't allow to input "," in it. And I want to handle "specialkey" and add "." manually. But "," isn't special key. How to add it there?
javascript
extjs
null
null
null
null
open
ExtJS:: How to add specific "specialkey event" for comma to numberfield? === If want to my nubmerfield take "," and covert it to "." on key up. Numberfield doesn't allow to input "," in it. And I want to handle "specialkey" and add "." manually. But "," isn't special key. How to add it there?
0
11,650,460
07/25/2012 13:09:50
1,095,108
12/13/2011 05:45:13
130
6
QVariant userType() id
My question refers to: http://stackoverflow.com/questions/3193275/how-to-verify-qvariant-of-type-qvariantusertype-is-expected-type Specifically, if struct MyType { .... }; Q_DECLARE_METATYPE(MyType); QVariant v(QVariant::fromValue(MyType()); Is there a way to find out what `v.userType()` will return at compile-time?
c++
qt
null
null
null
null
open
QVariant userType() id === My question refers to: http://stackoverflow.com/questions/3193275/how-to-verify-qvariant-of-type-qvariantusertype-is-expected-type Specifically, if struct MyType { .... }; Q_DECLARE_METATYPE(MyType); QVariant v(QVariant::fromValue(MyType()); Is there a way to find out what `v.userType()` will return at compile-time?
0
11,650,470
07/25/2012 13:10:25
846,380
07/15/2011 11:43:06
36
13
DevExpress Controls worth using?
Does using third party controls like DevExpress in windows forms, wpf, etc increases/decreases processing time and memory consumption ? They surely do increase ease of development. Their support online is also limited, unlike the native controls which Microsoft provides. Is using them worth the cost ?
devexpress
null
null
null
null
null
open
DevExpress Controls worth using? === Does using third party controls like DevExpress in windows forms, wpf, etc increases/decreases processing time and memory consumption ? They surely do increase ease of development. Their support online is also limited, unlike the native controls which Microsoft provides. Is using them worth the cost ?
0
11,650,472
07/25/2012 13:10:28
1,436,033
06/04/2012 20:55:17
27
0
Watch latest mysql query without logging
Does the command line client of mysql allow me to listen to current queries? So i would not need to turn on logging and can check the queries for the time, i am interested to it temporarily.
mysql
null
null
null
null
null
open
Watch latest mysql query without logging === Does the command line client of mysql allow me to listen to current queries? So i would not need to turn on logging and can check the queries for the time, i am interested to it temporarily.
0
11,650,497
07/25/2012 13:12:20
1,140,485
01/10/2012 09:13:27
73
2
how to call non static method in window console application
I built a console application.Now to test if my application works as expected. I call my as shown in the code below but i receive an error: An object reference is required for the non-static field.i checked similar issues resolved [here](http://www.codeproject.com/Questions/177586/An-object-reference-is-required-for-the-non-static/) but seem different. what am i doing wrong? namespace ConsoleApplication1 { class Api { String ConStr = "SERVER=myservername; Database=mydb; UID=mylogin; PWD=mypassword;encrypt=no;enlist=false"; String bin_Num = "201284-11-000"; Label lblResults; static void Main(string[] args) { Api Test_api = new Api(); Test_api.getQualWeight(ConStr, bin_Num, lblResults); } public Dictionary<String, String> getQualWeight(String sqlConStr, String inBin, Label lblResults) { Dictionary<String, String> qualList = new Dictionary<string, string>(); string selectSQL = "select Name,qual_weight from Qualification_type " + "where ID in (select Qualification_ID from Qualifications where BIN = @inBin)"; con = getConn(sqlConStr); SqlCommand cmd = new SqlCommand(selectSQL, con); cmd.Parameters.AddWithValue("@inBin", inBin); SqlDataReader reader; try { con.Open(); reader = cmd.ExecuteReader(); while (reader.Read()) { qualList.Add(reader[0].ToString(), reader[1].ToString()); } reader.Close(); return qualList; } catch (Exception err) { lblResults.Text = "error fetching qualification weight " + err.Message; return null; } finally { con.Close(); } }
c#
null
null
null
null
null
open
how to call non static method in window console application === I built a console application.Now to test if my application works as expected. I call my as shown in the code below but i receive an error: An object reference is required for the non-static field.i checked similar issues resolved [here](http://www.codeproject.com/Questions/177586/An-object-reference-is-required-for-the-non-static/) but seem different. what am i doing wrong? namespace ConsoleApplication1 { class Api { String ConStr = "SERVER=myservername; Database=mydb; UID=mylogin; PWD=mypassword;encrypt=no;enlist=false"; String bin_Num = "201284-11-000"; Label lblResults; static void Main(string[] args) { Api Test_api = new Api(); Test_api.getQualWeight(ConStr, bin_Num, lblResults); } public Dictionary<String, String> getQualWeight(String sqlConStr, String inBin, Label lblResults) { Dictionary<String, String> qualList = new Dictionary<string, string>(); string selectSQL = "select Name,qual_weight from Qualification_type " + "where ID in (select Qualification_ID from Qualifications where BIN = @inBin)"; con = getConn(sqlConStr); SqlCommand cmd = new SqlCommand(selectSQL, con); cmd.Parameters.AddWithValue("@inBin", inBin); SqlDataReader reader; try { con.Open(); reader = cmd.ExecuteReader(); while (reader.Read()) { qualList.Add(reader[0].ToString(), reader[1].ToString()); } reader.Close(); return qualList; } catch (Exception err) { lblResults.Text = "error fetching qualification weight " + err.Message; return null; } finally { con.Close(); } }
0
11,650,506
07/25/2012 13:12:51
1,551,595
07/25/2012 12:31:51
1
0
Random Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException
I got a problem with an AdomdConnection to SSAS. It works fine 99% of the time but sometimes I get the following error: 2012-07-25 09:58:47.5286|ERROR|BI.AdoMD.CubeConnectionAttribute|Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: A connection cannot be made. Ensure that the server is running. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port) at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetTcpClient(ConnectionInfo connectionInfo) --- End of inner exception stack trace --- at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetTcpClient(ConnectionInfo connectionInfo) at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenTcpConnection(ConnectionInfo connectionInfo) at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Connect(Boolean toIXMLA) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open() at BI.AdoMD.CubeConnectionAttribute.OnActionExecuting(ActionExecutingContext filterContext) in . I can't seem to figure out what's causing this problem. I've checked the server which is running the SSAS and it looks like it's no Authentication / firewall problem. Hopefully someone encountered this problem before and knows what is causing these random connection problem. -Rick
random
connection
ssas
cube
adomd.net
null
open
Random Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException === I got a problem with an AdomdConnection to SSAS. It works fine 99% of the time but sometimes I get the following error: 2012-07-25 09:58:47.5286|ERROR|BI.AdoMD.CubeConnectionAttribute|Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: A connection cannot be made. Ensure that the server is running. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port) at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetTcpClient(ConnectionInfo connectionInfo) --- End of inner exception stack trace --- at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetTcpClient(ConnectionInfo connectionInfo) at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenTcpConnection(ConnectionInfo connectionInfo) at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Connect(Boolean toIXMLA) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open() at BI.AdoMD.CubeConnectionAttribute.OnActionExecuting(ActionExecutingContext filterContext) in . I can't seem to figure out what's causing this problem. I've checked the server which is running the SSAS and it looks like it's no Authentication / firewall problem. Hopefully someone encountered this problem before and knows what is causing these random connection problem. -Rick
0
11,410,462
07/10/2012 09:35:47
1,505,833
07/06/2012 05:41:05
6
0
how to view Android application Database running on my phone
I am installing and running an android application on my phone and for some testing purpose i want to see the databases of my application that is on my phone. now my question how to get those databases and the tables???? please reply thank you in advance.....
android
sqlite
sqlite3
android-sqlite
null
null
open
how to view Android application Database running on my phone === I am installing and running an android application on my phone and for some testing purpose i want to see the databases of my application that is on my phone. now my question how to get those databases and the tables???? please reply thank you in advance.....
0
11,410,466
07/10/2012 09:36:03
1,510,300
07/08/2012 16:53:02
3
0
Unexpected infinate while loop traverse when iam doing an operation with while loop
look the below program. When compiled it, the loop is not terminating. That is not an expected behaviour. Anyone please explain this reason? #include<iostream.h> int main() { int nIntValue = 0; int nTempVal = 100; for( int nLoop = 1; nLoop <= 25; nLoop++ ) { nTempVal = nTempVal / nLoop; } // Print the value of nIntVal while( nIntVal == 0 ) { nIntVal += nTempVal; cout<<nIntVal; } return 0; }
c++
null
null
null
null
null
open
Unexpected infinate while loop traverse when iam doing an operation with while loop === look the below program. When compiled it, the loop is not terminating. That is not an expected behaviour. Anyone please explain this reason? #include<iostream.h> int main() { int nIntValue = 0; int nTempVal = 100; for( int nLoop = 1; nLoop <= 25; nLoop++ ) { nTempVal = nTempVal / nLoop; } // Print the value of nIntVal while( nIntVal == 0 ) { nIntVal += nTempVal; cout<<nIntVal; } return 0; }
0
11,410,467
07/10/2012 09:36:05
1,039,761
11/10/2011 12:42:43
22
1
java.net.UnknownHostException when trying to open stream
I'm trying to load xls file with Jexcel API from http://udios.site88.net/Lunch.xls with this code: URL url = new URL("http://udios.site88.net/Lunch.xls"); InputStream in = url.openStream(); Workbook workBook = null; workBook = Workbook.getWorkbook(in); Sheet sheet = workBook.getSheet(0); Cell cell; cell = sheet.getCell(21, 1); Toast.makeText(MainActivity.this, cell.getContents(), Toast.LENGTH_LONG*3).show(); But it throws the following Exception: java.net.UnknownHostException: udios.site88.net this happens in: InputStream in = url.openStream(); can anyone help me with that? thanks
android
excel
null
null
null
null
open
java.net.UnknownHostException when trying to open stream === I'm trying to load xls file with Jexcel API from http://udios.site88.net/Lunch.xls with this code: URL url = new URL("http://udios.site88.net/Lunch.xls"); InputStream in = url.openStream(); Workbook workBook = null; workBook = Workbook.getWorkbook(in); Sheet sheet = workBook.getSheet(0); Cell cell; cell = sheet.getCell(21, 1); Toast.makeText(MainActivity.this, cell.getContents(), Toast.LENGTH_LONG*3).show(); But it throws the following Exception: java.net.UnknownHostException: udios.site88.net this happens in: InputStream in = url.openStream(); can anyone help me with that? thanks
0