PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
11,652,483
07/25/2012 14:50:44
705,297
04/13/2011 05:05:46
88
7
Call wireless settings screen with back button
If there is no wireless connection and no logged in google account when you open Play Market and choose new or existing account it opens specific wireless settings screen with back button at the bottom. ![Wireless settings with back button][1] [1]: http://i.stack.imgur.com/w0akj.png How to open same screen from my app? Thanks
android
settings
ice-cream-sandwich
android-wireless
null
null
open
Call wireless settings screen with back button === If there is no wireless connection and no logged in google account when you open Play Market and choose new or existing account it opens specific wireless settings screen with back button at the bottom. ![Wireless settings with back button][1] [1]: http://i.stack.imgur.com/w0akj.png How to open same screen from my app? Thanks
0
10,613,139
05/16/2012 06:30:33
1,263,745
03/12/2012 09:28:32
45
1
how to combine results of different variables into one variable
I have following 4 variables in my controller index action which are retrieving data from different models as follows : @forum = Forum.where(:user_id => @users.collect(&:user_id)).all @poll=Poll.where(:created_by => @users.collect(&:user_id)).all @article = Article.where(:user_id => @users.collect(&:user_id)).all @jobpost = Jobplacement.where(:user_id => @users.collect(&:user_id)).all **I want to join all these 4 variables data into single variable say @post. How can i do this?**
ruby-on-rails
ruby
ruby-on-rails-3
controller
null
null
open
how to combine results of different variables into one variable === I have following 4 variables in my controller index action which are retrieving data from different models as follows : @forum = Forum.where(:user_id => @users.collect(&:user_id)).all @poll=Poll.where(:created_by => @users.collect(&:user_id)).all @article = Article.where(:user_id => @users.collect(&:user_id)).all @jobpost = Jobplacement.where(:user_id => @users.collect(&:user_id)).all **I want to join all these 4 variables data into single variable say @post. How can i do this?**
0
10,768,683
05/26/2012 18:19:31
590,849
01/26/2011 15:42:56
875
20
ide for c/c++ programming in Linux
Which IDE is best for coding in c/c++ in Linux which offers the following: 1. debugging 2. code completion 3. tooltips / documentation (function definitions) Also if the IDE can be used in general for phython and perl coding also it would be the best choice available. Thank you in advance.
linux
ide
null
null
null
05/26/2012 18:42:07
not constructive
ide for c/c++ programming in Linux === Which IDE is best for coding in c/c++ in Linux which offers the following: 1. debugging 2. code completion 3. tooltips / documentation (function definitions) Also if the IDE can be used in general for phython and perl coding also it would be the best choice available. Thank you in advance.
4
2,442,101
03/14/2010 12:15:20
293,373
03/14/2010 12:15:20
1
0
good beginner tutorial for turbogears 2
I find myself struggling to do simple things that would normally take me about 5 minutes to do in PHP. At the moment, I'm trying to create a basic form which will print the details on another page when you click submit. Looking at the documentation, I find examples but none explaining why it works in such a way.
tutorials
turbogears
php
null
null
06/15/2011 02:59:43
not a real question
good beginner tutorial for turbogears 2 === I find myself struggling to do simple things that would normally take me about 5 minutes to do in PHP. At the moment, I'm trying to create a basic form which will print the details on another page when you click submit. Looking at the documentation, I find examples but none explaining why it works in such a way.
1
3,997,280
10/22/2010 13:32:24
482,935
10/21/2010 11:39:31
1
0
How to fill N x M grid efficiently with Perl?
I have a Perl script, which parses datafile and writes 5 output files filled with 1100 x 1300 grid. The script works, but in my opinion, it's clumsy and probably non-efficient. The script is also inherited code, which I have modified a little to make it more readable. Still, it's a mess. At the moment, the script reads the datafile(~4Mb) and puts it into array. Then it loops through array parsing its content and pushing values to another array and finally printing them to file in another for loop. If value is not found for certain point, then it prints 9999. Zero is an acceptable value. The datafile has 5 different parameters and each of them is written to its own file. Example of data: data for the param: 2 5559 // (x,y) count values 280 40 3 0 0 0 280 41 4 0 0 0 0 280 42 5 0 0 0 0 0 281 43 4 0 0 10 10 281 44 4 0 0 10 10 281 45 4 0 0 0 10 281 46 4 0 0 10 0 281 47 4 0 0 10 0 281 48 3 10 10 0 281 49 2 0 0 41 50 3 0 0 0 45 50 3 0 0 0 280 50 2 0 0 40 51 8 0 0 0 0 0 0 0 0 ... data for the param: 3 3356 // (x,y) count values **5559** is the number of data lines to current parameter. Data line goes: **x**, **y**, **number of consecutive values** for that particular point and finally the **values**. There is an empty line between parameters. As I said earlier, the script works, but I feel like this could be done so much easier and more efficiently. I just don't know how. So here's a chance for self-improvement. What would be better approach to this problem, than a complicated combo of arrays and for-loops?
perl
grid
self-improvement
null
null
null
open
How to fill N x M grid efficiently with Perl? === I have a Perl script, which parses datafile and writes 5 output files filled with 1100 x 1300 grid. The script works, but in my opinion, it's clumsy and probably non-efficient. The script is also inherited code, which I have modified a little to make it more readable. Still, it's a mess. At the moment, the script reads the datafile(~4Mb) and puts it into array. Then it loops through array parsing its content and pushing values to another array and finally printing them to file in another for loop. If value is not found for certain point, then it prints 9999. Zero is an acceptable value. The datafile has 5 different parameters and each of them is written to its own file. Example of data: data for the param: 2 5559 // (x,y) count values 280 40 3 0 0 0 280 41 4 0 0 0 0 280 42 5 0 0 0 0 0 281 43 4 0 0 10 10 281 44 4 0 0 10 10 281 45 4 0 0 0 10 281 46 4 0 0 10 0 281 47 4 0 0 10 0 281 48 3 10 10 0 281 49 2 0 0 41 50 3 0 0 0 45 50 3 0 0 0 280 50 2 0 0 40 51 8 0 0 0 0 0 0 0 0 ... data for the param: 3 3356 // (x,y) count values **5559** is the number of data lines to current parameter. Data line goes: **x**, **y**, **number of consecutive values** for that particular point and finally the **values**. There is an empty line between parameters. As I said earlier, the script works, but I feel like this could be done so much easier and more efficiently. I just don't know how. So here's a chance for self-improvement. What would be better approach to this problem, than a complicated combo of arrays and for-loops?
0
8,618,022
12/23/2011 15:57:58
1,113,644
12/23/2011 15:47:34
1
0
Regex Required to convert comma to decimal
I have a value like AGGR//FAMT/126000,21 I want result as 126000.21 Can anyone help me on this
regex
null
null
null
null
12/24/2011 02:52:18
not a real question
Regex Required to convert comma to decimal === I have a value like AGGR//FAMT/126000,21 I want result as 126000.21 Can anyone help me on this
1
4,460,769
12/16/2010 12:30:50
542,180
12/14/2010 15:51:03
1
0
Nesting objects into a single class using MVC Entity Framework
I am using MVC with the Entity framework where all the database tables become objects. I am relatively new to full OO programming but I need advise on the following. I have one data type (table) which then needs to pull in lots of information from other tables to construct a full record. For example: I have a item called "Building". Each building has one "manager" and a collection of "floors". So far I am creating a new class which contains all these objects. See below: public BuildingComplete { public building _building; public manager _manager; public IEnumerable<floors> _floors; public BuildingComplete() {} } I'm then declaring this object and defining all the elements outside the class. This seems rather messy. Ideally I'd like to create a "building" object and within that object it will go away and create all the necessary elements within it. It can do this because the "Building" object contains all the linking id's / information to query the other data tables. I looked at creating a child of "Building" but I don't know how to set the base: "Building" from the Child.....or even if this is the right thing to do. Any ideas / pointers will be gratefully received.
c#
oop
mvc
null
null
null
open
Nesting objects into a single class using MVC Entity Framework === I am using MVC with the Entity framework where all the database tables become objects. I am relatively new to full OO programming but I need advise on the following. I have one data type (table) which then needs to pull in lots of information from other tables to construct a full record. For example: I have a item called "Building". Each building has one "manager" and a collection of "floors". So far I am creating a new class which contains all these objects. See below: public BuildingComplete { public building _building; public manager _manager; public IEnumerable<floors> _floors; public BuildingComplete() {} } I'm then declaring this object and defining all the elements outside the class. This seems rather messy. Ideally I'd like to create a "building" object and within that object it will go away and create all the necessary elements within it. It can do this because the "Building" object contains all the linking id's / information to query the other data tables. I looked at creating a child of "Building" but I don't know how to set the base: "Building" from the Child.....or even if this is the right thing to do. Any ideas / pointers will be gratefully received.
0
10,700,219
05/22/2012 10:28:51
1,111,447
12/22/2011 09:36:11
137
5
How to smooth mouse movement?
So I have a new x_coord between 9ms and 30ms. That means: x_coord = *x_coord1* *pause 30ms* x_coord = *x_coord2* *pause 9ms* x_coord = *x_coord2* *pause 13ms* ... for instance: x_coord = 700 *pause 30ms* x_coord = 711 *pause 9ms* x_coord = 708 *pause 13ms* ... x_coord is declared as private int x_coord; so it is available even to threads. This is a x-Coordinate for a mouse pointer. The differring pause times and values make it not move smoothly. I thought about using a thread like this: void threadname() { //What Thread.Sleep(17); // 1/60Hz = 0,0166666666666667 } The question is, how to fill //What? So while threadname is running, it should smooth the values, ie keep the time between values constant at 17ms and while being in between real values predict the coming next value and create a value that might be in between. Normally the curve is a sine curve, so moving to the right, slowing down, moving to the left etc. So what I am looking for is something like this: void threadname() { //Determine current(ie each 17th ms) probable value of x-coord. Thread.Sleep(17); // 1/60Hz = 0,0166666666666667 }
c#
mousemove
null
null
null
05/24/2012 13:05:19
not a real question
How to smooth mouse movement? === So I have a new x_coord between 9ms and 30ms. That means: x_coord = *x_coord1* *pause 30ms* x_coord = *x_coord2* *pause 9ms* x_coord = *x_coord2* *pause 13ms* ... for instance: x_coord = 700 *pause 30ms* x_coord = 711 *pause 9ms* x_coord = 708 *pause 13ms* ... x_coord is declared as private int x_coord; so it is available even to threads. This is a x-Coordinate for a mouse pointer. The differring pause times and values make it not move smoothly. I thought about using a thread like this: void threadname() { //What Thread.Sleep(17); // 1/60Hz = 0,0166666666666667 } The question is, how to fill //What? So while threadname is running, it should smooth the values, ie keep the time between values constant at 17ms and while being in between real values predict the coming next value and create a value that might be in between. Normally the curve is a sine curve, so moving to the right, slowing down, moving to the left etc. So what I am looking for is something like this: void threadname() { //Determine current(ie each 17th ms) probable value of x-coord. Thread.Sleep(17); // 1/60Hz = 0,0166666666666667 }
1
8,980,278
01/23/2012 23:49:28
1,101,107
12/16/2011 01:59:42
25
2
Preserve leading zeros SQL
I am saving a number eg. 000001 in a SQL TEXT field which causes the leading zeros to be lost. I need the TEXT type field as the data may contain letters and/or numbers. Any suggestions how I could preserve the leading zeros while still storing the data in a TEXT type field?
sql
database
null
null
null
01/24/2012 09:25:14
too localized
Preserve leading zeros SQL === I am saving a number eg. 000001 in a SQL TEXT field which causes the leading zeros to be lost. I need the TEXT type field as the data may contain letters and/or numbers. Any suggestions how I could preserve the leading zeros while still storing the data in a TEXT type field?
3
6,319,924
06/12/2011 03:20:14
733,809
05/02/2011 01:13:30
373
2
What does `new` mean in Java
I have the following: ... Scanner in = new Scanner(System.in); ... but would like to know what the term `new` above means. Also how does java-util-scanner work?
java
new-operator
java-util-scanner
null
null
06/12/2011 04:00:59
not a real question
What does `new` mean in Java === I have the following: ... Scanner in = new Scanner(System.in); ... but would like to know what the term `new` above means. Also how does java-util-scanner work?
1
10,939,166
06/07/2012 20:13:02
1,363,968
04/29/2012 09:31:02
12
0
Running Android Marketplace Crawler ('hg' directory?)
I'm having trouble figuring out how to run the Android Marketplace Crawler here: http://code.google.com/p/android-marketplace-crawler/ I think I just don't understand how the crawler is supposed to operate -- first of all, the source -- http://code.google.com/p/android-marketplace-crawler/source/checkout -- says I can create a local copy of the crawler with the command hg clone https://code.google.com/p/android-marketplace-crawler/ How am I supposed to run this command? Thanks.
android
crawler
null
null
null
07/08/2012 01:39:34
off topic
Running Android Marketplace Crawler ('hg' directory?) === I'm having trouble figuring out how to run the Android Marketplace Crawler here: http://code.google.com/p/android-marketplace-crawler/ I think I just don't understand how the crawler is supposed to operate -- first of all, the source -- http://code.google.com/p/android-marketplace-crawler/source/checkout -- says I can create a local copy of the crawler with the command hg clone https://code.google.com/p/android-marketplace-crawler/ How am I supposed to run this command? Thanks.
2
3,843,340
10/01/2010 22:04:39
464,286
10/01/2010 22:04:39
1
0
Mobile application based on bluetooth and wifi technology
I need help as I want to develop an application which based on bluetooth and wifi technologies, but I am run out of ideas. I was thinking about an application needs to share data between people something like a small social mobile network, so any ideas!!
bluetooth
wifi
mobile-application
null
null
10/04/2010 15:40:41
not a real question
Mobile application based on bluetooth and wifi technology === I need help as I want to develop an application which based on bluetooth and wifi technologies, but I am run out of ideas. I was thinking about an application needs to share data between people something like a small social mobile network, so any ideas!!
1
8,012,316
11/04/2011 16:11:18
641,769
03/02/2011 18:44:24
10
1
Chrome Debugger Date value
I am facing a strange problem. I worked with chrome debugger for hours and everything worked fine. Now it is nomore working correctly. I have a date variable and expect the value to shown like: end_date: Mon Nov 01 2010 00:00:00 GMT+0200 {} But instead it shows only "Date" as value. I can perform any functions on it like .getDate() etc. but the value is not shown by default. Even when I put this into the console: new Date() I get this response: Date Have I turned something on which hides the value of a Date object? Cheers
debugging
google-chrome
date
value
null
null
open
Chrome Debugger Date value === I am facing a strange problem. I worked with chrome debugger for hours and everything worked fine. Now it is nomore working correctly. I have a date variable and expect the value to shown like: end_date: Mon Nov 01 2010 00:00:00 GMT+0200 {} But instead it shows only "Date" as value. I can perform any functions on it like .getDate() etc. but the value is not shown by default. Even when I put this into the console: new Date() I get this response: Date Have I turned something on which hides the value of a Date object? Cheers
0
7,233,765
08/29/2011 17:47:07
918,291
08/29/2011 17:47:07
1
0
Like Us on Facebook doesn't take customers to our page
I put a Like Us On Facebook plugin on my company's website, and for some reason, it takes you to the Facebook Platform page instead of my center's Facebook page. Now I can't find where to go to fix this, and it sort of defeats the whole purpose of having the Like Us button. My company's page is Sylvan Learning Center in Buffalo Grove, IL and the Like Us link is <iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform%23%21%2Fpages%2FSylvan-Learning-Center%2F263361593683003&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=true&amp;header=true&amp;height=427" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:427px;" allowTransparency="true"></iframe>. Again, I don't know how to properly input this and the current Like Us button takes customers to the wrong place, which is very frustrating. The Getting Started page is very unhelpful, as it has gotten me n where except a Like Us button that doesn't allow people to actually like US. If there's something that can be done, please tell me how!
facebook-like
webpage
null
null
null
08/29/2011 18:51:09
off topic
Like Us on Facebook doesn't take customers to our page === I put a Like Us On Facebook plugin on my company's website, and for some reason, it takes you to the Facebook Platform page instead of my center's Facebook page. Now I can't find where to go to fix this, and it sort of defeats the whole purpose of having the Like Us button. My company's page is Sylvan Learning Center in Buffalo Grove, IL and the Like Us link is <iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform%23%21%2Fpages%2FSylvan-Learning-Center%2F263361593683003&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=true&amp;header=true&amp;height=427" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:427px;" allowTransparency="true"></iframe>. Again, I don't know how to properly input this and the current Like Us button takes customers to the wrong place, which is very frustrating. The Getting Started page is very unhelpful, as it has gotten me n where except a Like Us button that doesn't allow people to actually like US. If there's something that can be done, please tell me how!
2
7,227,718
08/29/2011 08:18:16
423,620
08/18/2010 05:30:03
505
2
can i install Debian Linux and windows on same partitions?
I'm having windows operating system.i want to install Debian operating system on same partition. Is it possible?if it is not possible then using other partition can i install Debian Linux and run both windows and Linux operating system(dual boot menu).i don't want to use virtual PC. Thanks
windows
linux
debian
null
null
08/29/2011 13:11:57
off topic
can i install Debian Linux and windows on same partitions? === I'm having windows operating system.i want to install Debian operating system on same partition. Is it possible?if it is not possible then using other partition can i install Debian Linux and run both windows and Linux operating system(dual boot menu).i don't want to use virtual PC. Thanks
2
8,772,691
01/07/2012 20:08:48
435,817
08/31/2010 10:30:08
72
2
rails 3: fields_for ordering after validation has failed
In my controllers create method I am creating a parent & child(ren) objects using accepts_nested_attributes. That all works fine. The children have an ordering attribute which is correctly set. However, when the validation fails (for a missing attribute say) the ordering of the child objects is *not* preserved when the fields_for method runs. I have tried using parent.children.reorder("ordering ASC") but that doesn't work... I'm happy to post any code should it make things clearer! def create @parent = Parent.new(params[:parent]) respond_to do |format| if @parent.save format.html else @parent.children.reorder("ordering ASC") #this makes no difference format.html { render :action => "new" } end end end ----- and in the form partial <%= f.fields_for :children do |ff| %> <%= render "child_fields", :ff => ff %> <% end %> Any pointers would be great..
ruby-on-rails
nested-attributes
fields-for
null
null
null
open
rails 3: fields_for ordering after validation has failed === In my controllers create method I am creating a parent & child(ren) objects using accepts_nested_attributes. That all works fine. The children have an ordering attribute which is correctly set. However, when the validation fails (for a missing attribute say) the ordering of the child objects is *not* preserved when the fields_for method runs. I have tried using parent.children.reorder("ordering ASC") but that doesn't work... I'm happy to post any code should it make things clearer! def create @parent = Parent.new(params[:parent]) respond_to do |format| if @parent.save format.html else @parent.children.reorder("ordering ASC") #this makes no difference format.html { render :action => "new" } end end end ----- and in the form partial <%= f.fields_for :children do |ff| %> <%= render "child_fields", :ff => ff %> <% end %> Any pointers would be great..
0
11,513,524
07/16/2012 22:28:40
768,384
05/24/2011 19:21:27
111
0
what is the simplest way of videoconnecting two random users like chatroulette?
Chatroulette is done entirely in flash i can see. But i have an idea of creating a datingsite with peer to peer videoconnections beeing a central part of it. So im looking for a simple way of doing this. There must be some simple example code out there, without coding an entire flash app? Thankful for all hints!
php
html
flash
adobe
webcam
07/16/2012 22:33:50
not constructive
what is the simplest way of videoconnecting two random users like chatroulette? === Chatroulette is done entirely in flash i can see. But i have an idea of creating a datingsite with peer to peer videoconnections beeing a central part of it. So im looking for a simple way of doing this. There must be some simple example code out there, without coding an entire flash app? Thankful for all hints!
4
9,908,464
03/28/2012 13:24:04
706,808
04/13/2011 20:43:46
307
0
How to check different value keys in a dictionary concurrently using list comprehensions
I'm trying to accomplish a task, but having some difficulty.Can someone set me straight on the following: myFormats = {'audio': ('.wav', '.wma', '.mp3'), 'video': ('.mpg', '.mp4', '.mpeg')} myFile = '5DeadlyVenoms.mp3' # Will not find '5DeadlyVenoms.mp4' displays [] f_exten = [x for x in myFormats['audio'] or myFormats['video'] if myFile.endswith(x)] f_exten[0] An audio extension is found no problem. But if I search for a video extension, I get the error: Traceback (most recent call last): File "C:\Users\GVRSQA004\Desktop\udCombo.py", line 86, in fileFormats if f_exten[0] in myFormats['audio']: IndexError: list index out of range I imagine this happens because the list comprehension (specifically ... or ...) is not properly formed.
python
dictionary
list-comprehension
null
null
null
open
How to check different value keys in a dictionary concurrently using list comprehensions === I'm trying to accomplish a task, but having some difficulty.Can someone set me straight on the following: myFormats = {'audio': ('.wav', '.wma', '.mp3'), 'video': ('.mpg', '.mp4', '.mpeg')} myFile = '5DeadlyVenoms.mp3' # Will not find '5DeadlyVenoms.mp4' displays [] f_exten = [x for x in myFormats['audio'] or myFormats['video'] if myFile.endswith(x)] f_exten[0] An audio extension is found no problem. But if I search for a video extension, I get the error: Traceback (most recent call last): File "C:\Users\GVRSQA004\Desktop\udCombo.py", line 86, in fileFormats if f_exten[0] in myFormats['audio']: IndexError: list index out of range I imagine this happens because the list comprehension (specifically ... or ...) is not properly formed.
0
6,641,355
07/10/2011 13:29:07
837,615
07/10/2011 13:14:44
1
0
jquery fullcalendar event filtering
Is there any method to dynamic filter events on client side in fullcalendar? When I get events from server (json_encoded) I assign my own parameter "school_id" to every event. After fullcalendar is ready, I want to dynamic filter events with "select". I add "select" element on page like this: <select id='school_selector'> <option value='all'>All schools</option> <option value='1'>school 1</option> <option value='2'>school 2</option> </select> And in javascript code I add: jQuery("#school_selector").change(function(){ filter_id = $(this).val(); if (filter_id != 'all') { var events = $('#mycalendar').fullCalendar( 'clientEvents', function(event) { if((filter_id == ''all) ) { return true; } return false; }); } }); But it's does not work. Any help will be great.thanks.
jquery
events
filter
fullcalendar
null
null
open
jquery fullcalendar event filtering === Is there any method to dynamic filter events on client side in fullcalendar? When I get events from server (json_encoded) I assign my own parameter "school_id" to every event. After fullcalendar is ready, I want to dynamic filter events with "select". I add "select" element on page like this: <select id='school_selector'> <option value='all'>All schools</option> <option value='1'>school 1</option> <option value='2'>school 2</option> </select> And in javascript code I add: jQuery("#school_selector").change(function(){ filter_id = $(this).val(); if (filter_id != 'all') { var events = $('#mycalendar').fullCalendar( 'clientEvents', function(event) { if((filter_id == ''all) ) { return true; } return false; }); } }); But it's does not work. Any help will be great.thanks.
0
3,931,840
10/14/2010 09:34:34
474,166
10/13/2010 07:09:37
6
1
What is the concept of menu??
Actually for what purpose is menu used?
android
null
null
null
null
06/30/2011 21:53:37
not a real question
What is the concept of menu?? === Actually for what purpose is menu used?
1
8,873,670
01/15/2012 21:51:51
488,195
10/26/2010 22:52:39
89
4
How to translate one string from one locale into another using FastGettext?
I use [FastGettext][1] in my Rails application. I need a particular string translated into every single ``FastGettext.available_locales`` in my application. How to do that? PS: I couldn't find the solution with I18n either. [1]: https://github.com/grosser/fast_gettext
ruby-on-rails
ruby
internationalization
gettext
null
null
open
How to translate one string from one locale into another using FastGettext? === I use [FastGettext][1] in my Rails application. I need a particular string translated into every single ``FastGettext.available_locales`` in my application. How to do that? PS: I couldn't find the solution with I18n either. [1]: https://github.com/grosser/fast_gettext
0
10,020,913
04/04/2012 23:56:04
420,941
08/15/2010 12:09:06
391
4
how to change the 'read more' text across all pages in wordpress
In wordpress, I have the loop.php file. There I can see the 'read more' code. I changed it and it does take effect on the index page. But then If I go on the tags pages `../?tag=reference` I get the old 'continue reading' text and not the edited text of 'read more' from the loop.php This is what I have on the loop.php <div class="entry-content"> <?php the_content( __( '<span class="read_more">Read More</span>', 'boilerplate' ) ); ?> </div><!-- .entry-content --> And this is what I am using on tag.php get_template_part( 'loop', 'tag' ); But as I said instead of getting the 'read more' (as I get on the index page) I sut get 'continue reading' I have looked in the general-template.php and functions.php and there's nothing that suggests it related to the read more code. and everything I have research on google simply points in editing the loop.php file or to mage a new loop-tag.php file. Which I did but the result I the same: instead of geting 'read more' I get 'continue reading' Thanks for your help
wordpress
null
null
null
null
null
open
how to change the 'read more' text across all pages in wordpress === In wordpress, I have the loop.php file. There I can see the 'read more' code. I changed it and it does take effect on the index page. But then If I go on the tags pages `../?tag=reference` I get the old 'continue reading' text and not the edited text of 'read more' from the loop.php This is what I have on the loop.php <div class="entry-content"> <?php the_content( __( '<span class="read_more">Read More</span>', 'boilerplate' ) ); ?> </div><!-- .entry-content --> And this is what I am using on tag.php get_template_part( 'loop', 'tag' ); But as I said instead of getting the 'read more' (as I get on the index page) I sut get 'continue reading' I have looked in the general-template.php and functions.php and there's nothing that suggests it related to the read more code. and everything I have research on google simply points in editing the loop.php file or to mage a new loop-tag.php file. Which I did but the result I the same: instead of geting 'read more' I get 'continue reading' Thanks for your help
0
2,764,558
05/04/2010 10:44:11
27,667
10/13/2008 23:48:31
969
37
Select value in designer for a Type property
I have a UserControl that exposes a `System.Type` property. I want to make it settable at design time, like the BindingSource's DataSource property. How can I achieve this?
.net
visual-studio
designer
types
null
null
open
Select value in designer for a Type property === I have a UserControl that exposes a `System.Type` property. I want to make it settable at design time, like the BindingSource's DataSource property. How can I achieve this?
0
11,260,452
06/29/2012 10:50:45
1,490,247
06/29/2012 04:15:42
1
0
javascript inventory management system
I have to make an inventory sys.There are 100 stocks maintained at Argentina and Brazil. A single ipod costs $100 in Brazil and $50 in Argentina. The cost of exporting stocks from one country to the other will cost $400 per 10 blocks. The transportation is always done in the multiples of 10. the minimum cost for purchasing the given no of units has to be calculated. Assuming that for each transaction, the available stock in each country is maintained to be 100 that is if it cannot become more than 100. Input and output format: The country from which the order is being placed: No of units Minimum costs:No of stock left in brazil:No of stock left at Argentina Sample Input and output: Brazil:5 5000:95:100 Brazil:50 4500:100:50 how can i calculate that when my order is above 100 i have to exprt? var countryinfo = [ { name:"Argentina", cost : 50, exprt : 40 }, { name:"brazil", cost: 100, exprt: 40 }, ]; inventoryipod=function(countryinfo,numberofunits) { this.allcountries=[]; this.country=countryinfo; this.numberofunits=numberofunits; for(i=0;i<this.country.length;i++) { console.log(this.country[i].name) this.allcountries.push(this.country[i].name); } } inventoryipod.prototype.minimizedcost=function() { if(this.numberofunits%10==0) { var prices = []; var name = []; var i, len; if( this.numberofunits<100) { for( i = 0, len = this.country.length; i < len; i += 1) { this.totalcost=this.numberofunits*this.country[i].cost+this.country[i].exprt*this.numberofunits; prices.push(this.totalcost); } return Math.min.apply(Math,prices); } } }
javascript
inventory
null
null
null
06/29/2012 11:07:50
not a real question
javascript inventory management system === I have to make an inventory sys.There are 100 stocks maintained at Argentina and Brazil. A single ipod costs $100 in Brazil and $50 in Argentina. The cost of exporting stocks from one country to the other will cost $400 per 10 blocks. The transportation is always done in the multiples of 10. the minimum cost for purchasing the given no of units has to be calculated. Assuming that for each transaction, the available stock in each country is maintained to be 100 that is if it cannot become more than 100. Input and output format: The country from which the order is being placed: No of units Minimum costs:No of stock left in brazil:No of stock left at Argentina Sample Input and output: Brazil:5 5000:95:100 Brazil:50 4500:100:50 how can i calculate that when my order is above 100 i have to exprt? var countryinfo = [ { name:"Argentina", cost : 50, exprt : 40 }, { name:"brazil", cost: 100, exprt: 40 }, ]; inventoryipod=function(countryinfo,numberofunits) { this.allcountries=[]; this.country=countryinfo; this.numberofunits=numberofunits; for(i=0;i<this.country.length;i++) { console.log(this.country[i].name) this.allcountries.push(this.country[i].name); } } inventoryipod.prototype.minimizedcost=function() { if(this.numberofunits%10==0) { var prices = []; var name = []; var i, len; if( this.numberofunits<100) { for( i = 0, len = this.country.length; i < len; i += 1) { this.totalcost=this.numberofunits*this.country[i].cost+this.country[i].exprt*this.numberofunits; prices.push(this.totalcost); } return Math.min.apply(Math,prices); } } }
1
9,942,125
03/30/2012 11:32:42
784,586
06/05/2011 08:48:13
138
3
how to connect to VPS linux from windows7 as a local network computer?
i have a linux VPS with cpanel/WHM installed on it, and i need to edit the files on this VPS from my home computer (windows7) just like if this VPS is a local computer on my local network. i mean from windows explorer with notepad or any other editor. thanks...
windows
linux
cpanel
vpn
vps
03/31/2012 15:00:09
not a real question
how to connect to VPS linux from windows7 as a local network computer? === i have a linux VPS with cpanel/WHM installed on it, and i need to edit the files on this VPS from my home computer (windows7) just like if this VPS is a local computer on my local network. i mean from windows explorer with notepad or any other editor. thanks...
1
3,961,047
10/18/2010 16:12:53
95,944
04/25/2009 12:57:54
1,843
71
easy_install does not work in Windows 7
I have Python 2.6.4 installed in C:\Python26. I have PyQt4 installed from here: http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-Py2.6-gpl-4.7.7-1.exe I have added this path to %PATH%: C:\Python26 When I type this command in cmd.exe however: easy_install cheetah I get this error: C:\Users\Richard>easy_install cheetah 'easy_install' is not recognized as an internal or external command, operable program or batch file. C:\Users\Richard> Any help? In Windows XP it worked.
python
pyqt4
null
null
null
null
open
easy_install does not work in Windows 7 === I have Python 2.6.4 installed in C:\Python26. I have PyQt4 installed from here: http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-Py2.6-gpl-4.7.7-1.exe I have added this path to %PATH%: C:\Python26 When I type this command in cmd.exe however: easy_install cheetah I get this error: C:\Users\Richard>easy_install cheetah 'easy_install' is not recognized as an internal or external command, operable program or batch file. C:\Users\Richard> Any help? In Windows XP it worked.
0
6,388,900
06/17/2011 16:36:56
783,239
06/03/2011 19:13:58
104
0
ORDER BY and WITH(ROWLOCK, UPDLOCK, READPAST)
I need to set up a queue system using some SQL tables, like the one described [here][1]. That being, and since I need to filter queued items by different critera, inside a stored procedure I am using BEGIN TRANSACTION CREATE TABLE #Temp (ID INT, SOMEFIELD INT) INSERT INTO #Temp SELECT TOP (@Something) TableA.ID, TableB.SomeField FROM TableA WITH (ROWLOCK, READPAST) INNER JOIN TableB WITH (UPDLOCK, READPAST) WHERE Condition1 INSERT INTO #Temp SELECT TOP (@Something) TableA.ID, TableB.SomeField FROM TableA WITH (ROWLOCK, READPAST) INNER JOIN TableB WITH (UPDLOCK, READPAST) WHERE Condition2 (...) UPDATE TableB SET SomeField = 1 FROM TableB WITH (ROWLOCK, READPAST) WHERE ID IN (SELECT ID FROM #Temp) COMMIT TRANSACTION I am using `ROWLOCK` in the first table and `UPDLOCK` in the second because, after this select, I am going to update `TableB` only, though I need to make sure that these lines don't get updated in`TableA` by any other concurrent query. Everything goes well until the point where I need to insert an `ORDER BY` clause in any of the `SELECT`s above, so that only very specific IDs get selected (I must really do this). What happens is: 1) Without `ORDER BY`, two concurrent executions execute as desired, returning different and non-overlapping results; however, they don't return the results I want because those precise results were outside the scope of every `SELECT` statement. 2) Using `ORDER BY` and two concurrent executions, only the first one returns results. The second one does not return anything. I recall seeing on a blog that for these kind of queries with `WITH (ROWLOCK, READPAST)` and `ORDER BY` to work one needs to create indexes on the fields one is using in the ordering. I tried it, but I got the same results. How can I get past this problem? [1]: http://stackoverflow.com/questions/2177880/using-a-database-table-as-a-queue
sql-server-2005
locking
order-by
null
null
null
open
ORDER BY and WITH(ROWLOCK, UPDLOCK, READPAST) === I need to set up a queue system using some SQL tables, like the one described [here][1]. That being, and since I need to filter queued items by different critera, inside a stored procedure I am using BEGIN TRANSACTION CREATE TABLE #Temp (ID INT, SOMEFIELD INT) INSERT INTO #Temp SELECT TOP (@Something) TableA.ID, TableB.SomeField FROM TableA WITH (ROWLOCK, READPAST) INNER JOIN TableB WITH (UPDLOCK, READPAST) WHERE Condition1 INSERT INTO #Temp SELECT TOP (@Something) TableA.ID, TableB.SomeField FROM TableA WITH (ROWLOCK, READPAST) INNER JOIN TableB WITH (UPDLOCK, READPAST) WHERE Condition2 (...) UPDATE TableB SET SomeField = 1 FROM TableB WITH (ROWLOCK, READPAST) WHERE ID IN (SELECT ID FROM #Temp) COMMIT TRANSACTION I am using `ROWLOCK` in the first table and `UPDLOCK` in the second because, after this select, I am going to update `TableB` only, though I need to make sure that these lines don't get updated in`TableA` by any other concurrent query. Everything goes well until the point where I need to insert an `ORDER BY` clause in any of the `SELECT`s above, so that only very specific IDs get selected (I must really do this). What happens is: 1) Without `ORDER BY`, two concurrent executions execute as desired, returning different and non-overlapping results; however, they don't return the results I want because those precise results were outside the scope of every `SELECT` statement. 2) Using `ORDER BY` and two concurrent executions, only the first one returns results. The second one does not return anything. I recall seeing on a blog that for these kind of queries with `WITH (ROWLOCK, READPAST)` and `ORDER BY` to work one needs to create indexes on the fields one is using in the ordering. I tried it, but I got the same results. How can I get past this problem? [1]: http://stackoverflow.com/questions/2177880/using-a-database-table-as-a-queue
0
7,280,513
09/02/2011 07:44:00
827,920
07/04/2011 10:15:43
4
0
Bad request error when posting xml using curl
Am pulling my hair out trying to solve this problem, am getting a bad request error when posting to XML using curl. My code is: $post_string = '<XML DATA>'; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'SOAPAction: ""')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); var_dump($data); Any ideas on what's wrong?
xml
curl
null
null
null
null
open
Bad request error when posting xml using curl === Am pulling my hair out trying to solve this problem, am getting a bad request error when posting to XML using curl. My code is: $post_string = '<XML DATA>'; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'SOAPAction: ""')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); var_dump($data); Any ideas on what's wrong?
0
10,751,796
05/25/2012 09:24:51
1,417,030
05/25/2012 09:19:54
1
0
set a pop up window on an item click of a list view
i want to write a programme that displays a scrollable list of the courses you took as a part of degree. For example "Comp 41150", "Comp 42343", etc. When clicked, each of item should open up a pop-up box that contains a full course name, i.e. "COMP 41150 Mobile Application Development".
android
null
null
null
null
05/28/2012 00:39:36
not a real question
set a pop up window on an item click of a list view === i want to write a programme that displays a scrollable list of the courses you took as a part of degree. For example "Comp 41150", "Comp 42343", etc. When clicked, each of item should open up a pop-up box that contains a full course name, i.e. "COMP 41150 Mobile Application Development".
1
4,542,694
12/27/2010 23:45:29
424,303
08/18/2010 16:56:43
63
4
Getting-started: Setup Database for Node.js
I am new to node.js but am excited to try it out. I am using <a href="http://expressjs.com/">Express</a> as a web framework, and <a href="http://jade-lang.com">Jade</a> as a template engine. Both were easy to get setup following <a href="http://www.ustream.tv/recorded/11434722">this tutorial</a> from <a href="http://camp.nodejs.org/">Node Camp</a>. However the one problem I am finding is **I can't find a simple tutorial for getting a DB set up**. I am trying to build a basic chat application (store session and message). **Does anyone know of a good tutorial?** This other <a href="http://stackoverflow.com/questions/2750673/node-js-database">SO post</a> talks about dbs to use- but as this is very different from the Django/MySQL world I've been in, I want to make sure I understand what is going on. Thanks!
database
mongodb
couchdb
node.js
redis
null
open
Getting-started: Setup Database for Node.js === I am new to node.js but am excited to try it out. I am using <a href="http://expressjs.com/">Express</a> as a web framework, and <a href="http://jade-lang.com">Jade</a> as a template engine. Both were easy to get setup following <a href="http://www.ustream.tv/recorded/11434722">this tutorial</a> from <a href="http://camp.nodejs.org/">Node Camp</a>. However the one problem I am finding is **I can't find a simple tutorial for getting a DB set up**. I am trying to build a basic chat application (store session and message). **Does anyone know of a good tutorial?** This other <a href="http://stackoverflow.com/questions/2750673/node-js-database">SO post</a> talks about dbs to use- but as this is very different from the Django/MySQL world I've been in, I want to make sure I understand what is going on. Thanks!
0
2,072,878
01/15/2010 15:58:08
18,709
09/19/2008 10:03:48
232
6
IE Back Button issue in java
i am having 2 jsp pages test1.jsp and test2.jsp on test1.jsp i am posting some data and it will redirected to test2.jsp . but from test2.jsp if i clicked ie browser back button then it is showing **Web Page Expired** page so how shall i proceed to show test1.jsp on back button click? i am getting this issue in IE browser.
java
jsp
null
null
null
null
open
IE Back Button issue in java === i am having 2 jsp pages test1.jsp and test2.jsp on test1.jsp i am posting some data and it will redirected to test2.jsp . but from test2.jsp if i clicked ie browser back button then it is showing **Web Page Expired** page so how shall i proceed to show test1.jsp on back button click? i am getting this issue in IE browser.
0
959,393
06/06/2009 10:02:50
109,935
05/20/2009 13:46:46
24
6
Mac developing - building an application with toolbar
I am new to mac developing, and kind of confused. I am trying to create a program with a toolbar, but can't seem to get it working. Can anyone explain me the steps needed to do this? Beside, is there any control on the mac developing system similar to iPhones UITabBarController? Thanks, Hans Espen
mac-development
mac
nstoolbar
toolbar
null
null
open
Mac developing - building an application with toolbar === I am new to mac developing, and kind of confused. I am trying to create a program with a toolbar, but can't seem to get it working. Can anyone explain me the steps needed to do this? Beside, is there any control on the mac developing system similar to iPhones UITabBarController? Thanks, Hans Espen
0
6,678,353
07/13/2011 11:47:41
829,821
07/05/2011 13:48:10
8
0
Can I use MediaPlayer play video from stream line
Here is my code. This code have to wait until Vdo is transferred then it can play How can i modify it to play video from stream line videoV = (SurfaceView) findViewById(R.id.SurfaceView1); Log.d("Connecting.... 0 " , ""); sh = videoV.getHolder(); b = (Button)findViewById(R.id.button1); File path = Environment.getExternalStorageDirectory(); File file = new File(path, "sample.3gp"); Log.d("Connecting.... 1 " , " Wait For Socket"); try { Log.e("Connecting.... 2" , ""); sock = new Socket("10.4.18.43", 5550); Log.e("Receiving video..." , ""); final FileOutputStream fos = new FileOutputStream(file); final byte[] data = new byte[1024]; Thread t = new Thread(new Runnable() { @Override public void run() { int count = 0; try { count = sock.getInputStream().read(data, 0, data.length); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } while (count != -1) { System.out.println(count); try { fos.write(data, 0, count); count = sock.getInputStream().read(data, 0, data.length); Log.e("Receiving", "Receiving"); } catch (IOException e) { e.printStackTrace(); } } Log.e("Receiving", "Finish"); } }); t.start(); } catch (UnknownHostException e3) { // TODO Auto-generated catch block e3.printStackTrace(); } catch (IOException e3) { // TODO Auto-generated catch block e3.printStackTrace(); } sh.addCallback(this); mp = new MediaPlayer(); try { mp.setDataSource(file.getAbsolutePath()); //mp.setDataSource(ParcelFileDescriptor.fromSocket(sock).getFileDescriptor()); mp.setDisplay(sh); } catch (IllegalArgumentException e1) { e1.printStackTrace(); } catch (IllegalStateException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } b.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { mp.prepare(); //mp.prepareAsync(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mp.start(); } });
android
sockets
video
streaming
null
null
open
Can I use MediaPlayer play video from stream line === Here is my code. This code have to wait until Vdo is transferred then it can play How can i modify it to play video from stream line videoV = (SurfaceView) findViewById(R.id.SurfaceView1); Log.d("Connecting.... 0 " , ""); sh = videoV.getHolder(); b = (Button)findViewById(R.id.button1); File path = Environment.getExternalStorageDirectory(); File file = new File(path, "sample.3gp"); Log.d("Connecting.... 1 " , " Wait For Socket"); try { Log.e("Connecting.... 2" , ""); sock = new Socket("10.4.18.43", 5550); Log.e("Receiving video..." , ""); final FileOutputStream fos = new FileOutputStream(file); final byte[] data = new byte[1024]; Thread t = new Thread(new Runnable() { @Override public void run() { int count = 0; try { count = sock.getInputStream().read(data, 0, data.length); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } while (count != -1) { System.out.println(count); try { fos.write(data, 0, count); count = sock.getInputStream().read(data, 0, data.length); Log.e("Receiving", "Receiving"); } catch (IOException e) { e.printStackTrace(); } } Log.e("Receiving", "Finish"); } }); t.start(); } catch (UnknownHostException e3) { // TODO Auto-generated catch block e3.printStackTrace(); } catch (IOException e3) { // TODO Auto-generated catch block e3.printStackTrace(); } sh.addCallback(this); mp = new MediaPlayer(); try { mp.setDataSource(file.getAbsolutePath()); //mp.setDataSource(ParcelFileDescriptor.fromSocket(sock).getFileDescriptor()); mp.setDisplay(sh); } catch (IllegalArgumentException e1) { e1.printStackTrace(); } catch (IllegalStateException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } b.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { mp.prepare(); //mp.prepareAsync(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mp.start(); } });
0
10,089,043
04/10/2012 12:44:00
1,324,053
04/10/2012 12:31:30
1
0
How can I get through a proxy server?
I am working in a company, where all my browsing is through a proxy server. Currently, I am trying to run an application on windows 2000, in which I have to specify a url of remote server to get connected to it. This application is run on my home laptop with a simple usb modem like MTS broadband, it works fine, i.e connects to the remote server. When if I try to run it from my office machine, it throws an error, "Server not reachable". I went to system admin and asked for the access permission. When i get the permission, the server was reachable. My question is, if I want to reach the server, without asking for special permission from system admin, how can I do it? Please tell me some way to solve this problem. Thanks.
proxy
null
null
null
null
07/22/2012 03:10:35
off topic
How can I get through a proxy server? === I am working in a company, where all my browsing is through a proxy server. Currently, I am trying to run an application on windows 2000, in which I have to specify a url of remote server to get connected to it. This application is run on my home laptop with a simple usb modem like MTS broadband, it works fine, i.e connects to the remote server. When if I try to run it from my office machine, it throws an error, "Server not reachable". I went to system admin and asked for the access permission. When i get the permission, the server was reachable. My question is, if I want to reach the server, without asking for special permission from system admin, how can I do it? Please tell me some way to solve this problem. Thanks.
2
9,954,949
03/31/2012 10:04:59
777,304
05/31/2011 08:18:13
11
0
Execute command after every 1 minute in C#
I am working on a project with serial port. I want to Write command to serial port after every 1, 2 or x minute. serialport1.write("AT"); I have a Timer and I am show Date and Time in my form with that timer . If there is any way to send above command with that timer or by using datetime. I read lot of posts but didn't understand, as I am starter in C# language.
c#
datetime
timer
serial-port
timertask
null
open
Execute command after every 1 minute in C# === I am working on a project with serial port. I want to Write command to serial port after every 1, 2 or x minute. serialport1.write("AT"); I have a Timer and I am show Date and Time in my form with that timer . If there is any way to send above command with that timer or by using datetime. I read lot of posts but didn't understand, as I am starter in C# language.
0
334,171
12/02/2008 14:49:09
5,056
09/07/2008 15:43:17
2,151
107
Outsourcing a project that needs an improvement in code quality
As my company's sole internal developer one of my main tasks is the maintenance of a medium sized inventory tracking .NET web forms application. The application itself was coded initially by a half-insane programmer with questionable credentials using many techniques (including such high-minded concepts as Ajax and N-tier architecture) that he didn't quite 'get'. It of course has no automated tests, no formal spec, no changelog - heck, before I got there they had never even heard of source control. As you can imagine, the application is incredibly difficult to work with, simple changes take days and routinely break unrelated components in unpredictable ways. Management has thus far refused to give me time to rewrite the application preferring to fight fires. They do however acknowledge the problem and have decreed that the solution lies in outsourcing. Now I am skeptical of the ability of this approach to result in an improvement in code quality but with no numbers to put behind any alternatives I am willing to give it a try. I would like to press the team to work in an ALT.NET/Agile fashion, short iterations, full unit testing, and a strongly decoupled architecture as I feel like this is the most likely way to get solid work out of the team. I am wondering if anyone has any experience with a similar project and any advice they might have. Our company has zero outsourcing experience and the research I have done on this is actually quite negative for this type of project and given our restrictions so any ideas or comments in general are more than welcome.
outsourcing
null
null
null
null
09/23/2011 05:08:44
off topic
Outsourcing a project that needs an improvement in code quality === As my company's sole internal developer one of my main tasks is the maintenance of a medium sized inventory tracking .NET web forms application. The application itself was coded initially by a half-insane programmer with questionable credentials using many techniques (including such high-minded concepts as Ajax and N-tier architecture) that he didn't quite 'get'. It of course has no automated tests, no formal spec, no changelog - heck, before I got there they had never even heard of source control. As you can imagine, the application is incredibly difficult to work with, simple changes take days and routinely break unrelated components in unpredictable ways. Management has thus far refused to give me time to rewrite the application preferring to fight fires. They do however acknowledge the problem and have decreed that the solution lies in outsourcing. Now I am skeptical of the ability of this approach to result in an improvement in code quality but with no numbers to put behind any alternatives I am willing to give it a try. I would like to press the team to work in an ALT.NET/Agile fashion, short iterations, full unit testing, and a strongly decoupled architecture as I feel like this is the most likely way to get solid work out of the team. I am wondering if anyone has any experience with a similar project and any advice they might have. Our company has zero outsourcing experience and the research I have done on this is actually quite negative for this type of project and given our restrictions so any ideas or comments in general are more than welcome.
2
10,067,700
04/09/2012 00:27:18
553,877
12/25/2010 16:21:42
390
6
Git: push a different changeset to heroku
I want to push a previous version of my repository. How can I push to heroku a previous changeset? something like: > git push heroku 07226c49428354b09349ec45078122ce7cd410c8 thanks!
git
heroku
changeset
null
null
null
open
Git: push a different changeset to heroku === I want to push a previous version of my repository. How can I push to heroku a previous changeset? something like: > git push heroku 07226c49428354b09349ec45078122ce7cd410c8 thanks!
0
11,112,873
06/20/2012 04:36:16
1,467,995
06/20/2012 02:41:20
1
0
How do you use rand() function to ask different questions each time?
What code is used for this type of problem? Also where do you place the code for the rand() in the top or bottom?
c++
null
null
null
null
06/20/2012 06:10:23
not a real question
How do you use rand() function to ask different questions each time? === What code is used for this type of problem? Also where do you place the code for the rand() in the top or bottom?
1
8,184,424
11/18/2011 15:00:09
108,915
05/18/2009 17:01:57
3,291
119
Access a Windows dll from Java under Linux (probably through Wine)
I've managed to run JavaFX 2.0 under Linux by following [this guide][1]. It works nicely by running a Windows version of Java by using Wine. This Java process can pick up the native .dll files of the Windows version of JavaFX. Now I wonder if there is a different solution that runs a Linux version of Java but somehow makes access to the .dll files through Wine. To sum it up graphically: - **works:** Wine -> Java(win) -> DLL(win) - **what I'm asking:** Java(linux) -> Wine -> DLL(win) ##Why I want to do it## I have the hope to make the application start like any other Java application and only require an installation of Wine. The already working solution requires a Wine installation *and* a Windows version of Java. [1]: http://andre86blog.blogspot.com/search/label/javafx
java
linux
jni
wine
winelib
null
open
Access a Windows dll from Java under Linux (probably through Wine) === I've managed to run JavaFX 2.0 under Linux by following [this guide][1]. It works nicely by running a Windows version of Java by using Wine. This Java process can pick up the native .dll files of the Windows version of JavaFX. Now I wonder if there is a different solution that runs a Linux version of Java but somehow makes access to the .dll files through Wine. To sum it up graphically: - **works:** Wine -> Java(win) -> DLL(win) - **what I'm asking:** Java(linux) -> Wine -> DLL(win) ##Why I want to do it## I have the hope to make the application start like any other Java application and only require an installation of Wine. The already working solution requires a Wine installation *and* a Windows version of Java. [1]: http://andre86blog.blogspot.com/search/label/javafx
0
9,238,510
02/11/2012 07:11:46
1,203,462
02/11/2012 07:05:20
1
0
Android Webview explicit page unload or stop previous page java script activities
I have a web based android application which uses Webview, it connects to a remote HTTP Server and brings HTML pages to be rendered in Webview. Each HTML page have some controls and every control action triggers a HTTP POST ajax request to the server. When the page loads, it first issues HTTP POST ajax requests to update the control states. Every new page which comes from the server gets reloaded/refreshed(using JS 'setInterval') in every 5 minutes. The problem is that in the Webview when the page transits to a new page, the previous page Java Script activities still continues and hence the previous page AJAX requests increases the network bandwidth. Is there a solution to stop the Javascript activities of the previous page in the webview, so that only the current/active page script works. Preferably the solution should still have cache enabled, I want to avoid bringing in same pages from the server in less than 5 minutes. Thanks In Advance Ash
android
ajax
webview
unload
null
null
open
Android Webview explicit page unload or stop previous page java script activities === I have a web based android application which uses Webview, it connects to a remote HTTP Server and brings HTML pages to be rendered in Webview. Each HTML page have some controls and every control action triggers a HTTP POST ajax request to the server. When the page loads, it first issues HTTP POST ajax requests to update the control states. Every new page which comes from the server gets reloaded/refreshed(using JS 'setInterval') in every 5 minutes. The problem is that in the Webview when the page transits to a new page, the previous page Java Script activities still continues and hence the previous page AJAX requests increases the network bandwidth. Is there a solution to stop the Javascript activities of the previous page in the webview, so that only the current/active page script works. Preferably the solution should still have cache enabled, I want to avoid bringing in same pages from the server in less than 5 minutes. Thanks In Advance Ash
0
4,024,439
10/26/2010 14:00:33
150,358
08/04/2009 13:31:31
143
5
How shall I setup user event notifications in my code?
I'm coding a team collaboration web app in PHP, and I have a few events that users get notified about through email and/or SMS. The current way I'm doing it is as follows: - Every user has his notification settings in the database as boolean variables. - Say users would be notified when someone comments on the team's page. When the function that posts a comment is called, the same function would contain extra code that checks "who wants to be notified about this?" and then sends notifications to them (which slows down the function a bit). Is there a more efficient/faster/flexible way to setup notifications? maybe through a script that runs via a cron job? or shall I just keep doing it this way? I appreciate your help.
php
notifications
null
null
null
null
open
How shall I setup user event notifications in my code? === I'm coding a team collaboration web app in PHP, and I have a few events that users get notified about through email and/or SMS. The current way I'm doing it is as follows: - Every user has his notification settings in the database as boolean variables. - Say users would be notified when someone comments on the team's page. When the function that posts a comment is called, the same function would contain extra code that checks "who wants to be notified about this?" and then sends notifications to them (which slows down the function a bit). Is there a more efficient/faster/flexible way to setup notifications? maybe through a script that runs via a cron job? or shall I just keep doing it this way? I appreciate your help.
0
7,911,882
10/27/2011 05:01:51
900,199
08/18/2011 08:30:19
28
1
Find an item in a text
I'm having a list and a text. For example, **ListA:** apple, fruit > **Text:** Apple is a fruit I need to match the item in the list to the text and highlight it like '**Apple** is a **fruit**' . How can I do this?
c#
javascript
jquery
linq
null
10/27/2011 05:16:14
not a real question
Find an item in a text === I'm having a list and a text. For example, **ListA:** apple, fruit > **Text:** Apple is a fruit I need to match the item in the list to the text and highlight it like '**Apple** is a **fruit**' . How can I do this?
1
11,682,785
07/27/2012 06:48:17
309,131
04/05/2010 09:51:47
63
0
Need design guidance on passing binary content back and forth between VB6 and .NET
I have C# .NET COM visible utility DLL and It is used in a VB6 application. The scenario goes like this: - BLOB field has a binary content of a file. - VB6 application reads the BLOB into record set. - Pass the binary content to .NET DLL. - .NET DLL process the binary content and the result is sent back to VB6 application. - VB6 application updates the BLOB filed with the resultant binary content. I need advice on proper way of passing binary data back and forth between VB6 and .NET, I assume I can achieve this in any of the following ways. 1. <strike>**Create temporary files from binary content. Pass the file path.**</strike> *(VB6 application is restricted to not to create any temporary files. so #1 is out of the league.)* 2. **Convert the binary content into byte array and send it to .NET DLL. Once it is processed .NET DLL returns byte array** *(This one needs parameters passed by "ref". I am concerned about the possible memory leak.)* 3. **Instead of sending byte array, send the blob content as a string from VB6 to .NET dll, once the string is received, .NET code convert input string into byte array, process it then convert back to binary string and returns the string back to VB6 application.** *(My main concern here is encoding conversion and possible data corruption when passing it as a string.)* Which one is the best practice? and Why? Are there any other ways?
c#
.net
com
vb6
interop
07/27/2012 12:16:50
not constructive
Need design guidance on passing binary content back and forth between VB6 and .NET === I have C# .NET COM visible utility DLL and It is used in a VB6 application. The scenario goes like this: - BLOB field has a binary content of a file. - VB6 application reads the BLOB into record set. - Pass the binary content to .NET DLL. - .NET DLL process the binary content and the result is sent back to VB6 application. - VB6 application updates the BLOB filed with the resultant binary content. I need advice on proper way of passing binary data back and forth between VB6 and .NET, I assume I can achieve this in any of the following ways. 1. <strike>**Create temporary files from binary content. Pass the file path.**</strike> *(VB6 application is restricted to not to create any temporary files. so #1 is out of the league.)* 2. **Convert the binary content into byte array and send it to .NET DLL. Once it is processed .NET DLL returns byte array** *(This one needs parameters passed by "ref". I am concerned about the possible memory leak.)* 3. **Instead of sending byte array, send the blob content as a string from VB6 to .NET dll, once the string is received, .NET code convert input string into byte array, process it then convert back to binary string and returns the string back to VB6 application.** *(My main concern here is encoding conversion and possible data corruption when passing it as a string.)* Which one is the best practice? and Why? Are there any other ways?
4
6,973,693
08/07/2011 15:23:32
353,528
05/29/2010 10:38:24
16
0
Displaying a blob image in a jsp page using Spring MVC 3
I have a class with (amongst others) the field picture which is retreived from the database: public class Person { String name; Blob picture; } So then I haven a controller where I add the person object to the model @RequestMapping(value = "/online", method = RequestMethod.GET) public String getCurrentUser(Model model) { Person person = getMyPerson() model.addAttribute("person", person); return "online"; } And finally I have a .jsp page to display the user: <html> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> ..some tags Persons name: ${person.name} Persons picture: ?your_answer_here? </html> So the question (obviously) is how do I display the blob field as an image? I have tried and failed with <img src=${person.picture} />. I really don't want to perform a new query to the database, I just want to display the image I already have ..
spring
jsp
spring-mvc
null
null
null
open
Displaying a blob image in a jsp page using Spring MVC 3 === I have a class with (amongst others) the field picture which is retreived from the database: public class Person { String name; Blob picture; } So then I haven a controller where I add the person object to the model @RequestMapping(value = "/online", method = RequestMethod.GET) public String getCurrentUser(Model model) { Person person = getMyPerson() model.addAttribute("person", person); return "online"; } And finally I have a .jsp page to display the user: <html> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> ..some tags Persons name: ${person.name} Persons picture: ?your_answer_here? </html> So the question (obviously) is how do I display the blob field as an image? I have tried and failed with <img src=${person.picture} />. I really don't want to perform a new query to the database, I just want to display the image I already have ..
0
7,605,736
09/30/2011 03:46:52
433,998
08/29/2010 00:30:38
18
1
Drupal - accessing a standalone php file
How would you reference an actual file in a Drupal project? I have a flash app that needs to talk to a php script, but I can't just say "http://{domain}/{filepath}/{file}" or even "http://{domain}/{file}" assuming there was some assumed pathing structure. To get more specific, the file lives in /sites/all/flash/postit.php. How would Drupal tie it's database driven content to an actual file?
php
drupal
null
null
null
null
open
Drupal - accessing a standalone php file === How would you reference an actual file in a Drupal project? I have a flash app that needs to talk to a php script, but I can't just say "http://{domain}/{filepath}/{file}" or even "http://{domain}/{file}" assuming there was some assumed pathing structure. To get more specific, the file lives in /sites/all/flash/postit.php. How would Drupal tie it's database driven content to an actual file?
0
9,443,131
02/25/2012 10:17:36
371,239
06/19/2010 21:09:18
452
2
Boost Spirit Auto Parser fails for a tuple of doubles
At the following code I am trying to use [Boost Spirit Auto Parser][1] for a sequence or two doubles, but it doesn't compile. What am I doing wrong here? // file main.cpp #include <boost/tuple/tuple.hpp> #include <boost/spirit/include/qi.hpp> namespace qi = boost::spirit::qi; int main() { boost::tuple<double, double> p; char* i = 0; qi::phrase_parse( i, i, p, qi::space ); // qi::phrase_parse( i, i, qi::double_ >> qi::double_, qi::space, qi::skip_flag::postskip, p ); return 0; } The commented out line compiles, so it accepts `boost::tuple<double, double>` as the attribute type of `qi::double_ >> qi::double_`; but it fails to obtain the parser from the attribute type. Why? [1]: http://www.boost.org/doc/libs/1_48_0/libs/spirit/doc/html/spirit/qi/reference/auto.html
c++
parsing
auto
boost-spirit-qi
boost-tuples
null
open
Boost Spirit Auto Parser fails for a tuple of doubles === At the following code I am trying to use [Boost Spirit Auto Parser][1] for a sequence or two doubles, but it doesn't compile. What am I doing wrong here? // file main.cpp #include <boost/tuple/tuple.hpp> #include <boost/spirit/include/qi.hpp> namespace qi = boost::spirit::qi; int main() { boost::tuple<double, double> p; char* i = 0; qi::phrase_parse( i, i, p, qi::space ); // qi::phrase_parse( i, i, qi::double_ >> qi::double_, qi::space, qi::skip_flag::postskip, p ); return 0; } The commented out line compiles, so it accepts `boost::tuple<double, double>` as the attribute type of `qi::double_ >> qi::double_`; but it fails to obtain the parser from the attribute type. Why? [1]: http://www.boost.org/doc/libs/1_48_0/libs/spirit/doc/html/spirit/qi/reference/auto.html
0
7,677,182
10/06/2011 16:05:37
982,519
10/06/2011 15:49:57
1
0
J2EE authentication and authorization
I am creating a website using J2EE. I have created a table in a PostgreSQL database for the user data(username, password, role). I want to make a security realm or something like that in which to put some of the servlets. If a user sends a request to one of the servlets in the security realm and is not loged in, I want to redirect them to the login page. The problem that I am having is that I don't know how to verify if the user is loged in or not when the request is received on the server. Should I use a session id or cookie? I've also searched a lot on form based authentication but I haven't found a way to compare the received data with the data stored in my database. I'm sorry if the subject is discussed somewhere else but I'm trying to solve this issue for a couple of weeks now. Thank you very much!
authentication
java-ee
authorization
web
null
10/07/2011 15:12:33
not constructive
J2EE authentication and authorization === I am creating a website using J2EE. I have created a table in a PostgreSQL database for the user data(username, password, role). I want to make a security realm or something like that in which to put some of the servlets. If a user sends a request to one of the servlets in the security realm and is not loged in, I want to redirect them to the login page. The problem that I am having is that I don't know how to verify if the user is loged in or not when the request is received on the server. Should I use a session id or cookie? I've also searched a lot on form based authentication but I haven't found a way to compare the received data with the data stored in my database. I'm sorry if the subject is discussed somewhere else but I'm trying to solve this issue for a couple of weeks now. Thank you very much!
4
4,126,509
11/08/2010 17:54:40
312,381
04/08/2010 23:47:32
1
3
Image compression software
I need an image compression program that works in Linux that is capable of compressing all the major image formats. I need it for my tomcat webserver so if it was a Java implementation, that would be great (I know, not likely). I have looked around and only came across GraphicsMagick/ImageMagick (which are excellent) but are written in C and I only need an application that does compression so they are a bit feature rich for my needs. Thanks for your help.
java
linux
tomcat
compression
graphicsmagick
null
open
Image compression software === I need an image compression program that works in Linux that is capable of compressing all the major image formats. I need it for my tomcat webserver so if it was a Java implementation, that would be great (I know, not likely). I have looked around and only came across GraphicsMagick/ImageMagick (which are excellent) but are written in C and I only need an application that does compression so they are a bit feature rich for my needs. Thanks for your help.
0
1,642,304
10/29/2009 08:34:34
181,748
09/30/2009 10:59:53
44
0
PHP Object Validation
I'm currently working on an OO PHP application. I have a class called validation which I would like to use to check all of the data submitted is valid, however I obviously need somewhere to define the rules for each property to be checked. At the moment, I'm using arrays during the construction of a new object. eg: $this->name = array( 'maxlength' => 10, 'minlength' => 2, 'required' => true, 'value' => $namefromparameter ) One array for each property. I would then call a static method from the validation class which would carry out various checks depending on the values defined in each array. Is there a more efficient way of doing this? Any advice appreciated. Thanks.
php
object
validation
null
null
null
open
PHP Object Validation === I'm currently working on an OO PHP application. I have a class called validation which I would like to use to check all of the data submitted is valid, however I obviously need somewhere to define the rules for each property to be checked. At the moment, I'm using arrays during the construction of a new object. eg: $this->name = array( 'maxlength' => 10, 'minlength' => 2, 'required' => true, 'value' => $namefromparameter ) One array for each property. I would then call a static method from the validation class which would carry out various checks depending on the values defined in each array. Is there a more efficient way of doing this? Any advice appreciated. Thanks.
0
6,086,212
05/22/2011 05:16:28
591,656
01/27/2011 04:04:03
692
50
Parse Enum with FlagsAttribute to a SqlParameter
I've got an Enum with Flags attribute. [Flags] public enum AlcoholStatus { NotRecorded = 1, Drinker = 2, NonDrinker = 4 } I am creating a Sqlparameter as below. new SqlParameter("@AlcoholStatus", SqlDbType.VarChar) {Value = (int) AlcoholStatus} If AlcoholStatus has all the values (NotRecorded | Drinker | NonDrinker) it returns 7 as the value for the SqlParameter. I am parsing this parameter for a stored procedure and I prefer if I can parse the value as "1,2,3,". What's the best way of doing this? Or is there any other easy way to filter records by parsing integer value 7 to the stored procedure?
c#
sql
sql-server
stored-procedures
enums
null
open
Parse Enum with FlagsAttribute to a SqlParameter === I've got an Enum with Flags attribute. [Flags] public enum AlcoholStatus { NotRecorded = 1, Drinker = 2, NonDrinker = 4 } I am creating a Sqlparameter as below. new SqlParameter("@AlcoholStatus", SqlDbType.VarChar) {Value = (int) AlcoholStatus} If AlcoholStatus has all the values (NotRecorded | Drinker | NonDrinker) it returns 7 as the value for the SqlParameter. I am parsing this parameter for a stored procedure and I prefer if I can parse the value as "1,2,3,". What's the best way of doing this? Or is there any other easy way to filter records by parsing integer value 7 to the stored procedure?
0
4,886,263
02/03/2011 12:40:44
307,203
04/01/2010 19:25:46
27
2
Basic Web Design Question
I have a few basic questions about web design. 1. What is the optimum size of web page in kB? 2. What resolutions are most commonly used? (best to use?) Thank you!
css
design
web
resolution
null
02/03/2011 13:57:24
not constructive
Basic Web Design Question === I have a few basic questions about web design. 1. What is the optimum size of web page in kB? 2. What resolutions are most commonly used? (best to use?) Thank you!
4
8,666,548
12/29/2011 10:20:09
950,176
09/17/2011 11:26:09
61
5
How to resolve screen ghosting issue in Kindle?
I am using KRepaintManager.paintImmediately(root, true) from start() in my main class that extends AbstractKindlet to refresh the screen, but there are still ghosting issue there. When pressing and dismissing Menu - the screen clears up. I am wondering what code is doing after the Menu is dismissed? How to resolve ghosting issue Kindle device?
kindle
kindle-fire
kindle-kdk
null
null
null
open
How to resolve screen ghosting issue in Kindle? === I am using KRepaintManager.paintImmediately(root, true) from start() in my main class that extends AbstractKindlet to refresh the screen, but there are still ghosting issue there. When pressing and dismissing Menu - the screen clears up. I am wondering what code is doing after the Menu is dismissed? How to resolve ghosting issue Kindle device?
0
10,322,202
04/25/2012 19:09:09
899,890
08/18/2011 04:40:13
11
0
HTML+JavaScript GUI Advice
I'm working on a music editor/sequencer app that will be written in JavaScript+HTML5 and will make use of the canvas element and Chrome's Web Audio API (I already have a [simple prototype working](http://www.cs.mcgill.ca/~mcheva/musictoy/main.html)). One of the things I'm not so sure about is how to implement the GUI for this. It will need to have many different views, and I'd like to perhaps have each view in a different clickable "tab", with one tab in the foreground at a given time and all the others hidden. I'm just not sure how to go about implementing all these tabs. Would it be better to implement each tab as a different HTML layer and have buttons control which layer shows up on top? Would it be better instead to (re)generate HTML on the fly when the tab buttons are pressed? Your advice is appreciated.
javascript
html5
gui
tabs
null
null
open
HTML+JavaScript GUI Advice === I'm working on a music editor/sequencer app that will be written in JavaScript+HTML5 and will make use of the canvas element and Chrome's Web Audio API (I already have a [simple prototype working](http://www.cs.mcgill.ca/~mcheva/musictoy/main.html)). One of the things I'm not so sure about is how to implement the GUI for this. It will need to have many different views, and I'd like to perhaps have each view in a different clickable "tab", with one tab in the foreground at a given time and all the others hidden. I'm just not sure how to go about implementing all these tabs. Would it be better to implement each tab as a different HTML layer and have buttons control which layer shows up on top? Would it be better instead to (re)generate HTML on the fly when the tab buttons are pressed? Your advice is appreciated.
0
10,474,166
05/06/2012 20:47:55
1,186,127
02/02/2012 20:56:36
15
2
Java: Getting multiple lines from socket
I have a Java application that consists of a client and a server. The client sends encrypted commands to the server, and the server executes them. The problem that I am having right now is that, with my encryption algorithm, sometimes the encrypted command contains "\n" or "\r" characters, which mess up my server code. This is because I am using the readLine() method, which stops when it finds a line terminator. What I need is a way to read all the characters the client sends into one string. Here is my code: public void run(){ System.out.println("Accepted Client!"); try{ in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), "ISO8859_1")); out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream(), "ISO8859_1")); String clientCommand = null; while(RunThread){ // read incoming stream do{ clientCommand = in.readLine(); }while(clientCommand == null); //decrypt the data System.out.println("Client: " + clientCommand); if(clientCommand.equalsIgnoreCase("quit")){ RunThread = false; }else{ //do something out.flush(); } } }catch(Exception e){ e.printStackTrace(); } } Everything I've tried (various forms of nested loops using the read() function) hasn't worked. I would welcome any help or suggestions. Thanks, everyone!
java
sockets
line
null
null
null
open
Java: Getting multiple lines from socket === I have a Java application that consists of a client and a server. The client sends encrypted commands to the server, and the server executes them. The problem that I am having right now is that, with my encryption algorithm, sometimes the encrypted command contains "\n" or "\r" characters, which mess up my server code. This is because I am using the readLine() method, which stops when it finds a line terminator. What I need is a way to read all the characters the client sends into one string. Here is my code: public void run(){ System.out.println("Accepted Client!"); try{ in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), "ISO8859_1")); out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream(), "ISO8859_1")); String clientCommand = null; while(RunThread){ // read incoming stream do{ clientCommand = in.readLine(); }while(clientCommand == null); //decrypt the data System.out.println("Client: " + clientCommand); if(clientCommand.equalsIgnoreCase("quit")){ RunThread = false; }else{ //do something out.flush(); } } }catch(Exception e){ e.printStackTrace(); } } Everything I've tried (various forms of nested loops using the read() function) hasn't worked. I would welcome any help or suggestions. Thanks, everyone!
0
84,859
09/17/2008 16:05:45
88,252
09/17/2008 15:52:45
1
0
Writing data over RxTx using usbserial?
I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial. One of my biggest problems is that the RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY does not work on linux over usbserial. How do I know when I should write to the stream? Any indicators I might have missed? So far my experience with writing and reading concurrently have not been great. Does anyone know if I should lock the DATA_AVAILABLE handler from being invoked while I'm writing on the stream? Or RxTx accepts concurrent read/writes? Thanks in advance
linux
usbserial
data-available
rxtx
null
null
open
Writing data over RxTx using usbserial? === I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial. One of my biggest problems is that the RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY does not work on linux over usbserial. How do I know when I should write to the stream? Any indicators I might have missed? So far my experience with writing and reading concurrently have not been great. Does anyone know if I should lock the DATA_AVAILABLE handler from being invoked while I'm writing on the stream? Or RxTx accepts concurrent read/writes? Thanks in advance
0
4,744,913
01/20/2011 08:35:03
330,867
05/02/2010 15:24:00
274
17
Java : Is there a way to automatically cast a return value ?
I have two classes : public abstract class Arguments { public List execute() { // do some stuff and return a list } } // and a child : public class ItemArguments { public List<Item> execute() { return super.execute(); } } As you can see, the method execute in ItemArguments is a bit useless, but without it, I have to cast all my calls to the execute method in Arguments. Is there a way to remove the execute method in ItemArguments and avoid having the cast to do where the calls are made ? Thanks for your help!
java
inheritance
types
null
null
null
open
Java : Is there a way to automatically cast a return value ? === I have two classes : public abstract class Arguments { public List execute() { // do some stuff and return a list } } // and a child : public class ItemArguments { public List<Item> execute() { return super.execute(); } } As you can see, the method execute in ItemArguments is a bit useless, but without it, I have to cast all my calls to the execute method in Arguments. Is there a way to remove the execute method in ItemArguments and avoid having the cast to do where the calls are made ? Thanks for your help!
0
6,809,982
07/24/2011 21:52:17
689,991
04/03/2011 16:19:35
413
4
Picking a good book for Information System Design
I am a Computer Science student. In this semester I am taking a course named : Information System Design. Teachers refereed to [System Analysis Design by Alan Dennis](http://www.amazon.com/Systems-Analysis-Design-Alan-Dennis/dp/0470228547) for this course. But I dont like this book at all. Whenever I am reading it I feels like I just have to read and memorize all of these pointless(mostly old) stuff to write then on the answer script. I was looking for something which is biased toward the real world practical work oriented, and on the fly I will learn differnt approaches with examples. For example, I am an aspiring indie game developers. I haven't worked out any TDD or Agile development methodology in my workflow. So, I want to study them in such a way, so I can use those knowledge directly. I am looking for a good book, that will teach me all the necessary things about modern Software Development Life Cycle(SDLC), and I will grab necessary juice to use them with my workflow. Rather then following classes I prefer to study book. Any other ideas or guidelines are welcome.
books
suggestions
null
null
null
07/26/2011 09:43:18
off topic
Picking a good book for Information System Design === I am a Computer Science student. In this semester I am taking a course named : Information System Design. Teachers refereed to [System Analysis Design by Alan Dennis](http://www.amazon.com/Systems-Analysis-Design-Alan-Dennis/dp/0470228547) for this course. But I dont like this book at all. Whenever I am reading it I feels like I just have to read and memorize all of these pointless(mostly old) stuff to write then on the answer script. I was looking for something which is biased toward the real world practical work oriented, and on the fly I will learn differnt approaches with examples. For example, I am an aspiring indie game developers. I haven't worked out any TDD or Agile development methodology in my workflow. So, I want to study them in such a way, so I can use those knowledge directly. I am looking for a good book, that will teach me all the necessary things about modern Software Development Life Cycle(SDLC), and I will grab necessary juice to use them with my workflow. Rather then following classes I prefer to study book. Any other ideas or guidelines are welcome.
2
7,686,771
10/07/2011 11:45:42
983,900
10/07/2011 11:37:24
1
0
Table Syntax in Loop
I am trying to use a loop for table syntax. I have to run set of variables 18 times on filter, but instead of writing 18 times i will write one time and run in loop. Please guide me for which command or loop syntax to be used. Thanks in advance and waiting for responses. Regards Bharadwaj
spss
null
null
null
null
10/07/2011 17:28:18
not a real question
Table Syntax in Loop === I am trying to use a loop for table syntax. I have to run set of variables 18 times on filter, but instead of writing 18 times i will write one time and run in loop. Please guide me for which command or loop syntax to be used. Thanks in advance and waiting for responses. Regards Bharadwaj
1
545,254
02/13/2009 09:03:05
64,979
02/11/2009 09:35:15
26
5
Sinatra success stories
Have you used Sinatra successfully? What kind of a project was it? In what situations would you recommend using Sinatra instead of Rails or Merb? (Yes, there is a list at http://www.sinatrarb.com/wild.html, but I'd like to hear a bit more about them. I also suspect that there are lots of successful Sinatra projects outside that list.)
ruby
sinatra
web-frameworks
null
null
05/23/2011 13:14:15
off topic
Sinatra success stories === Have you used Sinatra successfully? What kind of a project was it? In what situations would you recommend using Sinatra instead of Rails or Merb? (Yes, there is a list at http://www.sinatrarb.com/wild.html, but I'd like to hear a bit more about them. I also suspect that there are lots of successful Sinatra projects outside that list.)
2
1,932,346
12/19/2009 08:14:13
232,700
12/16/2009 06:49:15
1
0
Sending Multiple Commands in TCPClient
I am trying to use private TcpClient tcpClient; in a class and every time when I send a command like LIST, RETR, STOR, I used to lock the TCPCLient for that particular time of execution of commands and getting response. Now when I send the other command in between the one is executing, It doesn't able to lock that tcpclient instance again. How should I send the other command when one is executing. For all commands I need to lock the TCPClient, that I can't change.
tcpclient
null
null
null
null
null
open
Sending Multiple Commands in TCPClient === I am trying to use private TcpClient tcpClient; in a class and every time when I send a command like LIST, RETR, STOR, I used to lock the TCPCLient for that particular time of execution of commands and getting response. Now when I send the other command in between the one is executing, It doesn't able to lock that tcpclient instance again. How should I send the other command when one is executing. For all commands I need to lock the TCPClient, that I can't change.
0
10,701,023
05/22/2012 11:21:25
1,224,003
02/21/2012 17:48:34
324
53
check if bitmap is null
Bitmap bmp; bmp = (Android.Graphics.Bitmap)data.Extras.Get("data"); CallToFunction (bmp); Calling a function with Bitmap. private void CallToFunction(Bitmap bmp) { if(bmp) { } }
android
monodroid
null
null
null
05/22/2012 23:08:23
not a real question
check if bitmap is null === Bitmap bmp; bmp = (Android.Graphics.Bitmap)data.Extras.Get("data"); CallToFunction (bmp); Calling a function with Bitmap. private void CallToFunction(Bitmap bmp) { if(bmp) { } }
1
6,242,799
06/05/2011 12:07:21
66,593
02/15/2009 08:10:45
813
2
Question on sorting.. confused!!
There is a question and I have the solution to it also, but I am confused and I am not able to understand it.. Please if anybody can put their thoughts forward.... ---- Question There are 128 placyers participating in a tennis tournament. Assume that the "x beats y" relationship is transitive, i.e., for all players A, B and C, if A beats B and B beats C, then A beats C. What is the least number of matches we need to organize to find the best player? How many matches do you need to find the best and the second best player?? --- Answer First we consider the problem of finding the best player. Each game eliminates one player and there 128 players, so 127 matches are necessary and also sufficient. >>>> Understood.... To find the second best, we note that the only candidates are the players who are beaten by the player who is eventually determined to be the best - everyone else lost to someone who is not the best. >>>> Understanding (Those who are lost by the best players are the candidates of second best???? rite???) To find the best player, the order in which we organize the matches is inconsequential - we just pick pairs from the set of candidates and who ever loses is removed from the pool of candidates. However if we proceed in an arbitrary order, we might start with the best player, who defeats 127 other players and then the players who lost need to play 126 matches amongst themselves to find the second best. >>>>>>>>>>.. confused We can do much better by organizing the matches as a binary tree - we pair of players arbitrarily who play 64 matches. After these matches we are left with 64 candidates; we pair them off again arbitrarily and they play 32 matches. Proceeding in this fashion, we organize the 127 matches needed to find the best player and the winner who have played only 7 matches. Therefore we can find the second best player by organizing 6 matches between 7 players who lost to the best player, for a total of 134 matches. >>>>>>> confused......
algorithm
puzzle
null
null
null
06/05/2011 23:51:35
not a real question
Question on sorting.. confused!! === There is a question and I have the solution to it also, but I am confused and I am not able to understand it.. Please if anybody can put their thoughts forward.... ---- Question There are 128 placyers participating in a tennis tournament. Assume that the "x beats y" relationship is transitive, i.e., for all players A, B and C, if A beats B and B beats C, then A beats C. What is the least number of matches we need to organize to find the best player? How many matches do you need to find the best and the second best player?? --- Answer First we consider the problem of finding the best player. Each game eliminates one player and there 128 players, so 127 matches are necessary and also sufficient. >>>> Understood.... To find the second best, we note that the only candidates are the players who are beaten by the player who is eventually determined to be the best - everyone else lost to someone who is not the best. >>>> Understanding (Those who are lost by the best players are the candidates of second best???? rite???) To find the best player, the order in which we organize the matches is inconsequential - we just pick pairs from the set of candidates and who ever loses is removed from the pool of candidates. However if we proceed in an arbitrary order, we might start with the best player, who defeats 127 other players and then the players who lost need to play 126 matches amongst themselves to find the second best. >>>>>>>>>>.. confused We can do much better by organizing the matches as a binary tree - we pair of players arbitrarily who play 64 matches. After these matches we are left with 64 candidates; we pair them off again arbitrarily and they play 32 matches. Proceeding in this fashion, we organize the 127 matches needed to find the best player and the winner who have played only 7 matches. Therefore we can find the second best player by organizing 6 matches between 7 players who lost to the best player, for a total of 134 matches. >>>>>>> confused......
1
6,805,483
07/24/2011 07:22:59
860,026
07/24/2011 07:13:34
1
0
How to Download FTP files recursively from given date to current date
I am new in c#, I want download files in subdirectories from ftp ; Than I want to download ftp files one by one from given date to current date. There are more than 50 folders in ftp site. I am using these code for downloading ftp files but the problem is I need to create more than 50 backgrounds for each file to download from ftp. The code i am using is private void DownloadEOD(string filePath, string fileName) { try { FtpWebRequest reqFTP; if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } FileStream outputStream = new FileStream(filePath + "\\" + fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite); reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + ftp + "/" + selectedDate + ".zip")); reqFTP.Method = WebRequestMethods.Ftp.DownloadFile; reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); Stream ftpStream = response.GetResponseStream(); int Length = 2048; Byte[] buffer = new Byte[Length]; int bytesRead = ftpStream.Read(buffer, 0, Length); while (bytesRead > 0) { outputStream.Write(buffer, 0, bytesRead); bytesRead = ftpStream.Read(buffer, 0, Length); } response.Close(); outputStream.Close(); reqFTP = null; reqFTP = null; string Path1 = Application.UserAppDataPath + "\\Subdirectory" + "\\" + fileName; DirectoryInfo di = new DirectoryInfo(Path1); FileInfo fi = new FileInfo(Path1); Decompress(fi); File.Delete(Path1); } catch (Exception ex) { } } Thanks In Advance.
c#
null
null
null
null
08/27/2011 15:06:11
not a real question
How to Download FTP files recursively from given date to current date === I am new in c#, I want download files in subdirectories from ftp ; Than I want to download ftp files one by one from given date to current date. There are more than 50 folders in ftp site. I am using these code for downloading ftp files but the problem is I need to create more than 50 backgrounds for each file to download from ftp. The code i am using is private void DownloadEOD(string filePath, string fileName) { try { FtpWebRequest reqFTP; if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } FileStream outputStream = new FileStream(filePath + "\\" + fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite); reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + ftp + "/" + selectedDate + ".zip")); reqFTP.Method = WebRequestMethods.Ftp.DownloadFile; reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); Stream ftpStream = response.GetResponseStream(); int Length = 2048; Byte[] buffer = new Byte[Length]; int bytesRead = ftpStream.Read(buffer, 0, Length); while (bytesRead > 0) { outputStream.Write(buffer, 0, bytesRead); bytesRead = ftpStream.Read(buffer, 0, Length); } response.Close(); outputStream.Close(); reqFTP = null; reqFTP = null; string Path1 = Application.UserAppDataPath + "\\Subdirectory" + "\\" + fileName; DirectoryInfo di = new DirectoryInfo(Path1); FileInfo fi = new FileInfo(Path1); Decompress(fi); File.Delete(Path1); } catch (Exception ex) { } } Thanks In Advance.
1
11,607,761
07/23/2012 06:57:34
1,545,113
07/23/2012 06:36:55
1
0
How can I addchild ccsprite above keyboard?
I development ios application. I want to put ccsprite above keyboard. like this [picture.][1] is this possible? please your advice. Thanks. [1]: http://comang.kr/a1.png
iphone
ios
keyboard
cocos2d
ccsprite
null
open
How can I addchild ccsprite above keyboard? === I development ios application. I want to put ccsprite above keyboard. like this [picture.][1] is this possible? please your advice. Thanks. [1]: http://comang.kr/a1.png
0
6,785,358
07/22/2011 03:31:45
857,213
07/22/2011 03:31:45
1
0
Permutate a String upper and lower case
i have a string "abc" i want to write a program (if possible in java) who permute the String for example ... abc ABC Abc aBc abC ABc abC AbC any help to do it will be much appreciated :D
permutation
uppercase
lowercase
null
null
null
open
Permutate a String upper and lower case === i have a string "abc" i want to write a program (if possible in java) who permute the String for example ... abc ABC Abc aBc abC ABc abC AbC any help to do it will be much appreciated :D
0
6,254,595
06/06/2011 15:49:18
117,039
06/04/2009 03:26:15
2,158
4
how do you use the return
When we define our methods, we have a chance to use the `return` to tell the user what's the result. I always attempt to use this existing method to give max feedback to the caller. So I like to define a application level return status enum which is shared by all the components: public enum ReturnStatusEnum { SUCCESS, FAILED, FAIL_TO_SAVE, FAIL_TO_OPEN, FAIL_TO_WRITE, FAIL_TO_READ, FAIL_TO_FIND, TIMEOUT, FAILED_NULL_OBJECT, FAILED_NONEXIST, FAILED_CANNOT_CONNECT, FAILED_WRONG_TYPE, FAILED_CANCELED, FAILED_NEGATIVE, FAILED_COMMUNICATION_DOWN, }; It is actually give user a more specific information about failure cases. Somebody may say a primitive type of `boolean` is enough why bother an object type of `enum`? How you use your `return` effectively?
java
programming-languages
null
null
null
06/06/2011 18:47:11
not constructive
how do you use the return === When we define our methods, we have a chance to use the `return` to tell the user what's the result. I always attempt to use this existing method to give max feedback to the caller. So I like to define a application level return status enum which is shared by all the components: public enum ReturnStatusEnum { SUCCESS, FAILED, FAIL_TO_SAVE, FAIL_TO_OPEN, FAIL_TO_WRITE, FAIL_TO_READ, FAIL_TO_FIND, TIMEOUT, FAILED_NULL_OBJECT, FAILED_NONEXIST, FAILED_CANNOT_CONNECT, FAILED_WRONG_TYPE, FAILED_CANCELED, FAILED_NEGATIVE, FAILED_COMMUNICATION_DOWN, }; It is actually give user a more specific information about failure cases. Somebody may say a primitive type of `boolean` is enough why bother an object type of `enum`? How you use your `return` effectively?
4
9,684,442
03/13/2012 13:01:05
1,130,069
01/04/2012 13:55:37
89
0
strange token in: for(; max != 0 ; max/=10, pow10*=10)
for(; max != 0 ; max/=10, pow10*=10) Pulled this exerpt from the wiki page on "Radix sort." I've not seen a loop that starts with a semicolon like that before. The compiler didn't catch it so I'm assuming it's legal. Can anyone explain? Also, as I've only written fairly simple loops I didn't realize that you could make multiple assignments (right word?) like "max/=10, pow10*=10" at the end of the for() statement ... Is there any limit to this? Bad form? Thanks guys! (and pardon my potentially wrong vocabulary...it's early, I need more coffee...)
c++
loops
syntax
null
null
null
open
strange token in: for(; max != 0 ; max/=10, pow10*=10) === for(; max != 0 ; max/=10, pow10*=10) Pulled this exerpt from the wiki page on "Radix sort." I've not seen a loop that starts with a semicolon like that before. The compiler didn't catch it so I'm assuming it's legal. Can anyone explain? Also, as I've only written fairly simple loops I didn't realize that you could make multiple assignments (right word?) like "max/=10, pow10*=10" at the end of the for() statement ... Is there any limit to this? Bad form? Thanks guys! (and pardon my potentially wrong vocabulary...it's early, I need more coffee...)
0
447,982
01/15/2009 18:53:28
8,151
09/15/2008 15:16:47
1,104
78
LINQ to SQL Primary Key requirement for inserts fails
I'm working on better understanding Linq-to-SQL before using on a real project, so I'm playing with it on a little side project. I've a table that I'm trying to update via DataContext.SubmitChanges() and it's failing due to primary key constraints. I have no control over the table itself (I can't add an actual ID column), so instead I've modified the Linq entity to use 3 columns as a complex key. The inserts are still failing, even though the key data is unique across both the update set and the existing data in the table, and I'm curious to know why. What am I missing that forces Linq to treat these values as non unique? Note that I am not trying to solve the update problem itself - I've determined that in my situation DataContext.ExecuteCommand() will work just as well. I'm trying to grok where my understanding of Linq (or of my data) is wrong. The table structure looks like this: OPRID (char(30)) DATE (DateTime) PROJECT_ID (char(15)) HOURS (decimal) The last 3 columns are the complex key. And here's some sample data, comma delimited: cschlege, 2009-1-5, 10100, 0.8 cschlege, 2009-1-5, 10088, 1.1 cschlege, 2009-1-5, 10099, 0.8 cschlege, 2009-1-5, 10088, 1.2 The SubmitChanges() consistently fails on the last of those rows, but given a key of DATE, PROJECT_ID, HOURS those rows should be unique. It doesn't fail on the 3rd row, which has a duplication in the HOURS column, but only when it reaches the duplicate PROJECT_ID. If I remove PROJECT_ID from the complex key then the insert fails on the 3rd row, however. Why is LINQ not treating those rows as uniquely keyed?
linq-to-sql
c#
insert
null
null
01/15/2009 19:10:40
off topic
LINQ to SQL Primary Key requirement for inserts fails === I'm working on better understanding Linq-to-SQL before using on a real project, so I'm playing with it on a little side project. I've a table that I'm trying to update via DataContext.SubmitChanges() and it's failing due to primary key constraints. I have no control over the table itself (I can't add an actual ID column), so instead I've modified the Linq entity to use 3 columns as a complex key. The inserts are still failing, even though the key data is unique across both the update set and the existing data in the table, and I'm curious to know why. What am I missing that forces Linq to treat these values as non unique? Note that I am not trying to solve the update problem itself - I've determined that in my situation DataContext.ExecuteCommand() will work just as well. I'm trying to grok where my understanding of Linq (or of my data) is wrong. The table structure looks like this: OPRID (char(30)) DATE (DateTime) PROJECT_ID (char(15)) HOURS (decimal) The last 3 columns are the complex key. And here's some sample data, comma delimited: cschlege, 2009-1-5, 10100, 0.8 cschlege, 2009-1-5, 10088, 1.1 cschlege, 2009-1-5, 10099, 0.8 cschlege, 2009-1-5, 10088, 1.2 The SubmitChanges() consistently fails on the last of those rows, but given a key of DATE, PROJECT_ID, HOURS those rows should be unique. It doesn't fail on the 3rd row, which has a duplication in the HOURS column, but only when it reaches the duplicate PROJECT_ID. If I remove PROJECT_ID from the complex key then the insert fails on the 3rd row, however. Why is LINQ not treating those rows as uniquely keyed?
2
5,840,115
04/30/2011 06:47:28
669,017
03/21/2011 07:25:29
1
0
Command-line Arguments
i want to write a grep in c that it's syntax is (grep (directory) "text") that can search in txt files in this directory and if can find "text" in them print the name of files that contain it i should do it by pointers but without structure can you help me i really need it thanks alot
c
null
null
null
null
04/30/2011 06:56:34
not a real question
Command-line Arguments === i want to write a grep in c that it's syntax is (grep (directory) "text") that can search in txt files in this directory and if can find "text" in them print the name of files that contain it i should do it by pointers but without structure can you help me i really need it thanks alot
1
10,462,833
05/05/2012 14:33:30
1,361,440
04/27/2012 15:10:57
8
0
Adding method causes Compilation Error C# ASP
I am trying to create a `webpage`, but when i create a `button` and add a `method` to it a `compilation error occurs`, when i remove the `method` from the button it work fine i tried these steps 1. tried delete page, and redo it from from beginning 2. find the error `CS1061` online 3.adding method to button with different methods i am exhausted try to find what is the error pls help me! Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1061: 'ASP.usermodification_aspx' does not contain a definition for 'btnModify_Click' and no extension method 'btnModify_Click' accepting a first argument of type 'ASP.usermodification_aspx' could be found (are you missing a using directive or an assembly reference?) Source Error: Line 38: SelectCommand="SELECT RoleName FROM aspnet_Roles"></asp:SqlDataSource> Line 39: <br /> Line 40: <asp:Button ID="btnModify" runat="server" Text="Modify" Line 41: onclick="btnModify_Click" /> Line 42:
c#
sql
c#-4.0
asp-classic
compiler-errors
null
open
Adding method causes Compilation Error C# ASP === I am trying to create a `webpage`, but when i create a `button` and add a `method` to it a `compilation error occurs`, when i remove the `method` from the button it work fine i tried these steps 1. tried delete page, and redo it from from beginning 2. find the error `CS1061` online 3.adding method to button with different methods i am exhausted try to find what is the error pls help me! Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1061: 'ASP.usermodification_aspx' does not contain a definition for 'btnModify_Click' and no extension method 'btnModify_Click' accepting a first argument of type 'ASP.usermodification_aspx' could be found (are you missing a using directive or an assembly reference?) Source Error: Line 38: SelectCommand="SELECT RoleName FROM aspnet_Roles"></asp:SqlDataSource> Line 39: <br /> Line 40: <asp:Button ID="btnModify" runat="server" Text="Modify" Line 41: onclick="btnModify_Click" /> Line 42:
0
11,441,166
07/11/2012 20:42:47
315,913
04/13/2010 21:12:58
67
2
balanced payments PHP API examples
Besides the <a href="https://www.balancedpayments.com/docs/php#quickstart">useful code snippets on the balanced API for PHP</a> are there any end-to-end examples that I could follow and incorporate into my application? I have downloaded the samples at github https://github.com/balanced/balanced-php. However I'm not seeing how these interact with the user facing pages at https://gist.github.com/2662770 that utilize balanced.js. I'm looking for something that includes both parts so that I can grasp a better picture of how they interact.
php
null
null
null
null
07/11/2012 23:08:05
not a real question
balanced payments PHP API examples === Besides the <a href="https://www.balancedpayments.com/docs/php#quickstart">useful code snippets on the balanced API for PHP</a> are there any end-to-end examples that I could follow and incorporate into my application? I have downloaded the samples at github https://github.com/balanced/balanced-php. However I'm not seeing how these interact with the user facing pages at https://gist.github.com/2662770 that utilize balanced.js. I'm looking for something that includes both parts so that I can grasp a better picture of how they interact.
1
6,695,403
07/14/2011 15:03:58
73,535
03/04/2009 06:07:06
950
59
ASP.NET Session ending abruptly
My application's session is ending abruptly and don't see any error being generated in Application_Error in Global.asax. Also, the Session_Start event fires but not Session_End. It happens after I host the application on a server and does not happen on my dev machine. The steps to generate this auto exit is to switch between pages that load and display a list of objects (Client, Managers, etc). After about 30-40 seconds of activity, the user is logged out and Login screen is displayed. Any ideas what could be going wrong behind the scenes?
asp.net
session
session-timeout
null
null
null
open
ASP.NET Session ending abruptly === My application's session is ending abruptly and don't see any error being generated in Application_Error in Global.asax. Also, the Session_Start event fires but not Session_End. It happens after I host the application on a server and does not happen on my dev machine. The steps to generate this auto exit is to switch between pages that load and display a list of objects (Client, Managers, etc). After about 30-40 seconds of activity, the user is logged out and Login screen is displayed. Any ideas what could be going wrong behind the scenes?
0
7,368,659
09/10/2011 00:01:23
766,120
05/23/2011 13:51:37
692
35
my_udf_init not called
This is my first time trying to create an udf for mysql. The docs state that `my_func_init` gets called prior to executing the main function, yet in my environment this does not seem to happen. long long charmatch(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) { return 42; } my_bool charmatch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count != 2) { strncpy(message, "charmatch() requires two arguments", 34); return EXIT_SUCCESS; } if(args->arg_type[0] != STRING_RESULT) { strncpy(message, "argument 1 must be a string", 27); return EXIT_SUCCESS; } if(args->arg_type[0] != STRING_RESULT) { strncpy(message, "argument 2 must be a string", 27); return EXIT_SUCCESS; } return EXIT_SUCCESS; } As you can see, I'm checking whether there are two arguments. In theory `SELECT CHARMATCH()` should return a message saying I must set two arguments, but it's not: it return 42. Why doesn't it return the message?
mysql
c
udf
null
null
null
open
my_udf_init not called === This is my first time trying to create an udf for mysql. The docs state that `my_func_init` gets called prior to executing the main function, yet in my environment this does not seem to happen. long long charmatch(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) { return 42; } my_bool charmatch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count != 2) { strncpy(message, "charmatch() requires two arguments", 34); return EXIT_SUCCESS; } if(args->arg_type[0] != STRING_RESULT) { strncpy(message, "argument 1 must be a string", 27); return EXIT_SUCCESS; } if(args->arg_type[0] != STRING_RESULT) { strncpy(message, "argument 2 must be a string", 27); return EXIT_SUCCESS; } return EXIT_SUCCESS; } As you can see, I'm checking whether there are two arguments. In theory `SELECT CHARMATCH()` should return a message saying I must set two arguments, but it's not: it return 42. Why doesn't it return the message?
0
10,637,670
05/17/2012 14:28:23
1,377,403
05/05/2012 22:41:24
26
1
Which FP language follows lambda calculus the closest?
Which FP language follows lambda calculus the closest in terms of its code looking, feeling, acting like lambda calculus abstractions? I've heard Haskell is the closest and purest and Lisp . . . not so much. And if allowed, I'd also like to hear opinions on whether this matters or not.
functional-programming
lambda-calculus
null
null
null
05/22/2012 12:58:56
not constructive
Which FP language follows lambda calculus the closest? === Which FP language follows lambda calculus the closest in terms of its code looking, feeling, acting like lambda calculus abstractions? I've heard Haskell is the closest and purest and Lisp . . . not so much. And if allowed, I'd also like to hear opinions on whether this matters or not.
4
3,335,578
07/26/2010 14:09:24
112,922
05/27/2009 06:06:20
1
0
ASP.NET or PHP? Soft for Real Estate Agencies
Soon I begin create CRM for Real Estate Agencies sphere. In my backround 2 years of PHP-programming & then 5 years of ASP.NET (intranet applications). & I think maybe ASP.NET (i write code on C#) have good IDE (VS 2010), but this is monster :) My application will be multiplayer webapplication for different real estate agencies (it is now fashionable to talk SAAS). Interaction over SSL via web browser. What situation with developing of web applications now? What language prefer for start new project? Pluses & Minuses of each? Or maybe choose another language? Maybe now exist standarts of data structure & exchange in real estate at this moment?
php
asp.net
real-estate
null
null
07/27/2010 14:57:53
not constructive
ASP.NET or PHP? Soft for Real Estate Agencies === Soon I begin create CRM for Real Estate Agencies sphere. In my backround 2 years of PHP-programming & then 5 years of ASP.NET (intranet applications). & I think maybe ASP.NET (i write code on C#) have good IDE (VS 2010), but this is monster :) My application will be multiplayer webapplication for different real estate agencies (it is now fashionable to talk SAAS). Interaction over SSL via web browser. What situation with developing of web applications now? What language prefer for start new project? Pluses & Minuses of each? Or maybe choose another language? Maybe now exist standarts of data structure & exchange in real estate at this moment?
4
5,138,699
02/28/2011 05:54:57
518,581
11/24/2010 10:08:13
1
0
Future of Mobile development Coding - .net or Java?
I’m a front end developer with midlevel to advanced knowledge in popular programming tools like PHP, java, VB.net, C# and Action Script 3. Now I’m planning to invest some time seriously in mobile development and have to concentrate in one of the above programming languages (except PHP, as I guess it’s not having that much presence in mobile development also I already have some good grip in it). With which technology I have to go? Java or .net? Personally I feel Android platform usage is rising in mobiles, so Java is the right choice. My rich experience in Action Script 3.0 also supporting this decision. But on the other end, the news of Windows & Nokia collaboration is confusing me. Is there anyone to shed some light?
java
.net
programming-languages
windows-mobile
mobile-development
02/28/2011 06:12:51
not constructive
Future of Mobile development Coding - .net or Java? === I’m a front end developer with midlevel to advanced knowledge in popular programming tools like PHP, java, VB.net, C# and Action Script 3. Now I’m planning to invest some time seriously in mobile development and have to concentrate in one of the above programming languages (except PHP, as I guess it’s not having that much presence in mobile development also I already have some good grip in it). With which technology I have to go? Java or .net? Personally I feel Android platform usage is rising in mobiles, so Java is the right choice. My rich experience in Action Script 3.0 also supporting this decision. But on the other end, the news of Windows & Nokia collaboration is confusing me. Is there anyone to shed some light?
4
11,372,944
07/07/2012 06:52:52
1,063,545
11/24/2011 08:53:03
179
2
Calculate time period list between 2 time in php?
I want to generate 3 time-period-list column between two times. if $start_time = '08:00 AM';' $end_time = '10:00: PM'; Time Period List As: Time-interval 30min [12:00 PM - 12:30 PM - 1:00 PM] Morning ----- Noon ----- Eve 8:00 AM 1:00 PM 6:00 PM ... ... ... to to to ... ... ... 12:00 PM 5:00 PM 10:00 PM I have calculated times between Thanks in advance to all my mates.
php
date
time
period
null
null
open
Calculate time period list between 2 time in php? === I want to generate 3 time-period-list column between two times. if $start_time = '08:00 AM';' $end_time = '10:00: PM'; Time Period List As: Time-interval 30min [12:00 PM - 12:30 PM - 1:00 PM] Morning ----- Noon ----- Eve 8:00 AM 1:00 PM 6:00 PM ... ... ... to to to ... ... ... 12:00 PM 5:00 PM 10:00 PM I have calculated times between Thanks in advance to all my mates.
0
133,194
09/25/2008 13:04:20
22,062
09/25/2008 08:59:14
1
0
Embedded Outlook View Control
I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on Windows XP SP3. My add-in is using custom Folder Home Page which displays my custom form, which wraps Outlook View Control. When I try to set Folder property of the OVC, I get COM Exception with 'Unknown Error' description every time. I am using value of the CurrentFolder.FolderPath property of the active explorer: Outlook.Explorer currentExplorer = app.ActiveExplorer(); if (currentExplorer != null) { ovcWrapper.Folder = currentExplorer.CurrentFolder.FolderPath; } Folder is located in non-default PST file. I must underline that everything worked just fine before I went to holiday :). Thanks, Nenad
c#
.net
outlook
addin
null
null
open
Embedded Outlook View Control === I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on Windows XP SP3. My add-in is using custom Folder Home Page which displays my custom form, which wraps Outlook View Control. When I try to set Folder property of the OVC, I get COM Exception with 'Unknown Error' description every time. I am using value of the CurrentFolder.FolderPath property of the active explorer: Outlook.Explorer currentExplorer = app.ActiveExplorer(); if (currentExplorer != null) { ovcWrapper.Folder = currentExplorer.CurrentFolder.FolderPath; } Folder is located in non-default PST file. I must underline that everything worked just fine before I went to holiday :). Thanks, Nenad
0
8,736,644
01/05/2012 01:48:29
542,687
12/14/2010 23:22:38
443
0
C++: Using const on local variables
Similar to <a href="http://stackoverflow.com/questions/1554750/c-const-keyword-use-liberally">this question</a>, what are the pro/cons to using const local variables like in <a href="http://stackoverflow.com/questions/1554750/c-const-keyword-use-liberally/1556259#1556259">this answer</a>?
c++
coding-style
syntax
const
null
01/08/2012 05:22:14
not a real question
C++: Using const on local variables === Similar to <a href="http://stackoverflow.com/questions/1554750/c-const-keyword-use-liberally">this question</a>, what are the pro/cons to using const local variables like in <a href="http://stackoverflow.com/questions/1554750/c-const-keyword-use-liberally/1556259#1556259">this answer</a>?
1
11,265,864
06/29/2012 16:52:33
78,162
03/14/2009 23:55:56
7,187
331
All-or-none exclusive lock on 2 SQL tables
My simplistic testing suggested that I can acquire an exclusive lock on 2 tables or postpone acquiring the lock on either until both can be acquired at once by using a query like this: SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN ('20', '10000048') AND ItemCode = @ItemCode the key feature being the CROSS JOIN used to include multiple tables in a single query. I confirmed that if an exclusive lock already exists on the OITM row for @ItemCode in another transaction, then this statement doesn't introduce any lock on ONNM until it can acquire both locks. However, in the more complex full test run, SQL profiler returns some conflicting information. I have imported the SQL profiler results into a table and executed the following query: select rownum, e.name, EventClass, TextData, SPID, ClientProcessID from #pmit t join sys.trace_events e on t.EventClass = e.trace_event_id where rownum between 275799 and 546130 and (TextData LIKE '(ca73a6396124)' or TextData LIKE '(36fa3e654c8f)' or TextData LIKE '%(XLOCK)%' or TextData LIKE '%DeadLock%') order by rownum And these are the results I got back: Row | Event | SPID | Text 275799 | SP:StmtStarting | 99 | SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN ('20', '10000048') AND ItemCode = @ItemCode 304781 | Lock:Acquired | 139 | (36fa3e654c8f) 305365 | Lock:Acquired | 139 | (36fa3e654c8f) 351093 | Lock:Acquired | 139 | (ca73a6396124) 468768 | Lock:Released | 13 | (ca73a6396124) 470912 | Lock:Released | 13 | (36fa3e654c8f) 470922 | Lock:Acquired | 164 | (36fa3e654c8f) 470928 | Lock:Released | 164 | (36fa3e654c8f) 470971 | Lock:Acquired | 99 | (36fa3e654c8f) 471013 | RPC:Completed | 99 | exec sp_executesql N'SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (''20'', ''10000048'') AND ItemCode = @ItemCode',N'@ItemCode nvarchar(3)',@ItemCode=N'FX1' 490843 | SP:StmtStarting | 78 | SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN ('20', '10000048') AND ItemCode = @ItemCode 490848 | Lock:Acquired | 78 | (ca73a6396124) 495391 | Lock:Acquired | 114 | (36fa3e654c8f) 495396 | Lock:Acquired | 114 | (36fa3e654c8f) 542738 | Lock:Deadlock Chain | 6 | Deadlock Chain SPID = 78 (36fa3e654c8f) 545746 | Lock:Deadlock Chain | 6 | Deadlock Chain SPID = 154 (36fa3e654c8f) 545769 | Lock:Deadlock Chain | 6 | Deadlock Chain SPID = 114 (ca73a6396124) 545982 | Lock:Deadlock | 78 | (36fa3e654c8f) 545985 | RPC:Completed | 78 | exec sp_executesql N'SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (''20'', ''10000048'') AND ItemCode = @ItemCode',N'@ItemCode nvarchar(3)',@ItemCode=N'FC3' 545990 | Lock:Released | 78 | (ca73a6396124) 545998 | Lock:Acquired | 114 | (ca73a6396124) 546130 | Deadlock graph | 17 | (See below) The deadlock graph is as follows: <deadlock-list> <deadlock victim="process5e3ae08"> <process-list> <process id="process5e3ae08" taskpriority="0" logused="0" waitresource="KEY: 6:72057598620205056 (36fa3e654c8f)" waittime="9507" ownerId="513854688" transactionname="user_transaction" lasttranstarted="2012-06-28T13:38:54.463" XDES="0x1bbf9b950" lockMode="RangeX-X" schedulerid="6" kpid="13248" status="suspended" spid="78" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2012-06-28T13:38:54.483" lastbatchcompleted="2012-06-28T13:38:54.463" clientapp=".Net SqlClient Data Provider" hostname="PMIUSRSTL00013" hostpid="3180" loginname="RICFSE01SAPB1" isolationlevel="serializable (4)" xactid="513854688" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="adhoc" line="1" stmtstart="46" sqlhandle="0x02000000151c651e3c8b4437ee414cefdbc46b70aceca960"> SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (&apos;20&apos;, &apos;10000048&apos;) AND ItemCode = @ItemCode </frame> <frame procname="unknown" line="1" sqlhandle="0x000000000000000000000000000000000000000000000000"> unknown </frame> </executionStack> <inputbuf> (@ItemCode nvarchar(3))SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (&apos;20&apos;, &apos;10000048&apos;) AND ItemCode = @ItemCode </inputbuf> </process> <process id="process5e45048" taskpriority="0" logused="0" waitresource="KEY: 6:72057598620205056 (36fa3e654c8f)" waittime="12866" ownerId="513845303" transactionname="SELECT" lasttranstarted="2012-06-28T13:38:28.463" XDES="0x80048e50" lockMode="S" schedulerid="7" kpid="12772" status="suspended" spid="154" sbid="0" ecid="0" priority="0" trancount="0" lastbatchstarted="2012-06-28T13:38:28.390" lastbatchcompleted="2012-06-28T13:38:28.380" lastattention="2012-06-28T13:38:27.927" clientapp="TagClerkService" hostname="PMIUSRSTW00008" hostpid="2772" loginname="RICFSE01SAPB1" isolationlevel="read committed (2)" xactid="513845303" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="adhoc" line="1" sqlhandle="0x020000000d86e30171762b464b35e0923de532c497188b81"> SELECT T0.* FROM [dbo].[ONNM] T0 </frame> </executionStack> <inputbuf> SELECT T0.* FROM [dbo].[ONNM] T0 </inputbuf> </process> <process id="process5e31708" taskpriority="0" logused="25240" waitresource="KEY: 6:72057597517103104 (ca73a6396124)" waittime="2031" ownerId="513831818" transactionguid="0xdefde99023405d4a96d101faac79ef96" transactionname="user_transaction" lasttranstarted="2012-06-28T13:38:19.237" XDES="0xd68df950" lockMode="RangeS-S" schedulerid="5" kpid="11564" status="suspended" spid="114" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2012-06-28T13:38:58.560" lastbatchcompleted="2012-06-28T13:38:58.490" lastattention="2012-06-28T12:48:33.060" clientapp="TagClerkService" hostname="PMIUSRSTL00011" hostpid="2908" loginname="RICFSE01SAPB1" isolationlevel="serializable (4)" xactid="513831818" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="adhoc" line="1" stmtstart="24" sqlhandle="0x02000000a329a30eb1319f2df684296f889a1613a585b3a0"> SELECT ISNULL(a.U_FSE_ApplicationUsr,a.UserSign) ,a.DocNum ,b.LineNum ,f.IsLotTraced ,h.LotNumber ,b.WhsCode ,n.Bin ,g.Quantity ,b.LineTotal ,i.OnTimeDeliveryDaysEarly ,i.OnTimeDeliveryDaysLate ,i.ReceiptVarianceUnderAllowed ,i.ReceiptVarianceOverAllowed ,k.ItemCode ,d.Revision ,a.Comments ,e.RolledMaterialCost ,e.RolledLaborCost ,e.RolledVariableOverheadCost ,e.RolledFixedOverheadCost ,e.RolledOutsideCost ,ISNULL(c.Quantity, c2.Quantity) ,c.DocumentLineDetailKey /* TODO: Handle serial numbers for blanket deliveries */ ,ISNULL(c.InventoryCode, c2.InventoryCode) ,k.InvntryUom ,r.Resource ,p.ItemName ,CASE WHEN m.MOKey IS NULL THEN NULL ELSE b.U_FSE_STypeItemQty END ,a.DocDate FROM OPDN a LEFT JOIN PDN1 b ON a.DocEntry=b.DocEntry LEFT JOIN FSE_PurchaseGoodsReceiptLineDetail c ON (b.DocEntry=c.DocumentKey and b.LineNum=c.DocumentLineKey) LEFT JOIN FSE_PurchaseGoodsReceiptDeliveryLineDetail c2 ON (b.DocEntry=c2.DocumentKey and b.LineNum=c2.DocumentLineKey) LEFT JOIN FSE_MO m ON m.DocumentNumber = b.U_FSE_MONumbe </frame> <frame procname="unknown" sqlhandle="0x000000000000000000000000000000000000000000000000"> unknown </frame> <frame procname="FSDB00.dbo.SBO_SP_TransactionNotification" line="25" stmtstart="1588" stmtend="2032" sqlhandle="0x030006000a73d75dfe95d60059a000000100000000000000"> exec usp_FSE_HandleSBONotification @object_type, @transaction_type, @num_of_cols_in_key, @list_of_key_cols_tab_del, @list_of_cols_val_tab_del, @error out, @error_message out -- keep this on one line --PMI DataTransfer </frame> <frame procname="adhoc" line="1" sqlhandle="0x01000600fd116804e00371a5000000000000000000000000"> EXECUTE SBO_SP_TransactionNotification N&apos;20&apos;,N&apos;A&apos;,1,N&apos;DocEntry&apos;,N&apos;134138&apos; </frame> </executionStack> <inputbuf> EXECUTE SBO_SP_TransactionNotification N&apos;20&apos;,N&apos;A&apos;,1,N&apos;DocEntry&apos;,N&apos;134138&apos; </inputbuf> </process> </process-list> <resource-list> <keylock hobtid="72057598620205056" dbid="6" objectname="FSDB00.dbo.ONNM" indexname="ONNM_PRIMARY" id="lock1aa7d9880" mode="RangeX-X" associatedObjectId="72057598620205056"> <owner-list/> <waiter-list> <waiter id="process5e3ae08" mode="RangeX-X" requestType="wait"/> </waiter-list> </keylock> <keylock hobtid="72057598620205056" dbid="6" objectname="FSDB00.dbo.ONNM" indexname="ONNM_PRIMARY" id="lock1aa7d9880" mode="RangeX-X" associatedObjectId="72057598620205056"> <owner-list> <owner id="process5e31708" mode="RangeX-X"/> </owner-list> <waiter-list> <waiter id="process5e45048" mode="S" requestType="wait"/> </waiter-list> </keylock> <keylock hobtid="72057597517103104" dbid="6" objectname="FSDB00.dbo.OITM" indexname="OITM_PRIMARY" id="lock215ce6980" mode="X" associatedObjectId="72057597517103104"> <owner-list> <owner id="process5e3ae08" mode="X"/> </owner-list> <waiter-list> <waiter id="process5e31708" mode="RangeS-S" requestType="wait"/> </waiter-list> </keylock> </resource-list> </deadlock> </deadlock-list> My question is, why was it possible (is it normal) for SPID 78 to acquire a lock on OITM (ca73a6396124) (which happens to represent ItemCode FC1 if I recall correctly) even though it could not acquire a lock on ONNM (36fa3e654c8f). Is my assumption that SQL statements get all-or-none locks incorrect? Does it not hold if the holder of the ONNM lock was a shared lock on a different connection within a transaction that contains multiple connections in the other process? (I think SPID 99 is another connection in the same process as SPID 114.) This seems to be a really complicated problem to decipher; I don't know if there's a better way of going about deadlock avoidance or finding out what happened here.
sql
sql-server
locking
deadlock
null
06/29/2012 23:52:26
off topic
All-or-none exclusive lock on 2 SQL tables === My simplistic testing suggested that I can acquire an exclusive lock on 2 tables or postpone acquiring the lock on either until both can be acquired at once by using a query like this: SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN ('20', '10000048') AND ItemCode = @ItemCode the key feature being the CROSS JOIN used to include multiple tables in a single query. I confirmed that if an exclusive lock already exists on the OITM row for @ItemCode in another transaction, then this statement doesn't introduce any lock on ONNM until it can acquire both locks. However, in the more complex full test run, SQL profiler returns some conflicting information. I have imported the SQL profiler results into a table and executed the following query: select rownum, e.name, EventClass, TextData, SPID, ClientProcessID from #pmit t join sys.trace_events e on t.EventClass = e.trace_event_id where rownum between 275799 and 546130 and (TextData LIKE '(ca73a6396124)' or TextData LIKE '(36fa3e654c8f)' or TextData LIKE '%(XLOCK)%' or TextData LIKE '%DeadLock%') order by rownum And these are the results I got back: Row | Event | SPID | Text 275799 | SP:StmtStarting | 99 | SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN ('20', '10000048') AND ItemCode = @ItemCode 304781 | Lock:Acquired | 139 | (36fa3e654c8f) 305365 | Lock:Acquired | 139 | (36fa3e654c8f) 351093 | Lock:Acquired | 139 | (ca73a6396124) 468768 | Lock:Released | 13 | (ca73a6396124) 470912 | Lock:Released | 13 | (36fa3e654c8f) 470922 | Lock:Acquired | 164 | (36fa3e654c8f) 470928 | Lock:Released | 164 | (36fa3e654c8f) 470971 | Lock:Acquired | 99 | (36fa3e654c8f) 471013 | RPC:Completed | 99 | exec sp_executesql N'SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (''20'', ''10000048'') AND ItemCode = @ItemCode',N'@ItemCode nvarchar(3)',@ItemCode=N'FX1' 490843 | SP:StmtStarting | 78 | SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN ('20', '10000048') AND ItemCode = @ItemCode 490848 | Lock:Acquired | 78 | (ca73a6396124) 495391 | Lock:Acquired | 114 | (36fa3e654c8f) 495396 | Lock:Acquired | 114 | (36fa3e654c8f) 542738 | Lock:Deadlock Chain | 6 | Deadlock Chain SPID = 78 (36fa3e654c8f) 545746 | Lock:Deadlock Chain | 6 | Deadlock Chain SPID = 154 (36fa3e654c8f) 545769 | Lock:Deadlock Chain | 6 | Deadlock Chain SPID = 114 (ca73a6396124) 545982 | Lock:Deadlock | 78 | (36fa3e654c8f) 545985 | RPC:Completed | 78 | exec sp_executesql N'SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (''20'', ''10000048'') AND ItemCode = @ItemCode',N'@ItemCode nvarchar(3)',@ItemCode=N'FC3' 545990 | Lock:Released | 78 | (ca73a6396124) 545998 | Lock:Acquired | 114 | (ca73a6396124) 546130 | Deadlock graph | 17 | (See below) The deadlock graph is as follows: <deadlock-list> <deadlock victim="process5e3ae08"> <process-list> <process id="process5e3ae08" taskpriority="0" logused="0" waitresource="KEY: 6:72057598620205056 (36fa3e654c8f)" waittime="9507" ownerId="513854688" transactionname="user_transaction" lasttranstarted="2012-06-28T13:38:54.463" XDES="0x1bbf9b950" lockMode="RangeX-X" schedulerid="6" kpid="13248" status="suspended" spid="78" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2012-06-28T13:38:54.483" lastbatchcompleted="2012-06-28T13:38:54.463" clientapp=".Net SqlClient Data Provider" hostname="PMIUSRSTL00013" hostpid="3180" loginname="RICFSE01SAPB1" isolationlevel="serializable (4)" xactid="513854688" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="adhoc" line="1" stmtstart="46" sqlhandle="0x02000000151c651e3c8b4437ee414cefdbc46b70aceca960"> SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (&apos;20&apos;, &apos;10000048&apos;) AND ItemCode = @ItemCode </frame> <frame procname="unknown" line="1" sqlhandle="0x000000000000000000000000000000000000000000000000"> unknown </frame> </executionStack> <inputbuf> (@ItemCode nvarchar(3))SELECT AutoKey, OnHand FROM ONNM(XLOCK) CROSS JOIN OITM(XLOCK) WHERE ObjectCode IN (&apos;20&apos;, &apos;10000048&apos;) AND ItemCode = @ItemCode </inputbuf> </process> <process id="process5e45048" taskpriority="0" logused="0" waitresource="KEY: 6:72057598620205056 (36fa3e654c8f)" waittime="12866" ownerId="513845303" transactionname="SELECT" lasttranstarted="2012-06-28T13:38:28.463" XDES="0x80048e50" lockMode="S" schedulerid="7" kpid="12772" status="suspended" spid="154" sbid="0" ecid="0" priority="0" trancount="0" lastbatchstarted="2012-06-28T13:38:28.390" lastbatchcompleted="2012-06-28T13:38:28.380" lastattention="2012-06-28T13:38:27.927" clientapp="TagClerkService" hostname="PMIUSRSTW00008" hostpid="2772" loginname="RICFSE01SAPB1" isolationlevel="read committed (2)" xactid="513845303" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="adhoc" line="1" sqlhandle="0x020000000d86e30171762b464b35e0923de532c497188b81"> SELECT T0.* FROM [dbo].[ONNM] T0 </frame> </executionStack> <inputbuf> SELECT T0.* FROM [dbo].[ONNM] T0 </inputbuf> </process> <process id="process5e31708" taskpriority="0" logused="25240" waitresource="KEY: 6:72057597517103104 (ca73a6396124)" waittime="2031" ownerId="513831818" transactionguid="0xdefde99023405d4a96d101faac79ef96" transactionname="user_transaction" lasttranstarted="2012-06-28T13:38:19.237" XDES="0xd68df950" lockMode="RangeS-S" schedulerid="5" kpid="11564" status="suspended" spid="114" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2012-06-28T13:38:58.560" lastbatchcompleted="2012-06-28T13:38:58.490" lastattention="2012-06-28T12:48:33.060" clientapp="TagClerkService" hostname="PMIUSRSTL00011" hostpid="2908" loginname="RICFSE01SAPB1" isolationlevel="serializable (4)" xactid="513831818" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="adhoc" line="1" stmtstart="24" sqlhandle="0x02000000a329a30eb1319f2df684296f889a1613a585b3a0"> SELECT ISNULL(a.U_FSE_ApplicationUsr,a.UserSign) ,a.DocNum ,b.LineNum ,f.IsLotTraced ,h.LotNumber ,b.WhsCode ,n.Bin ,g.Quantity ,b.LineTotal ,i.OnTimeDeliveryDaysEarly ,i.OnTimeDeliveryDaysLate ,i.ReceiptVarianceUnderAllowed ,i.ReceiptVarianceOverAllowed ,k.ItemCode ,d.Revision ,a.Comments ,e.RolledMaterialCost ,e.RolledLaborCost ,e.RolledVariableOverheadCost ,e.RolledFixedOverheadCost ,e.RolledOutsideCost ,ISNULL(c.Quantity, c2.Quantity) ,c.DocumentLineDetailKey /* TODO: Handle serial numbers for blanket deliveries */ ,ISNULL(c.InventoryCode, c2.InventoryCode) ,k.InvntryUom ,r.Resource ,p.ItemName ,CASE WHEN m.MOKey IS NULL THEN NULL ELSE b.U_FSE_STypeItemQty END ,a.DocDate FROM OPDN a LEFT JOIN PDN1 b ON a.DocEntry=b.DocEntry LEFT JOIN FSE_PurchaseGoodsReceiptLineDetail c ON (b.DocEntry=c.DocumentKey and b.LineNum=c.DocumentLineKey) LEFT JOIN FSE_PurchaseGoodsReceiptDeliveryLineDetail c2 ON (b.DocEntry=c2.DocumentKey and b.LineNum=c2.DocumentLineKey) LEFT JOIN FSE_MO m ON m.DocumentNumber = b.U_FSE_MONumbe </frame> <frame procname="unknown" sqlhandle="0x000000000000000000000000000000000000000000000000"> unknown </frame> <frame procname="FSDB00.dbo.SBO_SP_TransactionNotification" line="25" stmtstart="1588" stmtend="2032" sqlhandle="0x030006000a73d75dfe95d60059a000000100000000000000"> exec usp_FSE_HandleSBONotification @object_type, @transaction_type, @num_of_cols_in_key, @list_of_key_cols_tab_del, @list_of_cols_val_tab_del, @error out, @error_message out -- keep this on one line --PMI DataTransfer </frame> <frame procname="adhoc" line="1" sqlhandle="0x01000600fd116804e00371a5000000000000000000000000"> EXECUTE SBO_SP_TransactionNotification N&apos;20&apos;,N&apos;A&apos;,1,N&apos;DocEntry&apos;,N&apos;134138&apos; </frame> </executionStack> <inputbuf> EXECUTE SBO_SP_TransactionNotification N&apos;20&apos;,N&apos;A&apos;,1,N&apos;DocEntry&apos;,N&apos;134138&apos; </inputbuf> </process> </process-list> <resource-list> <keylock hobtid="72057598620205056" dbid="6" objectname="FSDB00.dbo.ONNM" indexname="ONNM_PRIMARY" id="lock1aa7d9880" mode="RangeX-X" associatedObjectId="72057598620205056"> <owner-list/> <waiter-list> <waiter id="process5e3ae08" mode="RangeX-X" requestType="wait"/> </waiter-list> </keylock> <keylock hobtid="72057598620205056" dbid="6" objectname="FSDB00.dbo.ONNM" indexname="ONNM_PRIMARY" id="lock1aa7d9880" mode="RangeX-X" associatedObjectId="72057598620205056"> <owner-list> <owner id="process5e31708" mode="RangeX-X"/> </owner-list> <waiter-list> <waiter id="process5e45048" mode="S" requestType="wait"/> </waiter-list> </keylock> <keylock hobtid="72057597517103104" dbid="6" objectname="FSDB00.dbo.OITM" indexname="OITM_PRIMARY" id="lock215ce6980" mode="X" associatedObjectId="72057597517103104"> <owner-list> <owner id="process5e3ae08" mode="X"/> </owner-list> <waiter-list> <waiter id="process5e31708" mode="RangeS-S" requestType="wait"/> </waiter-list> </keylock> </resource-list> </deadlock> </deadlock-list> My question is, why was it possible (is it normal) for SPID 78 to acquire a lock on OITM (ca73a6396124) (which happens to represent ItemCode FC1 if I recall correctly) even though it could not acquire a lock on ONNM (36fa3e654c8f). Is my assumption that SQL statements get all-or-none locks incorrect? Does it not hold if the holder of the ONNM lock was a shared lock on a different connection within a transaction that contains multiple connections in the other process? (I think SPID 99 is another connection in the same process as SPID 114.) This seems to be a really complicated problem to decipher; I don't know if there's a better way of going about deadlock avoidance or finding out what happened here.
2
8,234,099
11/22/2011 21:32:21
1,024,973
11/02/2011 05:14:28
11
0
Resintalling Vim
I'm trying to reinstall vim in ubuntu 11.10, but am having trouble. From the software center I click on install, and I get the error message: "Failed to download package files. Check your internet connection". (my internet connection is fine. Then, I click on OK, and this message comes up: "Requires Installation of untrusted packages." I click on OK (the only option), and the installation ceases. Anyone know how I resolve this problem?
vim
ubuntu
ubuntu-11.10
null
null
11/24/2011 09:34:11
off topic
Resintalling Vim === I'm trying to reinstall vim in ubuntu 11.10, but am having trouble. From the software center I click on install, and I get the error message: "Failed to download package files. Check your internet connection". (my internet connection is fine. Then, I click on OK, and this message comes up: "Requires Installation of untrusted packages." I click on OK (the only option), and the installation ceases. Anyone know how I resolve this problem?
2
7,295,012
09/03/2011 18:28:25
832,976
07/07/2011 06:39:42
1
0
fetching data between two user
I tried a lot to fetch data from sql server between two user. Please give me some logic. Here is scenario In Msgtable ............................MsgId,UserId,ToUserId, Text, RoomId 1 1 2 xyz 1 2 2 1 abc 1 3 3 1 xyx 2 So, if user 1 and 2 share date, I want to fetch between them only not for user 3. Even I'm useing session state to keep current userid. Please help me out, it's needed desperately. thanks....
c#
asp.net
sql
null
null
09/03/2011 22:18:08
not a real question
fetching data between two user === I tried a lot to fetch data from sql server between two user. Please give me some logic. Here is scenario In Msgtable ............................MsgId,UserId,ToUserId, Text, RoomId 1 1 2 xyz 1 2 2 1 abc 1 3 3 1 xyx 2 So, if user 1 and 2 share date, I want to fetch between them only not for user 3. Even I'm useing session state to keep current userid. Please help me out, it's needed desperately. thanks....
1
3,157,081
07/01/2010 10:54:00
336,569
05/09/2010 09:17:57
1
0
files/folder creation in Windows OS
can anyone provides me details of files and folder which not allow to create in Window OS. Except these * PRN * AUX * NUL * LPT1 * COM1 * Potential drive letter - A: to Z: * A number of others
windows
null
null
null
null
11/11/2011 13:59:42
off topic
files/folder creation in Windows OS === can anyone provides me details of files and folder which not allow to create in Window OS. Except these * PRN * AUX * NUL * LPT1 * COM1 * Potential drive letter - A: to Z: * A number of others
2
5,839,987
04/30/2011 06:16:30
97,526
04/29/2009 05:48:00
899
18
Tell a friend in django
I am looking for a generic Tell a Friend application in django which will allow my website users to tell about website features to one's mail or social networking friends.... Thanks in advance...
python
django
email
contacts
social-networking
null
open
Tell a friend in django === I am looking for a generic Tell a Friend application in django which will allow my website users to tell about website features to one's mail or social networking friends.... Thanks in advance...
0
11,552,288
07/19/2012 00:23:47
209,591
11/12/2009 13:17:52
1,359
43
DDD, Saga & Event-sourcing: Can a Compensate Action simply be a delete on the event store?
I realize the above question probably raises a few 'what??'s, but let me try to explain : I'm trying to wrap my head on a couple of related concepts, basically the Saga-pattern ( http://www.rgoarchitects.com/Files/SOAPatterns/Saga.pdf) in combination with Event-sourcing (A DDD-concept: http://en.wikipedia.org/wiki/Domain-driven_design) A good post that wraps it together: http://blog.jonathanoliver.com/2010/09/cqrs-sagas-with-event-sourcing-part-ii-of-ii/ I'm getting to the question in a minute, but I think I have to try to summarize what I understand of it first (which might well be wrong, so please correct if that's the case) since this might well impact why I'm asking the question to begin with: 1. The Saga pattern is a sort of broker that given an action (end-user, automated, etc. essentially anything that is going to change data) divides that action up in business activities and sends each of these activities as messages to a Message Bus which in turn sends it to the respective aggregate roots to be taken care of. 2. These aggregate roots can operate completely autonomously (nice separation of concerns, great scalability, etc. ) 3. A Saga-instance itself doesn't contain any business logic, that is contained in the aggregate roots it sends activities to. The only 'logic' contained in the Saga is 'process'-logic, (often implemented as a Statemachine), which determines based on actions received (as well as follow-up events) what to do (i.e: what activities to send) 4. The Saga-patterns implements a kind of distributed transaction pattern. I.e: when one of the aggregate roots (which again work autonomously, without knowing of eachothers existense) fails, the entire action might have to be rolled back. 5. This is implemented by having all aggregate roots, upon completion of their activity report back to the Saga. (In case of success as well as error) 6. In case all aggregate roots return a success, the internal statemachine if the Saga determines what to do next (or decides it's done) 7. In case of failure, the Saga issues to all aggregate roots that took part in the last action a so called Compensation Action, i.e: an action to undo the last action each of the aggregate roots did. 8. This might be simply doing a 'Minus 1 vote' if the action was "plus 1 vote' but it could be more complicated like restoring a blogpost to it's previous version. 9. Event-sourcing (see the blogpost combining the two) aims to externalize saving the results of each of the activities that each of the aggregate roots undertake to a centralized Event Store (the changes are called 'events' in this context) 10. This Event store is the 'single version of the truth' and can be use to replay the state of all entities simply by iterating the events stored (essentially like an event log) 11. Combining the two (i.e: letting aggregate roots use Event-sourcing to outsource saving their changes before reporting back to the Saga) enables lots of nice possibilities, one of which concerns my question... I felt I needed to get this off of my shoulder, since it's a lot to grasp in one go. Given this context/mindset (again, please correct if wrong) **the question:** When an aggregate root receives a Compensate Action and it that aggregate root has outsourced it's state-changes using Event-sourcing, wouldn't the Compensate Action in all situations just be a delete of the last event in the Event Store for that given Aggregate Root? (Assuming the persist-implementation allows deletes) That would make sense to me a lot (and would be another great benefit of this combination) but as I said I might be making these assumptions based on a incorrect/incomplete understanding of these concepts. I hope this didn't get too long-winded. Thanks.
domain-driven-design
cqrs
event-sourcing
saga
null
07/19/2012 02:01:14
off topic
DDD, Saga & Event-sourcing: Can a Compensate Action simply be a delete on the event store? === I realize the above question probably raises a few 'what??'s, but let me try to explain : I'm trying to wrap my head on a couple of related concepts, basically the Saga-pattern ( http://www.rgoarchitects.com/Files/SOAPatterns/Saga.pdf) in combination with Event-sourcing (A DDD-concept: http://en.wikipedia.org/wiki/Domain-driven_design) A good post that wraps it together: http://blog.jonathanoliver.com/2010/09/cqrs-sagas-with-event-sourcing-part-ii-of-ii/ I'm getting to the question in a minute, but I think I have to try to summarize what I understand of it first (which might well be wrong, so please correct if that's the case) since this might well impact why I'm asking the question to begin with: 1. The Saga pattern is a sort of broker that given an action (end-user, automated, etc. essentially anything that is going to change data) divides that action up in business activities and sends each of these activities as messages to a Message Bus which in turn sends it to the respective aggregate roots to be taken care of. 2. These aggregate roots can operate completely autonomously (nice separation of concerns, great scalability, etc. ) 3. A Saga-instance itself doesn't contain any business logic, that is contained in the aggregate roots it sends activities to. The only 'logic' contained in the Saga is 'process'-logic, (often implemented as a Statemachine), which determines based on actions received (as well as follow-up events) what to do (i.e: what activities to send) 4. The Saga-patterns implements a kind of distributed transaction pattern. I.e: when one of the aggregate roots (which again work autonomously, without knowing of eachothers existense) fails, the entire action might have to be rolled back. 5. This is implemented by having all aggregate roots, upon completion of their activity report back to the Saga. (In case of success as well as error) 6. In case all aggregate roots return a success, the internal statemachine if the Saga determines what to do next (or decides it's done) 7. In case of failure, the Saga issues to all aggregate roots that took part in the last action a so called Compensation Action, i.e: an action to undo the last action each of the aggregate roots did. 8. This might be simply doing a 'Minus 1 vote' if the action was "plus 1 vote' but it could be more complicated like restoring a blogpost to it's previous version. 9. Event-sourcing (see the blogpost combining the two) aims to externalize saving the results of each of the activities that each of the aggregate roots undertake to a centralized Event Store (the changes are called 'events' in this context) 10. This Event store is the 'single version of the truth' and can be use to replay the state of all entities simply by iterating the events stored (essentially like an event log) 11. Combining the two (i.e: letting aggregate roots use Event-sourcing to outsource saving their changes before reporting back to the Saga) enables lots of nice possibilities, one of which concerns my question... I felt I needed to get this off of my shoulder, since it's a lot to grasp in one go. Given this context/mindset (again, please correct if wrong) **the question:** When an aggregate root receives a Compensate Action and it that aggregate root has outsourced it's state-changes using Event-sourcing, wouldn't the Compensate Action in all situations just be a delete of the last event in the Event Store for that given Aggregate Root? (Assuming the persist-implementation allows deletes) That would make sense to me a lot (and would be another great benefit of this combination) but as I said I might be making these assumptions based on a incorrect/incomplete understanding of these concepts. I hope this didn't get too long-winded. Thanks.
2
1,097,252
07/08/2009 10:24:23
87,271
04/05/2009 11:51:35
1
0
Grails - Lift: Which framework is better suited for which kind of applications?
I have been using Grails for the past few months and I really like it, specially GORM. However, I am getting interested into Scala's Lift. Therefore, I would like to know your opinion about which kind of web apps are better suited for which of those two frameworks or it is just a matter of taste, which framework to use? Finally, which of those frameworks do you think will be more used in the future? I have the feeling that Grails is far from reaching a critical mass and it still remains very obscure (in the past few months I had the opportunity to work with middle size and IT startups working mostly with the JVM stack and only one person knew and used Grails) and I am not even sure if it can become the "RoR" of the Java world (Indeed reports a drop of growth in the last few months even if other frameworks have a positive growing rate). And I love Groovy, it is really easy to learn but I have noticed how slow it can be for some tasks. On the other hand, Scala seems to be more popular (Tiobe Index) and the fact that Twitter is using it know gave it even more presence in the blogosphere with lots of lovers and haters making buzz. It is famous for being fast and scalable. However, the language seems somewhat hard to understand and learn for lots of developers (so maybe it will never gain mainstream status) and Lift is little known and I have read some reports that it is better suited for small apps (less than 20 domain classes). By seeing the number of books published Groovy-Grails dominate right now, but many publishers have Scala book on the works, so I think this advantage will not last long. Finally, we have the problem that both languages and frameworks still have poor IDE support (it is getting better by the day but far away from what Java shops expect to be productive). I do not want to start a flame wars, but I would be very interested to hear other users' opinions.
grails
lift
null
null
null
01/26/2012 11:55:12
not constructive
Grails - Lift: Which framework is better suited for which kind of applications? === I have been using Grails for the past few months and I really like it, specially GORM. However, I am getting interested into Scala's Lift. Therefore, I would like to know your opinion about which kind of web apps are better suited for which of those two frameworks or it is just a matter of taste, which framework to use? Finally, which of those frameworks do you think will be more used in the future? I have the feeling that Grails is far from reaching a critical mass and it still remains very obscure (in the past few months I had the opportunity to work with middle size and IT startups working mostly with the JVM stack and only one person knew and used Grails) and I am not even sure if it can become the "RoR" of the Java world (Indeed reports a drop of growth in the last few months even if other frameworks have a positive growing rate). And I love Groovy, it is really easy to learn but I have noticed how slow it can be for some tasks. On the other hand, Scala seems to be more popular (Tiobe Index) and the fact that Twitter is using it know gave it even more presence in the blogosphere with lots of lovers and haters making buzz. It is famous for being fast and scalable. However, the language seems somewhat hard to understand and learn for lots of developers (so maybe it will never gain mainstream status) and Lift is little known and I have read some reports that it is better suited for small apps (less than 20 domain classes). By seeing the number of books published Groovy-Grails dominate right now, but many publishers have Scala book on the works, so I think this advantage will not last long. Finally, we have the problem that both languages and frameworks still have poor IDE support (it is getting better by the day but far away from what Java shops expect to be productive). I do not want to start a flame wars, but I would be very interested to hear other users' opinions.
4
11,726,389
07/30/2012 17:20:13
1,535,882
07/18/2012 19:12:52
44
0
Java how to read and delete contents of a file.
I have a list with about 700 items I need to edit before adding them to my webpage. I tried editing each item manually but it became too extensive, and I thought I might use Java instead to read and edit the file since the words that need to be edited have the same beginning and ending in each item. I thought I would start by looping through the word in Q, save it and when I had the logic working I'd find out how to read the text file and do the same thing again. (I am open for suggestions if there is any other way) Here comes the code I put together so far, It was a long time ago I coded in Java so I basically have no skills right now. import javax.swing.JOptionPane; public class CustomizedList { public static void main (String[] args) { String Ord = JOptionPane.showInputDialog("Enter a word"); String resultatOrd =""; for(int i = 0; i < Ord.length(); i++) { if(Ord.charAt(i) == 'y' && Ord.charAt(i) == 'e' && Ord.charAt(i) == 's') { resultatOrd += Ord.charAt(i); System.out.println(resultatOrd); } else System.out.println("Wrong word."); } } } I am not sure what I am doing wrong, but the word i input doesnt work logically. There are two words I want to delete from this textfile: YES and NO, both in lower and uppercase.
java
null
null
null
null
07/31/2012 02:30:06
too localized
Java how to read and delete contents of a file. === I have a list with about 700 items I need to edit before adding them to my webpage. I tried editing each item manually but it became too extensive, and I thought I might use Java instead to read and edit the file since the words that need to be edited have the same beginning and ending in each item. I thought I would start by looping through the word in Q, save it and when I had the logic working I'd find out how to read the text file and do the same thing again. (I am open for suggestions if there is any other way) Here comes the code I put together so far, It was a long time ago I coded in Java so I basically have no skills right now. import javax.swing.JOptionPane; public class CustomizedList { public static void main (String[] args) { String Ord = JOptionPane.showInputDialog("Enter a word"); String resultatOrd =""; for(int i = 0; i < Ord.length(); i++) { if(Ord.charAt(i) == 'y' && Ord.charAt(i) == 'e' && Ord.charAt(i) == 's') { resultatOrd += Ord.charAt(i); System.out.println(resultatOrd); } else System.out.println("Wrong word."); } } } I am not sure what I am doing wrong, but the word i input doesnt work logically. There are two words I want to delete from this textfile: YES and NO, both in lower and uppercase.
3
7,061,916
08/15/2011 05:18:34
491,296
10/29/2010 12:54:01
33
0
Evolution of delegate from 1.0 to 4.0 in C#
I know this is simple question. I am little bit confused with the delegate improvement over the different versions. I need some clarification here. 1. How the delegate is introduced in .Net 1.0? 2. How it is improved with different versions? 3. What are the benefits over the improvement? Any link or sample code would be helpful. I got the link which is explaining other concept over the different version [here.][1] [1]: http://pranayamr.blogspot.com/2011/04/explaning-c-to-my-gf-from-c-10-to-40.html
c#
.net
delegates
null
null
08/15/2011 05:32:54
not a real question
Evolution of delegate from 1.0 to 4.0 in C# === I know this is simple question. I am little bit confused with the delegate improvement over the different versions. I need some clarification here. 1. How the delegate is introduced in .Net 1.0? 2. How it is improved with different versions? 3. What are the benefits over the improvement? Any link or sample code would be helpful. I got the link which is explaining other concept over the different version [here.][1] [1]: http://pranayamr.blogspot.com/2011/04/explaning-c-to-my-gf-from-c-10-to-40.html
1
7,659,070
10/05/2011 09:16:12
980,024
10/05/2011 09:03:20
1
0
how to convert propel criteria in symfony
select a.id, b.title, b.start_time, b.end_time from tv_channel a left join tv_program b on a.id = b.tv_channel_id and b.start_time >= ‘2011-09-23 12:00:00′ and b.end_time <= '2011-09-23 14:30:00' order by a.code limit 0, 10; –pager object tnx
symfony
criteria
propel
null
null
null
open
how to convert propel criteria in symfony === select a.id, b.title, b.start_time, b.end_time from tv_channel a left join tv_program b on a.id = b.tv_channel_id and b.start_time >= ‘2011-09-23 12:00:00′ and b.end_time <= '2011-09-23 14:30:00' order by a.code limit 0, 10; –pager object tnx
0
8,364,484
12/03/2011 00:40:27
1,078,259
12/02/2011 21:20:34
1
0
jQuery Simple calculations
I am new to the forum and programming in general so be patient with me. I am try to make a mobile app with jQuery and do a front end client simple calculations like +,-, * and get percentages from different fields. I can't this simple formulas going I find complicated Math. something or sum. and avg. Is it possible to do this calculation? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>jQuery Calculation Plug-in</title> <!---// load jQuery v1.3.1 from the GoogleAPIs CDN //---> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <!--// load jQuery Plug-ins //--> <script type="text/javascript" src="../field/jquery.field.js"></script> <script type="text/javascript" src="./jquery.calculation.js"></script> <script type="text/javascript"> var bIsFirebugReady = (!!window.console && !!window.console.log); $(document).ready( function (){ // update the plug-in version $("#idPluginVersion").text($.Calculation.version); /* $.Calculation.setDefaults({ onParseError: function(){ this.css("backgroundColor", "#cc0000") } , onParseClear: function (){ this.css("backgroundColor", ""); } }); */ // bind the recalc function to the quantity fields $("input[name^=qty_item_]").bind("keyup", recalc); // run the calculation function now recalc(); // automatically update the "#totalSum" field every time // the values are changes via the keyup event $("input[name^=sum]").sum("keyup", "#totalSum"); // automatically update the "#totalAvg" field every time // the values are changes via the keyup event $("input[name^=avg]").avg({ bind:"keyup" , selector: "#totalAvg" // if an invalid character is found, change the background color , onParseError: function(){ this.css("backgroundColor", "#cc0000") } // if the error has been cleared, reset the bgcolor , onParseClear: function (){ this.css("backgroundColor", ""); } }); // automatically update the "#minNumber" field every time // the values are changes via the keyup event $("input[name^=min]").min("keyup", "#numberMin"); // automatically update the "#minNumber" field every time // the values are changes via the keyup event $("input[name^=max]").max("keyup", { selector: "#numberMax" , oncalc: function (value, options){ // you can use this to format the value $(options.selector).val(value); } }); // this calculates the sum for some text nodes $("#idTotalTextSum").click( function (){ // get the sum of the elements var sum = $(".textSum").sum(); // update the total $("#totalTextSum").text("$" + sum.toString()); } ); // this calculates the average for some text nodes $("#idTotalTextAvg").click( function (){ // get the average of the elements var avg = $(".textAvg").avg(); // update the total $("#totalTextAvg").text(avg.toString()); } ); } ); function recalc(){ $("[id^=total_item]").calc( // the equation to use for the calculation "qty * price", // define the variables used in the equation, these can be a jQuery object { qty: $("input[name^=qty_item_]"), price: $("[id^=price_item_]") }, // define the formatting callback, the results of the calculation are passed to this function function (s){ // return the number as a dollar amount return "$" + s.toFixed(2); }, // define the finish callback, this runs after the calculation has been complete function ($this){ // sum the total of the $("[id^=total_item]") selector var sum = $this.sum(); $("#grandTotal").text( // round the results to 2 digits "$" + sum.toFixed(2) ); } ); } function recalc(){ $("[id^=z]").calc( // the equation to use for the calculation "(y-x)/y", // define the variables used in the equation, these can be a jQuery object { x: $("input[name^=x]"), y: $("input[id^=y]") }, // define the formatting callback, the results of the calculation are passed to this function function (s){ // return the number as a dollar amount return "$" + s.toFixed(2); }, // define the finish callback, this runs after the calculation has been complete function ($this){ // sum the total of the $("[id^=total_item]") selector var sum = $this.sum(); $("#z").text( // round the results to 2 digits "$" + sum.toFixed(2) ); } ); } </script> <style type="text/css"> #testForm { width: 800px; } code { background-color: #e0e0e0; } #formContent p { clear: both; min-height: 20px; } #idCheckboxMsg{ color: red; font-weight: bold; } #totalTextSum, .textSum, #totalTextAvg, .textAvg { border: 1px solid black; padding: 2px; } </style> </head> <body> <form id="form1" name="form1" method="post" action=""> <p> <label for="x">Bill Rate</label> <input name="x" type="text" id="x" value="0" /> </p> <p> <label for="y">Pay Rate</label> <input name="y" type="text" id="y" value="0" /> </p> <p> <label for="z">Mark up %</label> <input name="z" type="text" id="z" value="0"> </p> <p> <label for="a">Profit Margin</label> <input type="text" name="a" id="a" /> </p> <p> <label for="b">Margin %</label> <input type="text" name="b" id="b" /> </p> </form> </body>
calculation
null
null
null
null
12/03/2011 05:42:35
not a real question
jQuery Simple calculations === I am new to the forum and programming in general so be patient with me. I am try to make a mobile app with jQuery and do a front end client simple calculations like +,-, * and get percentages from different fields. I can't this simple formulas going I find complicated Math. something or sum. and avg. Is it possible to do this calculation? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>jQuery Calculation Plug-in</title> <!---// load jQuery v1.3.1 from the GoogleAPIs CDN //---> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <!--// load jQuery Plug-ins //--> <script type="text/javascript" src="../field/jquery.field.js"></script> <script type="text/javascript" src="./jquery.calculation.js"></script> <script type="text/javascript"> var bIsFirebugReady = (!!window.console && !!window.console.log); $(document).ready( function (){ // update the plug-in version $("#idPluginVersion").text($.Calculation.version); /* $.Calculation.setDefaults({ onParseError: function(){ this.css("backgroundColor", "#cc0000") } , onParseClear: function (){ this.css("backgroundColor", ""); } }); */ // bind the recalc function to the quantity fields $("input[name^=qty_item_]").bind("keyup", recalc); // run the calculation function now recalc(); // automatically update the "#totalSum" field every time // the values are changes via the keyup event $("input[name^=sum]").sum("keyup", "#totalSum"); // automatically update the "#totalAvg" field every time // the values are changes via the keyup event $("input[name^=avg]").avg({ bind:"keyup" , selector: "#totalAvg" // if an invalid character is found, change the background color , onParseError: function(){ this.css("backgroundColor", "#cc0000") } // if the error has been cleared, reset the bgcolor , onParseClear: function (){ this.css("backgroundColor", ""); } }); // automatically update the "#minNumber" field every time // the values are changes via the keyup event $("input[name^=min]").min("keyup", "#numberMin"); // automatically update the "#minNumber" field every time // the values are changes via the keyup event $("input[name^=max]").max("keyup", { selector: "#numberMax" , oncalc: function (value, options){ // you can use this to format the value $(options.selector).val(value); } }); // this calculates the sum for some text nodes $("#idTotalTextSum").click( function (){ // get the sum of the elements var sum = $(".textSum").sum(); // update the total $("#totalTextSum").text("$" + sum.toString()); } ); // this calculates the average for some text nodes $("#idTotalTextAvg").click( function (){ // get the average of the elements var avg = $(".textAvg").avg(); // update the total $("#totalTextAvg").text(avg.toString()); } ); } ); function recalc(){ $("[id^=total_item]").calc( // the equation to use for the calculation "qty * price", // define the variables used in the equation, these can be a jQuery object { qty: $("input[name^=qty_item_]"), price: $("[id^=price_item_]") }, // define the formatting callback, the results of the calculation are passed to this function function (s){ // return the number as a dollar amount return "$" + s.toFixed(2); }, // define the finish callback, this runs after the calculation has been complete function ($this){ // sum the total of the $("[id^=total_item]") selector var sum = $this.sum(); $("#grandTotal").text( // round the results to 2 digits "$" + sum.toFixed(2) ); } ); } function recalc(){ $("[id^=z]").calc( // the equation to use for the calculation "(y-x)/y", // define the variables used in the equation, these can be a jQuery object { x: $("input[name^=x]"), y: $("input[id^=y]") }, // define the formatting callback, the results of the calculation are passed to this function function (s){ // return the number as a dollar amount return "$" + s.toFixed(2); }, // define the finish callback, this runs after the calculation has been complete function ($this){ // sum the total of the $("[id^=total_item]") selector var sum = $this.sum(); $("#z").text( // round the results to 2 digits "$" + sum.toFixed(2) ); } ); } </script> <style type="text/css"> #testForm { width: 800px; } code { background-color: #e0e0e0; } #formContent p { clear: both; min-height: 20px; } #idCheckboxMsg{ color: red; font-weight: bold; } #totalTextSum, .textSum, #totalTextAvg, .textAvg { border: 1px solid black; padding: 2px; } </style> </head> <body> <form id="form1" name="form1" method="post" action=""> <p> <label for="x">Bill Rate</label> <input name="x" type="text" id="x" value="0" /> </p> <p> <label for="y">Pay Rate</label> <input name="y" type="text" id="y" value="0" /> </p> <p> <label for="z">Mark up %</label> <input name="z" type="text" id="z" value="0"> </p> <p> <label for="a">Profit Margin</label> <input type="text" name="a" id="a" /> </p> <p> <label for="b">Margin %</label> <input type="text" name="b" id="b" /> </p> </form> </body>
1
4,474,116
12/17/2010 19:34:43
189,869
10/14/2009 14:09:03
47
2
Avoid NullReferenceException
I'm fairly new to .NET programming. I am trying to check if there are settings in a database table and if not, create some default settings. The problem is that when there are no settings I need to make two calls with the datareader and it keeps giving me problems. I originally was only using one datareader but made two to attempt resolving my issue, didn't work. Then I tried closing the datareader and I get errors because it returned a nullreference. If I try to close it I get an issue, if I don't close it the next one gives me an error saying there is already an open datareader on this connection that needs to be closed. Can anyone tell me how I can refactor my code to get this to work (preferably with one datareader)? I also tried putting the reader.close() in another set of try catch, while that enables me to catch the error, it still doesn't close the datareader so I am at a loss. Private Sub Get_Initial_Settings() Dim reader1 As MySqlDataReader = Nothing, reader2 As MySqlDataReader = Nothing Dim cmd As New MySqlCommand("SELECT depot, size, roc_family, wil_family, ast_family, met_family, ric_family, view FROM vb_dashboard.user_preferences WHERE " & GetUserName() & "", conn) Dim hasSettings As Boolean 'Get Personal Settings or initiate them if necessary Try reader1 = cmd.ExecuteReader hasSettings = True MessageBox.Show("Your user settings show you have a selected depot of " & reader1(0).ToString) Catch ex As Exception 'No settings exist, set some up MessageBox.Show("You have no settings for this program yet") hasSettings = False Finally reader1.Close() End Try 'User has no preferences, Create some 'First, create a list of depots to select from and add it to a combobox If (hasSettings = False) Then Try cmd.CommandText = "SELECT depot FROM vb_dashboard.depots ORDER BY depot" reader2 = cmd.ExecuteReader While (reader2.Read) dlgSelectDepot.cbDepotSelect.Items.Add(reader2.GetString(0)) End While 'Now show the dialog box to initiate a depot setting Me.Hide() dlgSelectDepot.Show() Me.Show() If (dlgSelectDepot.DialogResult = Windows.Forms.DialogResult.Cancel) Then Me.Close() End If cmd.CommandText = "INSERT INTO vb_database.user_preferences SET user='" & GetUserName.ToUpper & "', depot='Rochester'" cmd.ExecuteNonQuery() Catch ex As Exception MessageBox.Show("An error has occurred: " & ex.Message) Finally reader2.Close() End Try End If End Sub
vb.net
visual-studio-2008
mysqldatareader
null
null
null
open
Avoid NullReferenceException === I'm fairly new to .NET programming. I am trying to check if there are settings in a database table and if not, create some default settings. The problem is that when there are no settings I need to make two calls with the datareader and it keeps giving me problems. I originally was only using one datareader but made two to attempt resolving my issue, didn't work. Then I tried closing the datareader and I get errors because it returned a nullreference. If I try to close it I get an issue, if I don't close it the next one gives me an error saying there is already an open datareader on this connection that needs to be closed. Can anyone tell me how I can refactor my code to get this to work (preferably with one datareader)? I also tried putting the reader.close() in another set of try catch, while that enables me to catch the error, it still doesn't close the datareader so I am at a loss. Private Sub Get_Initial_Settings() Dim reader1 As MySqlDataReader = Nothing, reader2 As MySqlDataReader = Nothing Dim cmd As New MySqlCommand("SELECT depot, size, roc_family, wil_family, ast_family, met_family, ric_family, view FROM vb_dashboard.user_preferences WHERE " & GetUserName() & "", conn) Dim hasSettings As Boolean 'Get Personal Settings or initiate them if necessary Try reader1 = cmd.ExecuteReader hasSettings = True MessageBox.Show("Your user settings show you have a selected depot of " & reader1(0).ToString) Catch ex As Exception 'No settings exist, set some up MessageBox.Show("You have no settings for this program yet") hasSettings = False Finally reader1.Close() End Try 'User has no preferences, Create some 'First, create a list of depots to select from and add it to a combobox If (hasSettings = False) Then Try cmd.CommandText = "SELECT depot FROM vb_dashboard.depots ORDER BY depot" reader2 = cmd.ExecuteReader While (reader2.Read) dlgSelectDepot.cbDepotSelect.Items.Add(reader2.GetString(0)) End While 'Now show the dialog box to initiate a depot setting Me.Hide() dlgSelectDepot.Show() Me.Show() If (dlgSelectDepot.DialogResult = Windows.Forms.DialogResult.Cancel) Then Me.Close() End If cmd.CommandText = "INSERT INTO vb_database.user_preferences SET user='" & GetUserName.ToUpper & "', depot='Rochester'" cmd.ExecuteNonQuery() Catch ex As Exception MessageBox.Show("An error has occurred: " & ex.Message) Finally reader2.Close() End Try End If End Sub
0
7,614,914
09/30/2011 19:04:23
877,202
08/03/2011 18:19:03
35
0
is there any function in sql which may return the result from first two alphabet or the first alphabet?
i am working on oracle10g. I was curious to know that is there any sql function which may give results from the starting alphabet of a string. for example, if i have road-1, road-A, road-89 and i want to know total number of such road sets without using the sql count() function.
sql
oracle10g
null
null
null
null
open
is there any function in sql which may return the result from first two alphabet or the first alphabet? === i am working on oracle10g. I was curious to know that is there any sql function which may give results from the starting alphabet of a string. for example, if i have road-1, road-A, road-89 and i want to know total number of such road sets without using the sql count() function.
0
6,668,359
07/12/2011 17:23:45
265,596
02/03/2010 19:55:46
536
24
What Android devices are small screen size and high density?
According to the [Android screen sizes and densities stats][1], 3.3% of devices are small screen size and high density (hdpi). What devices are these? I always thought that most small screen devices were low density (ldpi). Just looking at the Motorola developer website, [all their small screen devices are low density][2]. Am I missing a (somewhat) popular class of devices or is the data wrong? [1]: http://developer.android.com/resources/dashboard/screens.html [2]: http://developer.motorola.com/products/?filters=1033,1040
android
null
null
null
null
07/12/2011 22:13:08
not constructive
What Android devices are small screen size and high density? === According to the [Android screen sizes and densities stats][1], 3.3% of devices are small screen size and high density (hdpi). What devices are these? I always thought that most small screen devices were low density (ldpi). Just looking at the Motorola developer website, [all their small screen devices are low density][2]. Am I missing a (somewhat) popular class of devices or is the data wrong? [1]: http://developer.android.com/resources/dashboard/screens.html [2]: http://developer.motorola.com/products/?filters=1033,1040
4
4,213,070
11/18/2010 08:58:26
459,638
08/28/2010 17:03:25
195
20
Good book(s)/resources for learning Python 3.1.2?
I recently started learning Python. Initially I referred some online tutorials for basic understanding of the language and then I switched to [Python Programming for the Absolute Beginner][1]. The problem is I have Python 3.1.2 shell installed on my machine and the book covers Python 2.4. It'd be great if somebody suggests a good book that covers Python 3.1.2. I am already familiar with Java. Thanks in advance. [1]: http://www.amazon.com/Python-Programming-Absolute-Beginner-Michael/dp/1592000738
python
books
null
null
null
null
open
Good book(s)/resources for learning Python 3.1.2? === I recently started learning Python. Initially I referred some online tutorials for basic understanding of the language and then I switched to [Python Programming for the Absolute Beginner][1]. The problem is I have Python 3.1.2 shell installed on my machine and the book covers Python 2.4. It'd be great if somebody suggests a good book that covers Python 3.1.2. I am already familiar with Java. Thanks in advance. [1]: http://www.amazon.com/Python-Programming-Absolute-Beginner-Michael/dp/1592000738
0
8,507,613
12/14/2011 16:03:47
1,058,319
11/21/2011 17:52:31
52
5
How do you reference another GWT project in your project?
I have a SmartGWT project up and running. Now, I would like to create a new project SmartGWT which has to launch the servlet of the previous SmartGWT project. Is this possible?
smartgwt
null
null
null
null
null
open
How do you reference another GWT project in your project? === I have a SmartGWT project up and running. Now, I would like to create a new project SmartGWT which has to launch the servlet of the previous SmartGWT project. Is this possible?
0
3,326,852
07/24/2010 20:50:08
400,610
07/23/2010 19:44:47
1
0
Ruby on Rails 3 Release date
Is there a release date for Ruby on Rails 3? I've been searching but nothing yet.
ruby-on-rails
ruby
ruby-on-rails-3
null
null
01/19/2012 04:00:26
too localized
Ruby on Rails 3 Release date === Is there a release date for Ruby on Rails 3? I've been searching but nothing yet.
3
10,664,993
05/19/2012 12:00:53
1,393,320
05/14/2012 08:43:40
8
2
create Horizontal image scrolling slideshow in drupal
How to create Horizontal image scrolling slideshow in drupal any parson have an idea? Thanks,
drupal-6
null
null
null
null
05/21/2012 12:17:22
not a real question
create Horizontal image scrolling slideshow in drupal === How to create Horizontal image scrolling slideshow in drupal any parson have an idea? Thanks,
1
11,242,177
06/28/2012 09:58:10
1,057,443
11/21/2011 08:54:22
166
0
Fedora Installation Needs VGA Driver
I am installing Fedora 14 on my machine. After Installation and booting up I get a black screen once I reach the log in screen. The reason I guess is because Fedora could not recognize the VGA and it needs a driver for it. Any suggestion to how I can over come this problem. Thanks
linux
installation
fedora
boot
vga
06/28/2012 10:07:14
off topic
Fedora Installation Needs VGA Driver === I am installing Fedora 14 on my machine. After Installation and booting up I get a black screen once I reach the log in screen. The reason I guess is because Fedora could not recognize the VGA and it needs a driver for it. Any suggestion to how I can over come this problem. Thanks
2
10,148,025
04/13/2012 20:41:28
1,332,443
04/13/2012 20:30:17
1
0
GPS location by javascript/PHP iPhone anti-thiefs
Ok, I want to do the following: I want to create an exact replica of the iPhone Safari, just for my iPod; I have jailbroken it and I selected to hide the normal Safari icon. Now I want to create a website with the exact same icon as safari and save it to my home screen and name in Safari (This is not the problem). I want this so when a thief uses my iPod, he clicks on the Safari logo because he thinks it's Safari and just browses the web. But what I want to happen is that every time he clicks on my Safari, a javascript/PHP (no other stuff I'm a total noob in this) script runs and I get his location sent to me and then he gets redirected to google or something else. So basically my question is: Can I get a javascript/php code to send me his location and then just go to google or another website? For the record I went to restrictions and disabled the location feature icon off so he doesn't see it, and I disabled deleting apps, so the webclip thing of the Safari "shortcut" also can't be deleted (i think). Could you please help a poor noob?
php
javascript
iphone
safari
location
04/14/2012 23:19:33
not a real question
GPS location by javascript/PHP iPhone anti-thiefs === Ok, I want to do the following: I want to create an exact replica of the iPhone Safari, just for my iPod; I have jailbroken it and I selected to hide the normal Safari icon. Now I want to create a website with the exact same icon as safari and save it to my home screen and name in Safari (This is not the problem). I want this so when a thief uses my iPod, he clicks on the Safari logo because he thinks it's Safari and just browses the web. But what I want to happen is that every time he clicks on my Safari, a javascript/PHP (no other stuff I'm a total noob in this) script runs and I get his location sent to me and then he gets redirected to google or something else. So basically my question is: Can I get a javascript/php code to send me his location and then just go to google or another website? For the record I went to restrictions and disabled the location feature icon off so he doesn't see it, and I disabled deleting apps, so the webclip thing of the Safari "shortcut" also can't be deleted (i think). Could you please help a poor noob?
1
8,842,716
01/12/2012 21:37:41
1,037,361
11/09/2011 09:49:53
38
0
Inheritence can't access map
I cannot seem to access the map in the parent class from the child class, as i try to output the contents of the map and nothing is displayed if anyone could tell me what i am doing wrong i will be gratefull MY CODE IS BELLOW '//HEADER FILE' //////PARENT CLASS struct TTYElementBase { //some code here }; class element { public: std::map<char,std::string> transMask; std::map<char,std::string>::iterator it; void populate(); }; //////CHILD CLASS .HPP class elementV : public element { public : std::string s1; std::string s2; elementV(); friend ostream &operator<< (ostream &, const elementV &); void transLateMask(); }; //CPP FILE #include "example.h" #include <iostream> elementV::elementV() { } void elementV::transLateMask() { for ( it=transMask.begin() ; it != transMask.end(); it++ ) cout << (*it).first << endl; } int main() { elementV v; v.transLateMask(); } ' OUTPUT IS NOTHING I DONT KNOW WHY?'
c++
inheritance
map
null
null
01/13/2012 01:35:27
too localized
Inheritence can't access map === I cannot seem to access the map in the parent class from the child class, as i try to output the contents of the map and nothing is displayed if anyone could tell me what i am doing wrong i will be gratefull MY CODE IS BELLOW '//HEADER FILE' //////PARENT CLASS struct TTYElementBase { //some code here }; class element { public: std::map<char,std::string> transMask; std::map<char,std::string>::iterator it; void populate(); }; //////CHILD CLASS .HPP class elementV : public element { public : std::string s1; std::string s2; elementV(); friend ostream &operator<< (ostream &, const elementV &); void transLateMask(); }; //CPP FILE #include "example.h" #include <iostream> elementV::elementV() { } void elementV::transLateMask() { for ( it=transMask.begin() ; it != transMask.end(); it++ ) cout << (*it).first << endl; } int main() { elementV v; v.transLateMask(); } ' OUTPUT IS NOTHING I DONT KNOW WHY?'
3