PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,891,762 | 06/05/2012 04:52:58 | 105,817 | 05/12/2009 23:07:02 | 717 | 9 | Convert seconds to years/days/hours/minutes automatically, using JodaTime? | Is there way to convert 'x' seconds to y hours and z seconds when say x exceeds 3600 seconds? Similarly, convert it to 'a minutes and b seconds' when x exceeds 60 but is less than 3600 seconds, using JodaTime? I understand that I would have to specify what I need in the PeriodFormatter, but I don't want to specify it - I want a formatted text based on value of seconds.
This is similar to how you would post on a forum and then your post will initially be shown as 'posted 10 seconds ago'.. after 1 minute you would see 'posted 1minute 20 seconds ago' and likewise for weeks,days,years.
| java | jodatime | null | null | null | null | open | Convert seconds to years/days/hours/minutes automatically, using JodaTime?
===
Is there way to convert 'x' seconds to y hours and z seconds when say x exceeds 3600 seconds? Similarly, convert it to 'a minutes and b seconds' when x exceeds 60 but is less than 3600 seconds, using JodaTime? I understand that I would have to specify what I need in the PeriodFormatter, but I don't want to specify it - I want a formatted text based on value of seconds.
This is similar to how you would post on a forum and then your post will initially be shown as 'posted 10 seconds ago'.. after 1 minute you would see 'posted 1minute 20 seconds ago' and likewise for weeks,days,years.
| 0 |
8,027,443 | 11/06/2011 13:52:03 | 1,032,248 | 11/06/2011 13:46:03 | 1 | 0 | Visual Studio run and stop immediately | I recently had malware attack on my laptop I cleaned it, it works fine now beside the situation when i run any project in Visual Studio it run/starts properly loading the page but immediately the visual studio stops and come back to normal editing mode, infect before even the page loads completely.
Kindly help, I have already rectified the host file. | visual-studio | c#-3.0 | visual | null | null | 12/17/2011 23:42:19 | off topic | Visual Studio run and stop immediately
===
I recently had malware attack on my laptop I cleaned it, it works fine now beside the situation when i run any project in Visual Studio it run/starts properly loading the page but immediately the visual studio stops and come back to normal editing mode, infect before even the page loads completely.
Kindly help, I have already rectified the host file. | 2 |
10,413,573 | 05/02/2012 12:17:43 | 183,028 | 10/02/2009 10:46:31 | 1,061 | 41 | Rounding up to the nearest 0.05 in JavaScript | **Question**
Does anyone know of a way to round a float to the nearest 0.05 in JavaScript?
**Example**
BEFORE | AFTER
2.51 | 2.55
2.50 | 2.50
2.56 | 2.60
**Current Code**
var _ceil = Math.ceil;
Math.ceil = function(number, decimals){
if (arguments.length == 1)
return _ceil(number);
multiplier = Math.pow(10, decimals);
return _ceil(number * multiplier) / multiplier;
}
Then elsewhere...
`return (Math.ceil((amount - 0.05), 1) + 0.05).toFixed(2);`
Which is resulting in...
BEFORE | AFTER
2.51 | 2.55
2.50 | 2.55
2.56 | 2.65 | javascript | rounding | null | null | null | null | open | Rounding up to the nearest 0.05 in JavaScript
===
**Question**
Does anyone know of a way to round a float to the nearest 0.05 in JavaScript?
**Example**
BEFORE | AFTER
2.51 | 2.55
2.50 | 2.50
2.56 | 2.60
**Current Code**
var _ceil = Math.ceil;
Math.ceil = function(number, decimals){
if (arguments.length == 1)
return _ceil(number);
multiplier = Math.pow(10, decimals);
return _ceil(number * multiplier) / multiplier;
}
Then elsewhere...
`return (Math.ceil((amount - 0.05), 1) + 0.05).toFixed(2);`
Which is resulting in...
BEFORE | AFTER
2.51 | 2.55
2.50 | 2.55
2.56 | 2.65 | 0 |
6,972,048 | 08/07/2011 10:01:40 | 283,114 | 02/28/2010 14:54:48 | 68 | 4 | IP address how to manipulate? | My question is how to hide an IP address with Java code staying in your internet domain. Redirecting to another domain is not the answer which I'm looking for.
| java | ip | manipulation | null | null | 08/07/2011 10:04:15 | not a real question | IP address how to manipulate?
===
My question is how to hide an IP address with Java code staying in your internet domain. Redirecting to another domain is not the answer which I'm looking for.
| 1 |
10,828,755 | 05/31/2012 06:53:57 | 1,407,280 | 04/25/2011 10:36:49 | 69 | 1 | Local Notification | I am new to iPhone application.
I have to use local notification to set the fake incoming call in my application.
Then can anybody suggest me the steps to integrate the local notification in my application.
If links or source code with explanation is available, please suggest me for that.
Thanks in advance. | iphone | null | null | null | null | 07/20/2012 17:25:22 | not a real question | Local Notification
===
I am new to iPhone application.
I have to use local notification to set the fake incoming call in my application.
Then can anybody suggest me the steps to integrate the local notification in my application.
If links or source code with explanation is available, please suggest me for that.
Thanks in advance. | 1 |
9,023,354 | 01/26/2012 18:32:26 | 721,769 | 04/23/2011 13:43:47 | 13 | 1 | Proguard giving me random errors | So, out of the blue I get this error message.
Description Resource Path Location Type
Obsolete proguard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg /Think Fast line 1 Android Lint Problem
And I have no idea what I did wrong. I was just about to publish this app and now I this random error. I have never messed with this file. Here is the file for the proguard:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
Please help, because I have not a single clue what is going on here.
Thanks
-Derek | android | proguard | null | null | null | null | open | Proguard giving me random errors
===
So, out of the blue I get this error message.
Description Resource Path Location Type
Obsolete proguard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg /Think Fast line 1 Android Lint Problem
And I have no idea what I did wrong. I was just about to publish this app and now I this random error. I have never messed with this file. Here is the file for the proguard:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
Please help, because I have not a single clue what is going on here.
Thanks
-Derek | 0 |
7,912,570 | 10/27/2011 06:55:03 | 682,324 | 03/29/2011 15:10:24 | 142 | 22 | Ready to use backend for mobile applications? | for my mobile application, I am searching for a possibility to easy link all instances of this running application together (on server), but I have no experience in developing a backend server software. Thus, a ready to use "backend as a service" solution would be great.
Additionally, as I am dealing with geo-locational data, support for this kind of information (like finding others in my area) would be a benifit, too.
Thanks a lot! | mobile | service | backend | null | null | 04/25/2012 15:38:27 | not constructive | Ready to use backend for mobile applications?
===
for my mobile application, I am searching for a possibility to easy link all instances of this running application together (on server), but I have no experience in developing a backend server software. Thus, a ready to use "backend as a service" solution would be great.
Additionally, as I am dealing with geo-locational data, support for this kind of information (like finding others in my area) would be a benifit, too.
Thanks a lot! | 4 |
2,076,783 | 01/16/2010 08:59:53 | 122,536 | 06/13/2009 18:36:27 | 191 | 2 | Can't change Emacs's default identation between html tags | I'm confused about Emacs indentation paradigm.
I have this in my .emacs:
(setq-default tab-width 4)
If I press TAB in the following situation
<ul>
(caret)
</ul>
it end up like this
<ul>
(caret)
</ul>
(with 2 spaces indentation between the html tags.)
It should end up like this:
<ul>
(caret)
</ul>
I tries everything:
(setq-default tab-width 4)
(setq-default indent-tabs-mode t)
(setq tab-stop-list '(4 8 12 16))
I've set every possible Emacs setting about indentation to 4 but that 2 space indentation still there.
Any suggestions? | emacs | indent | null | null | null | null | open | Can't change Emacs's default identation between html tags
===
I'm confused about Emacs indentation paradigm.
I have this in my .emacs:
(setq-default tab-width 4)
If I press TAB in the following situation
<ul>
(caret)
</ul>
it end up like this
<ul>
(caret)
</ul>
(with 2 spaces indentation between the html tags.)
It should end up like this:
<ul>
(caret)
</ul>
I tries everything:
(setq-default tab-width 4)
(setq-default indent-tabs-mode t)
(setq tab-stop-list '(4 8 12 16))
I've set every possible Emacs setting about indentation to 4 but that 2 space indentation still there.
Any suggestions? | 0 |
4,584,235 | 01/03/2011 12:00:44 | 23,341 | 09/29/2008 04:41:59 | 2,392 | 38 | BDD-testing using a UI driver (e.g. Selenium for a web-application) | Can BDD (Behavior Driven Design) tests be implemented using a UI driver?
For example, given a web application, instead of:
* Writing tests for the back-end, and then more tests in Javascript for the front-end
Should I:
* Write the tests as Selenium macros, which simulate mouse-clicks, etc in the actual browser?
The advantages I see in doing it this way are:
* The tests are written in one language, rather than several
* They're focussed on the UI, which gets developers thinking *outside-in*
* They run in the real execution environment (the browser), which allows us to
* Test different browsers
* Test different servers
* Get insight into real-world performance
Thoughts? | tdd | bdd | web-testing | outside-in | null | null | open | BDD-testing using a UI driver (e.g. Selenium for a web-application)
===
Can BDD (Behavior Driven Design) tests be implemented using a UI driver?
For example, given a web application, instead of:
* Writing tests for the back-end, and then more tests in Javascript for the front-end
Should I:
* Write the tests as Selenium macros, which simulate mouse-clicks, etc in the actual browser?
The advantages I see in doing it this way are:
* The tests are written in one language, rather than several
* They're focussed on the UI, which gets developers thinking *outside-in*
* They run in the real execution environment (the browser), which allows us to
* Test different browsers
* Test different servers
* Get insight into real-world performance
Thoughts? | 0 |
10,146,153 | 04/13/2012 18:16:51 | 1,332,243 | 04/13/2012 18:13:23 | 1 | 0 | How do I create a members area in my django website? | how I create a members area in my django website
that requires a password to enter into? | python | django | null | null | null | 04/13/2012 20:18:42 | not a real question | How do I create a members area in my django website?
===
how I create a members area in my django website
that requires a password to enter into? | 1 |
11,356,685 | 07/06/2012 06:05:06 | 822,609 | 06/30/2011 08:09:01 | 12 | 1 | Replacing place holders in the template | TEMPLATE = Hi $#EMPLOYEENAME#$ you are eligible for $#PLANNAME#$ Regards $#MANAGERNAME#$
I have a template with place holders i would like to replace it with the actual values. I have a map with the palce holder as key and the corresponding value.
public static String replaceMergetag(final String template, final Map<String, String> values){
final StringBuffer sb = new StringBuffer();
final Pattern pattern = Pattern.compile("\\$\\#[a-zA-Z]\\#\\$");
final Matcher matcher = pattern.matcher(template);
while(matcher.find()){
final String key = matcher.group(1);
final String value= values.get(key);
if(value!= null){
matcher.appendReplacement(sb, value);
}
}
matcher.appendTail(sb);
return sb.toString();
}
I think my pattern is wrong . iam not able to get a match
| java | homework | null | null | null | 07/10/2012 02:27:46 | not a real question | Replacing place holders in the template
===
TEMPLATE = Hi $#EMPLOYEENAME#$ you are eligible for $#PLANNAME#$ Regards $#MANAGERNAME#$
I have a template with place holders i would like to replace it with the actual values. I have a map with the palce holder as key and the corresponding value.
public static String replaceMergetag(final String template, final Map<String, String> values){
final StringBuffer sb = new StringBuffer();
final Pattern pattern = Pattern.compile("\\$\\#[a-zA-Z]\\#\\$");
final Matcher matcher = pattern.matcher(template);
while(matcher.find()){
final String key = matcher.group(1);
final String value= values.get(key);
if(value!= null){
matcher.appendReplacement(sb, value);
}
}
matcher.appendTail(sb);
return sb.toString();
}
I think my pattern is wrong . iam not able to get a match
| 1 |
10,533,453 | 05/10/2012 11:56:10 | 847,220 | 07/15/2011 21:32:41 | 3 | 0 | Background Tab Host Android | I have created a tabhost in main activity with 4 tab specs. I have set the background for the Tab host (drawable, png image). Make all activities in the tab specs to be transparent.
For example tabhost:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<!-- Dummy item to prevent EditText from receiving focus -->
<LinearLayout
android:focusable="true" android:focusableInTouchMode="true"
android:layout_width="0px" android:layout_height="0px"/>
<EditText android:id="@+id/etContactSearch"
android:layout_height="60dip"
android:layout_width="fill_parent"
android:drawableRight="@drawable/search_contact" >
</EditText>
<ListView android:id="@+id/lvContacts"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="1dp"
android:cacheColorHint="#00000000"
android:listSelector="@drawable/relative_layout_clickable">
</ListView>
</LinearLayout>
And one of the tab specs has some linear layouts and list activity:
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bck_list">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp" />
</LinearLayout>
</TabHost>
Finally the problem is this:
When i start application from eclipse first time, the background(@drawable/bck_list) is shown perfectly. But if I close the application and run it again, the background is missing (black color is showing instead).
What can be the problem here?
Thanx in advance. | android | background | android-tabhost | null | null | null | open | Background Tab Host Android
===
I have created a tabhost in main activity with 4 tab specs. I have set the background for the Tab host (drawable, png image). Make all activities in the tab specs to be transparent.
For example tabhost:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<!-- Dummy item to prevent EditText from receiving focus -->
<LinearLayout
android:focusable="true" android:focusableInTouchMode="true"
android:layout_width="0px" android:layout_height="0px"/>
<EditText android:id="@+id/etContactSearch"
android:layout_height="60dip"
android:layout_width="fill_parent"
android:drawableRight="@drawable/search_contact" >
</EditText>
<ListView android:id="@+id/lvContacts"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="1dp"
android:cacheColorHint="#00000000"
android:listSelector="@drawable/relative_layout_clickable">
</ListView>
</LinearLayout>
And one of the tab specs has some linear layouts and list activity:
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bck_list">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp" />
</LinearLayout>
</TabHost>
Finally the problem is this:
When i start application from eclipse first time, the background(@drawable/bck_list) is shown perfectly. But if I close the application and run it again, the background is missing (black color is showing instead).
What can be the problem here?
Thanx in advance. | 0 |
4,783,168 | 01/24/2011 14:31:37 | 184,379 | 10/05/2009 13:04:32 | 58 | 4 | [Zend] PHPUnit test failing on plugin | my phpunit test fails with this error:
C:\workspace\internal_jets3\tests>phpunit --verbose
PHPUnit 3.5.7 by Sebastian Bergmann.
Fatal error: Call to a member function getOptions() on a non-object in C:\worksp
ace\internal_jets3\library\My\Controller\Plugin\ModuleLayoutLoader.php on line 7
Extract from plugin:
class My_Controller_Plugin_ModuleLayoutLoader extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$config = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOptions();
Any help on how to include plugins in testing will be helpful. Thanks! | plugins | zend | phpunit | bootstrap | null | null | open | [Zend] PHPUnit test failing on plugin
===
my phpunit test fails with this error:
C:\workspace\internal_jets3\tests>phpunit --verbose
PHPUnit 3.5.7 by Sebastian Bergmann.
Fatal error: Call to a member function getOptions() on a non-object in C:\worksp
ace\internal_jets3\library\My\Controller\Plugin\ModuleLayoutLoader.php on line 7
Extract from plugin:
class My_Controller_Plugin_ModuleLayoutLoader extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$config = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOptions();
Any help on how to include plugins in testing will be helpful. Thanks! | 0 |
11,680,525 | 07/27/2012 02:06:06 | 1,027,012 | 11/03/2011 05:20:31 | 30 | 2 | Ascii left arrow not showing up in chrome | The ◄ left arrow is not showing up in chrome Version 20.0.1132.57 on a Mac. It seems to work in Chrome on windows as well as firefox on both windows and mac.
"◄"
It looks like this in Chrome on a Mac
![http://i50.tinypic.com/aue23m.png][1]
Right arrow seems fine. I can switch it for any other ascii symbol and it seems fine.
Not sure if this is relevant but I have the HTML5 doctype:
<!DOCTYPE html>
<html>
You can see a jsfiddle here:
http://jsfiddle.net/vvErc/
[1]: http://i.stack.imgur.com/xEzcy.png | css | html5 | ascii | null | null | 07/29/2012 18:26:54 | too localized | Ascii left arrow not showing up in chrome
===
The ◄ left arrow is not showing up in chrome Version 20.0.1132.57 on a Mac. It seems to work in Chrome on windows as well as firefox on both windows and mac.
"◄"
It looks like this in Chrome on a Mac
![http://i50.tinypic.com/aue23m.png][1]
Right arrow seems fine. I can switch it for any other ascii symbol and it seems fine.
Not sure if this is relevant but I have the HTML5 doctype:
<!DOCTYPE html>
<html>
You can see a jsfiddle here:
http://jsfiddle.net/vvErc/
[1]: http://i.stack.imgur.com/xEzcy.png | 3 |
1,838,713 | 12/03/2009 09:22:03 | 140,901 | 07/19/2009 07:47:51 | 245 | 14 | Database Tables, more the better? | Lately I've been rethinking a database design I made a couple of months ago. The main reason is that last night I read the databse schema of vBulletin and saw that they use many, MANY, tables.
The current "idea" I'm using for my schema, for instance my log table, is to keep everything in one table by differencing the type of Log with an integer:
id, type, type_id, action, message
1 , 1, 305, 2, 'Explanation for user Ban'
2, 2, 1045, 1, 'Reason for deletion of Article'
Where `type 1 = user, type 2 = article`, `type_id = the ID of the user, article or w/e` and `action 2 = ban, action 1 = deletion`.
Should I change the design to two tables `logBans`, `logSomething` and so on? or is it better to keep the method I'm currently using? | mysql | database-design | null | null | null | null | open | Database Tables, more the better?
===
Lately I've been rethinking a database design I made a couple of months ago. The main reason is that last night I read the databse schema of vBulletin and saw that they use many, MANY, tables.
The current "idea" I'm using for my schema, for instance my log table, is to keep everything in one table by differencing the type of Log with an integer:
id, type, type_id, action, message
1 , 1, 305, 2, 'Explanation for user Ban'
2, 2, 1045, 1, 'Reason for deletion of Article'
Where `type 1 = user, type 2 = article`, `type_id = the ID of the user, article or w/e` and `action 2 = ban, action 1 = deletion`.
Should I change the design to two tables `logBans`, `logSomething` and so on? or is it better to keep the method I'm currently using? | 0 |
10,241,155 | 04/20/2012 06:13:26 | 1,282,934 | 03/21/2012 09:08:48 | 1 | 2 | Requirements to consume a SOAP web service | I am new to consume web service in android eclipse.Currently i am following the below link
http://jatin4rise.wordpress.com/2010/10/03/webservicecallfromandroid/
But not its working.
Can anyone tell what are the requirements to consume the SOAP web service from android eclipse.
Thanks for any HELP!! | android | eclipse | requirements | null | null | 04/20/2012 12:22:05 | not a real question | Requirements to consume a SOAP web service
===
I am new to consume web service in android eclipse.Currently i am following the below link
http://jatin4rise.wordpress.com/2010/10/03/webservicecallfromandroid/
But not its working.
Can anyone tell what are the requirements to consume the SOAP web service from android eclipse.
Thanks for any HELP!! | 1 |
5,098,196 | 02/23/2011 22:45:54 | 198,212 | 10/28/2009 15:37:51 | 586 | 28 | Consistent Hashing: what about rehashing? | As you may know, consistent hashing is a great idea when dealing with DHT. The main idea is to not suffer too much when a new node is added or deleted.
From the original Paper:
> When a machine is added to or removed
> from the set of caches, the expected
> fraction of objects that must be moved
> to a new cache is the minimum needed
> to maintain a balanced load across the
> caches.
The solution is great, but there is a phenomenon of bad distribution of the keys. To solve that, replicas of the original nodes are distributed randombly. That solution works quite well. Look at this [chart][1] if you want to be sure.
Ok, seems to work well. But, there is something i've been thinking that nobody mention.
What happens when one node is added (or removed)? Well, every key, "before" the node that is placed needs to be rehashed. That seems good, becouse those keys will not be "all" the keys. But, if we decide to place some replicas, say 20, then, 20 nodes will feel the pain of rehashing.
Less replicas means worse distribution, but more replicas means more pain when rehashing is needed.
What solution do you know would suit in this situation? Am I missing something?
[1]: http://www.lexemetech.com/2007/11/consistent-hashing.html | distributed | hashing | distributed-caching | dht | consistent-hashing | null | open | Consistent Hashing: what about rehashing?
===
As you may know, consistent hashing is a great idea when dealing with DHT. The main idea is to not suffer too much when a new node is added or deleted.
From the original Paper:
> When a machine is added to or removed
> from the set of caches, the expected
> fraction of objects that must be moved
> to a new cache is the minimum needed
> to maintain a balanced load across the
> caches.
The solution is great, but there is a phenomenon of bad distribution of the keys. To solve that, replicas of the original nodes are distributed randombly. That solution works quite well. Look at this [chart][1] if you want to be sure.
Ok, seems to work well. But, there is something i've been thinking that nobody mention.
What happens when one node is added (or removed)? Well, every key, "before" the node that is placed needs to be rehashed. That seems good, becouse those keys will not be "all" the keys. But, if we decide to place some replicas, say 20, then, 20 nodes will feel the pain of rehashing.
Less replicas means worse distribution, but more replicas means more pain when rehashing is needed.
What solution do you know would suit in this situation? Am I missing something?
[1]: http://www.lexemetech.com/2007/11/consistent-hashing.html | 0 |
11,556,785 | 07/19/2012 08:25:31 | 1,467,858 | 06/20/2012 00:36:35 | 3 | 2 | Can StatusStrip automatically change its height depending on its items' size? | I've got a statusstrip with a number of items. One of them is a ToolStripStatusLabel with Spring = True.
When the text of the label is too long, one can't see it.
Is it possible to make the statusstrip become higher and show whole text in multiline? | c# | autosize | statusstrip | null | null | null | open | Can StatusStrip automatically change its height depending on its items' size?
===
I've got a statusstrip with a number of items. One of them is a ToolStripStatusLabel with Spring = True.
When the text of the label is too long, one can't see it.
Is it possible to make the statusstrip become higher and show whole text in multiline? | 0 |
9,984,153 | 04/02/2012 21:32:54 | 303,463 | 03/28/2010 05:51:35 | 142 | 4 | Using flash inside a native iOS app | I'm working on a native Objective-C iOS app and I'm wondering if it is possible to embed an animation created in Flash into my app. The animation doesn't have to be interactive, all I need is a couple of animated screens (intro screen, loading screen). Is this posible? | ios | flash | animation | swf | null | null | open | Using flash inside a native iOS app
===
I'm working on a native Objective-C iOS app and I'm wondering if it is possible to embed an animation created in Flash into my app. The animation doesn't have to be interactive, all I need is a couple of animated screens (intro screen, loading screen). Is this posible? | 0 |
2,979,160 | 06/05/2010 04:29:50 | 115,949 | 06/02/2009 12:08:42 | 1,209 | 22 | changing jquery 'this' and 'next', to a specific element | Im working with the following code;
<a href=\"#\" onClick=\"if($(this).next('div').css('display') == 'none') { $(this).next('div').show('fast'); } else { $(this).next('div').hide('fast'); } return false;\">Link</a>
What i need to do, is change the part `if($(this).next('div')`, to target a specific element ID, not the next one from current location.
Any ideas are much appreciated, as well as explinations.
Thanks in advance. | javascript | jquery | null | null | null | null | open | changing jquery 'this' and 'next', to a specific element
===
Im working with the following code;
<a href=\"#\" onClick=\"if($(this).next('div').css('display') == 'none') { $(this).next('div').show('fast'); } else { $(this).next('div').hide('fast'); } return false;\">Link</a>
What i need to do, is change the part `if($(this).next('div')`, to target a specific element ID, not the next one from current location.
Any ideas are much appreciated, as well as explinations.
Thanks in advance. | 0 |
5,772,899 | 04/24/2011 19:59:15 | 719,617 | 04/21/2011 20:20:08 | 1 | 2 | why would you want export private key? | Why would anyone want to export SSL private key? | ssl-certificate | null | null | null | null | 04/24/2011 22:24:03 | not a real question | why would you want export private key?
===
Why would anyone want to export SSL private key? | 1 |
6,751,445 | 07/19/2011 17:32:49 | 843,338 | 07/13/2011 18:53:46 | 16 | 0 | Here is a good one I created a function that generates images with Ajax. | Why is it not using the Math.Random I put in there. Thanks in advance.
$(function () {
$.ajax({
type: "GET",
url: "myFakeChannelData.xml",
dataType: "xml",
success: changeChannel
});
});
function changeChannel(xml) {
$('#layer').fadeOut(1000);
var $limit = 4;
$(xml).find("Channel").each(function($limit) {
var $channel = $(this);
var image = $channel.attr('image');
$("#click").click(function () {
$(".layer-container").empty();
$(".layer-container").append('<div class="layer1">' +
'<img class="" alt="" src="' + image + '" />' + '</div></div>');
$(".layer-container").append('<div class="layer2">' + '<img class="" alt="" src="' + image + '" />' + '</div></div>');
$(".layer-container").append('<div class="layer3">' + '<img class="" alt="" src="' + image + '" />' + '</div></div>');
$(".Channel").fadeIn(1000);
var random = Math.floor(limit * Math.random());
var myNewChannel = remix(random);
myNewChannel(random);
});
});
} | jquery | ajax | null | null | null | 07/20/2011 03:06:18 | not a real question | Here is a good one I created a function that generates images with Ajax.
===
Why is it not using the Math.Random I put in there. Thanks in advance.
$(function () {
$.ajax({
type: "GET",
url: "myFakeChannelData.xml",
dataType: "xml",
success: changeChannel
});
});
function changeChannel(xml) {
$('#layer').fadeOut(1000);
var $limit = 4;
$(xml).find("Channel").each(function($limit) {
var $channel = $(this);
var image = $channel.attr('image');
$("#click").click(function () {
$(".layer-container").empty();
$(".layer-container").append('<div class="layer1">' +
'<img class="" alt="" src="' + image + '" />' + '</div></div>');
$(".layer-container").append('<div class="layer2">' + '<img class="" alt="" src="' + image + '" />' + '</div></div>');
$(".layer-container").append('<div class="layer3">' + '<img class="" alt="" src="' + image + '" />' + '</div></div>');
$(".Channel").fadeIn(1000);
var random = Math.floor(limit * Math.random());
var myNewChannel = remix(random);
myNewChannel(random);
});
});
} | 1 |
7,952,847 | 10/31/2011 11:06:57 | 273,792 | 02/15/2010 20:21:03 | 110 | 36 | Blank links opens in the same window - Why, and how to fix it? | I have a simple question. When i have four links e.g.
<a href="http://google.com" target="_blank">Google</a>
<a href="http://bing.com" target="_blank">Bing</a>
<a href="http://yahoo.com" target="_blank">Yahoo</a>
<a href="http://wikipedia.com" target="_blank">wiki</a>
When I click on a link, it will opens in a new window.
And on click to another link, it will opens in the same window opened last time.
It is not good for me, I want to open a blank window on every single click, regardless of the opened windows.
How can I handle this? (I don't care about double-click google link opens it twice, doesn't matter.) | html | hyperlink | cross-browser | open | blank | 11/01/2011 04:20:49 | too localized | Blank links opens in the same window - Why, and how to fix it?
===
I have a simple question. When i have four links e.g.
<a href="http://google.com" target="_blank">Google</a>
<a href="http://bing.com" target="_blank">Bing</a>
<a href="http://yahoo.com" target="_blank">Yahoo</a>
<a href="http://wikipedia.com" target="_blank">wiki</a>
When I click on a link, it will opens in a new window.
And on click to another link, it will opens in the same window opened last time.
It is not good for me, I want to open a blank window on every single click, regardless of the opened windows.
How can I handle this? (I don't care about double-click google link opens it twice, doesn't matter.) | 3 |
11,509,328 | 07/16/2012 17:21:55 | 957,677 | 09/21/2011 18:58:52 | 46 | 1 | Magento: how to make two languages of the same store? | Is that correct that you have to have separated store for each language?
I have a single store that needs to have french variant (not products descriptions/titles, interface only).
I have prepared fr_FR csv's in the locale folder.
How to allow user to switch them within a single store? | magento | translation | null | null | null | 07/17/2012 11:45:32 | off topic | Magento: how to make two languages of the same store?
===
Is that correct that you have to have separated store for each language?
I have a single store that needs to have french variant (not products descriptions/titles, interface only).
I have prepared fr_FR csv's in the locale folder.
How to allow user to switch them within a single store? | 2 |
7,707,617 | 10/10/2011 00:51:23 | 428,811 | 08/23/2010 20:32:05 | 594 | 34 | Windows 2003 server VPN - LAN inaccessible | I have the following config:
![enter image description here][1]
"Laptop" VPNs in to "Server". Then, "Laptop" can fully access "Server". The problem: "Laptop" can't connect to "Desktop" (neither TCP/IP, nor ICMP (ping)).
On "Laptop", "Use Default gateway for remote network" is un-checked, to maintain internet connectivity during VPN session.
On "Server", RRAS is configured as a router and according routing tables, everything should work.
On "Laptop", routes list 192.168.1.0/255.255.255.0 gateway 192.168.1.5. On "Server", routes list 192.168.1.0/255.255.255.0 gateway 192.168.1.3 (X). Am I not correct in thinking that when a packet comes from 192.168.1.5 for 192.168.1.4, "Server" should route it according to (X)?
Thank you!
[1]: http://i.stack.imgur.com/Zuyfh.png | windows | vpn | router | gateway | null | 10/10/2011 05:02:30 | off topic | Windows 2003 server VPN - LAN inaccessible
===
I have the following config:
![enter image description here][1]
"Laptop" VPNs in to "Server". Then, "Laptop" can fully access "Server". The problem: "Laptop" can't connect to "Desktop" (neither TCP/IP, nor ICMP (ping)).
On "Laptop", "Use Default gateway for remote network" is un-checked, to maintain internet connectivity during VPN session.
On "Server", RRAS is configured as a router and according routing tables, everything should work.
On "Laptop", routes list 192.168.1.0/255.255.255.0 gateway 192.168.1.5. On "Server", routes list 192.168.1.0/255.255.255.0 gateway 192.168.1.3 (X). Am I not correct in thinking that when a packet comes from 192.168.1.5 for 192.168.1.4, "Server" should route it according to (X)?
Thank you!
[1]: http://i.stack.imgur.com/Zuyfh.png | 2 |
6,464,453 | 06/24/2011 06:58:02 | 813,603 | 06/24/2011 06:58:02 | 1 | 0 | How to use visio in C # Windows application | I m using **visual studio 2008** and **visio pro. 2007**.
Language Using C#
**PROJECT DESCRIPTION:**
**Objective:**
Currently i have a project that maps user inputs (inputs from text boxes) into flow chart diagram that contains rectangles, diamonds and ovals etc.
To fullfil the above mentioned Objective we want to make an application in C SHARP windows application that:
- Takes inputs in windows application form (and in BACK AND it creates flow chart diagrams in visio 2007)
- And displays the flow diagram into the windows application form on a preview button.
**Problem:**
we have tried lots of tutorials to connect visio 2007 with VS c# 2008 but we could not establish any connection.
Please list out the required tools and assemblies (and how to install) to connect them .
***also plz provide a sample code that creates shapes in visio and display it back to window form.***
| c# | null | null | null | null | 06/24/2011 09:23:29 | not a real question | How to use visio in C # Windows application
===
I m using **visual studio 2008** and **visio pro. 2007**.
Language Using C#
**PROJECT DESCRIPTION:**
**Objective:**
Currently i have a project that maps user inputs (inputs from text boxes) into flow chart diagram that contains rectangles, diamonds and ovals etc.
To fullfil the above mentioned Objective we want to make an application in C SHARP windows application that:
- Takes inputs in windows application form (and in BACK AND it creates flow chart diagrams in visio 2007)
- And displays the flow diagram into the windows application form on a preview button.
**Problem:**
we have tried lots of tutorials to connect visio 2007 with VS c# 2008 but we could not establish any connection.
Please list out the required tools and assemblies (and how to install) to connect them .
***also plz provide a sample code that creates shapes in visio and display it back to window form.***
| 1 |
6,932,524 | 08/03/2011 20:01:07 | 175,679 | 09/18/2009 17:54:32 | 98 | 11 | What do you think is the most beautiful thing about WCF? | Does WCF make your life easier or harder? Do you think it's beautiful in nature or should you avoid its ugliness like the plague?
+ I like the idea of supporting REST + SOAP interfaces with <s>simple</s> binding configurations (*ala webHttpEndpoint / basicHttpBinding*). I do miss the ASMX days, but SVC seems like it's here to stay.
+ WCF + MVC are also great combination to build host factories and custom service routing (*ala ServiceHostFactory / WebServiceHostFactory*).
What are your likes / dislikes? | wcf | wcf-binding | wcf-client | wcf-behaviour | null | 08/04/2011 04:16:21 | not constructive | What do you think is the most beautiful thing about WCF?
===
Does WCF make your life easier or harder? Do you think it's beautiful in nature or should you avoid its ugliness like the plague?
+ I like the idea of supporting REST + SOAP interfaces with <s>simple</s> binding configurations (*ala webHttpEndpoint / basicHttpBinding*). I do miss the ASMX days, but SVC seems like it's here to stay.
+ WCF + MVC are also great combination to build host factories and custom service routing (*ala ServiceHostFactory / WebServiceHostFactory*).
What are your likes / dislikes? | 4 |
7,328,678 | 09/07/2011 03:49:26 | 931,946 | 09/07/2011 03:49:26 | 1 | 0 | Supersized doesn't work in IE9 | I'm using Supersized.
I really love it but, it doesn't work in IE9.
I have the last jquery and Supersized files.
The Supersized demo doesn't seem to work to.
http://buildinternet.com/project/supersized/slideshow/3.2/demo.html
My website is: http://frato-interiors.com/
Can you help me? | internet-explorer | internet-explorer-9 | null | null | null | 09/07/2011 19:44:36 | too localized | Supersized doesn't work in IE9
===
I'm using Supersized.
I really love it but, it doesn't work in IE9.
I have the last jquery and Supersized files.
The Supersized demo doesn't seem to work to.
http://buildinternet.com/project/supersized/slideshow/3.2/demo.html
My website is: http://frato-interiors.com/
Can you help me? | 3 |
11,247,541 | 06/28/2012 15:06:09 | 1,361,315 | 04/27/2012 14:12:23 | 131 | 0 | Branching model as we move to continuous integration | The goal is to be able to automate the build, so that whenever a developer checks their code in (or merge to a particular branch that has this trigger setup), the code should ship to the dev and QA environment. Pushing to production I imagine will require some manual involvement.
Note: This is a legacy application so we don't have control over how many things are setup.
Team size is about 10 developers.
Branching Strategy I have so far:
[1]Developer branch
[2]Main (Production) branch
When a developer is creating a new feature, they branch of the developer branch like: `dev_branch_feature_xyz`
When they want to push to the DEV or QA site for testing, they merge into the developer branch which will trigger TeamCity to first pull any changes from the Main branch, then compile etc. and then push to the DEV and QA servers.
Now if QA has signed off on a feature and it is ready for production, how will be pull the correct code to the Main branch and push the changes to our UAT environment and then production?
For example, feature#1 might get merged into dev, then feature#2, then a programmer might merge a bug fix for feature#1 again into dev, and maybe another merge for feature#2, so the DEV branch now has parts of feature#1 and feature#2, and there is no way to cherry pick the code to push to the MAIN branch now (if say feature#1 is ready for production).
**Also, is this a sound strategy? Any issues that you guys see?**
*Remember: Currently much of this will be manual (merging, pushing to servers) but the goal is to move to using TeamCity so I need to setup the branching strategy now.*
| tfs | continuous-integration | teamcity | null | null | 06/29/2012 16:22:51 | not constructive | Branching model as we move to continuous integration
===
The goal is to be able to automate the build, so that whenever a developer checks their code in (or merge to a particular branch that has this trigger setup), the code should ship to the dev and QA environment. Pushing to production I imagine will require some manual involvement.
Note: This is a legacy application so we don't have control over how many things are setup.
Team size is about 10 developers.
Branching Strategy I have so far:
[1]Developer branch
[2]Main (Production) branch
When a developer is creating a new feature, they branch of the developer branch like: `dev_branch_feature_xyz`
When they want to push to the DEV or QA site for testing, they merge into the developer branch which will trigger TeamCity to first pull any changes from the Main branch, then compile etc. and then push to the DEV and QA servers.
Now if QA has signed off on a feature and it is ready for production, how will be pull the correct code to the Main branch and push the changes to our UAT environment and then production?
For example, feature#1 might get merged into dev, then feature#2, then a programmer might merge a bug fix for feature#1 again into dev, and maybe another merge for feature#2, so the DEV branch now has parts of feature#1 and feature#2, and there is no way to cherry pick the code to push to the MAIN branch now (if say feature#1 is ready for production).
**Also, is this a sound strategy? Any issues that you guys see?**
*Remember: Currently much of this will be manual (merging, pushing to servers) but the goal is to move to using TeamCity so I need to setup the branching strategy now.*
| 4 |
3,778,277 | 09/23/2010 12:21:28 | 123,535 | 06/16/2009 07:14:52 | 28 | 0 | Template processing using Java | We have an email template which needs to be processed using Java. We have to replace the variables in the template with actual values. We were able to achieve this using pattern matching , ie; by searching the template for particular patters and replace them with actual values.
Now we need have conditions in the XML file.For example
$if($subject!=null)
sample subject
$endif
We need to check for this condition also. `subject` is a variable whose value needs to be repalced.
We are not allowed to use Velocity template processor.
Please suggest the best ways of implementing this.Is it good to have to ways of parsing it, like applying values for variables in the first parse and then checking the logic in the second parse. It will be of great help if anyone can provide their valuable suggestions. | java | pattern-matching | template-engine | processing | null | null | open | Template processing using Java
===
We have an email template which needs to be processed using Java. We have to replace the variables in the template with actual values. We were able to achieve this using pattern matching , ie; by searching the template for particular patters and replace them with actual values.
Now we need have conditions in the XML file.For example
$if($subject!=null)
sample subject
$endif
We need to check for this condition also. `subject` is a variable whose value needs to be repalced.
We are not allowed to use Velocity template processor.
Please suggest the best ways of implementing this.Is it good to have to ways of parsing it, like applying values for variables in the first parse and then checking the logic in the second parse. It will be of great help if anyone can provide their valuable suggestions. | 0 |
2,482,982 | 03/20/2010 12:27:46 | 89,752 | 04/11/2009 12:32:07 | 640 | 14 | Fatal Error in uploading to google DOcs using Zend_GData | Hi guys I'm trying the code samples from [zend frameworks][1] site on how to upload a document to google docs but I keep getting this error.
PHP Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 415
Content-Type application/x-www-form-urlencoded is not a valid input type.' in C:\...\Zend\Gdata\App.php:700
It can't be an unlisted type as I tried to upload even a .txt file - whats happening here - I've googled everywhere for an answer and landed nowhere - please help :(
[1]: http://framework.zend.com/svn/framework/standard/trunk/demos/Zend/Gdata/Docs.php
| zend-framework | php | google-docs | null | null | null | open | Fatal Error in uploading to google DOcs using Zend_GData
===
Hi guys I'm trying the code samples from [zend frameworks][1] site on how to upload a document to google docs but I keep getting this error.
PHP Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 415
Content-Type application/x-www-form-urlencoded is not a valid input type.' in C:\...\Zend\Gdata\App.php:700
It can't be an unlisted type as I tried to upload even a .txt file - whats happening here - I've googled everywhere for an answer and landed nowhere - please help :(
[1]: http://framework.zend.com/svn/framework/standard/trunk/demos/Zend/Gdata/Docs.php
| 0 |
8,865,126 | 01/14/2012 20:26:41 | 1,128,466 | 01/03/2012 18:44:20 | 1 | 0 | To call a java class from javascipt and pass a variable to the java servelet too | <!-- language: lang-js -->
function login(response, info)
{
if (response.authResponse)
{
var accessToken = response.authResponse.accessToken;
userInfo.innerHTML = '+ info.name';
+ "<br /> Your Access Token: " + accessToken;
button.innerHTML = 'Logout';
showLoader(false);
}
}
I have to pass the access token to a java servlet or java class how to do it
(UserService.java) | java | javascript | ajax | javascript-events | null | 01/14/2012 21:51:46 | not a real question | To call a java class from javascipt and pass a variable to the java servelet too
===
<!-- language: lang-js -->
function login(response, info)
{
if (response.authResponse)
{
var accessToken = response.authResponse.accessToken;
userInfo.innerHTML = '+ info.name';
+ "<br /> Your Access Token: " + accessToken;
button.innerHTML = 'Logout';
showLoader(false);
}
}
I have to pass the access token to a java servlet or java class how to do it
(UserService.java) | 1 |
11,114,501 | 06/20/2012 07:08:06 | 1,468,361 | 06/20/2012 06:56:05 | 1 | 0 | Facebook apps not getting the user photo | I had a problem in Facebook api to get the friends photo.
All the users are have the same permissions to upload and view photos of friends and for few users photo not able to view by friends but this user able view view his friends photo. it is showing empty tage for the friends, i don't know the problem but i have seen that there are many user for my apps , all the users user ids are going like this **100003946376883** but for few users the ids goes like this **539776512** these ids are making problem to view his photo to friends.
Is there any Resurrection for those users , since they are having different id format.
Please advice me to solve this problem .
Thanks in advance. | php | facebook | facebook-graph-api | null | null | 06/21/2012 01:32:31 | not a real question | Facebook apps not getting the user photo
===
I had a problem in Facebook api to get the friends photo.
All the users are have the same permissions to upload and view photos of friends and for few users photo not able to view by friends but this user able view view his friends photo. it is showing empty tage for the friends, i don't know the problem but i have seen that there are many user for my apps , all the users user ids are going like this **100003946376883** but for few users the ids goes like this **539776512** these ids are making problem to view his photo to friends.
Is there any Resurrection for those users , since they are having different id format.
Please advice me to solve this problem .
Thanks in advance. | 1 |
3,826,298 | 09/29/2010 22:17:56 | 461,174 | 09/28/2010 22:58:51 | 1 | 0 | Web Application using PHP + MySQL | Anyone got challenging web application project (preferably using PHP + MySQL) ideas suitable for first class degree?
All are welcome! | java | php5 | null | null | null | 09/30/2010 00:52:19 | not a real question | Web Application using PHP + MySQL
===
Anyone got challenging web application project (preferably using PHP + MySQL) ideas suitable for first class degree?
All are welcome! | 1 |
6,681,204 | 07/13/2011 15:14:46 | 838,233 | 07/11/2011 04:43:05 | 3 | 0 | Running good in browsers, but error by flash player directly : ReferenceError: Error #1056 | I wrote a flex demo, customized spark TextInput skin with rounded corners and a search icon in it, like mac os x search box, it's running good in browsers (by Flash Player browser plug-in) either .html or .swf, but error by flash player directly.
<pre>ReferenceError: Error #1056: Cannot create property allowCodeImport on flash.system.LoaderContext.
at mx.core::CrossDomainRSLItem/completeCdRslLoad()
at mx.core::CrossDomainRSLItem/itemCompleteHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()</pre>
there is the test demo, includes source: http://www.ycoder.com/wp-content/uploads/2011/07/CustomComponentSkinTest.zip
CustomTextInput
package component{
import skin.CustomTextInputSkin;
import spark.components.TextInput;
[Style(name="icon", inherit="no", type="Object")]
[Style(name="radius", inherit="true", type="Number")]
public class CustomTextInput extends TextInput{
[Embed(source="/images/search.png")]
private const defaultIcon:Class;
public function CustomTextInput(){
super();
this.setStyle('icon', defaultIcon);
this.setStyle('radius', 10);
this.setStyle("skinClass", CustomTextInputSkin);
}
}
}
CustomTextInputSkin
<!-- border -->
<!--- @private -->
<s:Rect left="0" right="0" top="0" bottom="0" id="border" radiusX="{hostComponent.getStyle('radius')}" radiusY="{hostComponent.getStyle('radius')}" >
<s:stroke>
<!--- @private -->
<s:SolidColorStroke id="borderStroke" weight="1" />
</s:stroke>
</s:Rect>
<!-- fill -->
<!--- Defines the appearance of the TextInput component's background. -->
<s:Rect id="background" left="1" right="1" top="1" bottom="1" radiusX="{hostComponent.getStyle('radius')}" radiusY="{hostComponent.getStyle('radius')}" >
<s:fill>
<!--- @private Defines the background fill color. -->
<s:SolidColor id="bgFill" color="0xFFFFFF" />
</s:fill>
</s:Rect>
<!-- shadow -->
<!--- @private -->
<s:Rect left="1" top="1" right="1" height="1" id="shadow" radiusX="{hostComponent.getStyle('radius')}" radiusY="{hostComponent.getStyle('radius')}" >
<s:fill>
<s:SolidColor color="0x000000" alpha="0.12" />
</s:fill>
</s:Rect>
<s:HGroup id="textGroup" gap="0" height="100%" paddingLeft="4" paddingRight="4">
<!-- icon -->
<s:Image id="icon" includeIn="normal" x="0" y="0" source="{hostComponent.getStyle('icon')}" verticalAlign="middle" height="100%"/>
<!-- text -->
<!--- @copy spark.components.supportClasses.SkinnableTextBase#textDisplay -->
<s:RichEditableText id="textDisplay"
verticalAlign="middle"
widthInChars="10"
left="1" right="1" top="1" bottom="1" height="100%"/>
</s:HGroup>
test case
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:component="component.*" >
<s:VGroup paddingLeft="20" paddingTop="20">
<s:TextInput />
<component:CustomTextInput />
<component:CustomTextInput radius="12" icon="images/device.png" text="ABC Test ... hohoho" editable="false" />
</s:VGroup>
</s:Application> | flex | spark | null | null | null | 07/15/2011 02:24:28 | too localized | Running good in browsers, but error by flash player directly : ReferenceError: Error #1056
===
I wrote a flex demo, customized spark TextInput skin with rounded corners and a search icon in it, like mac os x search box, it's running good in browsers (by Flash Player browser plug-in) either .html or .swf, but error by flash player directly.
<pre>ReferenceError: Error #1056: Cannot create property allowCodeImport on flash.system.LoaderContext.
at mx.core::CrossDomainRSLItem/completeCdRslLoad()
at mx.core::CrossDomainRSLItem/itemCompleteHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()</pre>
there is the test demo, includes source: http://www.ycoder.com/wp-content/uploads/2011/07/CustomComponentSkinTest.zip
CustomTextInput
package component{
import skin.CustomTextInputSkin;
import spark.components.TextInput;
[Style(name="icon", inherit="no", type="Object")]
[Style(name="radius", inherit="true", type="Number")]
public class CustomTextInput extends TextInput{
[Embed(source="/images/search.png")]
private const defaultIcon:Class;
public function CustomTextInput(){
super();
this.setStyle('icon', defaultIcon);
this.setStyle('radius', 10);
this.setStyle("skinClass", CustomTextInputSkin);
}
}
}
CustomTextInputSkin
<!-- border -->
<!--- @private -->
<s:Rect left="0" right="0" top="0" bottom="0" id="border" radiusX="{hostComponent.getStyle('radius')}" radiusY="{hostComponent.getStyle('radius')}" >
<s:stroke>
<!--- @private -->
<s:SolidColorStroke id="borderStroke" weight="1" />
</s:stroke>
</s:Rect>
<!-- fill -->
<!--- Defines the appearance of the TextInput component's background. -->
<s:Rect id="background" left="1" right="1" top="1" bottom="1" radiusX="{hostComponent.getStyle('radius')}" radiusY="{hostComponent.getStyle('radius')}" >
<s:fill>
<!--- @private Defines the background fill color. -->
<s:SolidColor id="bgFill" color="0xFFFFFF" />
</s:fill>
</s:Rect>
<!-- shadow -->
<!--- @private -->
<s:Rect left="1" top="1" right="1" height="1" id="shadow" radiusX="{hostComponent.getStyle('radius')}" radiusY="{hostComponent.getStyle('radius')}" >
<s:fill>
<s:SolidColor color="0x000000" alpha="0.12" />
</s:fill>
</s:Rect>
<s:HGroup id="textGroup" gap="0" height="100%" paddingLeft="4" paddingRight="4">
<!-- icon -->
<s:Image id="icon" includeIn="normal" x="0" y="0" source="{hostComponent.getStyle('icon')}" verticalAlign="middle" height="100%"/>
<!-- text -->
<!--- @copy spark.components.supportClasses.SkinnableTextBase#textDisplay -->
<s:RichEditableText id="textDisplay"
verticalAlign="middle"
widthInChars="10"
left="1" right="1" top="1" bottom="1" height="100%"/>
</s:HGroup>
test case
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:component="component.*" >
<s:VGroup paddingLeft="20" paddingTop="20">
<s:TextInput />
<component:CustomTextInput />
<component:CustomTextInput radius="12" icon="images/device.png" text="ABC Test ... hohoho" editable="false" />
</s:VGroup>
</s:Application> | 3 |
898,559 | 05/22/2009 15:45:25 | 94,990 | 04/23/2009 14:17:01 | 251 | 22 | VIsual Studio: Metadata file '...\Release\project.dll' could not be found | Recently I started to get this message randomly. I have a solution with several projects in it. Current build mode is Debug and all projects' configuration is set to Debug. But when I try to run the main project - sometimes it gives me a few errors all of which are "Metadata file '...\Release\projectX.dll' could not be found" - and, look, it says about RELEASE folder, though current mode is Debug. Why? I tried to search for reference to "Release\projectX.dll" inside all solution files and I found one in ResolveAssemblyReference.cache file.
I made a good search over the internet and found a few people with the similar problem, but there was no solution, or at least no working solution.
I tried to delete references to those projects and readd them, but in some time I start getting these errors again.
It seems like a bug. Why does it search for referenced projects in Release folders when I always use Debug mode? | visual-studio | metadata-file-could-not-b | release | debugging | resolveassemblyreference | null | open | VIsual Studio: Metadata file '...\Release\project.dll' could not be found
===
Recently I started to get this message randomly. I have a solution with several projects in it. Current build mode is Debug and all projects' configuration is set to Debug. But when I try to run the main project - sometimes it gives me a few errors all of which are "Metadata file '...\Release\projectX.dll' could not be found" - and, look, it says about RELEASE folder, though current mode is Debug. Why? I tried to search for reference to "Release\projectX.dll" inside all solution files and I found one in ResolveAssemblyReference.cache file.
I made a good search over the internet and found a few people with the similar problem, but there was no solution, or at least no working solution.
I tried to delete references to those projects and readd them, but in some time I start getting these errors again.
It seems like a bug. Why does it search for referenced projects in Release folders when I always use Debug mode? | 0 |
2,795,992 | 05/08/2010 23:09:26 | 98,514 | 04/30/2009 12:31:20 | 291 | 27 | addslashes and addcslahes | I was seeing today the addslashes and addcslashes in php.net, but did not get the point on what is the difference between them and what are the characters escaped in these two.
<?php
$originaltext = 'This text does NOT contain \\n a new-line!';
$encoded = addcslashes($originaltext, '\\');
$decoded = stripcslashes($encoded);
//$decoded now contains a copy of $originaltext with perfect integrity
echo $decoded; //Display the sentence with it's literal \n intact
?>
If i comment the $decoded variable and echo $encoded, i get the same value which is in the original string.
Can anyone clearly explain me the difference and use of these two. | php | null | null | null | null | null | open | addslashes and addcslahes
===
I was seeing today the addslashes and addcslashes in php.net, but did not get the point on what is the difference between them and what are the characters escaped in these two.
<?php
$originaltext = 'This text does NOT contain \\n a new-line!';
$encoded = addcslashes($originaltext, '\\');
$decoded = stripcslashes($encoded);
//$decoded now contains a copy of $originaltext with perfect integrity
echo $decoded; //Display the sentence with it's literal \n intact
?>
If i comment the $decoded variable and echo $encoded, i get the same value which is in the original string.
Can anyone clearly explain me the difference and use of these two. | 0 |
8,046,882 | 11/08/2011 06:52:22 | 1,035,085 | 11/08/2011 06:33:30 | 1 | 0 | Count Column Data based on Groupings | so I have this problem. My Database has two tables that look something
like this:
Table A:
============================
Username Group Number
============================
mike 1
john 1
stan 2
mark 2
============================
Table B:
========================================
Username FeatureA FeatureB FeatureC
----------------------------------------
mike Yes Yes
john Yes
stan Yes Yes
mark Yes Yes
========================================
Tables A and B are joined together by Username and I need something that looks like this:
============================================
Group Number FeatureA FeatureB FeatureC
============================================
1 1 1 1
2 1 1 2
============================================
Basically I need to count the number of users in each group that have access to each feature.
| sql | sql-server | null | null | null | null | open | Count Column Data based on Groupings
===
so I have this problem. My Database has two tables that look something
like this:
Table A:
============================
Username Group Number
============================
mike 1
john 1
stan 2
mark 2
============================
Table B:
========================================
Username FeatureA FeatureB FeatureC
----------------------------------------
mike Yes Yes
john Yes
stan Yes Yes
mark Yes Yes
========================================
Tables A and B are joined together by Username and I need something that looks like this:
============================================
Group Number FeatureA FeatureB FeatureC
============================================
1 1 1 1
2 1 1 2
============================================
Basically I need to count the number of users in each group that have access to each feature.
| 0 |
10,390,817 | 04/30/2012 21:26:45 | 683,216 | 03/30/2011 03:37:45 | 125 | 13 | Most Flexible Open Office Word Document Format (Not MS Word) For Git Versioning and Collaboration | I am looking to start a collaborative word document in Git, and want to know what is the best format?
**Some loose requirements I have for this document are**: potential to easily add some simple markup, like bold, italics, maybe some font sizes or highlighting (nothing too technical). Ability to work seamlessly in git without too many complicated commands, as not everybody on the project will be a git guru, or may even be first time users. Something that is light
I'm already biased against Microsoft Word because I don't want to pay for it, and it has a lot of the bells and whistles I don't need, and frankly find annoying.
I'm already leaning towards using OpenOffice Writer with ODF formatting. Has anybody done this, or have any suggestions on why this is not a good idea? There are a lot of formats to choose from, like this picture:![enter image description here][1]
That is sorta overwhelming.
My reasoning for using OpenOffice is that it's free, it can install on most computers, and it is open source. This project is open source as well, and it seems like using open source tools is true to the spirit.
I know this is not a discussion forum, and I truly am looking for a definitive answer on file type, or some suggestions from anybody who has experience versioning word / text documents in Git. It's totally out of the question to use SVN in this project, mainly because it sucks. Thanks!
[1]: http://i.stack.imgur.com/YP2v7.png | git | github | openoffice.org | openoffice-writer | null | 07/16/2012 12:04:05 | off topic | Most Flexible Open Office Word Document Format (Not MS Word) For Git Versioning and Collaboration
===
I am looking to start a collaborative word document in Git, and want to know what is the best format?
**Some loose requirements I have for this document are**: potential to easily add some simple markup, like bold, italics, maybe some font sizes or highlighting (nothing too technical). Ability to work seamlessly in git without too many complicated commands, as not everybody on the project will be a git guru, or may even be first time users. Something that is light
I'm already biased against Microsoft Word because I don't want to pay for it, and it has a lot of the bells and whistles I don't need, and frankly find annoying.
I'm already leaning towards using OpenOffice Writer with ODF formatting. Has anybody done this, or have any suggestions on why this is not a good idea? There are a lot of formats to choose from, like this picture:![enter image description here][1]
That is sorta overwhelming.
My reasoning for using OpenOffice is that it's free, it can install on most computers, and it is open source. This project is open source as well, and it seems like using open source tools is true to the spirit.
I know this is not a discussion forum, and I truly am looking for a definitive answer on file type, or some suggestions from anybody who has experience versioning word / text documents in Git. It's totally out of the question to use SVN in this project, mainly because it sucks. Thanks!
[1]: http://i.stack.imgur.com/YP2v7.png | 2 |
9,093,327 | 02/01/2012 09:17:51 | 1,182,299 | 02/01/2012 09:11:14 | 1 | 0 | Little JAVA code port to PHP, Perl, Ruby or Python | can anyone help me to port a little piece of code from JAVA (I don't speak JAVA) to any other programming language I speak like PHP, Perl, Ruby or Python? The code is basically a XOR based encrypt/decrypt class:
import java.io.PrintStream;
public class Encryptor
{
public Encryptor()
{
}
public static String encrypt(String pass)
{
String strTarget = XORString(pass);
strTarget = StringToHex(strTarget);
return strTarget;
}
public static String decrypt(String pass)
{
String strTarget = HexToString(pass);
strTarget = XORString(strTarget);
return strTarget;
}
private static String GetKeyForLength(int nLength)
{
int nKeyLen = "4p0L@r1$".length();
int nRepeats = nLength / nKeyLen + 1;
String strResult = "";
for(int i = 0; i < nRepeats; i++)
strResult = strResult + "4p0L@r1$";
return strResult.substring(0, nLength);
}
private static String HexToString(String str)
{
StringBuffer sb = new StringBuffer();
char buffDigit[] = new char[4];
buffDigit[0] = '0';
buffDigit[1] = 'x';
int length = str.length() / 2;
byte bytes[] = new byte[length];
for(int i = 0; i < length; i++)
{
buffDigit[2] = str.charAt(i * 2);
buffDigit[3] = str.charAt(i * 2 + 1);
Integer b = Integer.decode(new String(buffDigit));
bytes = (byte)b.intValue();
}
return new String(bytes);
}
private static String XORString(String strTarget)
{
int nTargetLen = strTarget.length();
String strPaddedKey = GetKeyForLength(nTargetLen);
String strResult = "";
byte bytes[] = new byte[nTargetLen];
for(int i = 0; i < nTargetLen; i++)
{
int b = strTarget.charAt(i) ^ strPaddedKey.charAt(i);
bytes = (byte)b;
}
String result = new String(bytes);
return result;
}
private static String StringToHex(String strInput)
{
StringBuffer hex = new StringBuffer();
int nLen = strInput.length();
for(int i = 0; i < nLen; i++)
{
char ch = strInput.charAt(i);
int b = ch;
String hexStr = Integer.toHexString(b);
if(hexStr.length() == 1)
hex.append("0");
hex.append(Integer.toHexString(b));
}
return hex.toString();
}
public static void main(String args[])
{
if(args.length < 1)
{
System.err.println("Missing password!");
System.exit(-1);
}
String pass = args[0];
String pass2 = encrypt(pass);
System.out.println("Encrypted: " + pass2);
pass2 = decrypt(pass2);
System.out.println("Decrypted: " + pass2);
if(!pass.equals(pass2))
{
System.out.println("Test Failed!");
System.exit(-1);
}
}
private static final String m_strPrivateKey = "4p0L@r1$";
}
Thank you very much for your help! | java | php | ruby | perl | null | 02/01/2012 19:12:08 | not constructive | Little JAVA code port to PHP, Perl, Ruby or Python
===
can anyone help me to port a little piece of code from JAVA (I don't speak JAVA) to any other programming language I speak like PHP, Perl, Ruby or Python? The code is basically a XOR based encrypt/decrypt class:
import java.io.PrintStream;
public class Encryptor
{
public Encryptor()
{
}
public static String encrypt(String pass)
{
String strTarget = XORString(pass);
strTarget = StringToHex(strTarget);
return strTarget;
}
public static String decrypt(String pass)
{
String strTarget = HexToString(pass);
strTarget = XORString(strTarget);
return strTarget;
}
private static String GetKeyForLength(int nLength)
{
int nKeyLen = "4p0L@r1$".length();
int nRepeats = nLength / nKeyLen + 1;
String strResult = "";
for(int i = 0; i < nRepeats; i++)
strResult = strResult + "4p0L@r1$";
return strResult.substring(0, nLength);
}
private static String HexToString(String str)
{
StringBuffer sb = new StringBuffer();
char buffDigit[] = new char[4];
buffDigit[0] = '0';
buffDigit[1] = 'x';
int length = str.length() / 2;
byte bytes[] = new byte[length];
for(int i = 0; i < length; i++)
{
buffDigit[2] = str.charAt(i * 2);
buffDigit[3] = str.charAt(i * 2 + 1);
Integer b = Integer.decode(new String(buffDigit));
bytes = (byte)b.intValue();
}
return new String(bytes);
}
private static String XORString(String strTarget)
{
int nTargetLen = strTarget.length();
String strPaddedKey = GetKeyForLength(nTargetLen);
String strResult = "";
byte bytes[] = new byte[nTargetLen];
for(int i = 0; i < nTargetLen; i++)
{
int b = strTarget.charAt(i) ^ strPaddedKey.charAt(i);
bytes = (byte)b;
}
String result = new String(bytes);
return result;
}
private static String StringToHex(String strInput)
{
StringBuffer hex = new StringBuffer();
int nLen = strInput.length();
for(int i = 0; i < nLen; i++)
{
char ch = strInput.charAt(i);
int b = ch;
String hexStr = Integer.toHexString(b);
if(hexStr.length() == 1)
hex.append("0");
hex.append(Integer.toHexString(b));
}
return hex.toString();
}
public static void main(String args[])
{
if(args.length < 1)
{
System.err.println("Missing password!");
System.exit(-1);
}
String pass = args[0];
String pass2 = encrypt(pass);
System.out.println("Encrypted: " + pass2);
pass2 = decrypt(pass2);
System.out.println("Decrypted: " + pass2);
if(!pass.equals(pass2))
{
System.out.println("Test Failed!");
System.exit(-1);
}
}
private static final String m_strPrivateKey = "4p0L@r1$";
}
Thank you very much for your help! | 4 |
8,130,227 | 11/15/2011 00:53:29 | 378,443 | 06/28/2010 21:04:08 | 46 | 2 | Flex: Karaoke app out of sync on playback,after publishing on an external server | I'm trying to create a Karaoke app in my spare time, but i'm having some problem syncing the recording and the backing track.
Basically, after i start to publish to an external media server (wowza), when i play back with the recording (mp3, ripped from the recording flv) and the backing track (mp3 too), i notice a delay of 0-800 ms between the 2 track, which is a big time for this type of application.
This delay is always random, as bigger in windows than macs.
I already tried many solution, amongs the others:
- Playback with the Sound.extract method, taking 2048 samples each time, to have less latency for the audio start/processing;
- Set the microphone silence level to 0;
- Sync by cuepoint, in different cases in flv or in the mp3 (extending the sound class)
But every time, i get mixed results (worse results in windows, best results in mac)
Anyone has some suggestion to give? Any help would be appreciated :-) | flex | actionscript | synchronization | delay | wowza | null | open | Flex: Karaoke app out of sync on playback,after publishing on an external server
===
I'm trying to create a Karaoke app in my spare time, but i'm having some problem syncing the recording and the backing track.
Basically, after i start to publish to an external media server (wowza), when i play back with the recording (mp3, ripped from the recording flv) and the backing track (mp3 too), i notice a delay of 0-800 ms between the 2 track, which is a big time for this type of application.
This delay is always random, as bigger in windows than macs.
I already tried many solution, amongs the others:
- Playback with the Sound.extract method, taking 2048 samples each time, to have less latency for the audio start/processing;
- Set the microphone silence level to 0;
- Sync by cuepoint, in different cases in flv or in the mp3 (extending the sound class)
But every time, i get mixed results (worse results in windows, best results in mac)
Anyone has some suggestion to give? Any help would be appreciated :-) | 0 |
9,051,544 | 01/29/2012 07:04:27 | 1,023,891 | 11/01/2011 14:32:09 | 8 | 0 | Shoud i distribute sources of open-source project if i'm making SaaS solution? | i was made an brunch of one open-source bloggin system licensed under "Microsoft Reciprocal License (MS-RL)". Then i publish a web site thats allow you to create blog on this system. I'm dont distribute product or its derivatives itself, only accessing deployed instances. So, now i'm trying to understand my relationships to author.
1. Shoud i leave copyrights somewhere on my service? Shoud i leave it in each blog or only on main site where users can create blogs?
2. Shoud i leave logos or only text copyrights?
3. Shoud i leave access to the sources of my project?
4. Shoud i publish sources only for original files in project or for added by me files too?
5. Shoud i publish sources for other components of my project that i create by my self?
In any way i wasnt see on any web site builded on top of opesource CMS (for example) any links on licences or links on modified sources.
Many thx for u answers!
*sorry for my worstest ever english. | licensing | saas | null | null | null | 01/30/2012 21:20:27 | not constructive | Shoud i distribute sources of open-source project if i'm making SaaS solution?
===
i was made an brunch of one open-source bloggin system licensed under "Microsoft Reciprocal License (MS-RL)". Then i publish a web site thats allow you to create blog on this system. I'm dont distribute product or its derivatives itself, only accessing deployed instances. So, now i'm trying to understand my relationships to author.
1. Shoud i leave copyrights somewhere on my service? Shoud i leave it in each blog or only on main site where users can create blogs?
2. Shoud i leave logos or only text copyrights?
3. Shoud i leave access to the sources of my project?
4. Shoud i publish sources only for original files in project or for added by me files too?
5. Shoud i publish sources for other components of my project that i create by my self?
In any way i wasnt see on any web site builded on top of opesource CMS (for example) any links on licences or links on modified sources.
Many thx for u answers!
*sorry for my worstest ever english. | 4 |
4,193,034 | 11/16/2010 10:14:10 | 260,665 | 01/28/2010 05:14:09 | 446 | 40 | Building solar water fountain! | I dont know if I am asking this question in wrong place, please bear me! I am planning of building a solar water fountain which would serve as a bird bath in my back yard this summer.
My requirements are simple:
The fountain should be powered by solar energy, a small output motor (or whatever) connected to this solar source which pumps out the water. I just need a small working model in a economic price.
I have no experience in building basic electronics model, please guide me on how this can be accomplished, where I can get solar panels and how do I configure it with a motor etc. I am from India and would like to purchase raw materials available in India rather than getting it shipped from elsewhere. Any help is greatly appreciated.
Thanks,
Raj | electronics | electrical-engineering | energy-saving | null | null | 11/16/2010 10:25:47 | off topic | Building solar water fountain!
===
I dont know if I am asking this question in wrong place, please bear me! I am planning of building a solar water fountain which would serve as a bird bath in my back yard this summer.
My requirements are simple:
The fountain should be powered by solar energy, a small output motor (or whatever) connected to this solar source which pumps out the water. I just need a small working model in a economic price.
I have no experience in building basic electronics model, please guide me on how this can be accomplished, where I can get solar panels and how do I configure it with a motor etc. I am from India and would like to purchase raw materials available in India rather than getting it shipped from elsewhere. Any help is greatly appreciated.
Thanks,
Raj | 2 |
3,681,557 | 09/10/2010 00:36:54 | 433,185 | 08/27/2010 17:18:43 | 1 | 0 | How can I extend Zend_Controller_Action to make a function universal in all controllers | I want to extend Zend_Controller_Action so I can have messaging be universal. Right now in the preDispatch() I am setting all the error and warning messages. How can I make the AddMessage (see code) and preDispatch functions be universal throughout all controllers?
<?php
class PlaygroundController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function preDispatch()
{
$flashMessenger = $this->_helper->FlashMessenger;
$flashMessenger->setNamespace('Errors');
$this->view->Errors = $flashMessenger->getMessages();
$flashMessenger->setNamespace('Warnings');
$this->view->Warnings = $flashMessenger->getMessages();
$flashMessenger->setNamespace('Messages');
$this->view->Messages = $flashMessenger->getMessages();
$flashMessenger->setNamespace('Success');
$this->view->Success = $flashMessenger->getMessages();
}
protected function AddMessage($message,$type='Errors') {
$flashMessenger = $this->_helper->FlashMessenger;
$flashMessenger->setNamespace($type);
$flashMessenger->addMessage($message);
}
public function flashAction()
{
$this->AddMessage('This is an error message');
$this->AddMessage('This is another error message');
$this->AddMessage('This is a warning message','Warnings');
$this->AddMessage('This is message','Messages');
$this->AddMessage('This is another success message','Success');
}
} | php | mvc | zend-framework | zend | null | null | open | How can I extend Zend_Controller_Action to make a function universal in all controllers
===
I want to extend Zend_Controller_Action so I can have messaging be universal. Right now in the preDispatch() I am setting all the error and warning messages. How can I make the AddMessage (see code) and preDispatch functions be universal throughout all controllers?
<?php
class PlaygroundController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function preDispatch()
{
$flashMessenger = $this->_helper->FlashMessenger;
$flashMessenger->setNamespace('Errors');
$this->view->Errors = $flashMessenger->getMessages();
$flashMessenger->setNamespace('Warnings');
$this->view->Warnings = $flashMessenger->getMessages();
$flashMessenger->setNamespace('Messages');
$this->view->Messages = $flashMessenger->getMessages();
$flashMessenger->setNamespace('Success');
$this->view->Success = $flashMessenger->getMessages();
}
protected function AddMessage($message,$type='Errors') {
$flashMessenger = $this->_helper->FlashMessenger;
$flashMessenger->setNamespace($type);
$flashMessenger->addMessage($message);
}
public function flashAction()
{
$this->AddMessage('This is an error message');
$this->AddMessage('This is another error message');
$this->AddMessage('This is a warning message','Warnings');
$this->AddMessage('This is message','Messages');
$this->AddMessage('This is another success message','Success');
}
} | 0 |
8,824,269 | 01/11/2012 18:00:09 | 675,455 | 03/24/2011 18:23:59 | 560 | 10 | GL/CL interoperability: Shared Texture | I intend to make Graphics calculation with OpenCL such as ray casting, ray marching and others. And I want to use OpenGL to display result of this calculations (pixel images). I use texture buffer attached to frame buffer. OpenCL writes the result into the texture and then I use glBlitFrameBuffer function to copy texture data to application window framebuffer.
I met a CL/GL inter problem during the implementation of it. I wrote a simple example to show it. This example shows framebuffer object and texture object initialization, their conjunction, OpenCL buffer creation from GL texture buffer. At the end the main render loop is shown. It consists of texture writing with new data in each frame, framebuffer attachment and copying of this framebuffer.
Texture Initialization:
for (int i = 0; i < data.Length; i +=4) {
data [i] = 255;
}
GL.BindTexture (TextureTarget.Texture2D, tboID [0]);
GL.TexImage2D<byte> (TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba8, w, h, 0,
PixelFormat.Rgba, PixelType.UnsignedByte, data);
GL.BindTexture (TextureTarget.Texture2D, 0)
TBO+FBO Initialization:
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, fboID [0]);
GL.FramebufferTexture2D (FramebufferTarget.FramebufferExt, FramebufferAttachment.ColorAttachment0,
TextureTarget.Texture2D, tboID [0], 0);
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0);
CL/GL Initialization:
bufferID = CL.CreateFromGLTexture2D (context, MemFlags.MemReadWrite, TextureTarget.Texture2D, ((uint[])tboID.Clone()) [0], 0);
Render Loop:
for (int i = 0; i < data.Length; i += 4) {
data [i] = tt;
}
tt++;
GL.BindTexture (TextureTarget.Texture2D, tboID [0]);
GL.TexImage2D<byte> (TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba8, w, h, 0,
PixelFormat.Rgba, PixelType.UnsignedByte, data);
GL.BindTexture (TextureTarget.Texture2D, 0);
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, fboID [0]);
GL.FramebufferTexture2D (FramebufferTarget.FramebufferExt, FramebufferAttachment.ColorAttachment0,
TextureTarget.Texture2D, tboID [0], 0);
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0);GL.BindFramebuffer (FramebufferTarget.ReadFramebuffer, fboID [0]);
GL.ReadBuffer (ReadBufferMode.ColorAttachment0);
GL.DrawBuffer (DrawBufferMode.Back);
GL.BlitFramebuffer (0, 0, w, h, 0, 0, w, h, ClearBufferMask.ColorBufferBit, BlitFramebufferFilter.Nearest);
GL.BindFramebuffer (FramebufferTarget.ReadFramebuffer, 0);
At the first glance this code looks weird, but it completely shows my problem. CL does not work at all here. In this application OpenCL context is created and OpenCL buffer initialization is occured.
The work of this should be simple. The color of screen is being changed from black to red. And It does not work in this way. The color does not change from the initial red (texture initialization).
But it works normal when I comment the CL/GL Initialization (creation of CL buffer from GL texture).
Why is it so? Why the behavior of the GL buffer is changed depending on CL attachments? How to fix it and make it works? | opengl | opencl | gpu | gpgpu | gpu-programming | 01/26/2012 13:36:31 | too localized | GL/CL interoperability: Shared Texture
===
I intend to make Graphics calculation with OpenCL such as ray casting, ray marching and others. And I want to use OpenGL to display result of this calculations (pixel images). I use texture buffer attached to frame buffer. OpenCL writes the result into the texture and then I use glBlitFrameBuffer function to copy texture data to application window framebuffer.
I met a CL/GL inter problem during the implementation of it. I wrote a simple example to show it. This example shows framebuffer object and texture object initialization, their conjunction, OpenCL buffer creation from GL texture buffer. At the end the main render loop is shown. It consists of texture writing with new data in each frame, framebuffer attachment and copying of this framebuffer.
Texture Initialization:
for (int i = 0; i < data.Length; i +=4) {
data [i] = 255;
}
GL.BindTexture (TextureTarget.Texture2D, tboID [0]);
GL.TexImage2D<byte> (TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba8, w, h, 0,
PixelFormat.Rgba, PixelType.UnsignedByte, data);
GL.BindTexture (TextureTarget.Texture2D, 0)
TBO+FBO Initialization:
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, fboID [0]);
GL.FramebufferTexture2D (FramebufferTarget.FramebufferExt, FramebufferAttachment.ColorAttachment0,
TextureTarget.Texture2D, tboID [0], 0);
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0);
CL/GL Initialization:
bufferID = CL.CreateFromGLTexture2D (context, MemFlags.MemReadWrite, TextureTarget.Texture2D, ((uint[])tboID.Clone()) [0], 0);
Render Loop:
for (int i = 0; i < data.Length; i += 4) {
data [i] = tt;
}
tt++;
GL.BindTexture (TextureTarget.Texture2D, tboID [0]);
GL.TexImage2D<byte> (TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba8, w, h, 0,
PixelFormat.Rgba, PixelType.UnsignedByte, data);
GL.BindTexture (TextureTarget.Texture2D, 0);
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, fboID [0]);
GL.FramebufferTexture2D (FramebufferTarget.FramebufferExt, FramebufferAttachment.ColorAttachment0,
TextureTarget.Texture2D, tboID [0], 0);
GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0);GL.BindFramebuffer (FramebufferTarget.ReadFramebuffer, fboID [0]);
GL.ReadBuffer (ReadBufferMode.ColorAttachment0);
GL.DrawBuffer (DrawBufferMode.Back);
GL.BlitFramebuffer (0, 0, w, h, 0, 0, w, h, ClearBufferMask.ColorBufferBit, BlitFramebufferFilter.Nearest);
GL.BindFramebuffer (FramebufferTarget.ReadFramebuffer, 0);
At the first glance this code looks weird, but it completely shows my problem. CL does not work at all here. In this application OpenCL context is created and OpenCL buffer initialization is occured.
The work of this should be simple. The color of screen is being changed from black to red. And It does not work in this way. The color does not change from the initial red (texture initialization).
But it works normal when I comment the CL/GL Initialization (creation of CL buffer from GL texture).
Why is it so? Why the behavior of the GL buffer is changed depending on CL attachments? How to fix it and make it works? | 3 |
5,868,100 | 05/03/2011 10:22:16 | 31,379 | 10/25/2008 04:03:43 | 458 | 34 | Signed applet running a PrivilegedAction still fails with an AccessControlException | Is there some sort of limit to what privileged actions are permitted even for signed applets? Here is the stack trace:
`Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.skype)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkLink(SecurityManager.java:818)
at java.lang.Runtime.loadLibrary0(Runtime.java:817)
at java.lang.System.loadLibrary(System.java:1045)
at com.skype.connector.ConnectorUtils.loadLibrary(ConnectorUtils.java:321)
at com.skype.connector.osx.SkypeFramework.init(SkypeFramework.java:44)
at com.skype.connector.osx.OSXConnector.initializeImpl(OSXConnector.java:107)
at com.skype.connector.Connector.initialize(Connector.java:485)
at com.skype.connector.osx.OSXConnector.isRunning(OSXConnector.java:86)
at com.skype.Skype.isRunning(Skype.java:172)`
| java | security | permissions | applet | skype4java | null | open | Signed applet running a PrivilegedAction still fails with an AccessControlException
===
Is there some sort of limit to what privileged actions are permitted even for signed applets? Here is the stack trace:
`Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.skype)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkLink(SecurityManager.java:818)
at java.lang.Runtime.loadLibrary0(Runtime.java:817)
at java.lang.System.loadLibrary(System.java:1045)
at com.skype.connector.ConnectorUtils.loadLibrary(ConnectorUtils.java:321)
at com.skype.connector.osx.SkypeFramework.init(SkypeFramework.java:44)
at com.skype.connector.osx.OSXConnector.initializeImpl(OSXConnector.java:107)
at com.skype.connector.Connector.initialize(Connector.java:485)
at com.skype.connector.osx.OSXConnector.isRunning(OSXConnector.java:86)
at com.skype.Skype.isRunning(Skype.java:172)`
| 0 |
8,577,935 | 12/20/2011 15:37:56 | 1,071,515 | 11/29/2011 14:42:40 | 65 | 1 | Updating a Cookie PHP? | Struggling to google a solution to my problem. I have found one for Javascript and ASP.net
However nothing for PHP.
Basically I have a Shopping Cart page that I am wanting to use a cookie to store all the details on what items the user has selected.
The code needs to be able to:
- Find the cookie
- If no cookie, create one
- If adding items, modify cookie
- If deleting items, modify cookie
- After 20 mins the cookie dies
Can anyone give me some sample code or links to resources for this . I am a junior dev in PHP and this is new territory!
Thanks
-Merry Christmas :)
| php | html | cookies | null | null | 12/20/2011 15:45:06 | not constructive | Updating a Cookie PHP?
===
Struggling to google a solution to my problem. I have found one for Javascript and ASP.net
However nothing for PHP.
Basically I have a Shopping Cart page that I am wanting to use a cookie to store all the details on what items the user has selected.
The code needs to be able to:
- Find the cookie
- If no cookie, create one
- If adding items, modify cookie
- If deleting items, modify cookie
- After 20 mins the cookie dies
Can anyone give me some sample code or links to resources for this . I am a junior dev in PHP and this is new territory!
Thanks
-Merry Christmas :)
| 4 |
8,908,734 | 01/18/2012 10:42:57 | 1,007,522 | 10/21/2011 16:41:18 | 59 | 1 | Create a 2D world | Ive got a project for school that is to create the tanks game ( like worms or something else )
With a little research I found that the best way to create the 2D world would be to hold a bitmap of 1 and 0 to switch between background and foreground. So that I could load 2 images one for the background like the worms game the sea or something and another image with the map that is placed on it. Now because of that bitmap if I shoot something I could simply replace a 1 in a 0 so that there is a whole in the map..
With QT I could then just draw a canvas where I could display that bitmap.
I just don't find how to program this, maybe someone could help me out, where to start?
Kind regards, | c++ | 2d | null | null | null | 01/19/2012 00:39:35 | not a real question | Create a 2D world
===
Ive got a project for school that is to create the tanks game ( like worms or something else )
With a little research I found that the best way to create the 2D world would be to hold a bitmap of 1 and 0 to switch between background and foreground. So that I could load 2 images one for the background like the worms game the sea or something and another image with the map that is placed on it. Now because of that bitmap if I shoot something I could simply replace a 1 in a 0 so that there is a whole in the map..
With QT I could then just draw a canvas where I could display that bitmap.
I just don't find how to program this, maybe someone could help me out, where to start?
Kind regards, | 1 |
3,025,641 | 06/11/2010 19:27:53 | 371,463 | 06/11/2010 19:14:57 | 1 | 0 | Who is the best application server: JBoss or Glassfish? | I have a choice to do: choose a application server for my company!
And I need some help. Glassfish or JBoss?
Thanks. | java | jboss | glassfish | null | null | 06/11/2010 20:16:13 | not constructive | Who is the best application server: JBoss or Glassfish?
===
I have a choice to do: choose a application server for my company!
And I need some help. Glassfish or JBoss?
Thanks. | 4 |
9,735,070 | 03/16/2012 09:54:49 | 450,469 | 07/08/2010 06:03:23 | 88 | 1 | How to change marker color in JQuery UI map | I have nearly 30 marker in my map and want to change marker color by java script(on check box selection) | jquery | jquery-ui | jquery-ui-map | null | null | 03/16/2012 22:04:51 | not a real question | How to change marker color in JQuery UI map
===
I have nearly 30 marker in my map and want to change marker color by java script(on check box selection) | 1 |
11,387,853 | 07/09/2012 00:31:58 | 625,242 | 02/20/2011 13:30:30 | 1,747 | 129 | What would be a better way of using task parallel library | I just started using the TPL, and I want to make several calls to web services happen in parallel. From what I can gather, I see two ways of doing this.
Either `Parallel.ForEach`:
List<ServiceMemberBase> list = new List<ServiceMemberBase>(); //Take list from somewhere.
Parallel.ForEach(list, member =>
{
var result = Proxy.Invoke(member);
//...
//Do stuff with the result
//...
});
Or `Task<T>`:
List<ServiceMemberBase> list = new List<ServiceMemberBase>(); //Take list from somewhere.
ForEach(var member in list)
{
Task<MemberResult>.Factory.StartNew(() => proxy.Invoke(member));
}
//Wait for all tasks to finish.
//Process the result objects.
Disregarding if the syntax is correct or not, are these to equivilant?
Will they produce the same result? If not, why? and which is preferable? | c# | task-parallel-library | null | null | null | null | open | What would be a better way of using task parallel library
===
I just started using the TPL, and I want to make several calls to web services happen in parallel. From what I can gather, I see two ways of doing this.
Either `Parallel.ForEach`:
List<ServiceMemberBase> list = new List<ServiceMemberBase>(); //Take list from somewhere.
Parallel.ForEach(list, member =>
{
var result = Proxy.Invoke(member);
//...
//Do stuff with the result
//...
});
Or `Task<T>`:
List<ServiceMemberBase> list = new List<ServiceMemberBase>(); //Take list from somewhere.
ForEach(var member in list)
{
Task<MemberResult>.Factory.StartNew(() => proxy.Invoke(member));
}
//Wait for all tasks to finish.
//Process the result objects.
Disregarding if the syntax is correct or not, are these to equivilant?
Will they produce the same result? If not, why? and which is preferable? | 0 |
8,815,991 | 01/11/2012 08:03:04 | 1,142,680 | 01/11/2012 07:51:52 | 1 | 0 | Spring for java web applications | What is the difference between spring mvc and spring framework used for java developing ? | spring | null | null | null | null | 01/11/2012 09:58:42 | not a real question | Spring for java web applications
===
What is the difference between spring mvc and spring framework used for java developing ? | 1 |
5,467,889 | 03/29/2011 04:28:02 | 681,348 | 03/29/2011 04:28:02 | 1 | 0 | downloading of a file over SCP from the SSH server | import net.schmizz.sshj.SSHClient;
import java.io.IOException;
public class SCPDownload {
public static void main(String[] args) throws IOException {
SSHClient ssh = new SSHClient();
//ssh.useCompression(); // Can lead to significant speedup (needs JZlib in classpath)
//ssh.loadKnownHosts();
ssh.addHostKeyVerifier("01:c7:75:8e:0a:6c:57:48:22:a5:57:2b:di:28:eg:da");
ssh.connect("localhost");
try {
ssh.authPassword("user", "user12");
final String src = "test_file";
final String target = "/tmp/";
ssh.newSCPFileTransfer().download(src, target);
}
finally {
ssh.disconnect();
}
}
}
* <terminated> | scp | null | null | null | null | 03/31/2011 04:37:13 | not a real question | downloading of a file over SCP from the SSH server
===
import net.schmizz.sshj.SSHClient;
import java.io.IOException;
public class SCPDownload {
public static void main(String[] args) throws IOException {
SSHClient ssh = new SSHClient();
//ssh.useCompression(); // Can lead to significant speedup (needs JZlib in classpath)
//ssh.loadKnownHosts();
ssh.addHostKeyVerifier("01:c7:75:8e:0a:6c:57:48:22:a5:57:2b:di:28:eg:da");
ssh.connect("localhost");
try {
ssh.authPassword("user", "user12");
final String src = "test_file";
final String target = "/tmp/";
ssh.newSCPFileTransfer().download(src, target);
}
finally {
ssh.disconnect();
}
}
}
* <terminated> | 1 |
7,486,335 | 09/20/2011 13:55:31 | 954,857 | 09/20/2011 13:29:49 | -1 | 0 | PHP: Classes, encapsulation and user input | What's the right way to send user input to a class?
Foo class:
<?php
class Foo
{
private $_bar;
private setBar($bar)
{
$this->_bar = $bar;
}
}
?>
Using foo class...
<?php
$foo = new Foo();
$foo->setBar((int) $_POST['input']);
?>
Or should I do the following?
Foo class:
<?php
class Foo
{
private $_bar;
private setBar($bar)
{
$this->_bar = (int) $bar;
}
}
?>
Using foo class...
<?php
$foo = new Foo();
$foo->setBar($_POST['input']);
?>
Should I convert data inside of the get method or pass data to classes already converted? What's the best approach? Why?
Thanks. | php | set | user-input | encapsulation | typeconverter | 09/20/2011 14:13:23 | too localized | PHP: Classes, encapsulation and user input
===
What's the right way to send user input to a class?
Foo class:
<?php
class Foo
{
private $_bar;
private setBar($bar)
{
$this->_bar = $bar;
}
}
?>
Using foo class...
<?php
$foo = new Foo();
$foo->setBar((int) $_POST['input']);
?>
Or should I do the following?
Foo class:
<?php
class Foo
{
private $_bar;
private setBar($bar)
{
$this->_bar = (int) $bar;
}
}
?>
Using foo class...
<?php
$foo = new Foo();
$foo->setBar($_POST['input']);
?>
Should I convert data inside of the get method or pass data to classes already converted? What's the best approach? Why?
Thanks. | 3 |
7,142,650 | 08/22/2011 02:36:32 | 355,010 | 02/26/2010 00:44:38 | 219 | 6 | Resize div background image | I have to set background images (sprite pngs) within 3 divs. I need the pngs to resize with the div size as it's a fluid layout.
I've looked around for a solution to this and can only find solutions using `<img>` within the html. I appreciate this would be an easier way to deal with the situation but need to use background images. I need a solution for background images - not advice to use `<img>` please!
I realise that css3 offers a possible solution with background-size, but this does not help with IE7 & IE8 and other non-css3 browsers. I am very happy to use jquery, but can't think of how I might dynamically resize the pngs to fit the divs.
I'd really appreciate some assistance, but please understand that I'm unable to use `<img>`.
Here's my css:
a.bigButton {
height:30%;
width:30%;
display:block;
float:left;
}
a.bigButton#btn-menus:link {
background:url(images/btn-menus-large.png) top center no-repeat;
background-position: 0 0;
}
a.bigButton#btn-menus:hover {
background-position: -298px 0;
}
a.bigButton#btn-functions:link {
background:url(images/btn-functions-large.png) top center no-repeat;
background-position: 0 0;
}
a.bigButton#btn-functions:hover {
background-position: -298px 0;
}
a.bigButton#btn-packages:link {
background:url(images/btn-av-large.png) top center no-repeat;
background-position: 0 0;
}
a.bigButton#btn-packages:hover {
background-position: -298px 0;
}
My html:
<div id="quick-links-holder">
<a href="#" alt="Check out our menus" class="scroll bigButton btnResize" id="btn-menus"></a>
<a href="#" alt="What function will you hold at Events Centre?" class="scroll bigButton btnResize addMargin" id="btn-functions"></a>
<a href="#" alt="Check out our functions and packages" class="scroll bigButton btnResize addMargin" id="btn-packages" ></a>
</div>
| jquery | html | css | background-image | null | null | open | Resize div background image
===
I have to set background images (sprite pngs) within 3 divs. I need the pngs to resize with the div size as it's a fluid layout.
I've looked around for a solution to this and can only find solutions using `<img>` within the html. I appreciate this would be an easier way to deal with the situation but need to use background images. I need a solution for background images - not advice to use `<img>` please!
I realise that css3 offers a possible solution with background-size, but this does not help with IE7 & IE8 and other non-css3 browsers. I am very happy to use jquery, but can't think of how I might dynamically resize the pngs to fit the divs.
I'd really appreciate some assistance, but please understand that I'm unable to use `<img>`.
Here's my css:
a.bigButton {
height:30%;
width:30%;
display:block;
float:left;
}
a.bigButton#btn-menus:link {
background:url(images/btn-menus-large.png) top center no-repeat;
background-position: 0 0;
}
a.bigButton#btn-menus:hover {
background-position: -298px 0;
}
a.bigButton#btn-functions:link {
background:url(images/btn-functions-large.png) top center no-repeat;
background-position: 0 0;
}
a.bigButton#btn-functions:hover {
background-position: -298px 0;
}
a.bigButton#btn-packages:link {
background:url(images/btn-av-large.png) top center no-repeat;
background-position: 0 0;
}
a.bigButton#btn-packages:hover {
background-position: -298px 0;
}
My html:
<div id="quick-links-holder">
<a href="#" alt="Check out our menus" class="scroll bigButton btnResize" id="btn-menus"></a>
<a href="#" alt="What function will you hold at Events Centre?" class="scroll bigButton btnResize addMargin" id="btn-functions"></a>
<a href="#" alt="Check out our functions and packages" class="scroll bigButton btnResize addMargin" id="btn-packages" ></a>
</div>
| 0 |
9,221,520 | 02/10/2012 01:28:29 | 673,108 | 03/23/2011 13:28:40 | 452 | 6 | RewriteRule wont work when link contains dash (on loaclhost xampp) |
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.html [NC,L]
This works for links like:
<a href="/subpagewithoutdash">working link</a>
But it doesn't work for links with dash:
<a href="/subpage-with-dash">not working link</a>
Any idea of how to fix it? I am sitting on a Windows computer with Xampp installed (localhost). | .htaccess | url-rewriting | null | null | null | null | open | RewriteRule wont work when link contains dash (on loaclhost xampp)
===
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.html [NC,L]
This works for links like:
<a href="/subpagewithoutdash">working link</a>
But it doesn't work for links with dash:
<a href="/subpage-with-dash">not working link</a>
Any idea of how to fix it? I am sitting on a Windows computer with Xampp installed (localhost). | 0 |
9,985,818 | 04/03/2012 00:59:42 | 1,060,036 | 11/22/2011 15:02:56 | 107 | 0 | Why am I getting core dumped? | Please help me. I can't figure out why I get a core dumped when I run this program. Before returning anything I can print `all_albums_p` just fine. Why am I getting `core dumped`?
#include "music_server.h"
struct album_ {
int num_tracks;
char **tracks;
int **playlist_hits;
};
typedef struct album_ album;
album *parse_album(FILE *album_file,int *number_of_albums){
int number_of_album,number_of_tracks,number_of_charaters;
int i,j;
char dummy_space;
int *p;
fscanf(album_file,"%d", &number_of_album);
*number_of_albums = number_of_album;
album *all_albums_p = (album *)malloc(sizeof(album)*number_of_album);
for(j=0;j<number_of_album;j++){
fscanf(album_file,"%d", &all_albums_p[j].num_tracks);
all_albums_p[j].tracks = calloc(all_albums_p[j].num_tracks,sizeof(char));
all_albums_p[j].playlist_hits = calloc(all_albums_p[j].num_tracks,sizeof(int));
for(i=0;i<all_albums_p[j].num_tracks;i++){
fscanf(album_file,"%d", &number_of_charaters);
all_albums_p[j].tracks[i] = (char *)calloc(number_of_charaters+1,sizeof(char));
all_albums_p[j].playlist_hits[i] = (int *)malloc(sizeof(int));
all_albums_p[j].playlist_hits[i] = 0;
fscanf(album_file," ",dummy_space);
fscanf(album_file, "%[^\n]s", all_albums_p[j].tracks[i]);
}
}
return all_albums_p;
}
int main(){
album *all_tracks_ptr;
all_tracks_ptr = parse_album(album_file,number_of_albums);
}
errors:
`Bus Error (core dumped)`
| c | pointers | null | null | null | 04/03/2012 05:20:04 | too localized | Why am I getting core dumped?
===
Please help me. I can't figure out why I get a core dumped when I run this program. Before returning anything I can print `all_albums_p` just fine. Why am I getting `core dumped`?
#include "music_server.h"
struct album_ {
int num_tracks;
char **tracks;
int **playlist_hits;
};
typedef struct album_ album;
album *parse_album(FILE *album_file,int *number_of_albums){
int number_of_album,number_of_tracks,number_of_charaters;
int i,j;
char dummy_space;
int *p;
fscanf(album_file,"%d", &number_of_album);
*number_of_albums = number_of_album;
album *all_albums_p = (album *)malloc(sizeof(album)*number_of_album);
for(j=0;j<number_of_album;j++){
fscanf(album_file,"%d", &all_albums_p[j].num_tracks);
all_albums_p[j].tracks = calloc(all_albums_p[j].num_tracks,sizeof(char));
all_albums_p[j].playlist_hits = calloc(all_albums_p[j].num_tracks,sizeof(int));
for(i=0;i<all_albums_p[j].num_tracks;i++){
fscanf(album_file,"%d", &number_of_charaters);
all_albums_p[j].tracks[i] = (char *)calloc(number_of_charaters+1,sizeof(char));
all_albums_p[j].playlist_hits[i] = (int *)malloc(sizeof(int));
all_albums_p[j].playlist_hits[i] = 0;
fscanf(album_file," ",dummy_space);
fscanf(album_file, "%[^\n]s", all_albums_p[j].tracks[i]);
}
}
return all_albums_p;
}
int main(){
album *all_tracks_ptr;
all_tracks_ptr = parse_album(album_file,number_of_albums);
}
errors:
`Bus Error (core dumped)`
| 3 |
10,888,827 | 06/04/2012 21:46:30 | 834,519 | 07/07/2011 23:48:25 | 81 | 4 | Preserving URL fragment through CAS sign-on | I maintain a single-page application that uses the YUI 2.8 history module to retain local options in the URL fragment. I've recently put it behind CAS authentication, and I'm finding that the fragment gets lost during CAS authentication. It is retained in the signon URL, but not when redirected back to the application page. This is also true after session timeouts, so users get bumped back to the default options after re-authentication.
Any suggested strategies for hanging on to the fragment (or the underlying javascript state) though a CAS roundtrip? | javascript | cas | yui2 | null | null | null | open | Preserving URL fragment through CAS sign-on
===
I maintain a single-page application that uses the YUI 2.8 history module to retain local options in the URL fragment. I've recently put it behind CAS authentication, and I'm finding that the fragment gets lost during CAS authentication. It is retained in the signon URL, but not when redirected back to the application page. This is also true after session timeouts, so users get bumped back to the default options after re-authentication.
Any suggested strategies for hanging on to the fragment (or the underlying javascript state) though a CAS roundtrip? | 0 |
8,779,181 | 01/08/2012 16:32:27 | 1,044,289 | 11/13/2011 15:20:34 | 1 | 0 | Bootstrapping in IIS7.5 | I have a dll which needs to be bootstrapped to start when IIS starts. I am having a set of data structure in this dll which needs to be accessed by application code.
Any suggestions?
Thanks | iis-7.5 | bootstrap | null | null | null | 01/11/2012 01:44:39 | not a real question | Bootstrapping in IIS7.5
===
I have a dll which needs to be bootstrapped to start when IIS starts. I am having a set of data structure in this dll which needs to be accessed by application code.
Any suggestions?
Thanks | 1 |
3,451,061 | 08/10/2010 16:13:31 | 383,804 | 07/05/2010 15:14:10 | 153 | 3 | How to do correct polygon rotation? ( in C# though it applies to anything ) | Hi I'm using this C# code to rotate polygons in my app - they do rotate but also get skewed along the way which is not what i want to happen. All the polygons are rectangles with four corners defined as 2D Vectors,
public Polygon GetRotated(float radians)
{
Vector origin = this.Center;
Polygon ret = new Polygon();
for (int i = 0; i < points.Count; i++)
{
ret.Points.Add(RotatePoint(points[i], origin, radians));
}
return ret;
}
public Vector RotatePoint(Vector point, Vector origin, float angle)
{
Vector ret = new Vector();
ret.X = (float)(origin.X + ((point.X - origin.X) * Math.Cos((float)angle)) - ((point.Y - origin.Y) * Math.Sin((float)angle)));
ret.Y = (float)(origin.Y + ((point.X - origin.X) * Math.Sin((float)angle)) - ((point.Y - origin.Y) * Math.Cos((float)angle)));
return ret;
} | c# | geometry | rotation | polygon | null | null | open | How to do correct polygon rotation? ( in C# though it applies to anything )
===
Hi I'm using this C# code to rotate polygons in my app - they do rotate but also get skewed along the way which is not what i want to happen. All the polygons are rectangles with four corners defined as 2D Vectors,
public Polygon GetRotated(float radians)
{
Vector origin = this.Center;
Polygon ret = new Polygon();
for (int i = 0; i < points.Count; i++)
{
ret.Points.Add(RotatePoint(points[i], origin, radians));
}
return ret;
}
public Vector RotatePoint(Vector point, Vector origin, float angle)
{
Vector ret = new Vector();
ret.X = (float)(origin.X + ((point.X - origin.X) * Math.Cos((float)angle)) - ((point.Y - origin.Y) * Math.Sin((float)angle)));
ret.Y = (float)(origin.Y + ((point.X - origin.X) * Math.Sin((float)angle)) - ((point.Y - origin.Y) * Math.Cos((float)angle)));
return ret;
} | 0 |
11,693,696 | 07/27/2012 18:34:13 | 310,787 | 04/07/2010 08:59:25 | 148 | 1 | DNS settings to host site externally | I have a domain that was purchased via Google Apps, the DNS management is through enom, but I wish to host the site elsewhere (but keep all of the Google apps services like docs, email, calendar as shown below). What do I need to change so I can point the site to my external hosting?
![DNS settings][1]
[1]: http://i.stack.imgur.com/VibkL.png | dns | null | null | null | null | null | open | DNS settings to host site externally
===
I have a domain that was purchased via Google Apps, the DNS management is through enom, but I wish to host the site elsewhere (but keep all of the Google apps services like docs, email, calendar as shown below). What do I need to change so I can point the site to my external hosting?
![DNS settings][1]
[1]: http://i.stack.imgur.com/VibkL.png | 0 |
3,150,908 | 06/30/2010 15:42:36 | 298,104 | 03/20/2010 17:34:11 | 67 | 3 | postfix problem sending email "RCPT reject localhost not listed" | i am hacing a hard time getting postfix to send emails.
this is the mail.log entry:
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: warning: ::1: address not listed for hostname localhost
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: connect from unknown[::1]
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: NOQUEUE: reject: RCPT from unknown[::1]: 554 5.7.1 <momchilrogelov@gmail.com>: Relay access denied; from=<ubuntu@debeldecibel.com> to=<momc$
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: lost connection after RCPT from unknown[::1]
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: disconnect from unknown[::1]
and this is my postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 4h
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
mydestination = debeldecibel.com, localhost
myhostname = smtp.debeldecibel.com
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
| linux | unix | ubuntu | smtp | postfix | 09/04/2011 15:49:11 | off topic | postfix problem sending email "RCPT reject localhost not listed"
===
i am hacing a hard time getting postfix to send emails.
this is the mail.log entry:
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: warning: ::1: address not listed for hostname localhost
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: connect from unknown[::1]
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: NOQUEUE: reject: RCPT from unknown[::1]: 554 5.7.1 <momchilrogelov@gmail.com>: Relay access denied; from=<ubuntu@debeldecibel.com> to=<momc$
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: lost connection after RCPT from unknown[::1]
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: disconnect from unknown[::1]
and this is my postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 4h
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
mydestination = debeldecibel.com, localhost
myhostname = smtp.debeldecibel.com
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
| 2 |
10,596,439 | 05/15/2012 07:57:15 | 1,060,187 | 11/22/2011 16:24:06 | 66 | 0 | Javascript/Jquery onclick definition of word appears | I'm looking for tips on how to be able to click on a word in an html document and then for the page to update and show a definition of the word that has been clicked. It can appear at the bottom of the page. So far I'm just adding an onclick into the p tag so for instance. Am I going about this in the right way? I'm quite bad at javascript so any help with this would be great. Many thanks
<p id="complexword1" onclick="functionToDisplayComplexWord()"> | javascript | null | null | null | null | null | open | Javascript/Jquery onclick definition of word appears
===
I'm looking for tips on how to be able to click on a word in an html document and then for the page to update and show a definition of the word that has been clicked. It can appear at the bottom of the page. So far I'm just adding an onclick into the p tag so for instance. Am I going about this in the right way? I'm quite bad at javascript so any help with this would be great. Many thanks
<p id="complexword1" onclick="functionToDisplayComplexWord()"> | 0 |
252,542 | 10/31/2008 03:42:17 | 1,512 | 08/16/2008 03:17:59 | 443 | 11 | What is your favorite IPython feature? | I've been learning (and enjoying learning!) Python via the IPython interactive shell recently... What's your favorite feature in IPython? Are there any tips and tricks you've picked up that other people might not know about? | python | ipython | shell | polls | null | 02/22/2012 01:57:38 | not constructive | What is your favorite IPython feature?
===
I've been learning (and enjoying learning!) Python via the IPython interactive shell recently... What's your favorite feature in IPython? Are there any tips and tricks you've picked up that other people might not know about? | 4 |
10,129,388 | 04/12/2012 18:16:36 | 1,328,128 | 04/12/2012 04:26:26 | 1 | 0 | I need a div to fill from the right of a 0 auto margin div to the right of the page | I have a main content div that is 950px and has 0 auto margins so it's centered. It has transparent content in it so can't have a background color but I need the right and left margins to have a background-color. Is it possible to have a div that is placed absolute to the right of the div and stretch to the end of the window? I can do it on the left by giving it a negative absolute value but on the right it scrolls till the end of the div.
.mainwrapper {width:950px; margin:0 auto; height:800px; position:relative;}
.leftmargin {height:800px;width:1000px;position:absolute;top:0px;left:-1000px;}
.rightmargin {height:800px;width:1000px;position:absolute;top:0px;left:950px;}
HTML
<div class="mainwrapper">
<div class="leftmargin"></div>
<div class="rightmargin"></div>
</div>
Is there an easy way to do this or only javascript? | javascript | html5 | css3 | null | null | null | open | I need a div to fill from the right of a 0 auto margin div to the right of the page
===
I have a main content div that is 950px and has 0 auto margins so it's centered. It has transparent content in it so can't have a background color but I need the right and left margins to have a background-color. Is it possible to have a div that is placed absolute to the right of the div and stretch to the end of the window? I can do it on the left by giving it a negative absolute value but on the right it scrolls till the end of the div.
.mainwrapper {width:950px; margin:0 auto; height:800px; position:relative;}
.leftmargin {height:800px;width:1000px;position:absolute;top:0px;left:-1000px;}
.rightmargin {height:800px;width:1000px;position:absolute;top:0px;left:950px;}
HTML
<div class="mainwrapper">
<div class="leftmargin"></div>
<div class="rightmargin"></div>
</div>
Is there an easy way to do this or only javascript? | 0 |
10,752,733 | 05/25/2012 10:25:24 | 733,766 | 05/01/2011 23:49:47 | 129 | 24 | Git repos on new hard drive | my old drive died and we moved to a new one.
I thought my Git repos were all fine, but then I realized that only the repos in my "Webapps" folder are operating, and that those I created in my Customers directory aren't.
Which caused me to then realize that the Customers folder was not present when I installed Git, while the Webapps folder was.
(This is Win Vista).
Is there a command I need to run?
| git | null | null | null | null | 05/26/2012 02:22:22 | not a real question | Git repos on new hard drive
===
my old drive died and we moved to a new one.
I thought my Git repos were all fine, but then I realized that only the repos in my "Webapps" folder are operating, and that those I created in my Customers directory aren't.
Which caused me to then realize that the Customers folder was not present when I installed Git, while the Webapps folder was.
(This is Win Vista).
Is there a command I need to run?
| 1 |
9,225,088 | 02/10/2012 08:51:38 | 1,005,072 | 10/20/2011 11:15:20 | 16 | 1 | Regex to seperate request uri by 'real' page request and image/js/css requests | I want to filter out all entries in my access logs that have a request uri which are requesting static recources like images, js, css, xml. The goal is to have an minfied access log wich only contains 'real' page request.
I'm trying to find a regex that fits my purpose and here's the point where I would like to ask for your help.
Here are some examples:
Strings I want to match:
r:GET / HTTP/1.1
r:GET /m HTTP/1.1
r:GET /autor/William-Mills/Deep-Hunting-Shallow-Fishing-8163700-t/ HTTP/1.1
r:GET /?wicket:interface=:1::IActivePageBehaviorListener:15:2&wicket:ignoreIfNotActive=true HTTP/1.1
Strings I **not** want to match: (One could say all that conatins something like .xxx before the ?querystring)
r:GET /js/global.js?v=17 HTTP/1.1
r:GET /js/global.js HTTP/1.1
r:GET /img/icon_action_arrow.png HTTP/1.1
I endend up, having a regex like this:
**r:[A-Z]+ \S+[^\.\s]{5}** (With a real whitespace at the end)
But this one is matching the first short url's "/" and "/m" I would like to match. And it also matches the "/js/global.js?v=17 " I would **not** like to match.
Thanks in advance for any hints, help or advices!
| regex | null | null | null | null | null | open | Regex to seperate request uri by 'real' page request and image/js/css requests
===
I want to filter out all entries in my access logs that have a request uri which are requesting static recources like images, js, css, xml. The goal is to have an minfied access log wich only contains 'real' page request.
I'm trying to find a regex that fits my purpose and here's the point where I would like to ask for your help.
Here are some examples:
Strings I want to match:
r:GET / HTTP/1.1
r:GET /m HTTP/1.1
r:GET /autor/William-Mills/Deep-Hunting-Shallow-Fishing-8163700-t/ HTTP/1.1
r:GET /?wicket:interface=:1::IActivePageBehaviorListener:15:2&wicket:ignoreIfNotActive=true HTTP/1.1
Strings I **not** want to match: (One could say all that conatins something like .xxx before the ?querystring)
r:GET /js/global.js?v=17 HTTP/1.1
r:GET /js/global.js HTTP/1.1
r:GET /img/icon_action_arrow.png HTTP/1.1
I endend up, having a regex like this:
**r:[A-Z]+ \S+[^\.\s]{5}** (With a real whitespace at the end)
But this one is matching the first short url's "/" and "/m" I would like to match. And it also matches the "/js/global.js?v=17 " I would **not** like to match.
Thanks in advance for any hints, help or advices!
| 0 |
10,643,127 | 05/17/2012 20:36:52 | 1,401,936 | 05/17/2012 20:28:11 | 1 | 0 | Full Calendar in Grails | i new in this. I need same help with populate a json un a calendar.
The json is this,
{
"start":"",
"end":"",
"title":"",
"summary":""
}
i have help form cero. Thank, and sorry for my english.
| grails | fullcalendar | null | null | null | null | open | Full Calendar in Grails
===
i new in this. I need same help with populate a json un a calendar.
The json is this,
{
"start":"",
"end":"",
"title":"",
"summary":""
}
i have help form cero. Thank, and sorry for my english.
| 0 |
6,686,354 | 07/13/2011 22:15:18 | 730,046 | 04/28/2011 20:20:04 | 15 | 2 | virus problem google_verify.php and ftp passwords | Couple days ago I had problems with my sites. In all ftp servers I got some php file called google_verify.php and in my .htaccess file the following text was added:
<IfModule mod_php5.c>
php_value auto_append_file "google_verify.php"
</IfModule>
<IfModule mod_php4.c>
php_value auto_append_file "google_verify.php"
</IfModule>
I suspect that my pc is infected with some kind of virus who can read my ftp access parameters from my ftp manager.
Does anybody know something more about this virus and how I can clean my computer?
Thanks in advance
| .htaccess | ftp | passwords | virus | null | null | open | virus problem google_verify.php and ftp passwords
===
Couple days ago I had problems with my sites. In all ftp servers I got some php file called google_verify.php and in my .htaccess file the following text was added:
<IfModule mod_php5.c>
php_value auto_append_file "google_verify.php"
</IfModule>
<IfModule mod_php4.c>
php_value auto_append_file "google_verify.php"
</IfModule>
I suspect that my pc is infected with some kind of virus who can read my ftp access parameters from my ftp manager.
Does anybody know something more about this virus and how I can clean my computer?
Thanks in advance
| 0 |
11,506,699 | 07/16/2012 14:43:39 | 426,344 | 08/20/2010 12:38:19 | 713 | 10 | How to select center image in gallery in android | can anybody tell how to select center image in gallery in android
Thanks | android | null | null | null | null | 07/16/2012 21:17:43 | not a real question | How to select center image in gallery in android
===
can anybody tell how to select center image in gallery in android
Thanks | 1 |
10,562,982 | 05/12/2012 10:39:12 | 1,390,933 | 05/12/2012 10:33:20 | 1 | 0 | Computing Exam Example | A ram is described as being a 1024 address by 4-bit ram . for this RAM, calculate:
i. how many bits are there in the ram;
ii. how many lines are necessary on the data bus;
iii. how many address lines are necessary . | homework | example | exam | null | null | 05/12/2012 18:44:10 | too localized | Computing Exam Example
===
A ram is described as being a 1024 address by 4-bit ram . for this RAM, calculate:
i. how many bits are there in the ram;
ii. how many lines are necessary on the data bus;
iii. how many address lines are necessary . | 3 |
2,094,760 | 01/19/2010 15:49:57 | 227,889 | 12/09/2009 10:54:53 | 124 | 6 | Working very slow | My application connects to web server, downloads data (approximately 43000 Bytes) and do mathematics function (such as log, +, -, * etc...) on each byte.
To prepare apk file, it is just like publishing to android market. Turned off debug mode and deactivated all loggers.
Then put it to the web server and downloaded (installed) on my HTC device. After installation, I've tested the application.
The time from beginning read bytes to end of task is approximately 4 minutes. It is very slow.
I've researched this part. It seems that is working slow on mathematics functions.
Is there any way to increase working speed ?
My code is same as iphone version of my application. It is very fast. All parts complete in 4 - 10 seconds.
What is wrong here ?
Or do I need to any configuration (related debug mode) ?
Please advice.
Thanks. | android | null | null | null | null | null | open | Working very slow
===
My application connects to web server, downloads data (approximately 43000 Bytes) and do mathematics function (such as log, +, -, * etc...) on each byte.
To prepare apk file, it is just like publishing to android market. Turned off debug mode and deactivated all loggers.
Then put it to the web server and downloaded (installed) on my HTC device. After installation, I've tested the application.
The time from beginning read bytes to end of task is approximately 4 minutes. It is very slow.
I've researched this part. It seems that is working slow on mathematics functions.
Is there any way to increase working speed ?
My code is same as iphone version of my application. It is very fast. All parts complete in 4 - 10 seconds.
What is wrong here ?
Or do I need to any configuration (related debug mode) ?
Please advice.
Thanks. | 0 |
9,709,827 | 03/14/2012 20:32:06 | 1,270,060 | 03/14/2012 20:24:44 | 1 | 0 | SIP phone: manage hand over | I'm doing a simple SIP phone with Android 2.3.1 SDK.
It works but I have a problem whit the hand-over.
I have two access point in the same private LAN.
AP have same SSID, same password, same configuration, and hand-over is supported.
But when hand-over occours the call end.
Is there a way to manage hand-over with android SDK?
| android | android-sdk-2.3 | null | null | null | null | open | SIP phone: manage hand over
===
I'm doing a simple SIP phone with Android 2.3.1 SDK.
It works but I have a problem whit the hand-over.
I have two access point in the same private LAN.
AP have same SSID, same password, same configuration, and hand-over is supported.
But when hand-over occours the call end.
Is there a way to manage hand-over with android SDK?
| 0 |
4,668,196 | 01/12/2011 11:23:49 | 107,062 | 05/14/2009 13:29:04 | 256 | 14 | Free ASP.Net controls for non-profits / charities | I am doing a website for a charity outside of work. I can't use the normal control libraries I would use at work because of the licencing (they won't let me), and predictably the charity can't afford them for a one-off project.
I am particularly struggling for a good grid control and a hierarchy diagram control.
Do any of the vendors give free licences to these kind of projects?
Or are there other good options? | asp.net | asp.net-controls | null | null | null | null | open | Free ASP.Net controls for non-profits / charities
===
I am doing a website for a charity outside of work. I can't use the normal control libraries I would use at work because of the licencing (they won't let me), and predictably the charity can't afford them for a one-off project.
I am particularly struggling for a good grid control and a hierarchy diagram control.
Do any of the vendors give free licences to these kind of projects?
Or are there other good options? | 0 |
1,109,838 | 07/10/2009 14:23:25 | 34,752 | 11/05/2008 16:37:04 | 106 | 0 | Recommend portable source control setup? | Since I have a couple of mid-sized personal projects and a lots of code snippets, sample programs, libraries which usage is demonstrated using unit tests, I want to have this whole lump of code available all the time - at home, at work, when using my laptop, etc.
The most logical step is to have this codebase under the source control, so I have it on my home desktop PC (currently under Perforce depot), so here is what I want from this setup:
* I want source control database to reside on my USB flash drive which I'm carrying with me all the time, or at least to have some easy way for transfering the database from the current working PC to the USB flash drive and vice versa.
* Seamless move of the source control database: I'm considering writing some script for automatically backing up the current state of the repository in some useful form ready to be imported on the PC which I'm intending to use.
Have some of you encounter similar problem and devise a solution?
What do you think about this:
Getting some VMWare appliance (pre-installed Linux virtual machnine), then installing on it just the minimum source control server and the database, and then just carrying the virtual machine image on my USB flash drive and just loading it on the machine which I intend to use and access my personal codebase. | version-control | perforce | svn | portable-applications | portable-database | 06/13/2012 13:30:48 | not constructive | Recommend portable source control setup?
===
Since I have a couple of mid-sized personal projects and a lots of code snippets, sample programs, libraries which usage is demonstrated using unit tests, I want to have this whole lump of code available all the time - at home, at work, when using my laptop, etc.
The most logical step is to have this codebase under the source control, so I have it on my home desktop PC (currently under Perforce depot), so here is what I want from this setup:
* I want source control database to reside on my USB flash drive which I'm carrying with me all the time, or at least to have some easy way for transfering the database from the current working PC to the USB flash drive and vice versa.
* Seamless move of the source control database: I'm considering writing some script for automatically backing up the current state of the repository in some useful form ready to be imported on the PC which I'm intending to use.
Have some of you encounter similar problem and devise a solution?
What do you think about this:
Getting some VMWare appliance (pre-installed Linux virtual machnine), then installing on it just the minimum source control server and the database, and then just carrying the virtual machine image on my USB flash drive and just loading it on the machine which I intend to use and access my personal codebase. | 4 |
10,635,077 | 05/17/2012 11:42:10 | 1,368,254 | 05/01/2012 17:34:28 | 22 | 0 | Userscript to safari and opera extensions | I builded a greasemonkey userscript for firefox and chrome and i now want to convert it to a safari extension and opera extension. Are there any compiler out there like <https://arantius.com/misc/greasemonkey/script-compiler.php>? Thanks a lot for your help and sorry for my bad English! | safari | opera | userscripts | null | null | null | open | Userscript to safari and opera extensions
===
I builded a greasemonkey userscript for firefox and chrome and i now want to convert it to a safari extension and opera extension. Are there any compiler out there like <https://arantius.com/misc/greasemonkey/script-compiler.php>? Thanks a lot for your help and sorry for my bad English! | 0 |
2,087,359 | 01/18/2010 16:07:38 | 243,918 | 01/05/2010 13:00:36 | 5 | 0 | shrink background-image | I have a transparent PNG that is used as a picture frame, and I want to utilize the background-image declaration to place an image in the transparent center of the frame. The problem is that the images I'm using in the background need to be shrunk a bit to fit all of the image's content into the available frame area.
I don't think there is a css or html solution, can I use javascript, jquery, or perhaps php to dynamically shrink the background images to a certain with on load? Thanks. | background-image | css | null | null | null | null | open | shrink background-image
===
I have a transparent PNG that is used as a picture frame, and I want to utilize the background-image declaration to place an image in the transparent center of the frame. The problem is that the images I'm using in the background need to be shrunk a bit to fit all of the image's content into the available frame area.
I don't think there is a css or html solution, can I use javascript, jquery, or perhaps php to dynamically shrink the background images to a certain with on load? Thanks. | 0 |
8,105,003 | 11/12/2011 14:19:52 | 413,225 | 07/05/2010 17:54:03 | 1,787 | 15 | Select rows only if one of their sibling has a keyword in common with them | How can I select the series of row only if one of their sibling has a keyword in common with them?
For instance, I will only select these 4 rows,
page_id page_url
1 A {group1}
2 B {group1}
3 C {group1}
4 D {group1}
**IF** the `page_id` **4** is tagged with a **keyword** that other pages have.
This is my attempt,
SELECT*
FROM root_pages AS p
LEFT JOIN root_mm_pages_tags AS mm
ON mm.page_id = p.page_id
LEFT JOIN root_tags AS t
ON t.tag_id = mm.tag_id
WHERE p.page_title LIKE '%{group1}%'
AND p.page_hide != '1'
AND t.tag_name LIKE '%keyword%'
IF (
SELECT page_url
FROM root_pages AS p
LEFT JOIN root_mm_pages_tags AS mm
ON mm.page_id = p.page_id
LEFT JOIN root_tags AS t
ON t.tag_id = mm.tag_id
WHERE page_url = 'D'
AND p.page_hide != '1'
AND t.tag_name LIKE '%keyword%'
)
ORDER BY (t.tag_name+0) ASC
But it returns error of course!
Any idea? | php | mysql | select | if-statement | tagging | null | open | Select rows only if one of their sibling has a keyword in common with them
===
How can I select the series of row only if one of their sibling has a keyword in common with them?
For instance, I will only select these 4 rows,
page_id page_url
1 A {group1}
2 B {group1}
3 C {group1}
4 D {group1}
**IF** the `page_id` **4** is tagged with a **keyword** that other pages have.
This is my attempt,
SELECT*
FROM root_pages AS p
LEFT JOIN root_mm_pages_tags AS mm
ON mm.page_id = p.page_id
LEFT JOIN root_tags AS t
ON t.tag_id = mm.tag_id
WHERE p.page_title LIKE '%{group1}%'
AND p.page_hide != '1'
AND t.tag_name LIKE '%keyword%'
IF (
SELECT page_url
FROM root_pages AS p
LEFT JOIN root_mm_pages_tags AS mm
ON mm.page_id = p.page_id
LEFT JOIN root_tags AS t
ON t.tag_id = mm.tag_id
WHERE page_url = 'D'
AND p.page_hide != '1'
AND t.tag_name LIKE '%keyword%'
)
ORDER BY (t.tag_name+0) ASC
But it returns error of course!
Any idea? | 0 |
6,462,745 | 06/24/2011 02:36:23 | 651,065 | 03/09/2011 06:58:27 | 16 | 2 | I'm developing an iPad app in English version. | I'm a programmer and developing an iPad app in English version.
But I'm not native speaker, so it's hard for me to use English words.
I want check if the following words are used the right way.
1. "Change Group Name"
- When users click edit button to change group names, then popped up a window and the
phrase will show top of it.
2. "Do you also want to delete all sites from the group?"
- When users click delete button to delete a group, then the phrase shows up. Some groups
include some sites's information, so the app asks if the user also want to delete the
sites's information.
3. "Added to the "Home" group."
- The above phrase appears after users add a site to "Home" group.
I want to know if the uses of the phrases are right in English grammar in general.
Can anyone help?
Thanks. | application | english | use | null | null | 06/24/2011 16:52:52 | off topic | I'm developing an iPad app in English version.
===
I'm a programmer and developing an iPad app in English version.
But I'm not native speaker, so it's hard for me to use English words.
I want check if the following words are used the right way.
1. "Change Group Name"
- When users click edit button to change group names, then popped up a window and the
phrase will show top of it.
2. "Do you also want to delete all sites from the group?"
- When users click delete button to delete a group, then the phrase shows up. Some groups
include some sites's information, so the app asks if the user also want to delete the
sites's information.
3. "Added to the "Home" group."
- The above phrase appears after users add a site to "Home" group.
I want to know if the uses of the phrases are right in English grammar in general.
Can anyone help?
Thanks. | 2 |
5,720,707 | 04/19/2011 18:09:04 | 591,079 | 01/26/2011 18:09:42 | 15 | 0 | Help me "hack" on a just released SharePoint 2010 site just launched | As the title might suggest, where I work, we just launched a new site that was developed (outsourced) in SharePoint 2010.
I don't want to give out the url, but would love to hack on it for any security vulnerabilities.
Wondering if you have any any copy/paste bits of code for SQL injection (harmless!) and XSS and anything else you can think of.
Nothing should be malicious/damaging, but just expose the weakness/exploit so it can be fixed. | sharepoint2010 | xss | sql-injection | hacking | code-injection | 04/19/2011 19:18:04 | off topic | Help me "hack" on a just released SharePoint 2010 site just launched
===
As the title might suggest, where I work, we just launched a new site that was developed (outsourced) in SharePoint 2010.
I don't want to give out the url, but would love to hack on it for any security vulnerabilities.
Wondering if you have any any copy/paste bits of code for SQL injection (harmless!) and XSS and anything else you can think of.
Nothing should be malicious/damaging, but just expose the weakness/exploit so it can be fixed. | 2 |
9,383,858 | 02/21/2012 19:27:48 | 1,209,289 | 02/14/2012 14:22:11 | 1 | 0 | How can i change free app to paid app | i wonder something. Some apps in app store are seen free. But when you used it for a time app says "if you want more pls download paid version " etc. How can we do that? is there 2 app in store(one free and one paid)?
And i have one more question. now i am working on a book app. i am writing it for someone. and it will be paid app. But she hasnt developer account. What can we do? does she have to has an developer acc? or can we use my developer account and can she menaage her bank account. but dont forget i shouldnt manage bank account? whats the soultion?
tahnks.. | iphone | itunes | null | null | null | 02/23/2012 02:07:11 | off topic | How can i change free app to paid app
===
i wonder something. Some apps in app store are seen free. But when you used it for a time app says "if you want more pls download paid version " etc. How can we do that? is there 2 app in store(one free and one paid)?
And i have one more question. now i am working on a book app. i am writing it for someone. and it will be paid app. But she hasnt developer account. What can we do? does she have to has an developer acc? or can we use my developer account and can she menaage her bank account. but dont forget i shouldnt manage bank account? whats the soultion?
tahnks.. | 2 |
8,545,981 | 12/17/2011 16:06:54 | 761,492 | 05/19/2011 17:05:57 | 251 | 0 | Smooth connection between piecewise parts | Example piecewise wise function:
f[x_]:=Piecewise[{{x^2, 0<x<1-epsilon},{x,1<x<2-epsilon},{2,x>2}}]
Is there a way to connect these parts in interval epsilon, so I get a smooth function? | mathematica | null | null | null | null | null | open | Smooth connection between piecewise parts
===
Example piecewise wise function:
f[x_]:=Piecewise[{{x^2, 0<x<1-epsilon},{x,1<x<2-epsilon},{2,x>2}}]
Is there a way to connect these parts in interval epsilon, so I get a smooth function? | 0 |
10,399,622 | 05/01/2012 15:03:44 | 1,367,989 | 05/01/2012 14:59:24 | 1 | 0 | Start drupal 7 module development | Where is the best place that can get me started in drupal 7 module development?! | drupal-7 | drupal-modules | null | null | null | 05/03/2012 08:03:57 | not constructive | Start drupal 7 module development
===
Where is the best place that can get me started in drupal 7 module development?! | 4 |
3,661,545 | 09/07/2010 18:32:34 | 95,665 | 04/24/2009 18:35:47 | 73 | 3 | In C# between >0 and >=1 which is faster and better? | In C# between >0 and >=1 which is faster and better? | c# | operators | null | null | null | 09/08/2010 00:46:30 | not a real question | In C# between >0 and >=1 which is faster and better?
===
In C# between >0 and >=1 which is faster and better? | 1 |
1,012,295 | 06/18/2009 12:10:10 | 94,131 | 04/22/2009 04:20:12 | 49 | 0 | Programming qualifications and career paths | I'm not quite sure if this question is strictly correct for SO, but i know you guys can help. If it isn't however, no hard feelings about voting to lock.
I am very interested in learning to program, and it's been my hobby for a good while. I have the fiscal oppertunity right now to take a long-distance learning course, so i'm looking around for good options. There's no way i can go to real classes full-time, this is a case of wanting to learn something primarily for fun, and since i have the rare oppertunity to pour some cash into a real qualification in my hobby, i want to make it matter (so that in theory, if i really do get into this in a bigger way, i will have something to work with and help me down the line in a career).
I'm liking the look of [this][1]
[1]: http://www.icslearn.co.uk/it-technical-courses/programming-game-design/video-game-design/
however i'm not sure what this qualification even if. I want the course i take to be fun, as well as interesting. I don't want to make cataloguing software for 4 years straight, but i want it to contain some juicy math and going into a lot of depth into an interesting and practical language (i've been learning C++). I really don't want to do anything web based yet, i don't know why, it just doesn't appeal to me.
My question(s):
- Is the ICS/GES (Gatlin Education Services) Certificate in Video Game Design and Development relevent, or heard of, has anybody taken this? Any comments?
- Could anybody help point me to any other distance learning courses that might be of interest, and roughly fit my criteria, that are reccomended?
Please note i'm in the UK (narrows my options a tad).
Thanks.
| career-development | study | training | null | null | 01/14/2012 06:23:35 | not constructive | Programming qualifications and career paths
===
I'm not quite sure if this question is strictly correct for SO, but i know you guys can help. If it isn't however, no hard feelings about voting to lock.
I am very interested in learning to program, and it's been my hobby for a good while. I have the fiscal oppertunity right now to take a long-distance learning course, so i'm looking around for good options. There's no way i can go to real classes full-time, this is a case of wanting to learn something primarily for fun, and since i have the rare oppertunity to pour some cash into a real qualification in my hobby, i want to make it matter (so that in theory, if i really do get into this in a bigger way, i will have something to work with and help me down the line in a career).
I'm liking the look of [this][1]
[1]: http://www.icslearn.co.uk/it-technical-courses/programming-game-design/video-game-design/
however i'm not sure what this qualification even if. I want the course i take to be fun, as well as interesting. I don't want to make cataloguing software for 4 years straight, but i want it to contain some juicy math and going into a lot of depth into an interesting and practical language (i've been learning C++). I really don't want to do anything web based yet, i don't know why, it just doesn't appeal to me.
My question(s):
- Is the ICS/GES (Gatlin Education Services) Certificate in Video Game Design and Development relevent, or heard of, has anybody taken this? Any comments?
- Could anybody help point me to any other distance learning courses that might be of interest, and roughly fit my criteria, that are reccomended?
Please note i'm in the UK (narrows my options a tad).
Thanks.
| 4 |
9,700,460 | 03/14/2012 10:50:34 | 201,302 | 11/02/2009 23:43:32 | 98 | 5 | Rendering issues with chrome | I got this site http://invictus38.com/forum/ in chrome the top right menu has question marks after every li except the last. This does not appear in any other browser....
What is causing the question marks? | php | html | google-chrome | mybb | null | null | open | Rendering issues with chrome
===
I got this site http://invictus38.com/forum/ in chrome the top right menu has question marks after every li except the last. This does not appear in any other browser....
What is causing the question marks? | 0 |
3,088,040 | 06/21/2010 19:54:10 | 265,445 | 02/03/2010 16:36:36 | 21 | 0 | .lib and .dll Backward Compatibility | I currently have a VS6 unmanaged C library that I deliver as either a .lib or .dll. I want to upgrade to VS2010 but I still have users that are in VS6, VS2005, and VS2008.
Can a .lib or .dll built in VS2010 be used in VS6, VS2005, or VS2008?
Thanks! | dll | compatibility | vc6 | visual-studio-2010 | null | null | open | .lib and .dll Backward Compatibility
===
I currently have a VS6 unmanaged C library that I deliver as either a .lib or .dll. I want to upgrade to VS2010 but I still have users that are in VS6, VS2005, and VS2008.
Can a .lib or .dll built in VS2010 be used in VS6, VS2005, or VS2008?
Thanks! | 0 |
1,427,862 | 09/15/2009 15:25:11 | 173,785 | 09/15/2009 15:25:11 | 1 | 0 | Best Practices ElseIf against Throw Exception | In Java: Which is the most performance code and why?<br><br>
if (x==1)<br>
{....}<br>
else if (x==2)<br>
{....}<br>
else if (x==3)<br>
{....}<br>
else if (x==4)<br>
{....}<br>
... rest code here...<br>
<br>
or <br><br>
try{<br>
if (x==1)<br>
{... throw MyException(1) ...}<br>
if (x==2)<br>
{... throw MyException(2) ...}<br>
if (x==3)<br>
{... throw MyException(3) ...}<br>
if (x==4)<br>
{... throw MyException(4) ...}<br>
}<br>
catch(MyException MEx)<br>
{<br>
... rest code here ...<br>
}<br>
<br><br>
<br>
Thanks a lot! | java | null | null | null | null | 09/15/2011 06:05:47 | not constructive | Best Practices ElseIf against Throw Exception
===
In Java: Which is the most performance code and why?<br><br>
if (x==1)<br>
{....}<br>
else if (x==2)<br>
{....}<br>
else if (x==3)<br>
{....}<br>
else if (x==4)<br>
{....}<br>
... rest code here...<br>
<br>
or <br><br>
try{<br>
if (x==1)<br>
{... throw MyException(1) ...}<br>
if (x==2)<br>
{... throw MyException(2) ...}<br>
if (x==3)<br>
{... throw MyException(3) ...}<br>
if (x==4)<br>
{... throw MyException(4) ...}<br>
}<br>
catch(MyException MEx)<br>
{<br>
... rest code here ...<br>
}<br>
<br><br>
<br>
Thanks a lot! | 4 |
6,564,771 | 07/03/2011 18:34:49 | 827,151 | 07/03/2011 18:34:49 | 1 | 0 | Why is javascript loading somewhere else? | I'm working locally so I won't be able to show an example but here is what's happening.
3 column layout. On my far right column, I have a skyscraper ad loading via javascript (it's a TriablFusion code snippet but I've tried replacing it with others).
On my left column, I have a tweet javascript provided from http://twitter.com/about/resources/tweetbutton.
When I load my page, an advertisement loads in the tweet snippet as well as the far right column. Why is this happening? Any ideas? The advert should only load in the right column; not in the tweet button. | javascript | null | null | null | null | 07/04/2011 12:29:53 | not a real question | Why is javascript loading somewhere else?
===
I'm working locally so I won't be able to show an example but here is what's happening.
3 column layout. On my far right column, I have a skyscraper ad loading via javascript (it's a TriablFusion code snippet but I've tried replacing it with others).
On my left column, I have a tweet javascript provided from http://twitter.com/about/resources/tweetbutton.
When I load my page, an advertisement loads in the tweet snippet as well as the far right column. Why is this happening? Any ideas? The advert should only load in the right column; not in the tweet button. | 1 |
9,433,723 | 02/24/2012 15:52:03 | 1,079,925 | 12/04/2011 09:47:23 | 48 | 2 | mvc3 ajax.actionlink coding for model failure | I'm using an ajax actionlink to allow the user to delete a record in the model (database table).<br>
User clicks on delete link, JQuery dialog opens to ask for confirmation. <br>User confirms they want to delete, actionlink calls relevant method on controller.<br>
Method tries to delete relevant record in database but fails, for example, database is down for some reason.<br>
Because I'm not updating an element on the page (I suspect onSuccess will fire?), how can I convey that the record has not been deleted?<br>
So really I'm asking how to pass a return value from the method to the Ajax ActionLink, or force the onFailure to fire. <br>
I suspect I can have a hidden field and update that using UpdateTargetId, and then call a function onSuccess to check the value - but is this the best way or will this even work?
| ajax | asp.net-mvc-3 | actionlink | null | null | null | open | mvc3 ajax.actionlink coding for model failure
===
I'm using an ajax actionlink to allow the user to delete a record in the model (database table).<br>
User clicks on delete link, JQuery dialog opens to ask for confirmation. <br>User confirms they want to delete, actionlink calls relevant method on controller.<br>
Method tries to delete relevant record in database but fails, for example, database is down for some reason.<br>
Because I'm not updating an element on the page (I suspect onSuccess will fire?), how can I convey that the record has not been deleted?<br>
So really I'm asking how to pass a return value from the method to the Ajax ActionLink, or force the onFailure to fire. <br>
I suspect I can have a hidden field and update that using UpdateTargetId, and then call a function onSuccess to check the value - but is this the best way or will this even work?
| 0 |
3,738,047 | 09/17/2010 18:43:47 | 24,573 | 10/02/2008 17:47:45 | 284 | 8 | localStorage doesn't retrieve values after page refresh | I'm trying to test out html5 localStorage feature. For some reason, whenever I try to retrieve a value from storage *after* refreshing the page, I only get null values returned. (If I try retrieving the values in the same function that I set them in, then I can properly retrieve them).
One thing: the html/javascript that I'm loading is being requested from the local disk (for example, I'm using the string: **"file:///C:/testLocalStore.html"** to browse to the file, instead of requesting it from a web server. Would this cause the localStore problems that I'm seeing?
(I'd like to post the full code example, but I'm having some problems with the formatting. I'll post it shortly).
<html> <head> <title>test local storage</title>
<base href="http://docs.jquery.com" />
<script src="http://code.jquery.com/jquery-1.3.js"></script>
<script type="text/javascript">
function savestuff()
{
var existingData = localStorage.getItem("existingData");
if( existingData === undefined || existingData === null )
{
// first time saving a map.
existingData = $("#mapName").val();
}
else
{
existingData = existingData + "," + $("#mapName").val();
}
localStorage.setItem("existingData", existingData);
// test is non-null here, it was properly retrieved.
var test = localStorage.getItem("existingData");
}
$(document).ready( function init()
{
// existing data is always null.
var existingData = localStorage.getItem("existingData");
if( existingData !== null )
{
var existingDataListHtml = existingData.split(",");
existingDataListHtml = $.each(existingData, function(data) {
return "<li>" + data + "<\/li>";
});
$("#existingData").html("<ul>" + existingDataListHtml + "<\/ul>");
}
} );
</script>
</head> <body>
<form id="loadFromUser" onsubmit="savestuff();">
<input id="mapName" type="text">
<input type="submit" value="save">
</form>
<div id="existingData"> </div>
</body> </html>
| html5 | null | null | null | null | null | open | localStorage doesn't retrieve values after page refresh
===
I'm trying to test out html5 localStorage feature. For some reason, whenever I try to retrieve a value from storage *after* refreshing the page, I only get null values returned. (If I try retrieving the values in the same function that I set them in, then I can properly retrieve them).
One thing: the html/javascript that I'm loading is being requested from the local disk (for example, I'm using the string: **"file:///C:/testLocalStore.html"** to browse to the file, instead of requesting it from a web server. Would this cause the localStore problems that I'm seeing?
(I'd like to post the full code example, but I'm having some problems with the formatting. I'll post it shortly).
<html> <head> <title>test local storage</title>
<base href="http://docs.jquery.com" />
<script src="http://code.jquery.com/jquery-1.3.js"></script>
<script type="text/javascript">
function savestuff()
{
var existingData = localStorage.getItem("existingData");
if( existingData === undefined || existingData === null )
{
// first time saving a map.
existingData = $("#mapName").val();
}
else
{
existingData = existingData + "," + $("#mapName").val();
}
localStorage.setItem("existingData", existingData);
// test is non-null here, it was properly retrieved.
var test = localStorage.getItem("existingData");
}
$(document).ready( function init()
{
// existing data is always null.
var existingData = localStorage.getItem("existingData");
if( existingData !== null )
{
var existingDataListHtml = existingData.split(",");
existingDataListHtml = $.each(existingData, function(data) {
return "<li>" + data + "<\/li>";
});
$("#existingData").html("<ul>" + existingDataListHtml + "<\/ul>");
}
} );
</script>
</head> <body>
<form id="loadFromUser" onsubmit="savestuff();">
<input id="mapName" type="text">
<input type="submit" value="save">
</form>
<div id="existingData"> </div>
</body> </html>
| 0 |
11,679,187 | 07/26/2012 22:53:10 | 487,243 | 10/26/2010 06:16:11 | 46 | 3 | Is it bad to use many web services on a business web application | I'm the sole developer on a web application project that a friend and I started up. I'm handling development and my friend is handling the business side. It's a guerrilla operation and with what our application is trying to achieve I could never develop it on my own in a reasonable time. So I'm planning on using many services to run the application. AppFog for hosting and deployment, MongoHQ for the database, Searchify for document indexing, Filepicker.io for file uploads, and AWS for misc utility needs. Besides the obvious worry about one of these companies going under, are there any other reasons why I should absolutely not be doing this?
I figure if our application actually takes off and we make any kind of revenue, at that point, I could then put resources into building solutions to take the place of different web services I'm currently using. | web-services | web-applications | null | null | null | 07/26/2012 22:58:48 | off topic | Is it bad to use many web services on a business web application
===
I'm the sole developer on a web application project that a friend and I started up. I'm handling development and my friend is handling the business side. It's a guerrilla operation and with what our application is trying to achieve I could never develop it on my own in a reasonable time. So I'm planning on using many services to run the application. AppFog for hosting and deployment, MongoHQ for the database, Searchify for document indexing, Filepicker.io for file uploads, and AWS for misc utility needs. Besides the obvious worry about one of these companies going under, are there any other reasons why I should absolutely not be doing this?
I figure if our application actually takes off and we make any kind of revenue, at that point, I could then put resources into building solutions to take the place of different web services I'm currently using. | 2 |
2,928,783 | 05/28/2010 12:05:30 | 225,264 | 12/05/2009 04:30:46 | 41 | 0 | form submit not working in firefox but works fine in IE | I want to submit my parent page when I click on submit button of the child page.
In my child page I've written my code as
string scriptString = "<script language=JavaScript> window.opener.document.forms(0).submit(); </script>";
// ASP.NET 2.0
if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptString))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script", scriptString);
}
it is working fine in IE but not working in Firefox. What could be the alternate method for this?
Thank in advance | c# | asp.net | firefox | form-submit | null | null | open | form submit not working in firefox but works fine in IE
===
I want to submit my parent page when I click on submit button of the child page.
In my child page I've written my code as
string scriptString = "<script language=JavaScript> window.opener.document.forms(0).submit(); </script>";
// ASP.NET 2.0
if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptString))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script", scriptString);
}
it is working fine in IE but not working in Firefox. What could be the alternate method for this?
Thank in advance | 0 |
4,064,276 | 10/31/2010 17:48:46 | 217,223 | 11/23/2009 18:13:52 | 42 | 4 | What happens if a program runs also its comments??!! | It seams very weird to me.I cant really understand whats happening.
I had a false on my code,decided to put a part of it on /*...*/.
The same I did for its calling of the function.
BUT when i run the program... this part of code is also executed!!!
| c | comments | null | null | null | 10/31/2010 18:12:03 | not a real question | What happens if a program runs also its comments??!!
===
It seams very weird to me.I cant really understand whats happening.
I had a false on my code,decided to put a part of it on /*...*/.
The same I did for its calling of the function.
BUT when i run the program... this part of code is also executed!!!
| 1 |
2,867,514 | 05/19/2010 16:33:27 | 317,984 | 04/15/2010 20:53:22 | 179 | 1 | How can I implement a tail-recursive list append? | A simple append function like this (in F#):
let rec app s t =
match s with
| [] -> t
| (x::ss) -> x :: (app ss t)
will crash when s becomes big, since the function is not tail recursive. I noticed that F#'s standard append function does not crash with big lists, so it must be implemented differently. So I wondered: How does a tail recursive definition of append look like? I came up with something like this:
let rec comb s t =
match s with
| [] -> t
| (x::ss) -> comb ss (x::t)
let app2 s t = comb (List.rev s) t
which works, but looks rather odd. Is there a more elegant definition?
| f# | tail-recursion | append | null | null | null | open | How can I implement a tail-recursive list append?
===
A simple append function like this (in F#):
let rec app s t =
match s with
| [] -> t
| (x::ss) -> x :: (app ss t)
will crash when s becomes big, since the function is not tail recursive. I noticed that F#'s standard append function does not crash with big lists, so it must be implemented differently. So I wondered: How does a tail recursive definition of append look like? I came up with something like this:
let rec comb s t =
match s with
| [] -> t
| (x::ss) -> comb ss (x::t)
let app2 s t = comb (List.rev s) t
which works, but looks rather odd. Is there a more elegant definition?
| 0 |
11,434,281 | 07/11/2012 13:56:48 | 1,517,974 | 07/11/2012 13:52:16 | 1 | 0 | Can someone explain the development process | I want to offer a service of taking a PSD template, converting to HTML/CSS, and building the front end and back end of a website. Basically, the service will be building the entire site. However, I do nott have the skills or creativity to create the PSD template.
My question therefore is this:
What happens when a client wants a website designed and developed, and they don't have any design ideas, images or logo etc, let alone a PSD template?
Is it standard practice at this point to find a good web designer and get them involved. Would I be paying the web designer out of the money that I am getting for developing the site?
I imagine that the web designer would need to be involved in design related discussions with the client, is it therefore standard practice to involve them in the process?
One last thing, is it often the case that I "hide" the designer from the client, so if the client gives me a logo and images etc, I find a designer to throw up a mock, show it to the client, he requests changes, my designer makes the changes, I show the client etc etc. All the time, the client assumes/doesn't ask if I am the designer?
Hopefully someone gets the gist of what I am asking here,
Many thanks
Alex
| design | process | web | null | null | 07/11/2012 19:36:19 | off topic | Can someone explain the development process
===
I want to offer a service of taking a PSD template, converting to HTML/CSS, and building the front end and back end of a website. Basically, the service will be building the entire site. However, I do nott have the skills or creativity to create the PSD template.
My question therefore is this:
What happens when a client wants a website designed and developed, and they don't have any design ideas, images or logo etc, let alone a PSD template?
Is it standard practice at this point to find a good web designer and get them involved. Would I be paying the web designer out of the money that I am getting for developing the site?
I imagine that the web designer would need to be involved in design related discussions with the client, is it therefore standard practice to involve them in the process?
One last thing, is it often the case that I "hide" the designer from the client, so if the client gives me a logo and images etc, I find a designer to throw up a mock, show it to the client, he requests changes, my designer makes the changes, I show the client etc etc. All the time, the client assumes/doesn't ask if I am the designer?
Hopefully someone gets the gist of what I am asking here,
Many thanks
Alex
| 2 |
5,518,382 | 04/01/2011 20:18:46 | 688,222 | 04/01/2011 20:08:20 | 1 | 0 | getting for nil:NilClass (NoMethodError) in this code. | I am doing the beginning ruby book and this is what I have for my code, which gives the following error:
in `show_current_description': undefined method `full_description' for nil:NilClass (NoMethodError)
The code is as follows. Any help is appreciated. Thanks!
<pre>
class Dungeon
attr_accessor :player
def initialize(player_name,start_location)
@player=Player.new(player_name,start_location)
puts @player.location
@rooms=[]
show_current_description
end
def show_current_description
@rm=find_room_in_dungeon(@player.location)
@rm.full_description
end
def find_room_in_dungeon(reference)
@rooms.detect{|room| room.reference == reference; puts room.full_description}
end
def add_room(reference,name,description,connections)
@rooms << Room.new(reference,name,description,connections)
end
Player=Struct.new(:name,:location)
class Room
attr_accessor :reference, :name, :description, :connections
def initialize(reference,name,description,connections)
@reference=reference
@name=name
@description=description
@connections=connections
end
def full_description
"You are in " + @description
end
end
end
d=Dungeon.new("Good Man",:small_cave)
d.add_room(:small_cave,"Small Cave","This is a small claustrophobic cave", {:east => :largecave})
d.add_room(:large_cave,"Large Cave","This is a large cavernous cave", {:west => :smallcave})
puts d.player.name
d.show_current_description
</pre>
| ruby | null | null | null | null | 04/01/2011 21:10:12 | too localized | getting for nil:NilClass (NoMethodError) in this code.
===
I am doing the beginning ruby book and this is what I have for my code, which gives the following error:
in `show_current_description': undefined method `full_description' for nil:NilClass (NoMethodError)
The code is as follows. Any help is appreciated. Thanks!
<pre>
class Dungeon
attr_accessor :player
def initialize(player_name,start_location)
@player=Player.new(player_name,start_location)
puts @player.location
@rooms=[]
show_current_description
end
def show_current_description
@rm=find_room_in_dungeon(@player.location)
@rm.full_description
end
def find_room_in_dungeon(reference)
@rooms.detect{|room| room.reference == reference; puts room.full_description}
end
def add_room(reference,name,description,connections)
@rooms << Room.new(reference,name,description,connections)
end
Player=Struct.new(:name,:location)
class Room
attr_accessor :reference, :name, :description, :connections
def initialize(reference,name,description,connections)
@reference=reference
@name=name
@description=description
@connections=connections
end
def full_description
"You are in " + @description
end
end
end
d=Dungeon.new("Good Man",:small_cave)
d.add_room(:small_cave,"Small Cave","This is a small claustrophobic cave", {:east => :largecave})
d.add_room(:large_cave,"Large Cave","This is a large cavernous cave", {:west => :smallcave})
puts d.player.name
d.show_current_description
</pre>
| 3 |
5,374,743 | 03/21/2011 07:06:31 | 372,519 | 06/21/2010 20:00:43 | 528 | 1 | customized dynamic web forms | I have a web form that has 2 drop down menus, when the first drop down menu chooses something, I want the next drop down menu to populate according to the selection on the first drop down menu without the page reloading. Would I use ajax for this? What is the best way to accomplish this? Anyone have any good tutorials for this? | c# | asp.net | ajax | asp.net-mvc-3 | null | null | open | customized dynamic web forms
===
I have a web form that has 2 drop down menus, when the first drop down menu chooses something, I want the next drop down menu to populate according to the selection on the first drop down menu without the page reloading. Would I use ajax for this? What is the best way to accomplish this? Anyone have any good tutorials for this? | 0 |
8,403,731 | 12/06/2011 16:59:12 | 654,928 | 03/11/2011 07:12:42 | 667 | 10 | GTK and scrolling text view | This is what I have so far
GtkWidget* createConsoleBox()
{
GtkWidget* textArea = gtk_text_view_new();
GtkWidget* scrollbar = gtk_vscrollbar_new(gtk_text_view_get_vadjustment(GTK_TEXT_VIEW(textArea)));
GtkWidget* textEntry = gtk_entry_new();
GtkWidget* console = gtk_table_new(3, 2, FALSE);
gtk_table_attach_defaults(GTK_TABLE(console), textArea, 0, 1, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(console), scrollbar, 1, 2, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(console), textEntry, 0, 2, 1, 2);
return console;
}
I want the text view to be scrollable as the text begins to fill the box, but the box keeps on expanding to accommodate more text. How to do I limit the size of the text view and create a scrollable text view.
Thanks in advance :-) | c | gtk2 | null | null | null | null | open | GTK and scrolling text view
===
This is what I have so far
GtkWidget* createConsoleBox()
{
GtkWidget* textArea = gtk_text_view_new();
GtkWidget* scrollbar = gtk_vscrollbar_new(gtk_text_view_get_vadjustment(GTK_TEXT_VIEW(textArea)));
GtkWidget* textEntry = gtk_entry_new();
GtkWidget* console = gtk_table_new(3, 2, FALSE);
gtk_table_attach_defaults(GTK_TABLE(console), textArea, 0, 1, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(console), scrollbar, 1, 2, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(console), textEntry, 0, 2, 1, 2);
return console;
}
I want the text view to be scrollable as the text begins to fill the box, but the box keeps on expanding to accommodate more text. How to do I limit the size of the text view and create a scrollable text view.
Thanks in advance :-) | 0 |
10,958,506 | 06/09/2012 05:02:10 | 80,353 | 03/20/2009 06:58:31 | 200 | 19 | What authentication mechanism does TweetDeck use for their desktop app/mobile app/web app? | I understand that TweetDeck can help a user to access Twitter and Facebook on her behalf.
In [OAuth2][1], that means TweetDeck is the 3rd Party Application, Twitter and Facebook are the Resource Server while the user is the Client.
My question is **NOT** about TweetDeck accessing some Resource Server on behalf of a Client.
My question is how does TweetDeck handle authentication for its own desktop app/mobile app/webapp because in all 3 types, a user still needs to login using her **own TweetDeck** username/password?
For webapp, it is straightforward enough. TweetDeck could be using good ol' server sessions and browser cookies to maintain application/authentication state and a simple login form over HTTPS.
My main question is **What about desktop app/mobile app?**
Does TweetDeck also use OAuth2 for its own authentication? if not, what does it use?
If so, is it [Resource Owner Password Credentials Grant][2]? if not, then which type of OAuth grant?
If so, how do they avoid being compromised by brute force attacks? since it is stated in the docs, the endpoint for this needs to protect against brute force attacks.
[1]: http://tools.ietf.org/html/draft-ietf-oauth-v2-20
[2]: http://tools.ietf.org/html/draft-ietf-oauth-v2-20#page-32 | authentication | desktop-application | oauth-2.0 | mobile-web | mobile-application | null | open | What authentication mechanism does TweetDeck use for their desktop app/mobile app/web app?
===
I understand that TweetDeck can help a user to access Twitter and Facebook on her behalf.
In [OAuth2][1], that means TweetDeck is the 3rd Party Application, Twitter and Facebook are the Resource Server while the user is the Client.
My question is **NOT** about TweetDeck accessing some Resource Server on behalf of a Client.
My question is how does TweetDeck handle authentication for its own desktop app/mobile app/webapp because in all 3 types, a user still needs to login using her **own TweetDeck** username/password?
For webapp, it is straightforward enough. TweetDeck could be using good ol' server sessions and browser cookies to maintain application/authentication state and a simple login form over HTTPS.
My main question is **What about desktop app/mobile app?**
Does TweetDeck also use OAuth2 for its own authentication? if not, what does it use?
If so, is it [Resource Owner Password Credentials Grant][2]? if not, then which type of OAuth grant?
If so, how do they avoid being compromised by brute force attacks? since it is stated in the docs, the endpoint for this needs to protect against brute force attacks.
[1]: http://tools.ietf.org/html/draft-ietf-oauth-v2-20
[2]: http://tools.ietf.org/html/draft-ietf-oauth-v2-20#page-32 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.