question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,236,054
6,237,735
Gaussian blur leads to white frame around image
I'm applying a blur effect to an image in WPF like so: As you can see, the radius is large, because the image is large and I need it to be really blurry. However, for a radius that large I'm getting a light frame around my image as seen in the attached image. How can I suppress this? In case you're wondering: The resul...
What's happening is the result of a blur together with the ClipToBounds. Since you're using a Gaussian blur, the edges are going to naturally blend into the background (white). Applying ClipToBounds basically cuts off where it would otherwise have been blending into the white, hence why you get a white frame. Unless yo...
Gaussian blur leads to white frame around image I'm applying a blur effect to an image in WPF like so: As you can see, the radius is large, because the image is large and I need it to be really blurry. However, for a radius that large I'm getting a light frame around my image as seen in the attached image. How can I su...
TITLE: Gaussian blur leads to white frame around image QUESTION: I'm applying a blur effect to an image in WPF like so: As you can see, the radius is large, because the image is large and I need it to be really blurry. However, for a radius that large I'm getting a light frame around my image as seen in the attached i...
[ "c#", "wpf", "image", "blur" ]
19
10
6,095
3
0
2011-06-04T09:59:04.620000
2011-06-04T15:48:26.177000
6,236,060
6,237,197
Problems with html5 mark tags in Opera
I was testing my website when I found a rendering problem in Opera 11.11 when using the tag inside a text block. As you can see in the picture, is not inline and break the text color. As new user, I can't embed image, so I link it: https://i.stack.imgur.com/4w8ga.png Here is the page I use for testing: http://trybooksh...
This is a known issue. It had a bug at Opera (CORE-39086) and has been fixed. It will be integrated in a future release. I don't know yet when exactly. There is no CSS Work around to the best of my knowledge.
Problems with html5 mark tags in Opera I was testing my website when I found a rendering problem in Opera 11.11 when using the tag inside a text block. As you can see in the picture, is not inline and break the text color. As new user, I can't embed image, so I link it: https://i.stack.imgur.com/4w8ga.png Here is the p...
TITLE: Problems with html5 mark tags in Opera QUESTION: I was testing my website when I found a rendering problem in Opera 11.11 when using the tag inside a text block. As you can see in the picture, is not inline and break the text color. As new user, I can't embed image, so I link it: https://i.stack.imgur.com/4w8ga...
[ "html", "opera" ]
2
2
213
1
0
2011-06-04T10:00:07.507000
2011-06-04T14:10:55.887000
6,236,071
6,236,158
adding on elements of a paired record to the original record (perhaps using a subselect?)
My data and model looks more or less like this: ID NAME STUFF PAIRED_AGAINST 1 john xxx 3 2 jane yyy 4 3 jill zzz 1 4 jake aaa 2 class Swaps(models.Model): name = models.CharField() stuff = models.CharField() paired_against = models.IntegerField() I need help, I think with a subselect, that will return a queryset that...
Is paired_against the primary key for a different person? Then you should be using a ForeignKey instead of an integer field. class Swaps(models.Model): name = models.CharField() stuff = models.CharField() paired_against = models.ForeignKey(self, blank=True, null=True) Edit Thanks Daniel!
adding on elements of a paired record to the original record (perhaps using a subselect?) My data and model looks more or less like this: ID NAME STUFF PAIRED_AGAINST 1 john xxx 3 2 jane yyy 4 3 jill zzz 1 4 jake aaa 2 class Swaps(models.Model): name = models.CharField() stuff = models.CharField() paired_against = mod...
TITLE: adding on elements of a paired record to the original record (perhaps using a subselect?) QUESTION: My data and model looks more or less like this: ID NAME STUFF PAIRED_AGAINST 1 john xxx 3 2 jane yyy 4 3 jill zzz 1 4 jake aaa 2 class Swaps(models.Model): name = models.CharField() stuff = models.CharField() pa...
[ "django", "django-views" ]
0
1
28
1
0
2011-06-04T10:02:37.050000
2011-06-04T10:21:28.557000
6,236,080
6,236,098
Passing a function with arguments to a delegate expecting none
I know in Python you can use functools.partial to pass a function object with some or all of the parameters already defined. Is there a way to do this in C#? I would like to do the following: class1.MethodTakingAMethodParameter(3, "foo", class1.MethodToPass(param1, param2, param3)); For a delegate like delegate void Bl...
You can use lambdas to give some parameters a value: Action paramlessDelegate = ()=>MyFunc(value1,value2,value3) Or if you want to only put a value into some params: Action oneParamDelegate = (remainingParam)=>MyFunc(value1, remainingParam, value3) In your example: class1.MethodTakingAMethodParameter(3, "foo", ()=>clas...
Passing a function with arguments to a delegate expecting none I know in Python you can use functools.partial to pass a function object with some or all of the parameters already defined. Is there a way to do this in C#? I would like to do the following: class1.MethodTakingAMethodParameter(3, "foo", class1.MethodToPass...
TITLE: Passing a function with arguments to a delegate expecting none QUESTION: I know in Python you can use functools.partial to pass a function object with some or all of the parameters already defined. Is there a way to do this in C#? I would like to do the following: class1.MethodTakingAMethodParameter(3, "foo", c...
[ "c#", "events", "parameters", "delegates" ]
2
2
398
1
0
2011-06-04T10:05:25.407000
2011-06-04T10:08:25.377000
6,236,081
6,236,257
python groupby behaviour?
>>from itertools import groupby >>keyfunc = lambda x: x > 500 >>obj = dict(groupby(range(1000), keyfunc)) >>list(obj[True]) [999] >>list(obj[False]) [] range(1000) is obviously sorted by default for the condition (x > 500). I was expecting the numbers from 0 to 999 to be grouped in a dict by the condition (x > 500). Bu...
From the docs: The returned group is itself an iterator that shares the underlying iterable with groupby(). Because the source is shared, when the groupby() object is advanced, the previous group is no longer visible. So, if that data is needed later, it should be stored as a list[.] And you are storing iterators in ob...
python groupby behaviour? >>from itertools import groupby >>keyfunc = lambda x: x > 500 >>obj = dict(groupby(range(1000), keyfunc)) >>list(obj[True]) [999] >>list(obj[False]) [] range(1000) is obviously sorted by default for the condition (x > 500). I was expecting the numbers from 0 to 999 to be grouped in a dict by t...
TITLE: python groupby behaviour? QUESTION: >>from itertools import groupby >>keyfunc = lambda x: x > 500 >>obj = dict(groupby(range(1000), keyfunc)) >>list(obj[True]) [999] >>list(obj[False]) [] range(1000) is obviously sorted by default for the condition (x > 500). I was expecting the numbers from 0 to 999 to be grou...
[ "python", "dictionary", "iterator", "group-by" ]
16
25
9,993
3
0
2011-06-04T10:05:33.357000
2011-06-04T10:43:49.090000
6,236,102
6,236,864
Unable to set alarm time in android
In my alarm application, I take time from time picker and set it in alarm manager. But the time which I set in the time picker was not set properly in alarm manager. So the alarm is not activated at the specified time. I have included my code below. Could anybody help me out? layout/main.xml MainActivity.java public cl...
I was able to replicate your problem and find why it was failing. Basically, say you were testing at "12:25" like i was, then using Calendar.HOUR of 12 and doing c.get(Calendar.HOUR_OF_DAY) was returning 0. To change, simply use: Calendar c = Calendar.getInstance(); c.setTimeInMillis(System.currentTimeMillis()); c.set(...
Unable to set alarm time in android In my alarm application, I take time from time picker and set it in alarm manager. But the time which I set in the time picker was not set properly in alarm manager. So the alarm is not activated at the specified time. I have included my code below. Could anybody help me out? layout/...
TITLE: Unable to set alarm time in android QUESTION: In my alarm application, I take time from time picker and set it in alarm manager. But the time which I set in the time picker was not set properly in alarm manager. So the alarm is not activated at the specified time. I have included my code below. Could anybody he...
[ "android", "android-alarms" ]
0
3
2,051
1
0
2011-06-04T10:09:50.757000
2011-06-04T12:58:10.633000
6,236,108
6,236,256
OpenID reference problem in asp.net
I am trying to use OpenID in my website using asp.net_c#. I am working on asp.net forms website with asp.net v4. I am following the articles: http://danhounshell.com/blog/adding-openid-to-your-web-site-in-conjunction-with-asp-net-membership/ and http://www.dotnetopenauth.net/developers/code-snippets/programmatic-openid...
as you can see ClaimsRequest Class is part of DotNetOpenAuth.OpenId.Extensions.SimpleRegistration namespace http://docs.dotnetopenauth.net/v3.3/html/T_DotNetOpenAuth_OpenId_Extensions_SimpleRegistration_ClaimsRequest.htm
OpenID reference problem in asp.net I am trying to use OpenID in my website using asp.net_c#. I am working on asp.net forms website with asp.net v4. I am following the articles: http://danhounshell.com/blog/adding-openid-to-your-web-site-in-conjunction-with-asp-net-membership/ and http://www.dotnetopenauth.net/develope...
TITLE: OpenID reference problem in asp.net QUESTION: I am trying to use OpenID in my website using asp.net_c#. I am working on asp.net forms website with asp.net v4. I am following the articles: http://danhounshell.com/blog/adding-openid-to-your-web-site-in-conjunction-with-asp-net-membership/ and http://www.dotnetope...
[ "c#", "asp.net", "visual-studio-2010", "dotnetopenauth" ]
0
2
470
1
0
2011-06-04T10:10:49.357000
2011-06-04T10:43:06.307000
6,236,114
6,236,269
UItextview with Finger gesture recognizer
I am creating app to write notes with out keyboard.. I am able to draw shapes on screen with finger..But I am saving notes as image...Can I Add this same feature for UITextview??? Means I want to write with finger movement in UItextview.. and want to save it in textfile...Is it possible? Code for this - (void)touchesMo...
Theorically, since UITextView is a subclass of UIResponder you should be able to override methods like the one you shown. However you should try it by yourself because the last time I tried (In iOS 3.0) there were some methods that were not called ( UITextView implementation changed a lot between 2.x and 3.0) It seemed...
UItextview with Finger gesture recognizer I am creating app to write notes with out keyboard.. I am able to draw shapes on screen with finger..But I am saving notes as image...Can I Add this same feature for UITextview??? Means I want to write with finger movement in UItextview.. and want to save it in textfile...Is it...
TITLE: UItextview with Finger gesture recognizer QUESTION: I am creating app to write notes with out keyboard.. I am able to draw shapes on screen with finger..But I am saving notes as image...Can I Add this same feature for UITextview??? Means I want to write with finger movement in UItextview.. and want to save it i...
[ "iphone", "uitextview", "uigesturerecognizer" ]
0
1
406
1
0
2011-06-04T10:12:16.550000
2011-06-04T10:47:09.443000
6,236,119
6,236,324
How to develop screen capture to video application
I visited a web site screencast-o-matic. They have a web-application of java applet which capture screen to export as video. I want to develop similar application. What are the knowledge and steps required to do it? another website: screenr.
To get a screenshot, use Robot.createScreenCapture(Rectangle). To get many screenshots, call that in a loop invoked by a (Swing) Timer. Add them to an expandable collection such as an ArrayList. Convert the BufferedImage objects to JPEG format using ImageIO.write(). To form those screenshots into a.MOV, use JpegImagesT...
How to develop screen capture to video application I visited a web site screencast-o-matic. They have a web-application of java applet which capture screen to export as video. I want to develop similar application. What are the knowledge and steps required to do it? another website: screenr.
TITLE: How to develop screen capture to video application QUESTION: I visited a web site screencast-o-matic. They have a web-application of java applet which capture screen to export as video. I want to develop similar application. What are the knowledge and steps required to do it? another website: screenr. ANSWER: ...
[ "java", "screen", "video-capture", "javasound" ]
8
23
54,005
2
0
2011-06-04T10:12:32.243000
2011-06-04T10:57:47.943000
6,236,125
6,236,147
Is it possible to make a javascript/html mutiplayer game?
Is it possible to make a javascript/html mutiplayer game (if I have a server, etc)?
Yes. Rawkets - MMO using HTML5 canvas and JavaScript WebSockets You can look at its source code: https://github.com/robhawkes/rawkets
Is it possible to make a javascript/html mutiplayer game? Is it possible to make a javascript/html mutiplayer game (if I have a server, etc)?
TITLE: Is it possible to make a javascript/html mutiplayer game? QUESTION: Is it possible to make a javascript/html mutiplayer game (if I have a server, etc)? ANSWER: Yes. Rawkets - MMO using HTML5 canvas and JavaScript WebSockets You can look at its source code: https://github.com/robhawkes/rawkets
[ "javascript" ]
2
5
213
2
0
2011-06-04T10:14:22.630000
2011-06-04T10:18:53.887000
6,236,126
6,236,460
uiviewanimationstate release. program crashes randomly
The application crashes very rarely. One time it crashed, and I got the following report: [UIViewAnimationState release]:message sent to deallocated instance I am not able to find where is this used. I do not use any animations in my code. What can be the reason for the crash? this is the code i suspect where it is cra...
Firstly, you are setting av1 to a retained object. Replace this line with something like this: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sending Message, please wait..." message:@"" delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; self.av1 = alert; [alert release]; Secondly, you never relea...
uiviewanimationstate release. program crashes randomly The application crashes very rarely. One time it crashed, and I got the following report: [UIViewAnimationState release]:message sent to deallocated instance I am not able to find where is this used. I do not use any animations in my code. What can be the reason fo...
TITLE: uiviewanimationstate release. program crashes randomly QUESTION: The application crashes very rarely. One time it crashed, and I got the following report: [UIViewAnimationState release]:message sent to deallocated instance I am not able to find where is this used. I do not use any animations in my code. What ca...
[ "iphone", "crash", "uiviewanimation" ]
1
2
2,772
1
0
2011-06-04T10:14:36.147000
2011-06-04T11:23:44.950000
6,236,127
6,236,169
Parse each line of a strictly formatted text file into an array of 3-element rows
I have a text file in which each line is an entry. each line has certain words separated by space and 2 -3 words at the end of the entry with brackets eg. asd asdasd asdasd {m} [jsbbsdfb] how do I get the following result in php $data[0]="asd asdasd asdasd" $data[1]= "{m}" $data[2]= "[jsbbsdfb]"
You can use substring and strpos to find the right parts or you can use preg_match (regular expressions), both have their own (dis)advantages. Using preg_match you can do this is as little as one line, but it is relatively slow and not as easy to use. I would do something like this: while(/* $line is next line availabl...
Parse each line of a strictly formatted text file into an array of 3-element rows I have a text file in which each line is an entry. each line has certain words separated by space and 2 -3 words at the end of the entry with brackets eg. asd asdasd asdasd {m} [jsbbsdfb] how do I get the following result in php $data[0]=...
TITLE: Parse each line of a strictly formatted text file into an array of 3-element rows QUESTION: I have a text file in which each line is an entry. each line has certain words separated by space and 2 -3 words at the end of the entry with brackets eg. asd asdasd asdasd {m} [jsbbsdfb] how do I get the following resul...
[ "php", "string", "text-parsing" ]
1
1
146
5
0
2011-06-04T10:14:54.737000
2011-06-04T10:23:13.180000
6,236,135
6,236,162
Is '<?=' the same as 'echo'?
I've found some page where people print strings on the web page with this: Is this a faster way to print strings in one row of code or does it work different?
Yes. This would work as echo, but it IS NOT RECOMMENDED and many servers have got this availability disabled. It's called "short tag"
Is '<?=' the same as 'echo'? I've found some page where people print strings on the web page with this: Is this a faster way to print strings in one row of code or does it work different?
TITLE: Is '<?=' the same as 'echo'? QUESTION: I've found some page where people print strings on the web page with this: Is this a faster way to print strings in one row of code or does it work different? ANSWER: Yes. This would work as echo, but it IS NOT RECOMMENDED and many servers have got this availability disab...
[ "php", "echo" ]
5
4
201
3
0
2011-06-04T10:16:31.317000
2011-06-04T10:22:10.040000
6,236,144
6,236,194
Why do SVG 1.1 Basic validation fail?
To the best of my knowledge this is a valid SVG document: The document does not validate on the W3C Validator though. I get errors like 125 "content model is ambiguous". I validate through the File Upload option. How can I make my document validate? or How do I make my document valid SVG Basic?
Here are the reference documents which should pass validation (some of them don't pass). This is one SVG 1.1 Basic document which does pass validation: color-prop-01-b Test that viewer has the basic capability to process the color property
Why do SVG 1.1 Basic validation fail? To the best of my knowledge this is a valid SVG document: The document does not validate on the W3C Validator though. I get errors like 125 "content model is ambiguous". I validate through the File Upload option. How can I make my document validate? or How do I make my document val...
TITLE: Why do SVG 1.1 Basic validation fail? QUESTION: To the best of my knowledge this is a valid SVG document: The document does not validate on the W3C Validator though. I get errors like 125 "content model is ambiguous". I validate through the File Upload option. How can I make my document validate? or How do I ma...
[ "validation", "svg" ]
2
2
2,257
1
0
2011-06-04T10:18:22.053000
2011-06-04T10:30:47.033000
6,236,146
6,237,459
Will modifying shared methods change the class that reference them?
I'm wondering what will actually change a class, in the sense that serialized objects of this class will no longer be recognized. If the class has reference to shared methods of another class. Will changing such shared methods also change the classes that reference them? And what about changing extension methods to cus...
A good reference for this is Version Tolerant Serialization on MSDN. In short, changes to Shared (static in C#) methods do not affect the deserialization of an object: Never remove a serialized field. Never apply the NonSerializedAttribute attribute to a field if the attribute was not applied to the field in the previo...
Will modifying shared methods change the class that reference them? I'm wondering what will actually change a class, in the sense that serialized objects of this class will no longer be recognized. If the class has reference to shared methods of another class. Will changing such shared methods also change the classes t...
TITLE: Will modifying shared methods change the class that reference them? QUESTION: I'm wondering what will actually change a class, in the sense that serialized objects of this class will no longer be recognized. If the class has reference to shared methods of another class. Will changing such shared methods also ch...
[ ".net", "vb.net", "serialization" ]
1
1
65
3
0
2011-06-04T10:18:53.200000
2011-06-04T15:00:44.220000
6,236,149
6,236,265
How to get a valid Time range using Regular Expressions
How can i be able to ensure that a selected date time value is between a given time range. i.e 2/2/2011 8:10:30 is invalid but 2/2/2011 8:30:00 is a valid date
Regular expressions match strings, not numbers or number ranges. Therefore you need to think about the textual representation of all valid times/dates and analyze them. A number between 5 and 11 would therefore be 1[01]|[5-9] etc.; this can get arbitrarily complex with dates, especially if you need to validate user inp...
How to get a valid Time range using Regular Expressions How can i be able to ensure that a selected date time value is between a given time range. i.e 2/2/2011 8:10:30 is invalid but 2/2/2011 8:30:00 is a valid date
TITLE: How to get a valid Time range using Regular Expressions QUESTION: How can i be able to ensure that a selected date time value is between a given time range. i.e 2/2/2011 8:10:30 is invalid but 2/2/2011 8:30:00 is a valid date ANSWER: Regular expressions match strings, not numbers or number ranges. Therefore yo...
[ ".net", "regex" ]
0
4
260
1
0
2011-06-04T10:19:13.210000
2011-06-04T10:46:35.260000
6,236,154
6,236,171
Run exe unless make setup (embed dll to exe)
Possible Duplicate:.NET windows application, can it be compressed into a single.exe? I have a project and I am using a lot of.dll files in this project. When i try the run my project on another computer it's not working. Because i am using only.exe. I think I have to make setup project. But I want to run my program wit...
You need just copy your dll file with exe file into the same directory. and you can use the ILMerge util you can download it from msdn
Run exe unless make setup (embed dll to exe) Possible Duplicate:.NET windows application, can it be compressed into a single.exe? I have a project and I am using a lot of.dll files in this project. When i try the run my project on another computer it's not working. Because i am using only.exe. I think I have to make se...
TITLE: Run exe unless make setup (embed dll to exe) QUESTION: Possible Duplicate:.NET windows application, can it be compressed into a single.exe? I have a project and I am using a lot of.dll files in this project. When i try the run my project on another computer it's not working. Because i am using only.exe. I think...
[ "c#", ".net", "installation" ]
0
1
1,306
3
0
2011-06-04T10:20:15.637000
2011-06-04T10:24:14.810000
6,236,156
6,236,295
Devise: Users have unique urls, how do I prevent them from using controller action routes?
In my config file I have this line (note: I am using cached_slugs from the slugged gem): match '/:id',:to => 'users#show',:as => 'user' How do I prevent users from signing up with routes that are currently being used for controller actions? For example, a user could sign up with the username 'users' and their profile's...
You could add a validation to your user model that checks agains the existing routes defined in the application: class User < ActiveRecord::Base... validates_exclusion_of:name,:in => Rails.application.routes.routes.map {|r| r.path.match(/\/(\w+)\//) }.compact.map{|m| m[1] }.uniq,:message => "Username %{value} is reser...
Devise: Users have unique urls, how do I prevent them from using controller action routes? In my config file I have this line (note: I am using cached_slugs from the slugged gem): match '/:id',:to => 'users#show',:as => 'user' How do I prevent users from signing up with routes that are currently being used for controll...
TITLE: Devise: Users have unique urls, how do I prevent them from using controller action routes? QUESTION: In my config file I have this line (note: I am using cached_slugs from the slugged gem): match '/:id',:to => 'users#show',:as => 'user' How do I prevent users from signing up with routes that are currently being...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "devise" ]
0
4
264
1
0
2011-06-04T10:21:08.383000
2011-06-04T10:51:48.930000
6,236,159
6,237,562
Could a set of function differing in the name depending on the operand types called theoritically statically polymorphic in C language?
Does a set of functions doing exactly one word but differing in the name like atoi, atol, atoll etc called theoretically polymorphic? For example I have a function say swap which needs to operate on different kind of data types. So i have one function/operation for which i have different implementations, but unfortunat...
In my opinion it is not incorrect, because the polymorphism and other object oriented terminologies are not something which is language dependent, and is a concept. Now, different languages provide different features with which the implementation of an object model is much easier, and some features are only possible wh...
Could a set of function differing in the name depending on the operand types called theoritically statically polymorphic in C language? Does a set of functions doing exactly one word but differing in the name like atoi, atol, atoll etc called theoretically polymorphic? For example I have a function say swap which needs...
TITLE: Could a set of function differing in the name depending on the operand types called theoritically statically polymorphic in C language? QUESTION: Does a set of functions doing exactly one word but differing in the name like atoi, atol, atoll etc called theoretically polymorphic? For example I have a function sa...
[ "c++", "c", "oop" ]
4
0
153
5
0
2011-06-04T10:21:29.237000
2011-06-04T15:20:40.830000
6,236,184
6,236,650
Putting the css code for the view only directly in the view
I'm doing practice with CakePHP and just wonder to know if it's logical/right thing to place CSS portions dedicated to the template view only. I'm talking about thing like this: Username Password
The cake way of doing this is to do a call to the HTML-Helper like this: Html->css('forms');?> The file has to be in the /app/webroot/css folder for this to work. The extension.css is not needed as the helper adds it automatically. Don't forget to add the HTML-Helper to your controller var $helpers = array('Html'); If ...
Putting the css code for the view only directly in the view I'm doing practice with CakePHP and just wonder to know if it's logical/right thing to place CSS portions dedicated to the template view only. I'm talking about thing like this: Username Password
TITLE: Putting the css code for the view only directly in the view QUESTION: I'm doing practice with CakePHP and just wonder to know if it's logical/right thing to place CSS portions dedicated to the template view only. I'm talking about thing like this: Username Password ANSWER: The cake way of doing this is to do a...
[ "css", "cakephp", "view" ]
0
2
157
3
0
2011-06-04T10:28:50.553000
2011-06-04T12:07:08.647000
6,236,199
6,236,292
How loading file in Prolog?
I have a file, name: "file1.pl" in c:/. Now I want to load the file into the prolog, and then ask a query about the procedure and the relations that I defined. as I understood, I need to do the next stpes: file -> edit. file -> reload modified files. file -> Navigator to view file and procedre. When I an doing these st...
Try doing consult(filename). Extension might or might not be needed.
How loading file in Prolog? I have a file, name: "file1.pl" in c:/. Now I want to load the file into the prolog, and then ask a query about the procedure and the relations that I defined. as I understood, I need to do the next stpes: file -> edit. file -> reload modified files. file -> Navigator to view file and proced...
TITLE: How loading file in Prolog? QUESTION: I have a file, name: "file1.pl" in c:/. Now I want to load the file into the prolog, and then ask a query about the procedure and the relations that I defined. as I understood, I need to do the next stpes: file -> edit. file -> reload modified files. file -> Navigator to vi...
[ "prolog", "swi-prolog" ]
1
1
1,154
1
0
2011-06-04T10:32:18.610000
2011-06-04T10:51:00.960000
6,236,206
6,237,221
url assistance while web development using php
I have categories saved in databse, ex. Category 1 Category 2.. Category 10 Now my menus are, Category name Category name Category name Category name Category name Category name i wanted to do like this Category name Category name Category name Category name Category name Category name category names will be different,...
If you have a finite number of categories and they don't change very often you could use RewriteMap to map the names in the pretty handled URLs to the versions with Ids. http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritemap Otherwise you could add a lookup in the database (either a table joined to the catego...
url assistance while web development using php I have categories saved in databse, ex. Category 1 Category 2.. Category 10 Now my menus are, Category name Category name Category name Category name Category name Category name i wanted to do like this Category name Category name Category name Category name Category name ...
TITLE: url assistance while web development using php QUESTION: I have categories saved in databse, ex. Category 1 Category 2.. Category 10 Now my menus are, Category name Category name Category name Category name Category name Category name i wanted to do like this Category name Category name Category name Category n...
[ "php", ".htaccess", "url-rewriting" ]
0
0
129
1
0
2011-06-04T10:34:20.350000
2011-06-04T14:15:24.413000
6,236,209
6,236,241
Problem while changing the background color of a table using javascript
I am trying to change the background color of a table on onchange event of a checkbox. My checkbox is inside my table. I have written a simple javascript code but I am unable to change the color of my table if any one can help me regarding this problem. Here is my code.. function getcolor() { var color=document.getEle...
Try document.getElementById('yourId').style.backgroundColor = "Red"; Edit: This is working at my end: Some Title
Problem while changing the background color of a table using javascript I am trying to change the background color of a table on onchange event of a checkbox. My checkbox is inside my table. I have written a simple javascript code but I am unable to change the color of my table if any one can help me regarding this pro...
TITLE: Problem while changing the background color of a table using javascript QUESTION: I am trying to change the background color of a table on onchange event of a checkbox. My checkbox is inside my table. I have written a simple javascript code but I am unable to change the color of my table if any one can help me ...
[ "javascript" ]
1
0
979
3
0
2011-06-04T10:34:57.797000
2011-06-04T10:40:22.383000
6,236,210
6,243,257
Generate anonymous listener in NetBeans
Is there any way to automatically generate appropriate listener in NetBeans? For example, when I have JButton, and I type button.addActionListener, I'd like NetBeans to generate following code: new ActionListener() { public void actionPerformed(ActionEvent e) { throw new UnsupportedOperationException("Not supported ye...
NetBeans is capable of pregenerating listeners, without using Code Templates. It is possible by typing new SomeListener and pressing CTRL+Space. And viola!
Generate anonymous listener in NetBeans Is there any way to automatically generate appropriate listener in NetBeans? For example, when I have JButton, and I type button.addActionListener, I'd like NetBeans to generate following code: new ActionListener() { public void actionPerformed(ActionEvent e) { throw new Unsuppo...
TITLE: Generate anonymous listener in NetBeans QUESTION: Is there any way to automatically generate appropriate listener in NetBeans? For example, when I have JButton, and I type button.addActionListener, I'd like NetBeans to generate following code: new ActionListener() { public void actionPerformed(ActionEvent e) {...
[ "java", "netbeans", "actionlistener", "anonymous-class" ]
2
4
997
5
0
2011-06-04T10:35:03.350000
2011-06-05T13:35:52.043000
6,236,217
6,236,255
detecting internet connection in android
I have an app in android which is a sort of a client side of a TCP/IP connection...this app has the use of receiving GPSt data from a GPS provider and sending it to the server side of my TCP/IP connection. Only that when there is no internet connection the GPS data I have to store it in a DB....and as soon as I have ag...
This thread answers your question Regarding something happening when its up. You could then raise an broadcast intent and receive the intent by an activity which will carry out the update once internet is available I hope that helps Edit: by broadcasting an intent i meant something like this. I'm not sure if this is th...
detecting internet connection in android I have an app in android which is a sort of a client side of a TCP/IP connection...this app has the use of receiving GPSt data from a GPS provider and sending it to the server side of my TCP/IP connection. Only that when there is no internet connection the GPS data I have to sto...
TITLE: detecting internet connection in android QUESTION: I have an app in android which is a sort of a client side of a TCP/IP connection...this app has the use of receiving GPSt data from a GPS provider and sending it to the server side of my TCP/IP connection. Only that when there is no internet connection the GPS ...
[ "android", "multithreading" ]
4
0
1,468
1
0
2011-06-04T10:35:37.300000
2011-06-04T10:42:51.543000
6,236,229
6,236,252
image uploading plugin (php jquery flash)
what's the best plugin for image uploading using php/jquery? it should have a progressbar and display information like percent, speed and such. how to do image-resizing after uploading? i'd also like to embed a watermark image thanks
i find Uploadify very good. http://www.uploadify.com/ Regarding watermarking images I'd use Perls GD or ImageMagik modules: http://metacpan.org/pod/GD https://metacpan.org/pod/Image::Magick
image uploading plugin (php jquery flash) what's the best plugin for image uploading using php/jquery? it should have a progressbar and display information like percent, speed and such. how to do image-resizing after uploading? i'd also like to embed a watermark image thanks
TITLE: image uploading plugin (php jquery flash) QUESTION: what's the best plugin for image uploading using php/jquery? it should have a progressbar and display information like percent, speed and such. how to do image-resizing after uploading? i'd also like to embed a watermark image thanks ANSWER: i find Uploadify ...
[ "php", "jquery", "image-manipulation", "image-uploading" ]
1
3
1,462
2
0
2011-06-04T10:37:33.973000
2011-06-04T10:42:15.037000
6,236,233
6,236,316
table in javascript
i am appending a new row to the end of a table by using appendrow(), but it doesnt work, can anybody help me. htm: js: function makeTable(){ var theTable =document.getElementById("tbl"); if (theTable.firstChild!= null) { var badIEBody = theTable.childNodes[0]; theTable.removeChild(badIEBody); } var tBody = document.cre...
There is no function getElementByTagName in javascript but getElement s ByTagName` ( list of elements ). Also, you are filling the new text elements with string constants ("code" & "name") not the value of corresponding variables: v1 = document.createTextNode("code"); --> v1 = document.createTextNode(code); You should ...
table in javascript i am appending a new row to the end of a table by using appendrow(), but it doesnt work, can anybody help me. htm: js: function makeTable(){ var theTable =document.getElementById("tbl"); if (theTable.firstChild!= null) { var badIEBody = theTable.childNodes[0]; theTable.removeChild(badIEBody); } var ...
TITLE: table in javascript QUESTION: i am appending a new row to the end of a table by using appendrow(), but it doesnt work, can anybody help me. htm: js: function makeTable(){ var theTable =document.getElementById("tbl"); if (theTable.firstChild!= null) { var badIEBody = theTable.childNodes[0]; theTable.removeChild(...
[ "javascript", "html" ]
0
1
234
2
0
2011-06-04T10:38:41.607000
2011-06-04T10:56:04.560000
6,236,237
6,236,945
java.lang.StackOverflowError when trying to optimize Java+Scala with ProGuard
I have an applet, which I was writing in Java. Recently, I thought that it would be good to add some Scala code to it (since Scala has good interoperability with Java). Everything works fine, but when I try to optimize the resulting jars using ProGuard, I have java.lang.StackOverflowError. How can I fix it? Error: The ...
I played around with proguard configuration, and found that if I set "mergeinterfacesaggressively" to "false", everything starts to work. I will notify the library owner about this, and I hope this question will help someone.
java.lang.StackOverflowError when trying to optimize Java+Scala with ProGuard I have an applet, which I was writing in Java. Recently, I thought that it would be good to add some Scala code to it (since Scala has good interoperability with Java). Everything works fine, but when I try to optimize the resulting jars usin...
TITLE: java.lang.StackOverflowError when trying to optimize Java+Scala with ProGuard QUESTION: I have an applet, which I was writing in Java. Recently, I thought that it would be good to add some Scala code to it (since Scala has good interoperability with Java). Everything works fine, but when I try to optimize the r...
[ "java", "optimization", "scala", "proguard" ]
2
1
1,630
2
0
2011-06-04T10:39:37.013000
2011-06-04T13:15:38.657000
6,236,238
6,237,193
Using matplotlib, how do I whiten the background of the axis label?
Is there a way to whiten out the background of the axis label so that when it crosses the axis line itself, the latter does not run through it? For example, this script (the best I managed so far) #!/usr/bin/python import matplotlib.pyplot as plt xx=[1,2,3] yy=[2,3,4] dy=[0.1,0.2,0.05] fig=plt.figure() ax=fig.add_sub...
By default, the left spine has a zorder of 2.5. For some reason this seems to cause problems; maybe there's something in the code which only works if they're integral? Anyway, if you add ax.spines['left'].set_zorder(2) or more generally ax.spines['left'].set_zorder(ax.yaxis.get_label().get_zorder()-1) before the show, ...
Using matplotlib, how do I whiten the background of the axis label? Is there a way to whiten out the background of the axis label so that when it crosses the axis line itself, the latter does not run through it? For example, this script (the best I managed so far) #!/usr/bin/python import matplotlib.pyplot as plt xx=[...
TITLE: Using matplotlib, how do I whiten the background of the axis label? QUESTION: Is there a way to whiten out the background of the axis label so that when it crosses the axis line itself, the latter does not run through it? For example, this script (the best I managed so far) #!/usr/bin/python import matplotlib.p...
[ "python", "matplotlib" ]
3
2
961
2
0
2011-06-04T10:39:47.733000
2011-06-04T14:09:41.473000
6,236,243
6,236,298
How do I configure my application icon so that it doesn't appear as a standard iPhone button?
Possible Duplicate: How to disable highlighting of the app icon? Hi all. In each of my apps, the icon on the iPhone screen gets automatically converted into one of Apple's shiny buttons. I am noticing that some apps have managed to either (a) turned off the shiny appearance (such as Netflix) and/or (b) created an icon ...
Please include the below key into your info.plist file. "icon already includes gloss effects" and make check checkbox as marked. So, your app icon will be as it is.
How do I configure my application icon so that it doesn't appear as a standard iPhone button? Possible Duplicate: How to disable highlighting of the app icon? Hi all. In each of my apps, the icon on the iPhone screen gets automatically converted into one of Apple's shiny buttons. I am noticing that some apps have manag...
TITLE: How do I configure my application icon so that it doesn't appear as a standard iPhone button? QUESTION: Possible Duplicate: How to disable highlighting of the app icon? Hi all. In each of my apps, the icon on the iPhone screen gets automatically converted into one of Apple's shiny buttons. I am noticing that so...
[ "iphone", "configuration", "icons" ]
0
2
108
2
0
2011-06-04T10:40:31.490000
2011-06-04T10:52:33.093000
6,236,251
6,236,755
Android: get facebook friends list
I am using the Facebook SDK to post messages on walls. Now I need to fetch the Facebook friends list. Can anybody help me with this? -- Edit -- try { Facebook mFacebook = new Facebook(Constants.FB_APP_ID); AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook); Bundle bundle = new Bundle(); bundle.putSt...
You are about half way there. You've sent the request, but you haven't defined anything to receive the response with your results. You can extend BaseRequestListener class and implement its onComplete method to do that. Something like this: public class FriendListRequestListener extends BaseRequestListener { public vo...
Android: get facebook friends list I am using the Facebook SDK to post messages on walls. Now I need to fetch the Facebook friends list. Can anybody help me with this? -- Edit -- try { Facebook mFacebook = new Facebook(Constants.FB_APP_ID); AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook); Bundle ...
TITLE: Android: get facebook friends list QUESTION: I am using the Facebook SDK to post messages on walls. Now I need to fetch the Facebook friends list. Can anybody help me with this? -- Edit -- try { Facebook mFacebook = new Facebook(Constants.FB_APP_ID); AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(m...
[ "android", "facebook" ]
13
12
42,612
8
0
2011-06-04T10:42:01.870000
2011-06-04T12:33:14.013000
6,236,262
6,236,562
How to access a variable from another class in Qt?
I am trying to implement in Qt a main window which has 2 widgets: one area where I draw some points and one list box where I write all the points with their respective coordinates. And I would like to implement the function "delete point" of a button on the main window, i.e. when I press the button then the point selec...
I'm suspecting you've got two RenderArea widgets hanging around for some reason. You're connecting ui->displayWidget 's signal, but acting on the area widget for the delete. Shouldn't you be calling ui->displayWidget->deletePoint or connecting area 's signal? As for the repaint, you should call the widget's update() me...
How to access a variable from another class in Qt? I am trying to implement in Qt a main window which has 2 widgets: one area where I draw some points and one list box where I write all the points with their respective coordinates. And I would like to implement the function "delete point" of a button on the main window...
TITLE: How to access a variable from another class in Qt? QUESTION: I am trying to implement in Qt a main window which has 2 widgets: one area where I draw some points and one list box where I write all the points with their respective coordinates. And I would like to implement the function "delete point" of a button ...
[ "c++", "qt4", "qpainter" ]
0
1
2,137
1
0
2011-06-04T10:45:51.330000
2011-06-04T11:49:29.383000
6,236,267
6,236,423
JQuery Ajax Request
I currently have a link: Click Here What I need is to do the same thing using ajax so that I don't have to go to a different url and still get the same result. UPDATE: I have page A and page B On page A I have a link to page B Display Page B Page B goes here Can the above be done please?
HI, You cant change a pages complete html with ajax, and the script in the ajax file won't be executed. so you have to make some tricks some thing like iframe or a master div. if you wish to use iframe ajax is no need. still you need this in ajax what you have to do is. 1. ajax files should have only the body content n...
JQuery Ajax Request I currently have a link: Click Here What I need is to do the same thing using ajax so that I don't have to go to a different url and still get the same result. UPDATE: I have page A and page B On page A I have a link to page B Display Page B Page B goes here Can the above be done please?
TITLE: JQuery Ajax Request QUESTION: I currently have a link: Click Here What I need is to do the same thing using ajax so that I don't have to go to a different url and still get the same result. UPDATE: I have page A and page B On page A I have a link to page B Display Page B Page B goes here Can the above be done p...
[ "ajax", "jquery" ]
1
3
485
1
0
2011-06-04T10:47:00.090000
2011-06-04T11:17:40.567000
6,236,268
6,236,394
JSF 2 error "Unable to instantiate ExpressionFactory" on App Engine
With a new JSF 2.0 app created in NetBeans 6.9.1 this error message appears in the log file on startup on the production server: com.sun.faces.config.ConfigureListener contextInitialized: Initializing Mojarra 2.0.2 (FCS b10) for context '' com.sun.faces.spi.InjectionProviderFactory createInstance: JSF1048: PostConstruc...
Deploying the app with el-api-2.2.jar and el-impl-2.2.jar solved the problem.
JSF 2 error "Unable to instantiate ExpressionFactory" on App Engine With a new JSF 2.0 app created in NetBeans 6.9.1 this error message appears in the log file on startup on the production server: com.sun.faces.config.ConfigureListener contextInitialized: Initializing Mojarra 2.0.2 (FCS b10) for context '' com.sun.face...
TITLE: JSF 2 error "Unable to instantiate ExpressionFactory" on App Engine QUESTION: With a new JSF 2.0 app created in NetBeans 6.9.1 this error message appears in the log file on startup on the production server: com.sun.faces.config.ConfigureListener contextInitialized: Initializing Mojarra 2.0.2 (FCS b10) for conte...
[ "java", "google-app-engine", "netbeans", "jsf-2" ]
1
3
7,299
2
0
2011-06-04T10:47:05.573000
2011-06-04T11:11:29.247000
6,236,275
6,236,791
What is the difference between the new TFileOpenDialog and the old TOpenDialog?
What is the difference between the new TFileOpenDialog and the old TOpenDialog? In my computer (Win 7/DXE), when I run the code, the dialogs look the same.
TOpenDialog wraps the traditional GetOpenFileName. It works on all versions of Windows. TFileOpenDialog wraps the new COM based dialog that was introduced in Vista. It therefore only works on Vista or later. It has more functionality than the older dialogs, most notably the tight integration with search. Vista common d...
What is the difference between the new TFileOpenDialog and the old TOpenDialog? What is the difference between the new TFileOpenDialog and the old TOpenDialog? In my computer (Win 7/DXE), when I run the code, the dialogs look the same.
TITLE: What is the difference between the new TFileOpenDialog and the old TOpenDialog? QUESTION: What is the difference between the new TFileOpenDialog and the old TOpenDialog? In my computer (Win 7/DXE), when I run the code, the dialogs look the same. ANSWER: TOpenDialog wraps the traditional GetOpenFileName. It wor...
[ "delphi", "windows-7", "windows-vista", "fileopendialog", "opendialog" ]
46
37
11,370
2
0
2011-06-04T10:47:43.163000
2011-06-04T12:41:04.387000
6,236,278
6,236,439
Problem with variables in prolog
num(N):- No=N, write(No), nl. check(S):- No==S -> write(Ok); write(Not ok). When i call num(5), it prints 5. However after calling num(5), when i call check(5), it prints Not ok. I think its because of scope of variables..How can i make it work, i mean variable No like a global variable, so that i can check its value ...
you can use the global variables of swipl or assert/retract however, using global variables is a bit against the declarative programming paradigm since it violates referential transparency
Problem with variables in prolog num(N):- No=N, write(No), nl. check(S):- No==S -> write(Ok); write(Not ok). When i call num(5), it prints 5. However after calling num(5), when i call check(5), it prints Not ok. I think its because of scope of variables..How can i make it work, i mean variable No like a global variabl...
TITLE: Problem with variables in prolog QUESTION: num(N):- No=N, write(No), nl. check(S):- No==S -> write(Ok); write(Not ok). When i call num(5), it prints 5. However after calling num(5), when i call check(5), it prints Not ok. I think its because of scope of variables..How can i make it work, i mean variable No lik...
[ "variables", "scope", "prolog", "global-variables" ]
0
3
1,039
2
0
2011-06-04T10:48:35.170000
2011-06-04T11:20:38.410000
6,236,285
6,236,424
In C# Generics are these two lines of code identical?
While reading about generics I came across those two chunks of code, and I was wondering if they were identical? public abstract class Search where TCollection: Collection where T: Name AND: public abstract class Search, TCriteria>
As Lasse pointed out, your second version doesn't compile. If you changed it to public abstract class Search it would compile, but it wouldn't do what you wanted it to do: This just specifies a generic class with three type parameters called Name, Collection and TCriteria. But it doesn't limit them in any way, so you c...
In C# Generics are these two lines of code identical? While reading about generics I came across those two chunks of code, and I was wondering if they were identical? public abstract class Search where TCollection: Collection where T: Name AND: public abstract class Search, TCriteria>
TITLE: In C# Generics are these two lines of code identical? QUESTION: While reading about generics I came across those two chunks of code, and I was wondering if they were identical? public abstract class Search where TCollection: Collection where T: Name AND: public abstract class Search, TCriteria> ANSWER: As Lass...
[ "c#", ".net", "oop" ]
3
1
132
2
0
2011-06-04T10:50:05.360000
2011-06-04T11:17:54.777000
6,236,286
6,236,296
Buttons that move on screen
I want to have multiple buttons on the screen that continuously move. When they touch the sides, they should bounce back. How do i do this? Any helpful links? Ideas? Thanks!
you go through the apple animation document. Introduction to Core Animation Programming Guide Check the following SO post. How to move several buttons throughout the screen Move a button in the screen
Buttons that move on screen I want to have multiple buttons on the screen that continuously move. When they touch the sides, they should bounce back. How do i do this? Any helpful links? Ideas? Thanks!
TITLE: Buttons that move on screen QUESTION: I want to have multiple buttons on the screen that continuously move. When they touch the sides, they should bounce back. How do i do this? Any helpful links? Ideas? Thanks! ANSWER: you go through the apple animation document. Introduction to Core Animation Programming Gui...
[ "iphone", "objective-c", "uibutton", "move" ]
0
3
227
2
0
2011-06-04T10:50:18.303000
2011-06-04T10:52:00.957000
6,236,289
6,242,319
Drawing different Textures with a single Basic Effect, XNA 4.0
I have a problem in the game I wrote with XNA. I recently added Textured polygons, and saw that every textured polygon shared the same texture although I changed it before calling. The code I am using: if (countMeshes > 0) { for (int i = 0; i < countMeshes; i++) { TexturedMesh curMesh = listMeshes[i]; if (curMesh.te...
It seems to be the only way, the way I did it was to create a Dictionary with the texture as the key and a struct of a basic effect and a list of Vertexs as the value. Something like this: public struct MeshEffect { public TexturedMesh mesh; public BasicEffect effect; } and the Dictionary: private Dictionary textured...
Drawing different Textures with a single Basic Effect, XNA 4.0 I have a problem in the game I wrote with XNA. I recently added Textured polygons, and saw that every textured polygon shared the same texture although I changed it before calling. The code I am using: if (countMeshes > 0) { for (int i = 0; i < countMeshes...
TITLE: Drawing different Textures with a single Basic Effect, XNA 4.0 QUESTION: I have a problem in the game I wrote with XNA. I recently added Textured polygons, and saw that every textured polygon shared the same texture although I changed it before calling. The code I am using: if (countMeshes > 0) { for (int i = ...
[ "c#", "textures", "xna-4.0" ]
2
1
1,371
1
0
2011-06-04T10:50:30.433000
2011-06-05T10:24:21.990000
6,236,294
6,236,376
Stop emacs from opening window automatically
This question probably applies to other emacs modes than haskell-mode, since I assume emacs has got a general way of opening windows for automatically created buffers: haskell-mode for emacs enables me to hit C-c C-l to load the contents of the current buffer into a Haskell interactive session, which automatically caus...
Ah, I found a solution just after posting this:). Adding (setq special-display-buffer-names '("*haskell*" "*Help*")) to my.emacs tells emacs to open these buffers in a frame instead of a split. Edit: But still, an even better solution would be for emacs never to create frames/splits automatically, but just silently cre...
Stop emacs from opening window automatically This question probably applies to other emacs modes than haskell-mode, since I assume emacs has got a general way of opening windows for automatically created buffers: haskell-mode for emacs enables me to hit C-c C-l to load the contents of the current buffer into a Haskell ...
TITLE: Stop emacs from opening window automatically QUESTION: This question probably applies to other emacs modes than haskell-mode, since I assume emacs has got a general way of opening windows for automatically created buffers: haskell-mode for emacs enables me to hit C-c C-l to load the contents of the current buff...
[ "emacs" ]
1
4
1,853
2
0
2011-06-04T10:51:19.630000
2011-06-04T11:08:15.393000
6,236,297
6,236,357
How do you notify a view controller that a row has been selected in a UIPickerView?
How do I notify my view controller and pass it the string when a row was selected in my UIPickerView? I have a custom UIPickerView in regular view and I have a custom datasource/delegate in a different class. How do I notify my view during the pickerView:didSelectRow:inComponent: delegate method? and pass the selected ...
The class that is conforming to the picker delegates would implement pickerView:didSelectRow:inComponent: to know which row (or string) was selected in the picker. If some other class from the outside world wants to know which row was selected, then this class in turn needs to inform. This will create a chain of delega...
How do you notify a view controller that a row has been selected in a UIPickerView? How do I notify my view controller and pass it the string when a row was selected in my UIPickerView? I have a custom UIPickerView in regular view and I have a custom datasource/delegate in a different class. How do I notify my view dur...
TITLE: How do you notify a view controller that a row has been selected in a UIPickerView? QUESTION: How do I notify my view controller and pass it the string when a row was selected in my UIPickerView? I have a custom UIPickerView in regular view and I have a custom datasource/delegate in a different class. How do I ...
[ "iphone", "ios4", "uipickerview" ]
0
1
317
3
0
2011-06-04T10:52:19.693000
2011-06-04T11:04:28.270000
6,236,307
6,237,363
Is there a static analysis tool to compute use-define chains?
I'm looking for a static analysis tool for C that performs dataflow analysis and computes use-define chains (preferably a command line tool). So far I have tried CIL, clang, lint, goanna and a few other static analysis tools, but none of them compute use-define chains. I also prefer not to work at the IR level (such as...
The Frama-C platform has plugins that compute def/use and can be used in batch mode from the command line.
Is there a static analysis tool to compute use-define chains? I'm looking for a static analysis tool for C that performs dataflow analysis and computes use-define chains (preferably a command line tool). So far I have tried CIL, clang, lint, goanna and a few other static analysis tools, but none of them compute use-def...
TITLE: Is there a static analysis tool to compute use-define chains? QUESTION: I'm looking for a static analysis tool for C that performs dataflow analysis and computes use-define chains (preferably a command line tool). So far I have tried CIL, clang, lint, goanna and a few other static analysis tools, but none of th...
[ "c", "static-analysis", "dataflow" ]
3
3
697
3
0
2011-06-04T10:54:54.247000
2011-06-04T14:41:46.290000
6,236,311
6,236,387
Unit testing console inputs and random numbers
I have a logic module for a turn based game (no UI yet), which uses async user input (parsed from console, until the real UI gets done), and in some cases generates random numbers ("die rolls") and makes changes in the game state-model based on the inputs and the random numbers. Reading this thread and this thread, I w...
Yes, that's all, but you don't even have to do that, if you don't want to. You don't have to create the interface IConsole, because in a way, it already exists. You can use TextReader for your input and TextWriter for your output. In real app, you pass in Console.In and Console.Out. In testing you can use StringReader ...
Unit testing console inputs and random numbers I have a logic module for a turn based game (no UI yet), which uses async user input (parsed from console, until the real UI gets done), and in some cases generates random numbers ("die rolls") and makes changes in the game state-model based on the inputs and the random nu...
TITLE: Unit testing console inputs and random numbers QUESTION: I have a logic module for a turn based game (no UI yet), which uses async user input (parsed from console, until the real UI gets done), and in some cases generates random numbers ("die rolls") and makes changes in the game state-model based on the inputs...
[ "c#", ".net", "unit-testing", "random" ]
1
3
998
2
0
2011-06-04T10:55:17.213000
2011-06-04T11:10:01.003000
6,236,321
6,236,814
Memcache Synchronization
I would like to know if any of you had, or may propose a solution to increase efficiency for online store based on Magento platform. We currently use multifront architecture (front == each separate server) using load-balancing and two Memcache servers. We're considering connection for each separate front an Memcache se...
If you are running memcached on its own hardware, there is no benefit to giving each store its own memcached server. Configure all front ends to use both memcached instances. This way, all front ends will go to the same memcached instance for a given key. Plus, you get automatic fail-over if one instance croaks, and yo...
Memcache Synchronization I would like to know if any of you had, or may propose a solution to increase efficiency for online store based on Magento platform. We currently use multifront architecture (front == each separate server) using load-balancing and two Memcache servers. We're considering connection for each sepa...
TITLE: Memcache Synchronization QUESTION: I would like to know if any of you had, or may propose a solution to increase efficiency for online store based on Magento platform. We currently use multifront architecture (front == each separate server) using load-balancing and two Memcache servers. We're considering connec...
[ "magento", "synchronization", "memcached" ]
0
1
2,827
2
0
2011-06-04T10:57:06.077000
2011-06-04T12:45:31.140000
6,236,329
6,236,474
Rails Include Module on Condition
I'm trying to include a module only when a condition is met. module PremiumServer def is_premium true end end class Server include Mongoid::Document include PremiumServer if self.premium field:premium,:type => Boolean,:default => false end This isn't working, and I can't figure out why. Can someone please tell me how ...
includes happen on the class level. Your premium attribute is at instance level. There are ways to do the include on per instance level, but I would not recommend them. Here you are better of using inheritance class Server;..; end class PremiumServer < Server;..; end Or, in your case, if the only method is is_premium a...
Rails Include Module on Condition I'm trying to include a module only when a condition is met. module PremiumServer def is_premium true end end class Server include Mongoid::Document include PremiumServer if self.premium field:premium,:type => Boolean,:default => false end This isn't working, and I can't figure out wh...
TITLE: Rails Include Module on Condition QUESTION: I'm trying to include a module only when a condition is met. module PremiumServer def is_premium true end end class Server include Mongoid::Document include PremiumServer if self.premium field:premium,:type => Boolean,:default => false end This isn't working, and I c...
[ "ruby", "module", "mongoid" ]
1
8
7,302
2
0
2011-06-04T10:58:11.337000
2011-06-04T11:29:37.507000
6,236,340
6,236,379
How to limit speed of internet connection on Android emulator?
I need to test app for work with slow internet connection. How to simulate slow internet connection on Android emulator?
For Android Studio projects you can do the following: If you need to change net speed temporarily, then on an emulator toolbar, click three dots (settings), go to Cellular tab and configure the network speed there. You need to have a recent Android Tools. If you want to set this speed permanently for some emulator imag...
How to limit speed of internet connection on Android emulator? I need to test app for work with slow internet connection. How to simulate slow internet connection on Android emulator?
TITLE: How to limit speed of internet connection on Android emulator? QUESTION: I need to test app for work with slow internet connection. How to simulate slow internet connection on Android emulator? ANSWER: For Android Studio projects you can do the following: If you need to change net speed temporarily, then on an...
[ "android", "performance", "connection" ]
61
85
54,820
7
0
2011-06-04T11:01:12.750000
2011-06-04T11:08:44.217000
6,236,341
6,236,396
dynamically set value of DataKeyNames in gridview
How i could set the value of DataKeyNames of gridview in C# code? since my gridview is generated dynamically, i need to set it from.cs file
Write code in cs file like GridView d; protected void Page_Load(object sender, EventArgs e) { d = new GridView(); d.DataKeyNames = new string[] { "Column1", "Column2" }; form1.Controls.Add(d); }
dynamically set value of DataKeyNames in gridview How i could set the value of DataKeyNames of gridview in C# code? since my gridview is generated dynamically, i need to set it from.cs file
TITLE: dynamically set value of DataKeyNames in gridview QUESTION: How i could set the value of DataKeyNames of gridview in C# code? since my gridview is generated dynamically, i need to set it from.cs file ANSWER: Write code in cs file like GridView d; protected void Page_Load(object sender, EventArgs e) { d = new ...
[ "c#", "asp.net" ]
5
12
19,181
4
0
2011-06-04T11:01:19.950000
2011-06-04T11:11:57.523000
6,236,342
6,236,971
Sobel Filter implementation for Harris Corner Detector
I have to implement a Harris detector and am not quite sure about the following detail regarding the Sobel filter to obtain the image derivative. When applying the Sobel filter to a Grayscale image, I might get negative intensity values. Do I need to convert the Image back to a Matrix of only positive values before I c...
I don't think you need to restrict it to only positive values. You can look at VLFeat 's Harris corner detection implementation (Matlab/C source included). It's in the toolbox directory: vl_harris.m
Sobel Filter implementation for Harris Corner Detector I have to implement a Harris detector and am not quite sure about the following detail regarding the Sobel filter to obtain the image derivative. When applying the Sobel filter to a Grayscale image, I might get negative intensity values. Do I need to convert the Im...
TITLE: Sobel Filter implementation for Harris Corner Detector QUESTION: I have to implement a Harris detector and am not quite sure about the following detail regarding the Sobel filter to obtain the image derivative. When applying the Sobel filter to a Grayscale image, I might get negative intensity values. Do I need...
[ "computer-vision" ]
1
1
2,543
1
0
2011-06-04T11:01:39.670000
2011-06-04T13:22:55.193000
6,236,371
6,236,873
PHP fetching data from MySQL database
So I'm trying to fetch data in a many-to-many relationship. So far I have this, which finds the user: $user = $_SESSION['user']; $userID = mysql_query("SELECT * FROM users WHERE user='$user'") or die(mysql_error()); And I know that to echo this information I have to put it in an array like so: while ($r = mysql_fetch_a...
You can get your projects with one query: $user = mysql_real_escape_string($_SESSION['user']); $query = mysql_query("SELECT pu.projects_ID FROM users u INNER JOIN projects_users pu ON (pu.users_ID = u.users_id) WHERE u.user='$user'") or die(mysql_error()); $result = mysql_query($query) or die(mysql_error()); while (...
PHP fetching data from MySQL database So I'm trying to fetch data in a many-to-many relationship. So far I have this, which finds the user: $user = $_SESSION['user']; $userID = mysql_query("SELECT * FROM users WHERE user='$user'") or die(mysql_error()); And I know that to echo this information I have to put it in an ar...
TITLE: PHP fetching data from MySQL database QUESTION: So I'm trying to fetch data in a many-to-many relationship. So far I have this, which finds the user: $user = $_SESSION['user']; $userID = mysql_query("SELECT * FROM users WHERE user='$user'") or die(mysql_error()); And I know that to echo this information I have ...
[ "php", "mysql" ]
3
0
14,013
5
0
2011-06-04T11:07:16.200000
2011-06-04T13:01:20.070000
6,236,374
6,236,518
Android, Unlimited Number of Activities in a Project and activity lifecycle !
Some days ago I have published my application in Android Marketplace and a question came into my mind during designing and developing application. This question is about limitation or unlimitation of number of activities. For example, my application includes 37 activities. Is it so much? I want to know for a game such ...
In the case of Anry Bairds, I doubt they have 100s of activities, I think they just have one (or possibly a couple) for levels and another for the welcome screen - different levels are probably loaded depending on some parameter that was passed to the activity. As for how to handle 100s of loaded activities, first of a...
Android, Unlimited Number of Activities in a Project and activity lifecycle ! Some days ago I have published my application in Android Marketplace and a question came into my mind during designing and developing application. This question is about limitation or unlimitation of number of activities. For example, my appl...
TITLE: Android, Unlimited Number of Activities in a Project and activity lifecycle ! QUESTION: Some days ago I have published my application in Android Marketplace and a question came into my mind during designing and developing application. This question is about limitation or unlimitation of number of activities. Fo...
[ "android", "android-activity", "lifecycle" ]
3
2
1,009
4
0
2011-06-04T11:07:46.330000
2011-06-04T11:39:03.057000
6,236,385
6,236,461
MySQL query, how to use string in multiple ways?
I'm trying to create a MySql query which will construct a string using the CONCAT function within 2 loops. I'm wondering if a string can be used both as a variable and a reference to a field in a table? My code so far is below, which is returning some syntax error near the UPDATE line:... WHILE x <= 5 DO WHILE y <= 3 ...
Lets start at the beginning: Change this code: SELECT @str_data = CONCAT(str,'data_',x); SELECT @str_data = CONCAT(str,'_',y); To: SET @str_data = CONCAT(str, 'data_',x,'_',y); I'm wondering why you are mixing DECLARE variables (str) with @vars *(@str_data)*, it looks very confused. So this code: SELECT @variable:= @st...
MySQL query, how to use string in multiple ways? I'm trying to create a MySql query which will construct a string using the CONCAT function within 2 loops. I'm wondering if a string can be used both as a variable and a reference to a field in a table? My code so far is below, which is returning some syntax error near t...
TITLE: MySQL query, how to use string in multiple ways? QUESTION: I'm trying to create a MySql query which will construct a string using the CONCAT function within 2 loops. I'm wondering if a string can be used both as a variable and a reference to a field in a table? My code so far is below, which is returning some s...
[ "php", "mysql" ]
0
1
293
1
0
2011-06-04T11:09:56.143000
2011-06-04T11:24:01.537000
6,236,386
6,236,842
Not understanding why ViewState is not increasing in size when changing content?
I thought I understood ViewState, but this is a bit of a weird one. I have a page of 1000 labels and textboxes like this: Label1 All incremeting by 1. I've added a button to the top: and the corresponding code is: protected void ChangeValues(object sender, EventArgs e) { for (int i = 1; i <= 1000; i++) { string textBox...
Perhaps it's because the Text property of a TextBox doesn't need to be saved to ViewState as it will be rendered to the page and posted back with the post data. If you look at the implementation of TextBox with Reflector you'll see it has a property SaveTextViewState that controls whether the Text property needs to be ...
Not understanding why ViewState is not increasing in size when changing content? I thought I understood ViewState, but this is a bit of a weird one. I have a page of 1000 labels and textboxes like this: Label1 All incremeting by 1. I've added a button to the top: and the corresponding code is: protected void ChangeValu...
TITLE: Not understanding why ViewState is not increasing in size when changing content? QUESTION: I thought I understood ViewState, but this is a bit of a weird one. I have a page of 1000 labels and textboxes like this: Label1 All incremeting by 1. I've added a button to the top: and the corresponding code is: protect...
[ "c#", "viewstate", "asp.net-4.0" ]
0
2
429
2
0
2011-06-04T11:09:57.797000
2011-06-04T12:51:34.720000
6,236,391
6,236,435
How to avoid useless white border in resized PNG with transparent background?
I have a folder containing about 2500 PNG images, with no transparency. Every image is about 500 x 500 (some are 491 x 433, others 511 x 499 etc). I want to programatically downsize every image to 10% of its original size, and to set the white background of every image as the transparent color. To test the functionalit...
I can't help with the specific code, but maybe can explain what's happening. newimg.MakeTransparent(Color.White); This will take one color, and make it transparent. The catch is that, there's a spectrum of colors between the edge of your billiard ball (orange) and the pure white background. This is the antialiasing of ...
How to avoid useless white border in resized PNG with transparent background? I have a folder containing about 2500 PNG images, with no transparency. Every image is about 500 x 500 (some are 491 x 433, others 511 x 499 etc). I want to programatically downsize every image to 10% of its original size, and to set the whit...
TITLE: How to avoid useless white border in resized PNG with transparent background? QUESTION: I have a folder containing about 2500 PNG images, with no transparency. Every image is about 500 x 500 (some are 491 x 433, others 511 x 499 etc). I want to programatically downsize every image to 10% of its original size, a...
[ "c#", "image-processing", "resize", "transparency", "system.drawing.imaging" ]
3
4
2,927
2
0
2011-06-04T11:11:09.413000
2011-06-04T11:20:08.190000
6,236,395
6,236,502
Null cursor in Android
I have a problem in my app. I have some lists and each of them has a date. If the date of a list is today I made a Notification,and in my notification I put the items from that list. The problem is that if my list empty I get force Close. I put the condition to make the notification only if the cursor is not null,but i...
Add the following check to see if the cursor has any results: if (cr!= null && cr.moveToFirst()) { //... } You need to moveToFirst() before getting data. Because you're using a do...while instead of while(), you're not initialising the cursor properly.
Null cursor in Android I have a problem in my app. I have some lists and each of them has a date. If the date of a list is today I made a Notification,and in my notification I put the items from that list. The problem is that if my list empty I get force Close. I put the condition to make the notification only if the c...
TITLE: Null cursor in Android QUESTION: I have a problem in my app. I have some lists and each of them has a date. If the date of a list is today I made a Notification,and in my notification I put the items from that list. The problem is that if my list empty I get force Close. I put the condition to make the notifica...
[ "android", "notifications" ]
5
6
2,008
1
0
2011-06-04T11:11:55.317000
2011-06-04T11:35:31.063000
6,236,417
6,236,449
Help with java regex
Hey, I've been struggling with this regex and I'm out of ideas. I have this types of strings (not all of them are here, but only this 2 types) and I have to extract the part between the th tags. manje ne d. manje točno više m./t. v./t. daje X2 12 I've tried some combinations bu I only get the value if there is no that ...
Try this one: Pattern pattern = Pattern.compile(" ]*>(.*) ");
Help with java regex Hey, I've been struggling with this regex and I'm out of ideas. I have this types of strings (not all of them are here, but only this 2 types) and I have to extract the part between the th tags. manje ne d. manje točno više m./t. v./t. daje X2 12 I've tried some combinations bu I only get the value...
TITLE: Help with java regex QUESTION: Hey, I've been struggling with this regex and I'm out of ideas. I have this types of strings (not all of them are here, but only this 2 types) and I have to extract the part between the th tags. manje ne d. manje točno više m./t. v./t. daje X2 12 I've tried some combinations bu I ...
[ "java", "regex" ]
3
0
142
5
0
2011-06-04T11:16:52.643000
2011-06-04T11:22:26.187000
6,236,436
6,236,548
How can I modify cookies' lifetimes with Chrome (Mac)?
In Safari, when I wanted to avoid Cookies to expire (e.g. in order to stay logged in to MediaWiki for longer than 4 weeks), i could open the cookies file in a text editor and just change the expiry date. Any idea how to do this with Chrome (on a Mac)? The cookie file (http://stackoverflow.com/questions/4528208/google-c...
Could you not install an extension to help you out like this one: https://chrome.google.com/webstore/detail/fngmhnnpilhplaeedifhccceomclgfbg?hl=en-GB
How can I modify cookies' lifetimes with Chrome (Mac)? In Safari, when I wanted to avoid Cookies to expire (e.g. in order to stay logged in to MediaWiki for longer than 4 weeks), i could open the cookies file in a text editor and just change the expiry date. Any idea how to do this with Chrome (on a Mac)? The cookie fi...
TITLE: How can I modify cookies' lifetimes with Chrome (Mac)? QUESTION: In Safari, when I wanted to avoid Cookies to expire (e.g. in order to stay logged in to MediaWiki for longer than 4 weeks), i could open the cookies file in a text editor and just change the expiry date. Any idea how to do this with Chrome (on a M...
[ "google-chrome", "cookies" ]
1
1
558
1
0
2011-06-04T11:20:32.690000
2011-06-04T11:44:51.227000
6,236,444
6,236,459
How detect browser with .htaccess
I want detect user browsers with.htaccess & redirect when user does not entered the site from cell phone
You can start here with an example. # Rewrite requests from all user-agents except modern Internet Explorer, Firefox, Opera RewriteCond %{HTTP_USER_AGENT}!^Mozilla/4\.[0-9]+\ \(compatible;\ MSIE\ [0-9.]+ RewriteCond %{HTTP_USER_AGENT}!^Mozilla/5\.0 \(([^;]+;\ )*[^;]+\)\ Gecko/2[0-9]{3}\ Firefox/[0-9.]+ RewriteCond %{HT...
How detect browser with .htaccess I want detect user browsers with.htaccess & redirect when user does not entered the site from cell phone
TITLE: How detect browser with .htaccess QUESTION: I want detect user browsers with.htaccess & redirect when user does not entered the site from cell phone ANSWER: You can start here with an example. # Rewrite requests from all user-agents except modern Internet Explorer, Firefox, Opera RewriteCond %{HTTP_USER_AGENT}...
[ "php", "html", ".htaccess", "wap", "wml" ]
3
8
4,095
1
0
2011-06-04T11:21:27.357000
2011-06-04T11:23:39.323000
6,236,447
6,236,560
vertical scroll bar disappears when DIV is in overflow state ( I.E. only)
I have the following DIV in I.E. (version 9 and 8): some large text blah blah.... both horizontal and vertical scroll bars display right on all browsers except IE, it only displays the horizontal one, and then, I have to scroll vertically using the mouse. is there a solution for this problem? thanks in advance.
I tryed this snippet with every browsers (including IE 7, 8 and 9) and I have no problems. Your style attribute is misspelled but I guess it's a typo... Optionally, you can try this instead of "overflow:auto;": overflow-x: auto; overflow-y: auto; But this is the normal behaviour of "overflow:auto;".
vertical scroll bar disappears when DIV is in overflow state ( I.E. only) I have the following DIV in I.E. (version 9 and 8): some large text blah blah.... both horizontal and vertical scroll bars display right on all browsers except IE, it only displays the horizontal one, and then, I have to scroll vertically using t...
TITLE: vertical scroll bar disappears when DIV is in overflow state ( I.E. only) QUESTION: I have the following DIV in I.E. (version 9 and 8): some large text blah blah.... both horizontal and vertical scroll bars display right on all browsers except IE, it only displays the horizontal one, and then, I have to scroll ...
[ "html", "css" ]
0
1
3,673
1
0
2011-06-04T11:21:55.937000
2011-06-04T11:48:58.603000
6,236,448
6,237,377
Codeigniter using flashdata and form_validation
I am trying to learn PHP with codeigniter, had have come across a problem. Am writing a user registration form with form validation. If the user input has passed validation, it will check database if the email is already existing in the database. If it exists, it should show an error to the user. I am storing this erro...
If you redirect when a form that posts to itself is valid, then yes you will lose set_value() as there is now nothing in the $_POST array - this is why you redirect, so a user won't resubmit the form on refresh. What you should do is create your own validation rule in a callback function in the same controller. See her...
Codeigniter using flashdata and form_validation I am trying to learn PHP with codeigniter, had have come across a problem. Am writing a user registration form with form validation. If the user input has passed validation, it will check database if the email is already existing in the database. If it exists, it should s...
TITLE: Codeigniter using flashdata and form_validation QUESTION: I am trying to learn PHP with codeigniter, had have come across a problem. Am writing a user registration form with form validation. If the user input has passed validation, it will check database if the email is already existing in the database. If it e...
[ "codeigniter", "validation" ]
1
2
3,397
2
0
2011-06-04T11:22:21.597000
2011-06-04T14:45:21.827000
6,236,457
6,236,734
Faster Loading of Bitmaps
As per this link below: http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/ You can speed up loading of bitmaps (or any files) if you do the buffering yourself (i.e., instead of using BufferedInputStream, you handle the buffering yourself). In particular, Approach 4 looks promising (slurp whole file...
This technique is not optimized for Android and will likely run poorly. The convention is to use AndroidHttpClient: Subclass of the Apache DefaultHttpClient that is configured with reasonable default settings and registered schemes for Android, and also lets the user add HttpRequestInterceptor classes. If you really wa...
Faster Loading of Bitmaps As per this link below: http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/ You can speed up loading of bitmaps (or any files) if you do the buffering yourself (i.e., instead of using BufferedInputStream, you handle the buffering yourself). In particular, Approach 4 looks p...
TITLE: Faster Loading of Bitmaps QUESTION: As per this link below: http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/ You can speed up loading of bitmaps (or any files) if you do the buffering yourself (i.e., instead of using BufferedInputStream, you handle the buffering yourself). In particular, ...
[ "android", "bitmap", "bufferedinputstream" ]
0
0
430
1
0
2011-06-04T11:23:00.713000
2011-06-04T12:27:13.327000
6,236,458
6,236,808
Plot using With versus Plot using Block (Mathematica)
I want to describe an issue I have been having with Plot using With to keep defined parameters 'local'. I am not necessarily asking for a fix: the problem I have is one of understanding. Sometimes I use a construction such as the following to obtain a Plot: Method 1 plot1 = With[{vmax = 10, km = 10}, Plot[Evaluate@((vm...
Your question is not so much about Plot as it is about how the scoping constructs work. The main confusion here is due to the differences between lexical and dynamic scoping. And the main culprit is this definition: f[x_]:= (vmax x)/(km + x) The problem with it is that it makes f implicitly depend on the global symbols...
Plot using With versus Plot using Block (Mathematica) I want to describe an issue I have been having with Plot using With to keep defined parameters 'local'. I am not necessarily asking for a fix: the problem I have is one of understanding. Sometimes I use a construction such as the following to obtain a Plot: Method 1...
TITLE: Plot using With versus Plot using Block (Mathematica) QUESTION: I want to describe an issue I have been having with Plot using With to keep defined parameters 'local'. I am not necessarily asking for a fix: the problem I have is one of understanding. Sometimes I use a construction such as the following to obtai...
[ "wolfram-mathematica" ]
31
68
4,495
2
0
2011-06-04T11:23:17.413000
2011-06-04T12:43:37.547000
6,236,468
6,236,516
calling kernel32.dll function without including windows.h
if kernel32.dll is guaranteed to loaded into a process virtual memory,why couldn't i call function such as Sleep without including windows.h? the below is an excerpt quoting from vividmachine.com 5. So, what about windows? How do I find the addresses of my needed DLL functions? Don't these addresses change with every s...
The article you quoted focuses on getting the address of the function. You still need the function prototype of the function (which doesn't change across versions), in order to generate the code for calling the function - with appropriate handling of input and output arguments, register values, and stack. The windows.h...
calling kernel32.dll function without including windows.h if kernel32.dll is guaranteed to loaded into a process virtual memory,why couldn't i call function such as Sleep without including windows.h? the below is an excerpt quoting from vividmachine.com 5. So, what about windows? How do I find the addresses of my neede...
TITLE: calling kernel32.dll function without including windows.h QUESTION: if kernel32.dll is guaranteed to loaded into a process virtual memory,why couldn't i call function such as Sleep without including windows.h? the below is an excerpt quoting from vividmachine.com 5. So, what about windows? How do I find the add...
[ "c++", "winapi", "dll", "shellcode" ]
1
6
4,941
4
0
2011-06-04T11:26:27.880000
2011-06-04T11:38:13.677000
6,236,471
6,236,540
Items in NSDictionary returns NULL
I'm using MGTWitterEngine and I cannot figure out why my dictionary items are returning null. I have this method: - (void)searchResultsReceived:(NSArray *)searchResults forRequest:(NSString *)connectionIdentifier{ NSDictionary *result = [searchResults objectAtIndex:0]; NSString *fromUser = [result valueForKey:@"from_us...
Look at this question: Parsing Search Result with MGTwitterEngine in Objective C They use: - (void)searchResultsReceived:(NSArray *)searchResults forRequest:(NSString *)connectionIdentifier { if ([searchResults count] > 0) { NSDictionary *result = [searchResults objectAtIndex:0]; NSString *fromUser = [result valueForK...
Items in NSDictionary returns NULL I'm using MGTWitterEngine and I cannot figure out why my dictionary items are returning null. I have this method: - (void)searchResultsReceived:(NSArray *)searchResults forRequest:(NSString *)connectionIdentifier{ NSDictionary *result = [searchResults objectAtIndex:0]; NSString *fromU...
TITLE: Items in NSDictionary returns NULL QUESTION: I'm using MGTWitterEngine and I cannot figure out why my dictionary items are returning null. I have this method: - (void)searchResultsReceived:(NSArray *)searchResults forRequest:(NSString *)connectionIdentifier{ NSDictionary *result = [searchResults objectAtIndex:0...
[ "iphone", "nsdictionary", "mgtwitterengine" ]
0
1
856
1
0
2011-06-04T11:28:13.487000
2011-06-04T11:43:35.117000
6,236,477
6,236,525
What's the concept I should use to build "hierarchical" GUIs in Qt?
I've done a lot of WPF and am now, for the first time, trying to get a grasp of Qt, so far fairly successful. However, in WPF, I'm used to encapsulate self-enclosed parts of GUIs in User Controls so that I can then easily re-use them across dialogs or rearrange an entire block without having to touch every single eleme...
You would create custom classes based on QWidget or some other simple widget class ( QFrame for instance). It's pretty standard practice, no need for another concept.
What's the concept I should use to build "hierarchical" GUIs in Qt? I've done a lot of WPF and am now, for the first time, trying to get a grasp of Qt, so far fairly successful. However, in WPF, I'm used to encapsulate self-enclosed parts of GUIs in User Controls so that I can then easily re-use them across dialogs or ...
TITLE: What's the concept I should use to build "hierarchical" GUIs in Qt? QUESTION: I've done a lot of WPF and am now, for the first time, trying to get a grasp of Qt, so far fairly successful. However, in WPF, I'm used to encapsulate self-enclosed parts of GUIs in User Controls so that I can then easily re-use them ...
[ "wpf", "qt", "user-interface", "controls" ]
4
4
92
1
0
2011-06-04T11:29:52.183000
2011-06-04T11:40:17.920000
6,236,479
6,236,693
Python with eclipse import problem
I use eclipse as my IDE for python. Recently I encountered a strange problem. A file contains an import from external libraries (such as wx, matplotlib etc.) if I put it inside the src directory, it will run as expected, but in the editor, I get error marks all over the places where I use the imported libraries. The er...
In my installation I have several other libraries in the system pythonpath dialog including wx. Try setting the interpreter again in order to reload the libraries or load them manually.
Python with eclipse import problem I use eclipse as my IDE for python. Recently I encountered a strange problem. A file contains an import from external libraries (such as wx, matplotlib etc.) if I put it inside the src directory, it will run as expected, but in the editor, I get error marks all over the places where I...
TITLE: Python with eclipse import problem QUESTION: I use eclipse as my IDE for python. Recently I encountered a strange problem. A file contains an import from external libraries (such as wx, matplotlib etc.) if I put it inside the src directory, it will run as expected, but in the editor, I get error marks all over ...
[ "python", "eclipse", "eclipse-plugin" ]
1
2
664
1
0
2011-06-04T11:30:03.783000
2011-06-04T12:16:14.467000
6,236,483
6,238,403
C# FlowDocument to HTML conversion
Basically, I have a RichTextBox and I want to convert the formatted contents of it to HTML so it can be sent as an email. The method I am currently using does not give any formatting at all: string message = new TextRange(messageTextBox.Document.ContentStart, messageTextBox.Document.ContentEnd).Text; So I searched arou...
The general technique is to use a XamlWriter to convert the FlowDocument content to a stream of XML, and then to use an XSLT transform to convert the XML to HTML. That's not much of an answer, but that's because there's a huge range of possible HTML representations of any given FlowDocument. This transform, for instanc...
C# FlowDocument to HTML conversion Basically, I have a RichTextBox and I want to convert the formatted contents of it to HTML so it can be sent as an email. The method I am currently using does not give any formatting at all: string message = new TextRange(messageTextBox.Document.ContentStart, messageTextBox.Document.C...
TITLE: C# FlowDocument to HTML conversion QUESTION: Basically, I have a RichTextBox and I want to convert the formatted contents of it to HTML so it can be sent as an email. The method I am currently using does not give any formatting at all: string message = new TextRange(messageTextBox.Document.ContentStart, message...
[ "c#", "wpf", "richtextbox", "flowdocument" ]
9
14
10,600
3
0
2011-06-04T11:30:52.483000
2011-06-04T17:46:06.853000
6,236,487
6,237,529
jQuery UI - Autcomplete - dynamically set with based on content
Is there a way to set the width of an autocomplete object dynamically, based on the length of text returned to it? Thanks
This one took a bit of effort but I believe I have a reasonable solution. Primarily this requires binding to the "open" event of the autocomplete widget in order to change the default behavior of the menu as it displays, as well as modifying a few CSS attributes to help us out. The method comes with one caveat: this wi...
jQuery UI - Autcomplete - dynamically set with based on content Is there a way to set the width of an autocomplete object dynamically, based on the length of text returned to it? Thanks
TITLE: jQuery UI - Autcomplete - dynamically set with based on content QUESTION: Is there a way to set the width of an autocomplete object dynamically, based on the length of text returned to it? Thanks ANSWER: This one took a bit of effort but I believe I have a reasonable solution. Primarily this requires binding t...
[ "jquery", "jquery-ui", "jquery-ui-autocomplete" ]
1
1
1,695
2
0
2011-06-04T11:31:34.663000
2011-06-04T15:12:58.873000
6,236,491
6,260,279
Creating Stored Procedures that can work with different tables
I need to use the same Stored Procedures against many tables all with the same structure in my DB. This is data loaded from customers,with one table/customer and the data needs calculations/checks run before it's loaded to our DataWarehouse. So far these are the options and issues I've found and I'm looking for a bette...
Maybe your approach is wrong, I will go deep in details in a while but it seems that your problem can be solved using SSIS -- Updated answer: First, the big picture: The most affordable way to process the tables dynamically is using a script instead of a stored procedure. If you want to make table access randomly chose...
Creating Stored Procedures that can work with different tables I need to use the same Stored Procedures against many tables all with the same structure in my DB. This is data loaded from customers,with one table/customer and the data needs calculations/checks run before it's loaded to our DataWarehouse. So far these ar...
TITLE: Creating Stored Procedures that can work with different tables QUESTION: I need to use the same Stored Procedures against many tables all with the same structure in my DB. This is data loaded from customers,with one table/customer and the data needs calculations/checks run before it's loaded to our DataWarehous...
[ "t-sql", "stored-procedures", "view" ]
3
11
647
5
0
2011-06-04T11:31:58.270000
2011-06-07T03:17:14.820000
6,236,494
6,236,655
Can I read just the key from plist?
Can I read just the key from plist without its value, also if I know the value can I read the key?
Reading.plist: NSString *path = [[NSBundle mainBundle] pathForResource:@"myPlist" ofType:@"plist"]; NSMutableDictionary *myDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; Getting all keys and all values: NSArray* allmyKeys = [myDictionary allKeys]; NSArray* allmyValues= [myDictionary allValues];...
Can I read just the key from plist? Can I read just the key from plist without its value, also if I know the value can I read the key?
TITLE: Can I read just the key from plist? QUESTION: Can I read just the key from plist without its value, also if I know the value can I read the key? ANSWER: Reading.plist: NSString *path = [[NSBundle mainBundle] pathForResource:@"myPlist" ofType:@"plist"]; NSMutableDictionary *myDictionary = [[NSMutableDictionary ...
[ "ios", "iphone", "ipad", "plist", "key-value" ]
5
11
2,817
4
0
2011-06-04T11:32:25.977000
2011-06-04T12:08:22.163000
6,236,503
6,236,551
Would this work to debug an iPad app on the device?
I don't have a "Developer Profile". But I want to test my app on the iPad device. Are there any workrounds? May e something like " TestFlight " but without the need of a profile. Something like a "temp" profile that is applied? Is there a unversial profile for anyone?
Unless your device is jailbroken, there is no known way to test your app on a device without a developer profile.
Would this work to debug an iPad app on the device? I don't have a "Developer Profile". But I want to test my app on the iPad device. Are there any workrounds? May e something like " TestFlight " but without the need of a profile. Something like a "temp" profile that is applied? Is there a unversial profile for anyone?
TITLE: Would this work to debug an iPad app on the device? QUESTION: I don't have a "Developer Profile". But I want to test my app on the iPad device. Are there any workrounds? May e something like " TestFlight " but without the need of a profile. Something like a "temp" profile that is applied? Is there a unversial p...
[ "ipad", "debugging", "certificate", "profile", "iphone-developer-program" ]
0
1
251
1
0
2011-06-04T11:35:50.757000
2011-06-04T11:45:55.537000
6,236,505
6,241,045
How to debug curl on IIS?
How to inspect CURL requests? My PHP scripts are hosted on IIS and I want to find some debugging tool for CURL. Could you suggest something in fiddler-style? (Or maybe there is a way to use fiddler itself, I failed to do so because if I make my CURL to tunnel through proxy 127.0.0.1 it makes CONNECT requests instead of...
wireshark is not working for HTTPS but for HTTP only. Can you change your curl script to use HTTP?
How to debug curl on IIS? How to inspect CURL requests? My PHP scripts are hosted on IIS and I want to find some debugging tool for CURL. Could you suggest something in fiddler-style? (Or maybe there is a way to use fiddler itself, I failed to do so because if I make my CURL to tunnel through proxy 127.0.0.1 it makes C...
TITLE: How to debug curl on IIS? QUESTION: How to inspect CURL requests? My PHP scripts are hosted on IIS and I want to find some debugging tool for CURL. Could you suggest something in fiddler-style? (Or maybe there is a way to use fiddler itself, I failed to do so because if I make my CURL to tunnel through proxy 12...
[ "php", "iis", "curl" ]
0
1
930
2
0
2011-06-04T11:36:23.837000
2011-06-05T04:41:54.760000
6,236,508
6,236,563
Using singleton class for sharing instance of database between activities?
Hey! I want to use a singleton class, because if I open the database every activity I get "Leak found"( that happens because I open the database even if it is already open ). I create a singleton class, but I don't know how should I use it. Here is my class: package com.ShoppingList; import com.ShoppingList.databases....
You can extend Application class and create there an instance of DbAdapter. This way it will be shared by all your activities.
Using singleton class for sharing instance of database between activities? Hey! I want to use a singleton class, because if I open the database every activity I get "Leak found"( that happens because I open the database even if it is already open ). I create a singleton class, but I don't know how should I use it. Here...
TITLE: Using singleton class for sharing instance of database between activities? QUESTION: Hey! I want to use a singleton class, because if I open the database every activity I get "Leak found"( that happens because I open the database even if it is already open ). I create a singleton class, but I don't know how sho...
[ "android", "database", "singleton" ]
0
1
1,792
3
0
2011-06-04T11:36:50.610000
2011-06-04T11:49:36.983000
6,236,511
6,241,587
Declarative Approach vs Programmatic Approach for Content Types Development?
For custom development of Content Types, which approach should be followed, Declarative Approach (via element.xml) vs Programmatic Approach (via code)? What are the pros and cons of each approach?
I think you should use code. Details can be found here: https://sharepoint.stackexchange.com/questions/13953/best-way-to-package-publishing-content-types
Declarative Approach vs Programmatic Approach for Content Types Development? For custom development of Content Types, which approach should be followed, Declarative Approach (via element.xml) vs Programmatic Approach (via code)? What are the pros and cons of each approach?
TITLE: Declarative Approach vs Programmatic Approach for Content Types Development? QUESTION: For custom development of Content Types, which approach should be followed, Declarative Approach (via element.xml) vs Programmatic Approach (via code)? What are the pros and cons of each approach? ANSWER: I think you should ...
[ "sharepoint", "sharepoint-2010", "content-type", "site-column" ]
1
0
1,426
2
0
2011-06-04T11:37:26.647000
2011-06-05T07:40:40.657000
6,236,521
6,236,572
Need to Click Popup with Gm script that is not always there
i'm still having a problem clicking a popup button on an auction site,that appears only if u won an auction. This popup seems tbe a problem. Ive managed to get help partially in Need to click a bid button with Grease monkey script, i'm able to get the bid buttons clicked, but the popu is stil a problem. The xpath for t...
The simplest solution would be to run this function, say every second, thus "waiting" for the popup to appear: setInterval(PopClick, 1000); It is also better to rewrite PopClick to check if the element is there, before calling click, like this: function PopClick () { var PopBtn1=document.getElementById("ctl00_mainConte...
Need to Click Popup with Gm script that is not always there i'm still having a problem clicking a popup button on an auction site,that appears only if u won an auction. This popup seems tbe a problem. Ive managed to get help partially in Need to click a bid button with Grease monkey script, i'm able to get the bid butt...
TITLE: Need to Click Popup with Gm script that is not always there QUESTION: i'm still having a problem clicking a popup button on an auction site,that appears only if u won an auction. This popup seems tbe a problem. Ive managed to get help partially in Need to click a bid button with Grease monkey script, i'm able t...
[ "xpath", "greasemonkey" ]
0
1
181
1
0
2011-06-04T11:39:29.977000
2011-06-04T11:51:09.970000
6,236,524
6,236,754
ASP.Net: how to draw map
HI, I am assigned a task to develop module for an already existing web application or to look for some third party plugin. The web application is developed using ASP.net and C# under.Net Framework 4.0. So if i develop by myself or i go for some 3rd party plugin then in both cases, my solutions need to work with above w...
Seems like you are in for some fun:) Infragistics seems to have a Silverlight control (http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/organization-chart.aspx#Overview) But you also might want to check out these as starting points: http://code.google.com/intl/nl-NL/apis/chart/interactive/...
ASP.Net: how to draw map HI, I am assigned a task to develop module for an already existing web application or to look for some third party plugin. The web application is developed using ASP.net and C# under.Net Framework 4.0. So if i develop by myself or i go for some 3rd party plugin then in both cases, my solutions ...
TITLE: ASP.Net: how to draw map QUESTION: HI, I am assigned a task to develop module for an already existing web application or to look for some third party plugin. The web application is developed using ASP.net and C# under.Net Framework 4.0. So if i develop by myself or i go for some 3rd party plugin then in both ca...
[ "asp.net" ]
2
1
1,008
2
0
2011-06-04T11:40:16.437000
2011-06-04T12:33:02.650000
6,236,529
6,237,293
Standard practise for ajax request page output?
What is the standard practise with PHP pages that are used for Ajax requests? Should they print out a single value (ex: get points of player with id = x)? Does/should a single page serve multiple requests? If so, how can code be grouped on the PHP side? P.S: An additional question: If a templating system like Smarty is...
I use this piece of code in Javascript. Backend wise things are organized in a MVC type of organisation, so things affecting one module are usually grouped together. In general I also create a sperate module for a seperate model, but in some cases you may deviate from this principle. PHP Execute a piece of code and wra...
Standard practise for ajax request page output? What is the standard practise with PHP pages that are used for Ajax requests? Should they print out a single value (ex: get points of player with id = x)? Does/should a single page serve multiple requests? If so, how can code be grouped on the PHP side? P.S: An additional...
TITLE: Standard practise for ajax request page output? QUESTION: What is the standard practise with PHP pages that are used for Ajax requests? Should they print out a single value (ex: get points of player with id = x)? Does/should a single page serve multiple requests? If so, how can code be grouped on the PHP side? ...
[ "php", "ajax", "coding-style" ]
2
1
274
2
0
2011-06-04T11:40:54.747000
2011-06-04T14:28:24.703000
6,236,535
6,236,765
Android listView styling
I want to change text color of the list item,below is my code public class HelloListView extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list); this.setListAdapter(new ArrayAdapter (this, android.R.layout.simple_list_item_1...
You are currently using an android built-in row component as a view for each row: android.R.layout.simple_list_item_1 If you want to customize it, pick the code and put your own version in your app. The original code can be found on google code project for android: Then you can customize xml and change the color attrib...
Android listView styling I want to change text color of the list item,below is my code public class HelloListView extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list); this.setListAdapter(new ArrayAdapter (this, android.R....
TITLE: Android listView styling QUESTION: I want to change text color of the list item,below is my code public class HelloListView extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list); this.setListAdapter(new ArrayAdapter...
[ "android", "listview", "styling" ]
0
1
2,374
2
0
2011-06-04T11:43:13.227000
2011-06-04T12:35:16.007000
6,236,538
6,237,034
mathematic range - simple question
I have a float number which represent percentage (0.0 to 100.0) % float represent = 50.00; // fifty present, or half. as an example: convert this number to a range from -2 to 2 thus: represent=0 will be represented as -2 represent=50 will be represented as 0 represent=100 will be represented as 2 EDIT: good simple answ...
This should do the trick: define map(v, r1, r2, t1, t2) { norm = (v-r1)/(r2-r1); return (t1*(1-norm) + t2*norm); } Explanation: norm is v scaled to a value between 0 and 1, related to r1 and r2. Next line is calculates the point between t1 and t2 using norm as percentage factor. Example usage: map (0, 0, 100, -2, 2) //...
mathematic range - simple question I have a float number which represent percentage (0.0 to 100.0) % float represent = 50.00; // fifty present, or half. as an example: convert this number to a range from -2 to 2 thus: represent=0 will be represented as -2 represent=50 will be represented as 0 represent=100 will be repr...
TITLE: mathematic range - simple question QUESTION: I have a float number which represent percentage (0.0 to 100.0) % float represent = 50.00; // fifty present, or half. as an example: convert this number to a range from -2 to 2 thus: represent=0 will be represented as -2 represent=50 will be represented as 0 represen...
[ "iphone", "objective-c", "math" ]
1
1
183
2
0
2011-06-04T11:43:20.670000
2011-06-04T13:35:09.693000
6,236,542
6,236,724
Password strength check: comparing to previous passwords
Every now and then I come across applications that force you to change passwords once in a while. Almost universally, they have this strange requirement for the new password: it has to be "significantly" different from your previous password(s). While at first this sounds logical, next thing I think is: how do they do ...
With a typical hash, the best you can do is see if the new password is exactly equal to previous ones. You can break the password into multiple hashes in order to get more flexible with comparison, for example 3 hashes: Alpha characters only Numeric characters only All other characters You could for example require all...
Password strength check: comparing to previous passwords Every now and then I come across applications that force you to change passwords once in a while. Almost universally, they have this strange requirement for the new password: it has to be "significantly" different from your previous password(s). While at first th...
TITLE: Password strength check: comparing to previous passwords QUESTION: Every now and then I come across applications that force you to change passwords once in a while. Almost universally, they have this strange requirement for the new password: it has to be "significantly" different from your previous password(s)....
[ "cryptography", "passwords" ]
16
8
1,302
2
0
2011-06-04T11:44:08.737000
2011-06-04T12:24:05.207000
6,236,552
6,236,744
how to automated a BUILD task
I need help about how to automated a task with MSBUILD. I wrote a small command line program that process files and I want integrate it at the moment of BUILD the solution. The program itself is used like this: Processor.exe inputFile.txt outputFile.txt –p -p of course represents some parameters. Is there a simple way ...
There are different solutions but in your case the best is probably with custom AfterBuild target and Exec task. You should add it to your cproj file after Microsoft.CSharp.targets get imported. You can read more about Exec Task here: Exec Task
how to automated a BUILD task I need help about how to automated a task with MSBUILD. I wrote a small command line program that process files and I want integrate it at the moment of BUILD the solution. The program itself is used like this: Processor.exe inputFile.txt outputFile.txt –p -p of course represents some para...
TITLE: how to automated a BUILD task QUESTION: I need help about how to automated a task with MSBUILD. I wrote a small command line program that process files and I want integrate it at the moment of BUILD the solution. The program itself is used like this: Processor.exe inputFile.txt outputFile.txt –p -p of course re...
[ "visual-studio-2010", "msbuild", "msbuild-task" ]
1
3
398
1
0
2011-06-04T11:46:05.590000
2011-06-04T12:30:12.403000
6,236,557
6,236,577
Cursor going out of bound
I have a scenerio in which i have to move the cursor to next and previous. I am runing into exception when the cursor is already at the first or last location, then it throws out of bound exception. How to tackle this situation? What is the best way to handle it and currently i am handling it with exception [try and ca...
if (!currentCursor.isLast()){ currentCursor.moveToNext(); //... }
Cursor going out of bound I have a scenerio in which i have to move the cursor to next and previous. I am runing into exception when the cursor is already at the first or last location, then it throws out of bound exception. How to tackle this situation? What is the best way to handle it and currently i am handling it ...
TITLE: Cursor going out of bound QUESTION: I have a scenerio in which i have to move the cursor to next and previous. I am runing into exception when the cursor is already at the first or last location, then it throws out of bound exception. How to tackle this situation? What is the best way to handle it and currently...
[ "android" ]
0
3
157
2
0
2011-06-04T11:48:34.760000
2011-06-04T11:52:08.480000
6,236,569
6,236,592
String assignment in C#
A few weeks ago, I discovered that strings in C# are defined as reference types and not value types. Initially I was confused about this, but then after some reading, I suddenly understood why it is important to store strings on the heap and not the stack - because it would be very inefficient to have a very large stri...
what language feature do strings use to keep them immutable? It is not a language feature. It is the way the class is defined. For example, class Integer { private readonly int value; public int Value { get { return this.value; } } public Integer(int value) { this.value = value; } } public Integer Add(Integer other) {...
String assignment in C# A few weeks ago, I discovered that strings in C# are defined as reference types and not value types. Initially I was confused about this, but then after some reading, I suddenly understood why it is important to store strings on the heap and not the stack - because it would be very inefficient t...
TITLE: String assignment in C# QUESTION: A few weeks ago, I discovered that strings in C# are defined as reference types and not value types. Initially I was confused about this, but then after some reading, I suddenly understood why it is important to store strings on the heap and not the stack - because it would be ...
[ "c#", "string", "reference", "heap-memory" ]
26
22
61,610
3
0
2011-06-04T11:50:11.253000
2011-06-04T11:55:19.817000
6,236,583
6,236,595
Create a file based on conditions
How to write a program in Java to check the existence of a txt file if does not exist than create a new one else append the new txt in that file.
FileWriter fstream = new FileWriter("foo.txt",true); BufferedWriter out = new BufferedWriter(fstream); out.write("foo bar"); out.close(); The second argumnet to FileWriter tells it to append.
Create a file based on conditions How to write a program in Java to check the existence of a txt file if does not exist than create a new one else append the new txt in that file.
TITLE: Create a file based on conditions QUESTION: How to write a program in Java to check the existence of a txt file if does not exist than create a new one else append the new txt in that file. ANSWER: FileWriter fstream = new FileWriter("foo.txt",true); BufferedWriter out = new BufferedWriter(fstream); out.write(...
[ "java", "file", "exception" ]
0
3
147
1
0
2011-06-04T11:53:38.977000
2011-06-04T11:56:10.250000
6,236,586
6,236,632
Remove JPanel with some JComponents from JDialog
if created a JPanel and then added some JComponents with these rules public class MyPanel extends JPanel { myButton = new MyButton() myButton.addXxxListener(...) myButton.... add(myButton) } public class MyButton extends JButton { //some constructors for parametrize JButton Object //build only JButton Object value or ...
just removing the panel and all listeners should suffice, as long you don't reference any of its subcomponents from other objects.
Remove JPanel with some JComponents from JDialog if created a JPanel and then added some JComponents with these rules public class MyPanel extends JPanel { myButton = new MyButton() myButton.addXxxListener(...) myButton.... add(myButton) } public class MyButton extends JButton { //some constructors for parametrize JBu...
TITLE: Remove JPanel with some JComponents from JDialog QUESTION: if created a JPanel and then added some JComponents with these rules public class MyPanel extends JPanel { myButton = new MyButton() myButton.addXxxListener(...) myButton.... add(myButton) } public class MyButton extends JButton { //some constructors f...
[ "java", "swing", "jdialog", "jcomponent" ]
2
2
315
1
0
2011-06-04T11:54:29.850000
2011-06-04T12:04:17.103000
6,236,587
6,236,661
Need help for explain scala problem
I have two scala classes (and their Java code when I use javap -private to read the class file). When I use n and d in the toString method, it will generate private member field in class. Why is that? I'm a little confused. Scala #1: class Rational(n: Int, d: Int) { } equivalent from javap: public class com.zjffdu.tut...
Well, the value of n and d needs to be available somehow from inside the toString body, right? Otherwise you couldn't use them. Anything could happen between when you construct a new instance and n and d happen to be on the stack, and when you call toString, and n and p have long disappeared from the stack. So the comp...
Need help for explain scala problem I have two scala classes (and their Java code when I use javap -private to read the class file). When I use n and d in the toString method, it will generate private member field in class. Why is that? I'm a little confused. Scala #1: class Rational(n: Int, d: Int) { } equivalent fro...
TITLE: Need help for explain scala problem QUESTION: I have two scala classes (and their Java code when I use javap -private to read the class file). When I use n and d in the toString method, it will generate private member field in class. Why is that? I'm a little confused. Scala #1: class Rational(n: Int, d: Int) {...
[ "scala" ]
4
7
142
3
0
2011-06-04T11:54:41.593000
2011-06-04T12:08:55.560000
6,236,589
6,236,615
My Math.random() method always return with 1 ? WHy?
There are 3 marbles randomly generated and i'll compare them if they are same,different or one is different. My code is below and my question is above... can u help me out? public static void marb(){ int a[],b[]; int num=0; a=new int[3]; b=new int[3]; a[0]=1; a[1]=2; a[2]=3; **num=(int)Math.random();** //num is alwa...
Create an instance of the random number generator Random rand = new Random(); which also seeds the generator. Then call int myrandnum = rand.nextInt(); Subsequent calls to the nextInt method will generate a different number.
My Math.random() method always return with 1 ? WHy? There are 3 marbles randomly generated and i'll compare them if they are same,different or one is different. My code is below and my question is above... can u help me out? public static void marb(){ int a[],b[]; int num=0; a=new int[3]; b=new int[3]; a[0]=1; a[1]=2...
TITLE: My Math.random() method always return with 1 ? WHy? QUESTION: There are 3 marbles randomly generated and i'll compare them if they are same,different or one is different. My code is below and my question is above... can u help me out? public static void marb(){ int a[],b[]; int num=0; a=new int[3]; b=new int[3...
[ "java" ]
0
2
7,031
8
0
2011-06-04T11:55:01.113000
2011-06-04T12:01:20.687000
6,236,594
6,236,641
Evaluating boolean values in PL/SQL
Say I have a boolean variable foo. At the moment I use IF foo = FALSE THEN... to compare it it, but it seems so cumbersome. There has to be a better way! An alternative would be to rename the variable to not_foo but that doesn't really make it any simpler. Is there a way to test like IF!foo THEN...?
I think you can use the IF NOT foo THEN... Statement. Check out this link for more information
Evaluating boolean values in PL/SQL Say I have a boolean variable foo. At the moment I use IF foo = FALSE THEN... to compare it it, but it seems so cumbersome. There has to be a better way! An alternative would be to rename the variable to not_foo but that doesn't really make it any simpler. Is there a way to test like...
TITLE: Evaluating boolean values in PL/SQL QUESTION: Say I have a boolean variable foo. At the moment I use IF foo = FALSE THEN... to compare it it, but it seems so cumbersome. There has to be a better way! An alternative would be to rename the variable to not_foo but that doesn't really make it any simpler. Is there ...
[ "plsql", "if-statement" ]
1
5
6,227
1
0
2011-06-04T11:56:08.303000
2011-06-04T12:05:32.663000
6,236,599
6,238,049
How can ASP.NET MVC enhance security compared to a webform?
Since we have separation of layers it should be easier to isolate each layer by security. How does MVC in ASP.NET exploit this to more easily secure a website compared to using a webform? By security I do not only mean authorization but also anti-hacking security.
1) Decorate Controller/Action by [Authorize] attribute (optionnaly with list of roles that allowed). Example: [Authorize("Manager")] public class MyController:Controller { //Each action available only for authorized user [Authorize(Roles = "Admin;Customer")] public ActionResult MyAction() { //This action is available t...
How can ASP.NET MVC enhance security compared to a webform? Since we have separation of layers it should be easier to isolate each layer by security. How does MVC in ASP.NET exploit this to more easily secure a website compared to using a webform? By security I do not only mean authorization but also anti-hacking secur...
TITLE: How can ASP.NET MVC enhance security compared to a webform? QUESTION: Since we have separation of layers it should be easier to isolate each layer by security. How does MVC in ASP.NET exploit this to more easily secure a website compared to using a webform? By security I do not only mean authorization but also ...
[ "asp.net", "asp.net-mvc" ]
1
1
227
3
0
2011-06-04T11:57:24.777000
2011-06-04T16:48:31.617000
6,236,602
6,236,685
How to open a file from Memory Stream
Is it possible to open a file directly from a MemoryStream opposed to writing to disk and doing Process.Start()? Specifically a pdf file? If not, I guess I need to write the MemoryStream to disk (which is kind of annoying). Could someone then point me to a resource about how to write a MemoryStream to Disk?
It depends on the client:) if the client will accept input from stdin you could push the dta to the client. Another possibility might be to write a named-pipes server or a socket-server - not trivial, but it may work. However, the simplest option is to just grab a temp file and write to that (and delete afterwards). va...
How to open a file from Memory Stream Is it possible to open a file directly from a MemoryStream opposed to writing to disk and doing Process.Start()? Specifically a pdf file? If not, I guess I need to write the MemoryStream to disk (which is kind of annoying). Could someone then point me to a resource about how to wri...
TITLE: How to open a file from Memory Stream QUESTION: Is it possible to open a file directly from a MemoryStream opposed to writing to disk and doing Process.Start()? Specifically a pdf file? If not, I guess I need to write the MemoryStream to disk (which is kind of annoying). Could someone then point me to a resourc...
[ "c#", "file", "file-io", "memorystream" ]
6
7
29,874
3
0
2011-06-04T11:58:35.217000
2011-06-04T12:14:47.093000
6,236,609
6,244,136
Problem with C# and 32feet.NET Bluetooth Library
I just started bluetooth programming. I need to come up with an desktop application in C# that receives images from a J2ME application. Before beginning...I just tried some code snippets from 32feet user guide...the guide is in VB.NET. The VB.NET works fine...but my C# is not working correctly. Here is the VB.NET snipp...
My guess is that the two programs are somehow using different versions of the library. And the C# compiler is using an older version of the library and copying in to the output folder. Check what versions the library assembly is in the same folder as each.exe. Likely also that Widcomm or BlueSoleil is being used on you...
Problem with C# and 32feet.NET Bluetooth Library I just started bluetooth programming. I need to come up with an desktop application in C# that receives images from a J2ME application. Before beginning...I just tried some code snippets from 32feet user guide...the guide is in VB.NET. The VB.NET works fine...but my C# i...
TITLE: Problem with C# and 32feet.NET Bluetooth Library QUESTION: I just started bluetooth programming. I need to come up with an desktop application in C# that receives images from a J2ME application. Before beginning...I just tried some code snippets from 32feet user guide...the guide is in VB.NET. The VB.NET works ...
[ "c#", "bluetooth" ]
1
2
4,504
2
0
2011-06-04T12:00:20.667000
2011-06-05T16:15:47.380000
6,236,617
6,236,710
Customized sprintf,is it worth the effort?
The code below is extracted from nginx,which basically rewrites sprintf,in fact nginx also rewrites some other string functions,is it worth the effort? u_char * ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) { u_char *p, zero; int d; double f, scale; size_t len, slen; int64_t i64; uint64_t ui64...
I think this kind of thing is not only wasteful but actively harmful. The name includes printf, which would lead a reasonable person first seeing code that's using it to assume its format strings are printf -compatible. But in fact they're only a very poor approximation of printf semantics. This could lead to extremely...
Customized sprintf,is it worth the effort? The code below is extracted from nginx,which basically rewrites sprintf,in fact nginx also rewrites some other string functions,is it worth the effort? u_char * ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) { u_char *p, zero; int d; double f, scale; s...
TITLE: Customized sprintf,is it worth the effort? QUESTION: The code below is extracted from nginx,which basically rewrites sprintf,in fact nginx also rewrites some other string functions,is it worth the effort? u_char * ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) { u_char *p, zero; int d; ...
[ "c", "printf" ]
1
1
996
2
0
2011-06-04T12:01:44.460000
2011-06-04T12:19:46.630000
6,236,636
6,237,130
where is the template (zip file) for WCF Rest Service
I've been working on a process for programmatically generating Visual Studio projects using GetProjectTemplate. You provide GetProjectTemplate the name of the template (a.zip file like "MvcWebApplicationProjectTemplatev3.01.cshtml.zip") and the language ("csharp"). Here's the path to MvcWebApplicationProjectTemplatev3....
The template is an extension and because of that it is not part of Visual installation (that is affected only by separately installed products). You will find the template under your user profile: "%USERPROFILE%\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\WCF REST Service Template 40(CS)"
where is the template (zip file) for WCF Rest Service I've been working on a process for programmatically generating Visual Studio projects using GetProjectTemplate. You provide GetProjectTemplate the name of the template (a.zip file like "MvcWebApplicationProjectTemplatev3.01.cshtml.zip") and the language ("csharp"). ...
TITLE: where is the template (zip file) for WCF Rest Service QUESTION: I've been working on a process for programmatically generating Visual Studio projects using GetProjectTemplate. You provide GetProjectTemplate the name of the template (a.zip file like "MvcWebApplicationProjectTemplatev3.01.cshtml.zip") and the lan...
[ "visual-studio-2010", "templates", "wcf-rest", "project-template" ]
0
1
699
1
0
2011-06-04T12:05:11.467000
2011-06-04T13:58:50.150000
6,236,643
6,236,663
preg_match_all no results
preg_match_all('| (.*?) |', ' oo ddd ', $matches, PREG_PATTERN_ORDER); why this doesn't show any results. I want to get second match $matches[1][2]
You need to use the s pattern modifier preg_match_all('| (.*?) |s',...
preg_match_all no results preg_match_all('| (.*?) |', ' oo ddd ', $matches, PREG_PATTERN_ORDER); why this doesn't show any results. I want to get second match $matches[1][2]
TITLE: preg_match_all no results QUESTION: preg_match_all('| (.*?) |', ' oo ddd ', $matches, PREG_PATTERN_ORDER); why this doesn't show any results. I want to get second match $matches[1][2] ANSWER: You need to use the s pattern modifier preg_match_all('| (.*?) |s',...
[ "php", "regex", "preg-match-all" ]
0
4
389
1
0
2011-06-04T12:05:45.473000
2011-06-04T12:09:06.350000
6,236,665
6,236,742
How can I upload and convert video using RoR?
User can upload any video of any type... after that I need to convert this video to *.flv How can I do this using RoR?
We do this with paperclip and ffmpeg. Paperclip allows you to add custom processors to a Paperclip attachment. We created such a processor which just calls ffmpeg on the command line to create the flash version of the video. ffmpeg even allows you to extract stills from the video for thumbnail representations.
How can I upload and convert video using RoR? User can upload any video of any type... after that I need to convert this video to *.flv How can I do this using RoR?
TITLE: How can I upload and convert video using RoR? QUESTION: User can upload any video of any type... after that I need to convert this video to *.flv How can I do this using RoR? ANSWER: We do this with paperclip and ffmpeg. Paperclip allows you to add custom processors to a Paperclip attachment. We created such a...
[ "ruby-on-rails", "ruby" ]
2
6
935
4
0
2011-06-04T12:09:19.313000
2011-06-04T12:29:34.857000
6,236,667
6,236,797
I'm wondering how to add the @synthesize statements for the MovieEditorViewController header file in XCode
The implementation file looks like this: #import "MovieViewController.h" #import "Movie.h" #import "MovieEditorViewController.h" @implementation MovieViewController @synthesize titleLabel; @synthesize boxOfficeGrossLabel; @synthesize summaryLabel; @synthesize movie; but i'm thinking my problem is not adding @synthesi...
Looks like you're in the iPhone SDK Development book. Have you made it to section 4.8 yet? The error says that your MovieViewController doesn't have a property named editingViewController, which is something you add in 4.8. The project won't build and run until you get through section 4.9, which is where you make some ...
I'm wondering how to add the @synthesize statements for the MovieEditorViewController header file in XCode The implementation file looks like this: #import "MovieViewController.h" #import "Movie.h" #import "MovieEditorViewController.h" @implementation MovieViewController @synthesize titleLabel; @synthesize boxOfficeG...
TITLE: I'm wondering how to add the @synthesize statements for the MovieEditorViewController header file in XCode QUESTION: The implementation file looks like this: #import "MovieViewController.h" #import "Movie.h" #import "MovieEditorViewController.h" @implementation MovieViewController @synthesize titleLabel; @syn...
[ "cocoa-touch", "xcode", "properties", "terminate", "statements" ]
0
1
127
1
0
2011-06-04T12:09:50.257000
2011-06-04T12:42:10.587000
6,236,671
6,236,696
How to get current value of progress bar with jQuery?
I'm trying out some new HTML5 form features in the latest version of Opera. What I want to do is to get the current value of the progress bar using jQuery. I tried... $(function(){ alert($('progress').val()); });...but it didn't do anything. How can I get the current value using jQuery?
Using jQuery's val() threw an error for me, so I used the native value property. var value = $('progress:first').prop('value'); jsFiddle. If using < 1.6, then use [0].value to access the native value property.
How to get current value of progress bar with jQuery? I'm trying out some new HTML5 form features in the latest version of Opera. What I want to do is to get the current value of the progress bar using jQuery. I tried... $(function(){ alert($('progress').val()); });...but it didn't do anything. How can I get the curre...
TITLE: How to get current value of progress bar with jQuery? QUESTION: I'm trying out some new HTML5 form features in the latest version of Opera. What I want to do is to get the current value of the progress bar using jQuery. I tried... $(function(){ alert($('progress').val()); });...but it didn't do anything. How c...
[ "jquery", "html" ]
2
3
4,353
1
0
2011-06-04T12:10:21.140000
2011-06-04T12:17:21.167000
6,236,673
6,236,740
GWT UiBinder and Image Sprites
I'm having trouble getting CSS image sprites to appear in GWT UiBinder. I did review how do i use image sprites in GWT?, but found I was already doing what was suggested. I have a ui.xml, ClientBundle interface with a CssBundle nested interface, and a css file. ui.xml: ClientBundle: public interface POWResources extend...
You have to call ensureInjected() on your CssResource somewhere in your code; either: POWResources.INSTANCE.sprites().ensureInjected(); or @UiField POWResources resources; … resources.sprites().ensureInjected(); Alternatively, if you don't share the styles/images with other code, you can replace your ClientBundle with ...
GWT UiBinder and Image Sprites I'm having trouble getting CSS image sprites to appear in GWT UiBinder. I did review how do i use image sprites in GWT?, but found I was already doing what was suggested. I have a ui.xml, ClientBundle interface with a CssBundle nested interface, and a css file. ui.xml: ClientBundle: publi...
TITLE: GWT UiBinder and Image Sprites QUESTION: I'm having trouble getting CSS image sprites to appear in GWT UiBinder. I did review how do i use image sprites in GWT?, but found I was already doing what was suggested. I have a ui.xml, ClientBundle interface with a CssBundle nested interface, and a css file. ui.xml: C...
[ "gwt", "sprite", "uibinder", "clientbundle" ]
3
17
7,258
1
0
2011-06-04T12:10:48.750000
2011-06-04T12:28:19.170000
6,236,676
6,236,729
Auto start service in symbian
I have a question about symbian service. is that possible to create a service that automatically start with system? Thanks for your help.
Go through the Startup List Management API to make an auto start application. How to auto start a program in symbian
Auto start service in symbian I have a question about symbian service. is that possible to create a service that automatically start with system? Thanks for your help.
TITLE: Auto start service in symbian QUESTION: I have a question about symbian service. is that possible to create a service that automatically start with system? Thanks for your help. ANSWER: Go through the Startup List Management API to make an auto start application. How to auto start a program in symbian
[ "symbian" ]
0
1
1,361
2
0
2011-06-04T12:11:55.260000
2011-06-04T12:24:58.997000
6,236,677
6,236,705
what is the string maximum and minimum value in range validator in asp.net?
I dont know what is the maximum and minimum value of string in RangeValidator in asp.net is anyone have idea? in such interview of asp.net company ask this question? so i want to know please help me out thnx in advance
The RangeValidator control is used to check that the user enters an input value that falls between two values. It is possible to check ranges within numbers, dates, and characters. Note: 1.The validation will not fail if the input control is empty. Use the RequiredFieldValidator control to make the field required. 2.Th...
what is the string maximum and minimum value in range validator in asp.net? I dont know what is the maximum and minimum value of string in RangeValidator in asp.net is anyone have idea? in such interview of asp.net company ask this question? so i want to know please help me out thnx in advance
TITLE: what is the string maximum and minimum value in range validator in asp.net? QUESTION: I dont know what is the maximum and minimum value of string in RangeValidator in asp.net is anyone have idea? in such interview of asp.net company ask this question? so i want to know please help me out thnx in advance ANSWER...
[ "c#", ".net", "asp.net" ]
0
2
7,228
1
0
2011-06-04T12:12:25.163000
2011-06-04T12:19:12.930000
6,236,680
6,236,706
BuyerAccounts and SellerAccounts Tables that both reference Accounts Table. Create Account INSERT
I am designing tables to store accounts of website users. There will be two types of accounts for the website, BuyerAccounts and SellerAccounts. My approach is to have a master Accounts table that will store information that is common to both types of accounts and then to have a table each for BuyerAccounts and SellerA...
use scope_identity() example declare @id int insert Accounts values('a@b.com','pass','bla',1) select @id = SCOPE_IDENTITY() insert SellerAccounts values(@id,1) select * from SellerAccounts
BuyerAccounts and SellerAccounts Tables that both reference Accounts Table. Create Account INSERT I am designing tables to store accounts of website users. There will be two types of accounts for the website, BuyerAccounts and SellerAccounts. My approach is to have a master Accounts table that will store information th...
TITLE: BuyerAccounts and SellerAccounts Tables that both reference Accounts Table. Create Account INSERT QUESTION: I am designing tables to store accounts of website users. There will be two types of accounts for the website, BuyerAccounts and SellerAccounts. My approach is to have a master Accounts table that will st...
[ "sql-server", "sql-server-2008", "database-design" ]
1
2
76
1
0
2011-06-04T12:13:33.370000
2011-06-04T12:19:15.567000