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
2,344,018
02/26/2010 18:45:27
282,280
02/26/2010 18:45:27
1
0
Why is 'java.net.SocketException: jks not found'?
I am passing the same VM arguments '-Djavax.net.ssl.keyStore=./key.jks -Djavax.net.ssl.keyStorePassword=abc -Djavax.net.ssl.trustStore=./key.jks -Djavax.net.ssl.trust=abc -Djavax.net.ssl.trustStorePassword=abc -Djava.protocol.handler.pkgs=com.ibm.net.ssl.internal.www.protocol -Djavax.net.ssl.trustStoreType=JKS -DtraceSettingsFile=trace.log' to a WS client application that runs on Websphere 5.1.1 JRE, one on Windows XP and one on Linux but get different behaviors. On Windows all work fine, but on Linux I am getting an exception right where the WS client is supposed to open a connection: java.net.SocketException: jks not found at javax.net.ssl.DefaultSSLSocketFactory.createSocket(Unknown Source) at com.ibm.ws.webservices.engine.components.net.JSSESocketFactory.create(JSSESocketFactory.java:207) at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$5.run(HTTP11Sender.java:1789) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111) at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$SocketPoolFactory.obtainSocket(HTTP11Sender.java:1781) at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender.invoke(HTTP11Sender.java:185) at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:87) at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212) at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:255) Am I missing something? Thanks Peter
java
java-ee
websphere
null
null
null
open
Why is 'java.net.SocketException: jks not found'? === I am passing the same VM arguments '-Djavax.net.ssl.keyStore=./key.jks -Djavax.net.ssl.keyStorePassword=abc -Djavax.net.ssl.trustStore=./key.jks -Djavax.net.ssl.trust=abc -Djavax.net.ssl.trustStorePassword=abc -Djava.protocol.handler.pkgs=com.ibm.net.ssl.internal.www.protocol -Djavax.net.ssl.trustStoreType=JKS -DtraceSettingsFile=trace.log' to a WS client application that runs on Websphere 5.1.1 JRE, one on Windows XP and one on Linux but get different behaviors. On Windows all work fine, but on Linux I am getting an exception right where the WS client is supposed to open a connection: java.net.SocketException: jks not found at javax.net.ssl.DefaultSSLSocketFactory.createSocket(Unknown Source) at com.ibm.ws.webservices.engine.components.net.JSSESocketFactory.create(JSSESocketFactory.java:207) at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$5.run(HTTP11Sender.java:1789) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111) at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$SocketPoolFactory.obtainSocket(HTTP11Sender.java:1781) at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender.invoke(HTTP11Sender.java:185) at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:87) at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212) at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:255) Am I missing something? Thanks Peter
0
5,909,284
05/06/2011 09:17:39
252,799
01/17/2010 21:19:19
873
46
ruby - empty string as nil to avoid variable caching
`"".chomp` returns `""` and the system command returns empty string if *which* doesn't know it. In other words, the code below will cache "" and not check system again. @wkhtmltoimage ||= `which wkhtmltoimage-proxy`.chomp I'd like to - keep variable caching, not running system command again if found. - avoid running the system command twice in the code in order to check `.empty?` if chomp returned *nil on empty string*, it wouldn't be a problem. Any suggestions?
ruby
null
null
null
null
null
open
ruby - empty string as nil to avoid variable caching === `"".chomp` returns `""` and the system command returns empty string if *which* doesn't know it. In other words, the code below will cache "" and not check system again. @wkhtmltoimage ||= `which wkhtmltoimage-proxy`.chomp I'd like to - keep variable caching, not running system command again if found. - avoid running the system command twice in the code in order to check `.empty?` if chomp returned *nil on empty string*, it wouldn't be a problem. Any suggestions?
0
7,278,025
09/02/2011 00:11:43
379,468
06/29/2010 21:17:31
98
2
On OSX Tiger, where does Adobe Media Encoder save the queue file to?
So I read somewhere that adobe media encoder saves the current queue in an XML file. Unfortunately you can't load or save other queues. My thought was perhaps there is a way to manually do this, back up the xml file then rename to load a new one. But I can't seem to locate where it stores this file. Does anyone know?
xml
batch
adobe
media
encoder
09/02/2011 01:47:05
off topic
On OSX Tiger, where does Adobe Media Encoder save the queue file to? === So I read somewhere that adobe media encoder saves the current queue in an XML file. Unfortunately you can't load or save other queues. My thought was perhaps there is a way to manually do this, back up the xml file then rename to load a new one. But I can't seem to locate where it stores this file. Does anyone know?
2
6,565,952
07/03/2011 22:34:01
827,320
07/03/2011 22:34:01
1
0
creating functions and using function calls in PHP
How would one go about creating a function file that is stored outside of the document root? I want to create a function that could accept 2 - 4 arguments and returns the sum of the arguments and want it in an external file... any ideas / suggestions would help because i seem to be a little (ok, a lot) confused!
php
function
calls
creating
null
null
open
creating functions and using function calls in PHP === How would one go about creating a function file that is stored outside of the document root? I want to create a function that could accept 2 - 4 arguments and returns the sum of the arguments and want it in an external file... any ideas / suggestions would help because i seem to be a little (ok, a lot) confused!
0
7,098,300
08/17/2011 19:25:17
897,491
08/16/2011 20:46:53
1
1
Ruby on Rails: Need Recommendations for Wizards/Spring Webflow-type Solutions
I'm starting work on a multi-page web application using Ruby on Rails 3. My webapp won't be using a database directly - it'll be calling a web service to persist the collected information. Are there any equivalents to Spring Webflow that more advanced RoR developers would recommend? I've looked at examples for wizardly and actsaswizard. Both libraries seem to use ActiveRecord. A few co-workers have experimented with Spring Webflow, which seems to work well, but I'd really like to find a RoR solution. My team would be open to looking at a Rails 3.1 solution, if available. Any feedback would be greatly appreciated. Thanks!
ruby-on-rails-3
wizard
webflow
formwizard
null
null
open
Ruby on Rails: Need Recommendations for Wizards/Spring Webflow-type Solutions === I'm starting work on a multi-page web application using Ruby on Rails 3. My webapp won't be using a database directly - it'll be calling a web service to persist the collected information. Are there any equivalents to Spring Webflow that more advanced RoR developers would recommend? I've looked at examples for wizardly and actsaswizard. Both libraries seem to use ActiveRecord. A few co-workers have experimented with Spring Webflow, which seems to work well, but I'd really like to find a RoR solution. My team would be open to looking at a Rails 3.1 solution, if available. Any feedback would be greatly appreciated. Thanks!
0
7,631,108
10/03/2011 04:45:46
333,239
05/05/2010 09:10:50
201
9
Defy Froyo Kernel
I am a proud owner of Motorola Defy. A few months ago i upgraded my defy from 2.1 to 2.2. Although it had new features it became a bit laggy and so finally i decided to root my defy and install MIUI Gingerbread. I was using MIUI Gingerbread all this time and suddenly it started itching me and a thought came to my mind that i want to experience Motoblur again. I had already created an image of my Motoblur Froyo before installing MIUI Gingerbread. So i went ahead and reverted the Froyo image back on my defy. But then some of the things stopped working..e.g. Camera is not working now. I found that the Foryo image did not copy the Motoblur Froyo Kernel and when i reverted back my defy is still having the MIUI kernel. Can someone help me getting back to Motoblur Froyo! OR Can i download the original kernel and re-install it back to my defy! Anything would help.... Thanks.
android
kernel
froyo
motorola
null
10/03/2011 05:14:07
off topic
Defy Froyo Kernel === I am a proud owner of Motorola Defy. A few months ago i upgraded my defy from 2.1 to 2.2. Although it had new features it became a bit laggy and so finally i decided to root my defy and install MIUI Gingerbread. I was using MIUI Gingerbread all this time and suddenly it started itching me and a thought came to my mind that i want to experience Motoblur again. I had already created an image of my Motoblur Froyo before installing MIUI Gingerbread. So i went ahead and reverted the Froyo image back on my defy. But then some of the things stopped working..e.g. Camera is not working now. I found that the Foryo image did not copy the Motoblur Froyo Kernel and when i reverted back my defy is still having the MIUI kernel. Can someone help me getting back to Motoblur Froyo! OR Can i download the original kernel and re-install it back to my defy! Anything would help.... Thanks.
2
11,007,510
06/13/2012 02:34:45
1,419,734
05/27/2012 03:40:54
1
1
Custom editing mask in UIImagePickerController?
Is it possible to change the "cropping guideline mask" (from `[imagePicker setAllowsEditing:YES];`) displayed after the photo is taken? I thought that `[imagePicker setCameraOverlayView addSubview:customMaskView]` would do it, but apparently that is looks like thats only for the camera screen, and not the subsequent editing screen or from the photo library (since it throws the exception: `'Source type must be UIImagePickerControllerSourceTypeCamera'`). I want to leave the camera view uninhibited, but add a custom mask onto to the editing view. Is it possible to change this editing mask? Or please let me know if I'm just doing it wrong!
iphone
objective-c
ios
uiview
uiimagepickercontroller
null
open
Custom editing mask in UIImagePickerController? === Is it possible to change the "cropping guideline mask" (from `[imagePicker setAllowsEditing:YES];`) displayed after the photo is taken? I thought that `[imagePicker setCameraOverlayView addSubview:customMaskView]` would do it, but apparently that is looks like thats only for the camera screen, and not the subsequent editing screen or from the photo library (since it throws the exception: `'Source type must be UIImagePickerControllerSourceTypeCamera'`). I want to leave the camera view uninhibited, but add a custom mask onto to the editing view. Is it possible to change this editing mask? Or please let me know if I'm just doing it wrong!
0
7,892,610
10/25/2011 16:35:30
275,617
02/17/2010 21:36:58
355
6
Flot memory leak while associating two graphs using panning
we are rendering two graphs with flot, which share the same x-axis. we plot them with: plot1 = $.plot($("#placeholderGraph1"), p1_data, d1_options); plot2 = $.plot($("#placeholderGraph2"), p2_data, d2_options); we need to make sure that panning and zooming on one graph also redraws the other and vice versa. we achieve this with the following binding: $("#placeholderGraph1").bind("plotpan", adjustGraph1Axes); $("#placeholderGraph2").bind("plotpan", adjustGraph2Axes); If we don't add these last two statements, there is no memory leak and browser(all the browsers) drops the memory whenever it redraws. But with the above binding, browser never drops memory and it piles up towards hundreds of megabytes. Apart from this, we also update individual legends with mouse movements. we tried following approaches for the memory leak, but none worked: 1. making plot1 and plot2 global variables and explicitly deleting the contents 2. Deleting the graph divs and recreating 3. Explicitly unbinding events before rebinding 4. Plotting a empty graph before redrawing Any other approaches to associating two graphs or dumping memory?
javascript
jquery
memory-leaks
flot
null
null
open
Flot memory leak while associating two graphs using panning === we are rendering two graphs with flot, which share the same x-axis. we plot them with: plot1 = $.plot($("#placeholderGraph1"), p1_data, d1_options); plot2 = $.plot($("#placeholderGraph2"), p2_data, d2_options); we need to make sure that panning and zooming on one graph also redraws the other and vice versa. we achieve this with the following binding: $("#placeholderGraph1").bind("plotpan", adjustGraph1Axes); $("#placeholderGraph2").bind("plotpan", adjustGraph2Axes); If we don't add these last two statements, there is no memory leak and browser(all the browsers) drops the memory whenever it redraws. But with the above binding, browser never drops memory and it piles up towards hundreds of megabytes. Apart from this, we also update individual legends with mouse movements. we tried following approaches for the memory leak, but none worked: 1. making plot1 and plot2 global variables and explicitly deleting the contents 2. Deleting the graph divs and recreating 3. Explicitly unbinding events before rebinding 4. Plotting a empty graph before redrawing Any other approaches to associating two graphs or dumping memory?
0
9,902,127
03/28/2012 06:20:08
1,138,923
01/09/2012 14:50:39
38
0
How to get total value on dynamic value?
I have form like this : <input type='hidden' name='seq' id='idseq' value='1' /> <div id='add_field' class='locbutton'><a href='#' title='Add'>Add</a></div> <div id='remove_field' class='locbutton2'><a href='#' title='Delete'>Delete</a></div> <div id="idcover"> 1.<br /> <div class="group"> <div class="satu"><input type='text' name='score[1][]' id='score[1][]'></div> <div class="dua"><input type='text' name='weight[1][]' id='weight[1][]'> %</div> <div class="tiga"><input type='text' name='weightscore[1][]' id='weightscore[1][]' disabled></div> </div> </div> <br /><br /> <div id='idtotalcover' class='totalcover'> Total <div class='total'><input type='text' name='total' id='idtotal' disabled /></div> </div> This is the jquery script: <script type="text/javascript"> $(document).ready( function () { $("input[id^=score],input[id^=weight]").bind("keyup", recalc); recalc(); var counter = $("#idseq").val(); $("#add_field").click(function () { counter++; $.ajax({ url: 'addinput.php', dataType: "html", data: "count="+counter, success: function(data) { $('#idcover').append(data); $('.dua input').keyup(function() { var $duaInput = $(this); var weight=$duaInput.val(); var score=$duaInput.closest(".group").find('.satu input').val(); $.ajax({ url: "cekweightscore.php", data: "score="+score+"&weight="+weight, success: function(data) { $duaInput.closest(".group").find('.tiga input').val(data); }//success });//ajax }); }//success });//ajax }); }); function recalc() { var a=$("input[id^=score]"); var b=$("input[id^=weight]"); $("[id^=weightscore]").calc("(score * weight)/100",{score: a,weight: b}, function (s) { return s.toFixed(2); }, function ($this){ //function($("[id^=weightscore]")){ // sum the total of the $("[id^=total_item]") selector //alert($this); //var sum = $this.sum(); var sum=$this.sum(); $("#idtotal").val(sum.toFixed(2)); } ); } </script> This is the php code: <? $count=$_GET['count']; echo" <br> $count <div class='group' > <div class='satu'> <input type='text' name='score[$count][]' id='score[$count][]'> </div> <div class='dua'> <input type='text' name='weight[$count][]' id='weight[$count][]'> % </div> <div class='tiga'> <input type='text' name='weightscore[$count][]' id='weightscore[$count][]' disabled> </div> </div>"; ?> When I click the Add button, i cant get value on new form so that the new form cannot be calculated. What can i do to get total value on dynamic value ?
php
jquery
input
null
null
null
open
How to get total value on dynamic value? === I have form like this : <input type='hidden' name='seq' id='idseq' value='1' /> <div id='add_field' class='locbutton'><a href='#' title='Add'>Add</a></div> <div id='remove_field' class='locbutton2'><a href='#' title='Delete'>Delete</a></div> <div id="idcover"> 1.<br /> <div class="group"> <div class="satu"><input type='text' name='score[1][]' id='score[1][]'></div> <div class="dua"><input type='text' name='weight[1][]' id='weight[1][]'> %</div> <div class="tiga"><input type='text' name='weightscore[1][]' id='weightscore[1][]' disabled></div> </div> </div> <br /><br /> <div id='idtotalcover' class='totalcover'> Total <div class='total'><input type='text' name='total' id='idtotal' disabled /></div> </div> This is the jquery script: <script type="text/javascript"> $(document).ready( function () { $("input[id^=score],input[id^=weight]").bind("keyup", recalc); recalc(); var counter = $("#idseq").val(); $("#add_field").click(function () { counter++; $.ajax({ url: 'addinput.php', dataType: "html", data: "count="+counter, success: function(data) { $('#idcover').append(data); $('.dua input').keyup(function() { var $duaInput = $(this); var weight=$duaInput.val(); var score=$duaInput.closest(".group").find('.satu input').val(); $.ajax({ url: "cekweightscore.php", data: "score="+score+"&weight="+weight, success: function(data) { $duaInput.closest(".group").find('.tiga input').val(data); }//success });//ajax }); }//success });//ajax }); }); function recalc() { var a=$("input[id^=score]"); var b=$("input[id^=weight]"); $("[id^=weightscore]").calc("(score * weight)/100",{score: a,weight: b}, function (s) { return s.toFixed(2); }, function ($this){ //function($("[id^=weightscore]")){ // sum the total of the $("[id^=total_item]") selector //alert($this); //var sum = $this.sum(); var sum=$this.sum(); $("#idtotal").val(sum.toFixed(2)); } ); } </script> This is the php code: <? $count=$_GET['count']; echo" <br> $count <div class='group' > <div class='satu'> <input type='text' name='score[$count][]' id='score[$count][]'> </div> <div class='dua'> <input type='text' name='weight[$count][]' id='weight[$count][]'> % </div> <div class='tiga'> <input type='text' name='weightscore[$count][]' id='weightscore[$count][]' disabled> </div> </div>"; ?> When I click the Add button, i cant get value on new form so that the new form cannot be calculated. What can i do to get total value on dynamic value ?
0
7,682,023
10/07/2011 00:43:05
969,068
09/28/2011 12:32:55
18
0
jquery to display diffrent text onclick
I have this current script which works great for changing class names $('#mydiv li a').click( function(e) { e.preventDefault(); // prevent the default action e.stopPropagation(); // stop the click from bubbling $(this).closest('ul').find('.current').removeClass('current'); $(this).addClass('current'); }); <ul> <li><a href="" class="current">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> <li><a href="#">four</a></li> </ul> Now i have 4 diffrent div's area <div id="first">some text and form</div> <div id="second">some text and form</div> <div id="third">some text and form</div> <div id="last">some text and form</div> which i have hidden with jquery like $(#second).hide(); $(#third).hide();$(#last).hide(); so when page loads one #first is visible on page, if i click on second href from above list item i wants to initialize $(#second).show(); and hide other 3 div's, if i click on 3rd href from above list i wants to display $(#third).show(); and so on. So from 4 div's only one should be visible on page. can someone help me to show how i can achieve it with above code? Thanks
jquery
null
null
null
null
null
open
jquery to display diffrent text onclick === I have this current script which works great for changing class names $('#mydiv li a').click( function(e) { e.preventDefault(); // prevent the default action e.stopPropagation(); // stop the click from bubbling $(this).closest('ul').find('.current').removeClass('current'); $(this).addClass('current'); }); <ul> <li><a href="" class="current">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> <li><a href="#">four</a></li> </ul> Now i have 4 diffrent div's area <div id="first">some text and form</div> <div id="second">some text and form</div> <div id="third">some text and form</div> <div id="last">some text and form</div> which i have hidden with jquery like $(#second).hide(); $(#third).hide();$(#last).hide(); so when page loads one #first is visible on page, if i click on second href from above list item i wants to initialize $(#second).show(); and hide other 3 div's, if i click on 3rd href from above list i wants to display $(#third).show(); and so on. So from 4 div's only one should be visible on page. can someone help me to show how i can achieve it with above code? Thanks
0
1,832,236
12/02/2009 11:06:42
206,003
11/08/2009 11:23:15
8
0
creating a dropdown with customized options
Situation: There is a page with 2 dropdowns. On clicking the first drop down, you get a list of companies. After selecting a company, the second dropdown, labelled Comapany's Project, should automatically customise its list to the list of projects associated with the selected company. How can the second drop down be achieved?
.net
drop-down-menu
null
null
null
12/04/2010 05:47:41
not a real question
creating a dropdown with customized options === Situation: There is a page with 2 dropdowns. On clicking the first drop down, you get a list of companies. After selecting a company, the second dropdown, labelled Comapany's Project, should automatically customise its list to the list of projects associated with the selected company. How can the second drop down be achieved?
1
3,982,048
10/20/2010 20:34:17
481,224
10/20/2010 03:40:58
6
0
computer science GPA
I just wonder how important is my computer science GPA in terms of getting my first job? right now I only have a 2.5 GPA, which is kind of bad. can I just leave it out on my resume? do employers really care what my GPA is? I've heard stories of people getting into big name companies like Microsoft with 2.0 GPA.
gpa
null
null
null
null
10/20/2010 20:39:29
off topic
computer science GPA === I just wonder how important is my computer science GPA in terms of getting my first job? right now I only have a 2.5 GPA, which is kind of bad. can I just leave it out on my resume? do employers really care what my GPA is? I've heard stories of people getting into big name companies like Microsoft with 2.0 GPA.
2
9,442,326
02/25/2012 07:52:10
1,191,660
02/06/2012 06:12:41
11
2
E:unable to bind netlink socket no such a file directory
last time i open my app its runnig but now my emulator stock, here the logcat : "E: unable to bind netlink socket no such a file directory" help me out on this error i cant find in google
android
android-intent
android-emulator
null
null
null
open
E:unable to bind netlink socket no such a file directory === last time i open my app its runnig but now my emulator stock, here the logcat : "E: unable to bind netlink socket no such a file directory" help me out on this error i cant find in google
0
7,791,403
10/17/2011 08:51:25
855,331
07/21/2011 06:46:13
1
3
XAMPP 1.7.7 - port 80 and 8080 are taken, how do i change Tomcat's port?
I have read http://stackoverflow.com/questions/4756039/how-to-change-the-port-of-tomcat-from-8080-to-80 (and similar pages), and have already tried this (I've tried port 8888, 8090 and 8088), but Tomcat still wants to listen on 8080. As the title says, port 80 and 8080 are already taken by IIS and Apache respectively. And no, I can't disable IIS because it is in use by other processes. Solutions, anyone?
apache
tomcat
xampp
port
null
10/17/2011 14:59:34
off topic
XAMPP 1.7.7 - port 80 and 8080 are taken, how do i change Tomcat's port? === I have read http://stackoverflow.com/questions/4756039/how-to-change-the-port-of-tomcat-from-8080-to-80 (and similar pages), and have already tried this (I've tried port 8888, 8090 and 8088), but Tomcat still wants to listen on 8080. As the title says, port 80 and 8080 are already taken by IIS and Apache respectively. And no, I can't disable IIS because it is in use by other processes. Solutions, anyone?
2
11,712,470
07/29/2012 19:57:42
1,406,854
05/20/2012 23:47:57
6
0
I am a beginner in C# and need help creating a proper method
Ok, here is my assignment at school. 1. Create a console application named CreateVehicle. 2. Develop a Vehicle class that captures the following information: a. Company b. Model c. MRSP d. Number of vehicles created. 3. Your class should have a null constructor and at least one additional constructor to collect the full information on creation. 4. Have a method to buy the vehicle. 5. Create an efficient way to print out all of the information collected on a vehicle. 6. Develop a class to test your Vehicle class. In this class do the following: a. Create the following vehicles from the information below: Car: Model: MSRP: Aston Martin Vantage $129,000 Ford Fusion $ 28,678.99 Honda Civic EX $ 18,713.27 b. Exercise your Buy method by buying the Honda Civic. c. Use your print method to print out all relevant information on the vehicles above. d. When you buy your Honda print out the fact that you bought the Honda. 7. Bonus points (10). Include a flag item in your class that tells the status of whether the created vehicle was bought or not and have that status print out in your overall Vehicle class print method. Here is the code I've come up with so far, but I'm not sure where to go from here or how to fix the parts with syntax problems. I'm definitely not sure how my BuyVehicle method is supposed to work: Program.cs using System; namespace CreateVehicle { class Program { static void Main(string[] args) { Vehicle firstVehicle = new Vehicle("Aston Martin", "Vantage", 129000); Console.WriteLine(firstVehicle.ToString()); firstVehicle.BuyVehicle(true); Console.WriteLine("You bought a {0}", firstVehicle.Model); Vehicle secondVehicle = new Vehicle("Ford", "Fusion", 28678.99); Console.WriteLine(secondVehicle.ToString()); Vehicle thirdVehicle = new Vehicle("Honda", "Civic EX", 18713.27); Console.WriteLine(thirdVehicle.ToString()); } } } Vehicle.cs using System; namespace CreateVehicle { class Vehicle { public string companyName; private static int totalVehicles = 0; private string mModel; private string mMSRP; public Vehicle() { companyName = "Not assigned"; mModel = "Not assigned"; mMSRP = 0; totalVehicles++; } public Vehicle(string companyName, string model, double price) { this.companyName = companyName; mModel = model; mMSRP = price; totalVehicles++; } public string Model { get { return mModel; } } public decimal MSRP { get { return mMSRP; } set { if (value >= 0) { mMSRP = value; } else { mMSRP = 0; } } } public string BuyVehicle(Boolean buy) { if (buy == true) { return mModel; } else { return ""; } public override string ToString() { return "Vehicle Data: \n\t" + "Company Name: " + companyName + "\n\t" + "Model: " + mModel + "\n\t" + "MSRP: " + mMSRP.ToString("C") + "\n\t" + "Total vehicles: " + totalVehicles + "\n"; } } }
c#
visual-studio-2010
homework
class
methods
07/30/2012 02:24:03
not a real question
I am a beginner in C# and need help creating a proper method === Ok, here is my assignment at school. 1. Create a console application named CreateVehicle. 2. Develop a Vehicle class that captures the following information: a. Company b. Model c. MRSP d. Number of vehicles created. 3. Your class should have a null constructor and at least one additional constructor to collect the full information on creation. 4. Have a method to buy the vehicle. 5. Create an efficient way to print out all of the information collected on a vehicle. 6. Develop a class to test your Vehicle class. In this class do the following: a. Create the following vehicles from the information below: Car: Model: MSRP: Aston Martin Vantage $129,000 Ford Fusion $ 28,678.99 Honda Civic EX $ 18,713.27 b. Exercise your Buy method by buying the Honda Civic. c. Use your print method to print out all relevant information on the vehicles above. d. When you buy your Honda print out the fact that you bought the Honda. 7. Bonus points (10). Include a flag item in your class that tells the status of whether the created vehicle was bought or not and have that status print out in your overall Vehicle class print method. Here is the code I've come up with so far, but I'm not sure where to go from here or how to fix the parts with syntax problems. I'm definitely not sure how my BuyVehicle method is supposed to work: Program.cs using System; namespace CreateVehicle { class Program { static void Main(string[] args) { Vehicle firstVehicle = new Vehicle("Aston Martin", "Vantage", 129000); Console.WriteLine(firstVehicle.ToString()); firstVehicle.BuyVehicle(true); Console.WriteLine("You bought a {0}", firstVehicle.Model); Vehicle secondVehicle = new Vehicle("Ford", "Fusion", 28678.99); Console.WriteLine(secondVehicle.ToString()); Vehicle thirdVehicle = new Vehicle("Honda", "Civic EX", 18713.27); Console.WriteLine(thirdVehicle.ToString()); } } } Vehicle.cs using System; namespace CreateVehicle { class Vehicle { public string companyName; private static int totalVehicles = 0; private string mModel; private string mMSRP; public Vehicle() { companyName = "Not assigned"; mModel = "Not assigned"; mMSRP = 0; totalVehicles++; } public Vehicle(string companyName, string model, double price) { this.companyName = companyName; mModel = model; mMSRP = price; totalVehicles++; } public string Model { get { return mModel; } } public decimal MSRP { get { return mMSRP; } set { if (value >= 0) { mMSRP = value; } else { mMSRP = 0; } } } public string BuyVehicle(Boolean buy) { if (buy == true) { return mModel; } else { return ""; } public override string ToString() { return "Vehicle Data: \n\t" + "Company Name: " + companyName + "\n\t" + "Model: " + mModel + "\n\t" + "MSRP: " + mMSRP.ToString("C") + "\n\t" + "Total vehicles: " + totalVehicles + "\n"; } } }
1
6,561,064
07/03/2011 04:16:55
192,298
10/19/2009 08:38:40
161
2
Displaying images like Google Image Search
Does anybody know of a script that will let me diplay image results in the way that Google Image Search does (image grid view) with hover to enlarge and details? Something that I can just "plug-and-play" so to speak.
javascript
jquery
user-interface
null
null
null
open
Displaying images like Google Image Search === Does anybody know of a script that will let me diplay image results in the way that Google Image Search does (image grid view) with hover to enlarge and details? Something that I can just "plug-and-play" so to speak.
0
11,205,117
06/26/2012 10:14:17
1,400,581
05/17/2012 09:14:58
24
0
How can i goto appdelegate class
Iam developing one application.In that i set the notification in viewcontroller1.And close the application.After getting the notification iam directly going to viewcontroller1 xib not main xib.I written code like that.But my problem is after coming to viewcontroller1 xib,that contain the cancel button.When i click on cancel button i need to go to appdelegate class.But its not going.That cancel button is working when i come from appdelegate class.But its not working when i come directly to this class.That cancel method contain [self.view dismissviewcontroller];So please tell me how can i go to appdelegate class when i click on cancel button.
iphone
null
null
null
null
06/26/2012 16:38:07
not a real question
How can i goto appdelegate class === Iam developing one application.In that i set the notification in viewcontroller1.And close the application.After getting the notification iam directly going to viewcontroller1 xib not main xib.I written code like that.But my problem is after coming to viewcontroller1 xib,that contain the cancel button.When i click on cancel button i need to go to appdelegate class.But its not going.That cancel button is working when i come from appdelegate class.But its not working when i come directly to this class.That cancel method contain [self.view dismissviewcontroller];So please tell me how can i go to appdelegate class when i click on cancel button.
1
3,917,085
10/12/2010 16:51:43
383,609
07/05/2010 11:20:27
52
4
C++ cross platform USB library?
I'm (going to be) writing an application in Qt that will run on the 3 main OSes (Windoze, Linux and Mac). One of the features of this app is that it needs USB to talk to a piece of custom external hardware. Would anyone know of a cross platform USB library so porting is as easy as possible? Or am I going to be slugging it out on Windoze because Micro$oft's overpaid developers can't write propper APIs? (sorry for mini rant) James
c++
c
cross-platform
usb
null
null
open
C++ cross platform USB library? === I'm (going to be) writing an application in Qt that will run on the 3 main OSes (Windoze, Linux and Mac). One of the features of this app is that it needs USB to talk to a piece of custom external hardware. Would anyone know of a cross platform USB library so porting is as easy as possible? Or am I going to be slugging it out on Windoze because Micro$oft's overpaid developers can't write propper APIs? (sorry for mini rant) James
0
9,328,471
02/17/2012 12:47:06
1,095,606
12/13/2011 11:11:43
6
2
Making a panel persist despite click on page opened in browser
I want to achieve this 1. Anchor a panel to a widget 2. make it persist 3. It will only appear or disappear when widget is clicked 4. or It may be made to disappear by clicking some button on it I want to achieve this because my addon is entirely residing in a panel [Here][1] is the addon. [1]: https://addons.mozilla.org/en-US/firefox/search/?q=gradientoo&appver=10.0.1&platform=windows
firefox-addon-sdk
null
null
null
null
null
open
Making a panel persist despite click on page opened in browser === I want to achieve this 1. Anchor a panel to a widget 2. make it persist 3. It will only appear or disappear when widget is clicked 4. or It may be made to disappear by clicking some button on it I want to achieve this because my addon is entirely residing in a panel [Here][1] is the addon. [1]: https://addons.mozilla.org/en-US/firefox/search/?q=gradientoo&appver=10.0.1&platform=windows
0
5,884,168
05/04/2011 13:28:05
158,008
08/17/2009 20:35:44
681
4
CU updates with SP2?
I am planning to update My MOSS SP1 to SP2. But SP2 was released almost 2 years back. After that there were so many CUs released. If download SP2 for MOSS. Will all CUs will come with SP2 or Do I need install CU separately after installing SP2. Please give me suggestions
.net
asp.net
sharepoint
sharepoint2007
null
05/04/2011 18:35:53
off topic
CU updates with SP2? === I am planning to update My MOSS SP1 to SP2. But SP2 was released almost 2 years back. After that there were so many CUs released. If download SP2 for MOSS. Will all CUs will come with SP2 or Do I need install CU separately after installing SP2. Please give me suggestions
2
8,766,980
01/07/2012 02:58:03
867,895
07/28/2011 16:20:29
2,835
232
Logic in making sure a int variable doesnt exceed 0
Okay i know this may be simple but i am struggling with it for some reason. What i am trying to do is not allow a user's score to go into the negative. For example, a user score is 10..Then they get a -11. instead of the int going to -1 i would like for it to just go to 0. Now, ive came up with this code so far. hitCount -=10; if(hitCount <= 0){ hitCount = 0; }else{ hitCount -=10; } As you see i deduct -10 initially but run a check to make sure the number isnt negative, and if it is we set it to 0. The only problem is, when the hitCount is 11 and then - 10. it subtracts to -9 for some reason. I just want it to simply go to 0 and not beyond that. Any suggestions?
java
null
null
null
null
01/07/2012 03:51:24
too localized
Logic in making sure a int variable doesnt exceed 0 === Okay i know this may be simple but i am struggling with it for some reason. What i am trying to do is not allow a user's score to go into the negative. For example, a user score is 10..Then they get a -11. instead of the int going to -1 i would like for it to just go to 0. Now, ive came up with this code so far. hitCount -=10; if(hitCount <= 0){ hitCount = 0; }else{ hitCount -=10; } As you see i deduct -10 initially but run a check to make sure the number isnt negative, and if it is we set it to 0. The only problem is, when the hitCount is 11 and then - 10. it subtracts to -9 for some reason. I just want it to simply go to 0 and not beyond that. Any suggestions?
3
1,971,183
12/28/2009 19:47:55
236,215
12/21/2009 17:39:14
26
1
when does c++ allocate/deallocate string literals
When is the string literal "hello" allocated and deallocated during the lifetime of the program in this example? <code> init(char **s) { *s = "hello"; } int f() { char *s = 0; init(&s); printf("%s\n", s); return 0; } </code>
memory-allocation
c++
null
null
null
null
open
when does c++ allocate/deallocate string literals === When is the string literal "hello" allocated and deallocated during the lifetime of the program in this example? <code> init(char **s) { *s = "hello"; } int f() { char *s = 0; init(&s); printf("%s\n", s); return 0; } </code>
0
6,304,280
06/10/2011 09:11:50
531,984
12/06/2010 08:29:33
300
7
Alternative to infopath
I'm looking for an application that provides similar functionality to what ms infopath provides. It should preferably be free or open source. I have done some searching, however I cannot seem to find a suitable product.
infopath
alternative
null
null
null
null
open
Alternative to infopath === I'm looking for an application that provides similar functionality to what ms infopath provides. It should preferably be free or open source. I have done some searching, however I cannot seem to find a suitable product.
0
6,456,801
06/23/2011 15:39:58
812,545
06/23/2011 15:39:58
1
0
Using scala and lift, how can I do efficient filtering operations on documents in a collection of mongodb?
I have a User collection in mongodb and am using lift/scala to do User.findAll operations and retrieve the number of users that were created within certain time frames. I am taking advantage of the getTime method of an objectId, however I need to apply a few methods and multiply to get the string that is stored in each document, convert it back to an objectID and convert to seconds from milliseconds. This is the line of code for users created in the last hour: val users = User.findAll.filter{ u:User => ((((ObjectId.massageToObjectId(u._id)).getTime)* 1000) <= 3600)}.length I need to find a way to do this inside the database as opposed to getting all the data into memory and then filtering it with the function. In the past I have used queryBuilder in ways like this to accomplish the same goal but in this case I had no other methods of calculations to apply to the value from the document: val qry1 = QueryBuilder.start("numberOfFriends").greaterThan(0).get var oneplus:List[User] = User.findAll{qry1} I also am aware of methods like this: User.findAll(("name" -> "joe") ~ ("age" -> 27)) And I know that findall can take in many other things like a DBObject called sort. But i am unfamiliar with how to use that. If anyone knows how to manipulate one of these methods or can suggest another it would be greatly appreciated. Thanks, -Ronnie
database
query
scala
mongodb
filter
null
open
Using scala and lift, how can I do efficient filtering operations on documents in a collection of mongodb? === I have a User collection in mongodb and am using lift/scala to do User.findAll operations and retrieve the number of users that were created within certain time frames. I am taking advantage of the getTime method of an objectId, however I need to apply a few methods and multiply to get the string that is stored in each document, convert it back to an objectID and convert to seconds from milliseconds. This is the line of code for users created in the last hour: val users = User.findAll.filter{ u:User => ((((ObjectId.massageToObjectId(u._id)).getTime)* 1000) <= 3600)}.length I need to find a way to do this inside the database as opposed to getting all the data into memory and then filtering it with the function. In the past I have used queryBuilder in ways like this to accomplish the same goal but in this case I had no other methods of calculations to apply to the value from the document: val qry1 = QueryBuilder.start("numberOfFriends").greaterThan(0).get var oneplus:List[User] = User.findAll{qry1} I also am aware of methods like this: User.findAll(("name" -> "joe") ~ ("age" -> 27)) And I know that findall can take in many other things like a DBObject called sort. But i am unfamiliar with how to use that. If anyone knows how to manipulate one of these methods or can suggest another it would be greatly appreciated. Thanks, -Ronnie
0
9,422,031
02/23/2012 21:58:02
696,485
04/07/2011 09:18:36
174
5
GUI for Mono port of .NET 4 application using WPF
I've decided to port a little C# .NET application over to linux. It uses .NET 4, and the author (not me) decided to use WPF because he had performance issues with Winforms. http://www.mono-project.com/Gui_Toolkits shows quite a lot of possible options for me to use, but I'm relatively new to C# and even more so to Mono. I need it to be fast, and preferably fairly lightweight. What would you recommend and why?
c#
.net
gui
mono
port
02/24/2012 22:10:56
not constructive
GUI for Mono port of .NET 4 application using WPF === I've decided to port a little C# .NET application over to linux. It uses .NET 4, and the author (not me) decided to use WPF because he had performance issues with Winforms. http://www.mono-project.com/Gui_Toolkits shows quite a lot of possible options for me to use, but I'm relatively new to C# and even more so to Mono. I need it to be fast, and preferably fairly lightweight. What would you recommend and why?
4
6,693,708
07/14/2011 13:14:13
479,003
10/18/2010 06:06:57
155
1
using get or post to pass argument to django view
In my django app ,I need to call a view with an argument named 'year'. Then in the template,I created a form and a dropdown list using a list of year names,At this point,I am confused as to how the view should be invoked. The view is named 'create_report_for_data_of_the_year'.It expects a year argument. ie, http://127.0.0.1:8000/myapp/reports/2011 I tried to write the template as shown below. <li id="yearlydataplots" class="report"> <form action="create_report_for_data_of_the_year" > <select name="year" id="year"> {% for anyear in years %} <option value={{anyear}} > {{anyear}}</option> {% endfor %} </select> <input type="submit" value="Plot for entries of the year"/> </form> </li> However,when the submit button is clicked,the browser goes to http://127.0.0.1:8000/myapp/reports/create_report_for_data_of_the_year?year=2006 which causes a 404. I changed method="post", and clicking submit goes to http://127.0.0.1:8000/myapp/reports/create_report_for_data_of_the_year which again causes 404 I know,I am missing something very basic :-)..If someone can kindly point it out,it would be nice thanks in advance, mark def create_report_for_data_of_the_year(request,year,page_title,template_name): dataset=MyDataModel.objects.filter(today__year=year,creator=request.user) #today is a field in MyDataModel and is a datetime.datetime map = create_map_of_names_and_values(dataset) basefilename = "plotofdataforyear%s"%year page_title = page_title+" "+year imgfilename= create_plot(map,basefilename) report_data={'basefilename':basefilename,'plot_image':imgfilename,'year':year,'page_title':page_title} report_data["name_value_dict"]=map req_context=RequestContext(request,context) return render_to_response(template_name,req_context) and url mapping is ... url(r'^reports/(?P<year>\d{4})/$','myapp.views.create_report_for_data_of_the_year', { 'template_name':'myapp/report_for_data_of_the_year.html', 'page_title':'report for data in the Year' },name='report_data_for_year' ), ...
django
select
view
option
arguments
null
open
using get or post to pass argument to django view === In my django app ,I need to call a view with an argument named 'year'. Then in the template,I created a form and a dropdown list using a list of year names,At this point,I am confused as to how the view should be invoked. The view is named 'create_report_for_data_of_the_year'.It expects a year argument. ie, http://127.0.0.1:8000/myapp/reports/2011 I tried to write the template as shown below. <li id="yearlydataplots" class="report"> <form action="create_report_for_data_of_the_year" > <select name="year" id="year"> {% for anyear in years %} <option value={{anyear}} > {{anyear}}</option> {% endfor %} </select> <input type="submit" value="Plot for entries of the year"/> </form> </li> However,when the submit button is clicked,the browser goes to http://127.0.0.1:8000/myapp/reports/create_report_for_data_of_the_year?year=2006 which causes a 404. I changed method="post", and clicking submit goes to http://127.0.0.1:8000/myapp/reports/create_report_for_data_of_the_year which again causes 404 I know,I am missing something very basic :-)..If someone can kindly point it out,it would be nice thanks in advance, mark def create_report_for_data_of_the_year(request,year,page_title,template_name): dataset=MyDataModel.objects.filter(today__year=year,creator=request.user) #today is a field in MyDataModel and is a datetime.datetime map = create_map_of_names_and_values(dataset) basefilename = "plotofdataforyear%s"%year page_title = page_title+" "+year imgfilename= create_plot(map,basefilename) report_data={'basefilename':basefilename,'plot_image':imgfilename,'year':year,'page_title':page_title} report_data["name_value_dict"]=map req_context=RequestContext(request,context) return render_to_response(template_name,req_context) and url mapping is ... url(r'^reports/(?P<year>\d{4})/$','myapp.views.create_report_for_data_of_the_year', { 'template_name':'myapp/report_for_data_of_the_year.html', 'page_title':'report for data in the Year' },name='report_data_for_year' ), ...
0
9,857,767
03/25/2012 03:43:52
1,233,647
02/26/2012 10:06:11
57
1
java: run process by crontab
My search system has two main parts: index and search. I want to make the index as a java process which can be called by crontab. But I have no idea how to implement this. Could someone tell my how to do it?
java
null
null
null
null
null
open
java: run process by crontab === My search system has two main parts: index and search. I want to make the index as a java process which can be called by crontab. But I have no idea how to implement this. Could someone tell my how to do it?
0
9,063,566
01/30/2012 12:02:26
1,175,951
01/29/2012 01:54:08
1
0
How much bandwidth is used by Javascript/PHP GET and POST
When sending just a simple XMLHTTPrequest how much bandwidth is actually used to send it to the web server. How much to send it back from the web server?
php
javascript
xmlhttprequest
bandwidth
web-developer
01/31/2012 04:41:10
not a real question
How much bandwidth is used by Javascript/PHP GET and POST === When sending just a simple XMLHTTPrequest how much bandwidth is actually used to send it to the web server. How much to send it back from the web server?
1
6,008,446
05/15/2011 12:47:22
711,400
04/16/2011 17:59:31
41
1
javascript confirmation box??
Public Function CheckIfItemPresent(ByVal userID As String, ByVal itemID As String, ByVal itemPrice As Integer, ByVal offer As String) As Boolean On Error GoTo galti Dim sqlStatement As String = "SELECT itemQtty FROM shoppingCart WHERE userID = '" & _ userID & "' AND itemID = '" & itemID & "'" & _ " AND itemPrice = " & itemPrice & " AND offer = '" & offer & "'" Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;" & _ "AttachDbFilename=|DataDirectory|\database.mdf;" & _ "Integrated Security=True;User Instance=True") Dim sql As New SqlClient.SqlCommand(sqlStatement, con) Dim reader As SqlClient.SqlDataReader con.Open() reader = sql.ExecuteReader reader.Read() Dim itemQtty As Integer = reader.Item("itemQtty") reader.Close() If itemQtty > 0 Then If ***MsgBox("Item already present. Add another one? Currently, number of this item in cart: " & itemQtty, MsgBoxStyle.YesNo, "") = MsgBoxResult.Yes*** Then itemQtty = itemQtty + 1 sql.CommandText = "UPDATE shoppingCart SET itemQtty = " & itemQtty & " WHERE " & _ "userID = '" & userID & "' AND itemID = '" & itemID & "' AND itemPrice=" & _ itemPrice & " AND offer = '" & offer & "'" sql.ExecuteNonQuery() Else End If End If con.Close() con.Dispose() Return True Exit Function galti: con.Close() con.Dispose() Return False End Function how to use javascript conformation box instead of asp.net msgbox...please check the portion in between ***
javascript
asp.net
messagebox
null
null
05/15/2011 13:09:57
not a real question
javascript confirmation box?? === Public Function CheckIfItemPresent(ByVal userID As String, ByVal itemID As String, ByVal itemPrice As Integer, ByVal offer As String) As Boolean On Error GoTo galti Dim sqlStatement As String = "SELECT itemQtty FROM shoppingCart WHERE userID = '" & _ userID & "' AND itemID = '" & itemID & "'" & _ " AND itemPrice = " & itemPrice & " AND offer = '" & offer & "'" Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;" & _ "AttachDbFilename=|DataDirectory|\database.mdf;" & _ "Integrated Security=True;User Instance=True") Dim sql As New SqlClient.SqlCommand(sqlStatement, con) Dim reader As SqlClient.SqlDataReader con.Open() reader = sql.ExecuteReader reader.Read() Dim itemQtty As Integer = reader.Item("itemQtty") reader.Close() If itemQtty > 0 Then If ***MsgBox("Item already present. Add another one? Currently, number of this item in cart: " & itemQtty, MsgBoxStyle.YesNo, "") = MsgBoxResult.Yes*** Then itemQtty = itemQtty + 1 sql.CommandText = "UPDATE shoppingCart SET itemQtty = " & itemQtty & " WHERE " & _ "userID = '" & userID & "' AND itemID = '" & itemID & "' AND itemPrice=" & _ itemPrice & " AND offer = '" & offer & "'" sql.ExecuteNonQuery() Else End If End If con.Close() con.Dispose() Return True Exit Function galti: con.Close() con.Dispose() Return False End Function how to use javascript conformation box instead of asp.net msgbox...please check the portion in between ***
1
9,214,314
02/09/2012 16:02:23
1,199,397
02/09/2012 10:32:15
1
0
Rougelike game library for mac
I am looking into making a "rouge-like" game, preferably in python/Java/C++ and it has to run on a mac. I have looked into using the libtcod library but there doesn't seem to be an easy way of compiling with that on a mac.
java
c++
python
null
null
02/09/2012 16:20:45
not constructive
Rougelike game library for mac === I am looking into making a "rouge-like" game, preferably in python/Java/C++ and it has to run on a mac. I have looked into using the libtcod library but there doesn't seem to be an easy way of compiling with that on a mac.
4
4,323,934
12/01/2010 11:39:41
145,261
07/26/2009 11:30:12
691
87
adding icon between back button & title of navigation bar
I want to put an icon by side of the title of my navigation bar. I'd prefer not to implement it as a custom titleView, because then i'll need to create a custom titleView for each controller i put on the stack (and I have pretty deep nesting). I'm adding currently as an UIImageView to a navigationBar, which. My problem is to calculate exactly this icon's horizontal position. It depends on the length of the back button, which has each time another title. How do I calculate this back button frame? Googling on it seems doesn't bring any reasonable results. Thanks in advance
iphone
size
uinavigationbar
uibarbuttonitem
null
null
open
adding icon between back button & title of navigation bar === I want to put an icon by side of the title of my navigation bar. I'd prefer not to implement it as a custom titleView, because then i'll need to create a custom titleView for each controller i put on the stack (and I have pretty deep nesting). I'm adding currently as an UIImageView to a navigationBar, which. My problem is to calculate exactly this icon's horizontal position. It depends on the length of the back button, which has each time another title. How do I calculate this back button frame? Googling on it seems doesn't bring any reasonable results. Thanks in advance
0
4,453,569
12/15/2010 18:36:55
32,834
10/30/2008 17:00:00
923
18
How to find the code for color I like ?
There is a color I like in an image, but how can I find the code [ i.e. #FFC6A5 ] for it ? The image is in .png format.
colors
null
null
null
null
12/15/2010 18:40:59
off topic
How to find the code for color I like ? === There is a color I like in an image, but how can I find the code [ i.e. #FFC6A5 ] for it ? The image is in .png format.
2
7,419,409
09/14/2011 16:03:51
888,495
08/10/2011 18:02:06
19
1
Image Processing using Gabor Filter
I am trying to execute gabor filter on images. %% Read clear all; close all; clc; I=imread('test.png'); imshow(I); %% Crop I2 = imcrop(I); figure, imshow(I2) m=size(I2,1); n=size(I2,2); %% Gabor phi = 7*pi/8; theta = 2; sigma = 0.65*theta; for i=1:3 for j=1:3 xprime= j*cos(phi); yprime= i*sin(phi); K = exp(2*pi*theta*i(xprime+ yprime)); G= exp(-(i.^2+j.^2)/(sigma^2)).*abs(K); end end %% Convolve for i=1:m for j=1:n J(i,j)=conv2(I2,G); end end imshow(uint8(J)) I am getting this error always. ??? Subscript indices must either be real positive integers or logicals. Not sure how to solve this...
matlab
null
null
null
null
null
open
Image Processing using Gabor Filter === I am trying to execute gabor filter on images. %% Read clear all; close all; clc; I=imread('test.png'); imshow(I); %% Crop I2 = imcrop(I); figure, imshow(I2) m=size(I2,1); n=size(I2,2); %% Gabor phi = 7*pi/8; theta = 2; sigma = 0.65*theta; for i=1:3 for j=1:3 xprime= j*cos(phi); yprime= i*sin(phi); K = exp(2*pi*theta*i(xprime+ yprime)); G= exp(-(i.^2+j.^2)/(sigma^2)).*abs(K); end end %% Convolve for i=1:m for j=1:n J(i,j)=conv2(I2,G); end end imshow(uint8(J)) I am getting this error always. ??? Subscript indices must either be real positive integers or logicals. Not sure how to solve this...
0
3,575,291
08/26/2010 13:03:43
254,788
01/20/2010 10:32:44
107
1
Validation naming conventions? C#
Very simple question, but I want to start using a consistent naming convention for validation methods and I can't think of the best way! Do people tend to use IsDataValid() style? or are there any others that are more descriptive and meaningful? Cheers
c#
standards
null
null
null
08/27/2010 02:26:01
not constructive
Validation naming conventions? C# === Very simple question, but I want to start using a consistent naming convention for validation methods and I can't think of the best way! Do people tend to use IsDataValid() style? or are there any others that are more descriptive and meaningful? Cheers
4
9,759,921
03/18/2012 16:21:37
1,277,114
03/18/2012 16:10:06
1
0
Floyd-Warshall algorithm doesn't work [C++]
I'm currently developing a little c++-program in order to find the shortest way from a point a to a point b in a directed and weighted graph saved in an adjacency matrix. To do this, I'm using the Floyd-Warshall algorithm (http://en.wikipedia.org/wiki/Floyd_Warshall). Unluckily, my program does not work. The algorithm creates totally wrong data, my entire program than tries to use ways that don't even exist. I've been working on this since three days and I can't find a solution. Maybe you're able to help me... My code looks like this: void map::floydWarshall() { for(unsigned int k=0;k<this->nodes;k++) { for(unsigned int i=0;i<this->nodes;i++) { for(unsigned int j=0;j<this->nodes;j++) { if((this->floydWarshallMatrix[i][k] + this->floydWarshallMatrix[k][j]) < this->floydWarshallMatrix[i][j]) { this->floydWarshallMatrix[i][j] = this->floydWarshallMatrix[i][k] + this->floydWarshallMatrix[k][j]; this->nextStepMatrix[i][j] = k; } } } } } unsigned int map::getNextNodeOnWayFromTo(unsigned int from, unsigned int to) { if(this->floydWarshallMatrix[from][to] == INF) { return NOEDGE; } if(this->nextStepMatrix[from][to] == INF) { return to; } else { return this->getNextNodeOnWayFromTo(from, this->nextStepMatrix[from][to]); } } I hope you understand what I mean and can help me. Thanks in advance Dominik
c++
floyd-warshall
null
null
null
03/18/2012 16:31:13
too localized
Floyd-Warshall algorithm doesn't work [C++] === I'm currently developing a little c++-program in order to find the shortest way from a point a to a point b in a directed and weighted graph saved in an adjacency matrix. To do this, I'm using the Floyd-Warshall algorithm (http://en.wikipedia.org/wiki/Floyd_Warshall). Unluckily, my program does not work. The algorithm creates totally wrong data, my entire program than tries to use ways that don't even exist. I've been working on this since three days and I can't find a solution. Maybe you're able to help me... My code looks like this: void map::floydWarshall() { for(unsigned int k=0;k<this->nodes;k++) { for(unsigned int i=0;i<this->nodes;i++) { for(unsigned int j=0;j<this->nodes;j++) { if((this->floydWarshallMatrix[i][k] + this->floydWarshallMatrix[k][j]) < this->floydWarshallMatrix[i][j]) { this->floydWarshallMatrix[i][j] = this->floydWarshallMatrix[i][k] + this->floydWarshallMatrix[k][j]; this->nextStepMatrix[i][j] = k; } } } } } unsigned int map::getNextNodeOnWayFromTo(unsigned int from, unsigned int to) { if(this->floydWarshallMatrix[from][to] == INF) { return NOEDGE; } if(this->nextStepMatrix[from][to] == INF) { return to; } else { return this->getNextNodeOnWayFromTo(from, this->nextStepMatrix[from][to]); } } I hope you understand what I mean and can help me. Thanks in advance Dominik
3
9,138,014
02/04/2012 02:52:52
1,188,801
02/04/2012 02:45:57
1
0
Android Rendering / shaping for Pashto (Arabic)
I'm a newbie Android developer. I'm looking for some help with rendering or text shaping for Pashto language which is written in arabic script but has additional letters. What's the best way to work on it? any help would be appreciated.
android
rendering
arabic
reshape
null
02/05/2012 22:09:07
not constructive
Android Rendering / shaping for Pashto (Arabic) === I'm a newbie Android developer. I'm looking for some help with rendering or text shaping for Pashto language which is written in arabic script but has additional letters. What's the best way to work on it? any help would be appreciated.
4
11,329,393
07/04/2012 12:45:20
537,936
12/10/2010 14:13:41
256
20
Find file including full path in name search
I was using "find / -name xxx" but it searches only for the file name. What I want is to include results containing "xxx" in the full path to the file. For instance I want a file with path "/data/xxx/somefile.txt" to be included in the results. How can I achieve this?
linux
null
null
null
null
07/05/2012 14:21:22
off topic
Find file including full path in name search === I was using "find / -name xxx" but it searches only for the file name. What I want is to include results containing "xxx" in the full path to the file. For instance I want a file with path "/data/xxx/somefile.txt" to be included in the results. How can I achieve this?
2
7,550,125
09/26/2011 02:26:12
964,265
09/26/2011 02:05:30
1
0
Android Goole API Java Client com.google.api.client.auth.oauth2.draft10
first question here on StackOverflow. I've searched the internet, stackoverflow, everything, times and times again, I've tried everything but now I'm getting desperate. I'm fairly new into android development, but I've developed enough to know the bare minimum of what I'm talking about. I was trying to do a simple app using the Google Tasks API. Something simple it's turning into a nightmare. Maybe it's something simple, probably it is, but I can't figure it out. So the problem. I was following the example of TasksSample.java from google but I can't compile even after [importing the libraries and dependencies required][2]. I'm using Google API Java Client version 1.5.0. The problem it's when I access the GoogleAccessProtectedResource class. The import is import com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource; I always, and I mean always, no matter what code I have get the following error: > 09-26 03:14:38.372: ERROR/dalvikvm(18731): Could not find class 'com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource', referenced from method com.greven.test.google.tasks.GoogleTasksTake100Activity.<init> 09-26 03:14:38.402: ERROR/AndroidRuntime(18731): FATAL EXCEPTION: main 09-26 03:14:38.402: ERROR/AndroidRuntime(18731): java.lang.NoClassDefFoundError: com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource I really can't see where the problem is. I imported all the needed .jars... I guess As you can see in this picture the class is obviously imported: http://cl.ly/AQGC So what other options do I have to fix this? Use Maven? I'm clueless now. I never thought I would have a problem like this. Oh I also tested on different computers, other google java api client (version 1.4) and same thing happend. Thanks in advance. [2]: http://code.google.com/apis/tasks/articles/oauth-and-tasks-on-android.html
android
oauth-2.0
google-api-java-client
null
null
null
open
Android Goole API Java Client com.google.api.client.auth.oauth2.draft10 === first question here on StackOverflow. I've searched the internet, stackoverflow, everything, times and times again, I've tried everything but now I'm getting desperate. I'm fairly new into android development, but I've developed enough to know the bare minimum of what I'm talking about. I was trying to do a simple app using the Google Tasks API. Something simple it's turning into a nightmare. Maybe it's something simple, probably it is, but I can't figure it out. So the problem. I was following the example of TasksSample.java from google but I can't compile even after [importing the libraries and dependencies required][2]. I'm using Google API Java Client version 1.5.0. The problem it's when I access the GoogleAccessProtectedResource class. The import is import com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource; I always, and I mean always, no matter what code I have get the following error: > 09-26 03:14:38.372: ERROR/dalvikvm(18731): Could not find class 'com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource', referenced from method com.greven.test.google.tasks.GoogleTasksTake100Activity.<init> 09-26 03:14:38.402: ERROR/AndroidRuntime(18731): FATAL EXCEPTION: main 09-26 03:14:38.402: ERROR/AndroidRuntime(18731): java.lang.NoClassDefFoundError: com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource I really can't see where the problem is. I imported all the needed .jars... I guess As you can see in this picture the class is obviously imported: http://cl.ly/AQGC So what other options do I have to fix this? Use Maven? I'm clueless now. I never thought I would have a problem like this. Oh I also tested on different computers, other google java api client (version 1.4) and same thing happend. Thanks in advance. [2]: http://code.google.com/apis/tasks/articles/oauth-and-tasks-on-android.html
0
3,446,195
08/10/2010 05:07:55
368,957
06/17/2010 05:06:22
153
16
Deploy Struts and Spring application using java service wrapper..
I am very new to Java Service Wrapper and windows service. Can we run struts and spring application as windows service using Java Service Wrapper without any web server(Tomcat, Jboss etc.) ?.
java
windows
null
null
null
null
open
Deploy Struts and Spring application using java service wrapper.. === I am very new to Java Service Wrapper and windows service. Can we run struts and spring application as windows service using Java Service Wrapper without any web server(Tomcat, Jboss etc.) ?.
0
4,323,773
12/01/2010 11:18:52
170,365
09/08/2009 18:48:04
1,183
10
Java: How do I do a "onclick" for TextField?
I want to make my text field clear the text when someone clicks it. How can I do this?
java
null
null
null
null
null
open
Java: How do I do a "onclick" for TextField? === I want to make my text field clear the text when someone clicks it. How can I do this?
0
9,386,031
02/21/2012 22:09:38
987,903
10/10/2011 14:49:29
72
0
Writing hex representation to file
In my program, I am trying to read data from binary file, and then write it's hex representation to txt file. #include <stdio.h> #include <stdlib.h> int counter = 0; int read; int i = 0; long size; FILE *file1 = NULL; FILE *file2 = NULL; fpos_t length; char newLine = '\n'; int main(int argc, char **argv) { if (argc < 2) { printf("Use: %s file1 file2", argv[0]); exit (-1); } unsigned char hex[513]; unsigned char buffer[257]; file1 = fopen(argv[1], "rb"); fseek(file1, 0, SEEK_END); fgetpos(file1, &length); size = length.__pos; fseek(file1, 0, SEEK_SET); if (file1) { file2 = fopen(argv[2], "w"); if (!file2) { printf("Cannot open file: %s\n", argv[2]); exit(-1); } while (counter < size) { read = fread(buffer, 1, 256, file1); counter += read; i = 0; while (i < read) { sprintf(hex, "%02x", buffer[i++]); } printf("%d\n", sizeof(hex)); fwrite(hex, 1, 512, file2); fwrite(&newLine, 1, 1, file2); } } else printf("Cannot open file %s\n", argv[1]); fclose(file1); fclose(file2); } Unfortunately data don't write to txt file properly. Please help me find my mistake. What is wrong in this code?
c
null
null
null
null
02/22/2012 02:09:08
too localized
Writing hex representation to file === In my program, I am trying to read data from binary file, and then write it's hex representation to txt file. #include <stdio.h> #include <stdlib.h> int counter = 0; int read; int i = 0; long size; FILE *file1 = NULL; FILE *file2 = NULL; fpos_t length; char newLine = '\n'; int main(int argc, char **argv) { if (argc < 2) { printf("Use: %s file1 file2", argv[0]); exit (-1); } unsigned char hex[513]; unsigned char buffer[257]; file1 = fopen(argv[1], "rb"); fseek(file1, 0, SEEK_END); fgetpos(file1, &length); size = length.__pos; fseek(file1, 0, SEEK_SET); if (file1) { file2 = fopen(argv[2], "w"); if (!file2) { printf("Cannot open file: %s\n", argv[2]); exit(-1); } while (counter < size) { read = fread(buffer, 1, 256, file1); counter += read; i = 0; while (i < read) { sprintf(hex, "%02x", buffer[i++]); } printf("%d\n", sizeof(hex)); fwrite(hex, 1, 512, file2); fwrite(&newLine, 1, 1, file2); } } else printf("Cannot open file %s\n", argv[1]); fclose(file1); fclose(file2); } Unfortunately data don't write to txt file properly. Please help me find my mistake. What is wrong in this code?
3
1,169,670
07/23/2009 04:54:02
117,802
06/05/2009 05:50:00
455
16
How to interpret "error C2018: unknown character '0x40'?
While compiling some code I receive the following: "error C2018: unknown character '0x40'" I wonder how to resolve such issue?
c
visual-studio-2008
null
null
null
null
open
How to interpret "error C2018: unknown character '0x40'? === While compiling some code I receive the following: "error C2018: unknown character '0x40'" I wonder how to resolve such issue?
0
5,605,610
04/09/2011 14:27:24
306,719
04/01/2010 08:57:51
358
1
why it is so difficult to learn ruby?
I have learn ruby almost two weaks.( I am working on java for two years,two years ago I do not know what's java and what java can do.) But now I can use java in my work(though I am not a java experter yet.) But when I try to use ruby,I found it is so difficult!!! After two weaks,I still can not write a ruby code. The following problem confusing me most: > the ruby syntax It is too flexible,I can not find any rule when I try to write the ruby code. For example the iterator in ruby. And too flexible means too many choices,but sometime too many choices is not a good idea. In fact,maybe it is my own problem,I do not like javascirpt's syntax(also the perl,python..). I just think the syntax of java is the best for reading and understanding.... So many people say ruby is simple and fast,but what do you mean simple??? In my opinion it is difficult to learn than java. Everything in java is object to the rules,so it is easy to start(though hard to be a experter). I post here just want to know if some of you guys have the same problem with me? Any suggestion to make me feel comfortable when use ruby?
ruby
null
null
null
null
04/09/2011 14:37:29
not a real question
why it is so difficult to learn ruby? === I have learn ruby almost two weaks.( I am working on java for two years,two years ago I do not know what's java and what java can do.) But now I can use java in my work(though I am not a java experter yet.) But when I try to use ruby,I found it is so difficult!!! After two weaks,I still can not write a ruby code. The following problem confusing me most: > the ruby syntax It is too flexible,I can not find any rule when I try to write the ruby code. For example the iterator in ruby. And too flexible means too many choices,but sometime too many choices is not a good idea. In fact,maybe it is my own problem,I do not like javascirpt's syntax(also the perl,python..). I just think the syntax of java is the best for reading and understanding.... So many people say ruby is simple and fast,but what do you mean simple??? In my opinion it is difficult to learn than java. Everything in java is object to the rules,so it is easy to start(though hard to be a experter). I post here just want to know if some of you guys have the same problem with me? Any suggestion to make me feel comfortable when use ruby?
1
4,857,666
02/01/2011 00:18:40
345,600
05/19/2010 23:24:33
342
17
Iterate over jQuery JSON object in original order
I've got some json data in a map object which is sorted by time. The key is an integer id and the value is an object which contains a timestamp. However when I try to iterate over this data with the jQuery $.each function, the results come back sorted by the key instead. How can I iterate over my collection of objects in their original order? Code example: $.getJSON(url, addPages); function addPages(pageData) { $.each(pageData, function(key,value){ alert(key+' : '+value); } }
javascript
jquery
json
null
null
null
open
Iterate over jQuery JSON object in original order === I've got some json data in a map object which is sorted by time. The key is an integer id and the value is an object which contains a timestamp. However when I try to iterate over this data with the jQuery $.each function, the results come back sorted by the key instead. How can I iterate over my collection of objects in their original order? Code example: $.getJSON(url, addPages); function addPages(pageData) { $.each(pageData, function(key,value){ alert(key+' : '+value); } }
0
6,529,789
06/30/2011 03:57:25
822,304
06/30/2011 03:57:25
1
0
How do I make a MySQL statement from ID to ID
Example I have 500 users and every 50 users manage by one moderator. Let's say `moderator_id = 1` can edit/manage user from `user_id` 1 until 50. What is the statement should I use? SELECT * FROM users WHERE user_id `what should i use here?` AND moderator_id = '1'; Let me know..
mysql
sql
null
null
null
null
open
How do I make a MySQL statement from ID to ID === Example I have 500 users and every 50 users manage by one moderator. Let's say `moderator_id = 1` can edit/manage user from `user_id` 1 until 50. What is the statement should I use? SELECT * FROM users WHERE user_id `what should i use here?` AND moderator_id = '1'; Let me know..
0
7,175,203
08/24/2011 12:13:02
829,679
07/05/2011 12:32:43
11
1
Driver installation
I have a kernel mode driver and i have to install t on 64 bit win 7. It needs to be digitally signed. I digitally signed it using the dseo13b.exe. But when i load the driver i get error in the system event log saying The driver failed to start due to the following error: Windows cannot verify the digital signature for this file. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. I dont want to use the testsigning mode. How do i resolve this? DO i need to get certificate from microsoft? I have developed the driver and now making it work on the 64 bit machine...
driver
null
null
null
null
08/24/2011 19:38:45
off topic
Driver installation === I have a kernel mode driver and i have to install t on 64 bit win 7. It needs to be digitally signed. I digitally signed it using the dseo13b.exe. But when i load the driver i get error in the system event log saying The driver failed to start due to the following error: Windows cannot verify the digital signature for this file. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. I dont want to use the testsigning mode. How do i resolve this? DO i need to get certificate from microsoft? I have developed the driver and now making it work on the 64 bit machine...
2
7,833,507
10/20/2011 09:04:56
1,004,762
10/20/2011 08:34:30
1
1
wcf error by using mono for android
my client is programe by mono fro andriod with c# and run in android2.2. my server is programe in windows by c# . it can use some sdk to play a video record file on of a api interface can be playrecord(string filepath,int windowhandle) filepath is the video file'path windowhandle is the handle of control for play video on you give the file path and control handle ,it can play the video on the control you give i use wcf to send the parm from client to service. if i use windows client it works well, but when i use the android client, some problem appare, i think it's the buffer size'problem. but i do not know how to resovle it.can someone help me?thx . exception info is belove: {System.IndexOutOfRangeException: Array index is out of range. at (wrapper stelemref) object:virt_stelemref_object (intptr,object) at System.Xml.Serialization.XmlTypeMapMember.SetValueSpecified (System.Object ob, Boolean value) [0x0000c] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapMember.cs:200 at System.Xml.Serialization.XmlSerializationReaderInterpreter.SetMemberValue (System.Xml.Serialization.XmlTypeMapMember member, System.Object ob, System.Object value, Boolean isValueList) [0x0002d] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:585 at System.Xml.Serialization.XmlSerializationReaderInterpreter.SetMemberValueFromAttr (System.Xml.Serialization.XmlTypeMapMember member, System.Object ob, System.Object value, Boolean isValueList) [0x00028] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:596 at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMessage (System.Xml.Serialization.XmlMembersMapping typeMap) [0x00057] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:125 at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x0004c] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:92 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x0001c] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:361 } System.IndexOutOfRangeException
c#
android
xml
wcf
mono
10/20/2011 13:48:04
not a real question
wcf error by using mono for android === my client is programe by mono fro andriod with c# and run in android2.2. my server is programe in windows by c# . it can use some sdk to play a video record file on of a api interface can be playrecord(string filepath,int windowhandle) filepath is the video file'path windowhandle is the handle of control for play video on you give the file path and control handle ,it can play the video on the control you give i use wcf to send the parm from client to service. if i use windows client it works well, but when i use the android client, some problem appare, i think it's the buffer size'problem. but i do not know how to resovle it.can someone help me?thx . exception info is belove: {System.IndexOutOfRangeException: Array index is out of range. at (wrapper stelemref) object:virt_stelemref_object (intptr,object) at System.Xml.Serialization.XmlTypeMapMember.SetValueSpecified (System.Object ob, Boolean value) [0x0000c] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapMember.cs:200 at System.Xml.Serialization.XmlSerializationReaderInterpreter.SetMemberValue (System.Xml.Serialization.XmlTypeMapMember member, System.Object ob, System.Object value, Boolean isValueList) [0x0002d] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:585 at System.Xml.Serialization.XmlSerializationReaderInterpreter.SetMemberValueFromAttr (System.Xml.Serialization.XmlTypeMapMember member, System.Object ob, System.Object value, Boolean isValueList) [0x00028] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:596 at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMessage (System.Xml.Serialization.XmlMembersMapping typeMap) [0x00057] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:125 at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x0004c] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:92 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x0001c] in /home/jon/Development/xamarin/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:361 } System.IndexOutOfRangeException
1
5,895,682
05/05/2011 09:48:30
739,631
05/05/2011 09:42:12
101
0
What's an algorithm to retrieve values for a week to date calculation
The algorithm needs to accept a date and then get values for each day from Monday until the date inputted.
c#
algorithm
null
null
null
05/10/2011 01:06:05
not a real question
What's an algorithm to retrieve values for a week to date calculation === The algorithm needs to accept a date and then get values for each day from Monday until the date inputted.
1
7,795,620
10/17/2011 14:57:24
239,279
12/27/2009 20:03:55
379
5
WCF - how to make custom errors?
I've got a WCF REST project and I want to catch the errors that the WCF framework throws and display them in my way (JSON, that is). For example, If I'm expecting an int parameter in my call and I get a string, the framework would display a page with "request error" and some trace info... I'd just like to get the exception and display it in my JSON format as response to the user. Any ideas how this can be done? Many thanks in advance!
c#
.net
wcf
null
null
null
open
WCF - how to make custom errors? === I've got a WCF REST project and I want to catch the errors that the WCF framework throws and display them in my way (JSON, that is). For example, If I'm expecting an int parameter in my call and I get a string, the framework would display a page with "request error" and some trace info... I'd just like to get the exception and display it in my JSON format as response to the user. Any ideas how this can be done? Many thanks in advance!
0
6,676,568
07/13/2011 09:05:30
738,737
05/04/2011 20:12:15
68
1
How to print in a tabular format in tcl?
I am trying to print the data in a tabular format in tcl. Suppose I have three arrays:- `GOLD, TEST, DIFF` and it has some values in it. I want to get in printed in the following format:- > GOLD &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TEST &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DIFF <br> >-----------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;---------<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hello&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi<br> >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Format<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print <br> Would you guys like to suggest something? Thanks!!!
format
tcl
sprint
null
null
null
open
How to print in a tabular format in tcl? === I am trying to print the data in a tabular format in tcl. Suppose I have three arrays:- `GOLD, TEST, DIFF` and it has some values in it. I want to get in printed in the following format:- > GOLD &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TEST &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DIFF <br> >-----------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;---------<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hello&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi<br> >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Format<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print <br> Would you guys like to suggest something? Thanks!!!
0
2,001,460
01/04/2010 19:03:40
181,222
09/29/2009 15:16:08
88
0
What is the Explanation for DOMDocument's Inconsistent Behavior when Dumping a non-ASCII Character?
I've noticed different "dumping" behaviors when using PHP's ``DOMDocument``'s ``saveXML()`` and ``saveHTML()`` methods. Here is a simple example of dumping the copyright symbol (&copy;). <code> &lt;?<br>$domDoc = new DOMDocument();<br> $domDoc->loadHTML("&amp;copy;");<br> echo $domDoc->saveHTML();<br> echo $domDoc->saveXML();<br> echo $domDoc->saveXML($domDoc);<br> ?&gt; </code> The three dumps produce three different outputs: The first outputs the string ``&copy;``<br>The second outputs the character entity ``&#xA9;``<br> The third outputs the UTF8 2-byte code for the copyright symbol (``U+00A9``) Why the different outputs? Is there a way to predictability control which method is used?
domdocument
xml
utf-8
html
dom
null
open
What is the Explanation for DOMDocument's Inconsistent Behavior when Dumping a non-ASCII Character? === I've noticed different "dumping" behaviors when using PHP's ``DOMDocument``'s ``saveXML()`` and ``saveHTML()`` methods. Here is a simple example of dumping the copyright symbol (&copy;). <code> &lt;?<br>$domDoc = new DOMDocument();<br> $domDoc->loadHTML("&amp;copy;");<br> echo $domDoc->saveHTML();<br> echo $domDoc->saveXML();<br> echo $domDoc->saveXML($domDoc);<br> ?&gt; </code> The three dumps produce three different outputs: The first outputs the string ``&copy;``<br>The second outputs the character entity ``&#xA9;``<br> The third outputs the UTF8 2-byte code for the copyright symbol (``U+00A9``) Why the different outputs? Is there a way to predictability control which method is used?
0
1,008,277
06/17/2009 16:48:47
79,910
03/19/2009 07:35:54
32
2
MultiTriggers with other elements
Is it possible to use a multiTrigger to evaluate properties on multiple elements? That don't reside within a template, but are within the Usercontrol/Window. Example: <CheckBox x:Name="checkBox1" /> <CheckBox x:Name="checkBox2" /> <CustomControl> <CustomControl.ContentTemplate> <DataTemplate> <DataTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition SourceName="checkBox1" Property="IsChecked" Value="False" /> <Condition SourceName="checkBox2" Property="IsChecked" Value="True" /> </MultiTrigger.Conditions> <MultiTrigger.Setters> <Setter Property="Visibility" Value="Collapsed" /> </MultiTrigger.Setters> </MultiTrigger> </DataTemplate.Triggers> </DataTemplate> </CustomControl.ContentTemplate> <CustomControl> In a normal Trigger this is fine, but with a multiTrigger I get build errors finding the controls. Note: The reason I'm using a DataTemplate as opposed to a Style is mentioned [here][1] [1]: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b59822de-21ea-4a74-a115-3860241ba6b1
wpf
triggers
xaml
null
null
null
open
MultiTriggers with other elements === Is it possible to use a multiTrigger to evaluate properties on multiple elements? That don't reside within a template, but are within the Usercontrol/Window. Example: <CheckBox x:Name="checkBox1" /> <CheckBox x:Name="checkBox2" /> <CustomControl> <CustomControl.ContentTemplate> <DataTemplate> <DataTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition SourceName="checkBox1" Property="IsChecked" Value="False" /> <Condition SourceName="checkBox2" Property="IsChecked" Value="True" /> </MultiTrigger.Conditions> <MultiTrigger.Setters> <Setter Property="Visibility" Value="Collapsed" /> </MultiTrigger.Setters> </MultiTrigger> </DataTemplate.Triggers> </DataTemplate> </CustomControl.ContentTemplate> <CustomControl> In a normal Trigger this is fine, but with a multiTrigger I get build errors finding the controls. Note: The reason I'm using a DataTemplate as opposed to a Style is mentioned [here][1] [1]: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b59822de-21ea-4a74-a115-3860241ba6b1
0
8,369,721
12/03/2011 18:01:30
1,078,800
12/03/2011 09:03:56
1
0
how to convert from opengl to opengl ES?
please write the implementation of glutPostRedisplay() to change from opengl to opengl ES .Also send all implementation of all the functions that are in opengl and not in opengl ES
opengl-es
null
null
null
null
12/04/2011 00:14:49
not a real question
how to convert from opengl to opengl ES? === please write the implementation of glutPostRedisplay() to change from opengl to opengl ES .Also send all implementation of all the functions that are in opengl and not in opengl ES
1
8,248,311
11/23/2011 19:56:51
562,422
01/04/2011 10:49:29
182
9
how to correctly format WideString using sprintf or wprintf
I am using this code to format WideString but with no success! It prints unexpecting results :( here is my code WideString s; dep=new TStringList(); while(!DM->tDepPln->Eof) { //where tDepPlnFltNo is mysql field type of WideString s.sprintf(L"%-11S",DM->tDepPlnFltNo->AsWideString); dep->Add(s); DM->tDepPln->Next(); } when I use `s.sprintf(L"%-11S","blablabla");` it works but when i set to mysql field type of WideString it's not!! I think the problem is with conversion! How to correct it ???
sprintf
widestring
c++builder-2010
null
null
null
open
how to correctly format WideString using sprintf or wprintf === I am using this code to format WideString but with no success! It prints unexpecting results :( here is my code WideString s; dep=new TStringList(); while(!DM->tDepPln->Eof) { //where tDepPlnFltNo is mysql field type of WideString s.sprintf(L"%-11S",DM->tDepPlnFltNo->AsWideString); dep->Add(s); DM->tDepPln->Next(); } when I use `s.sprintf(L"%-11S","blablabla");` it works but when i set to mysql field type of WideString it's not!! I think the problem is with conversion! How to correct it ???
0
9,325,408
02/17/2012 08:59:36
1,215,742
02/17/2012 08:19:23
1
0
Doctrine 2, how to get a property in a left join result set?
Symfony 2, Doctrine 2. I've got 3 entities, one of them intermediate (join table). Let's say it's SomeObject, SomeProperty and ObjectProperties. **Problem:** I can't get the value of SomeProperty 'name' property. Here's the code: [...] class SomeObject { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * * @var ObjectProperties $objectProperties * * @ORM\OneToMany(targetEntity="ObjectProperties", mappedBy="object_id", cascade={"all"}) */ private $objectProperties; [...] --- [...] class SomeProperty { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") * @ORM\OneToMany(targetEntity="ObjectProperties", mappedBy="property_id", cascade={"all"}) */ private $id; /** * @var string $name * */ private $name;//I NEED TO GET VALUE OF $name [...] --- [...] class ObjectProperties { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\ManyToOne(targetEntity="SomeObject", inversedBy="id", cascade={"all"}) * @ORM\JoinColumn(name="object_id", referencedColumnName="id") */ private $object_id; /** * @ORM\Id * @ORM\ManyToOne(targetEntity="SomeProperty", inversedBy="id", cascade={"all"}) * @ORM\JoinColumn(name="property_id", referencedColumnName="id") */ private $property_id; [...] --- Setters and getters as usual. In my controller I've got something along the lines of: $entity = $em->getRepository('SomeTestBundle:SomeObject')->find($id); [...] $props = $entity->getObjectProperties(); foreach ($props as $prop){ echo '---------------------------<br>'; var_dump($prop->getPropertyId()->getName()); } --- Now, getName() gives me null result, but if i replace it with getId it works as expected. Same if I try to use it in a form class. Is it because there is no doctrine association between SomeProperty->name and ObjectProperties? I think I don't quite get the way doctrine is supposed to work. I thought that only property_id and object_id are needed in a junction table, otherwise it doesn't make much sense for me, because SomeProperty serves as a dictionary table, so I could change SomeProperty->name in one place. I'm seriously stuck with it. Is it some sort of configuration option that is lacking or am I generally not getting the bigger picture?
join
symfony-2.0
doctrine2
junction-table
null
03/11/2012 14:00:00
too localized
Doctrine 2, how to get a property in a left join result set? === Symfony 2, Doctrine 2. I've got 3 entities, one of them intermediate (join table). Let's say it's SomeObject, SomeProperty and ObjectProperties. **Problem:** I can't get the value of SomeProperty 'name' property. Here's the code: [...] class SomeObject { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * * @var ObjectProperties $objectProperties * * @ORM\OneToMany(targetEntity="ObjectProperties", mappedBy="object_id", cascade={"all"}) */ private $objectProperties; [...] --- [...] class SomeProperty { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") * @ORM\OneToMany(targetEntity="ObjectProperties", mappedBy="property_id", cascade={"all"}) */ private $id; /** * @var string $name * */ private $name;//I NEED TO GET VALUE OF $name [...] --- [...] class ObjectProperties { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\ManyToOne(targetEntity="SomeObject", inversedBy="id", cascade={"all"}) * @ORM\JoinColumn(name="object_id", referencedColumnName="id") */ private $object_id; /** * @ORM\Id * @ORM\ManyToOne(targetEntity="SomeProperty", inversedBy="id", cascade={"all"}) * @ORM\JoinColumn(name="property_id", referencedColumnName="id") */ private $property_id; [...] --- Setters and getters as usual. In my controller I've got something along the lines of: $entity = $em->getRepository('SomeTestBundle:SomeObject')->find($id); [...] $props = $entity->getObjectProperties(); foreach ($props as $prop){ echo '---------------------------<br>'; var_dump($prop->getPropertyId()->getName()); } --- Now, getName() gives me null result, but if i replace it with getId it works as expected. Same if I try to use it in a form class. Is it because there is no doctrine association between SomeProperty->name and ObjectProperties? I think I don't quite get the way doctrine is supposed to work. I thought that only property_id and object_id are needed in a junction table, otherwise it doesn't make much sense for me, because SomeProperty serves as a dictionary table, so I could change SomeProperty->name in one place. I'm seriously stuck with it. Is it some sort of configuration option that is lacking or am I generally not getting the bigger picture?
3
9,090,817
02/01/2012 04:30:54
334,304
05/06/2010 10:12:13
416
6
Copying files using rsync from remote server to local machine
Once I've ssh'd into my remote server, what would the command be to copy all files in a directory to a local directory on my machine? Thanks!
ssh
rsync
null
null
null
02/01/2012 08:23:57
off topic
Copying files using rsync from remote server to local machine === Once I've ssh'd into my remote server, what would the command be to copy all files in a directory to a local directory on my machine? Thanks!
2
11,045,566
06/15/2012 06:22:37
1,457,933
06/15/2012 06:16:37
1
0
connecting JSP with MySQL in netbeans
I want to connect **JSP** with **MySQL** using netbeans. > Blockquote Is it possible? > Blockquote
mysql
database
jsp
netbeans
connect
06/15/2012 07:12:19
not a real question
connecting JSP with MySQL in netbeans === I want to connect **JSP** with **MySQL** using netbeans. > Blockquote Is it possible? > Blockquote
1
7,785,367
10/16/2011 15:43:36
893,402
08/13/2011 21:28:38
1
0
Regex in Python and save in csv
Input text file view: 64120655007 6173 0578 111 8th Avenue, 7th Floor 30319. File consist a lot of lines how to use regex save in scv file - 64120655007 6173 0578 30319. only need the numbers, where numbers + letters that do not need to
python
null
null
null
null
10/17/2011 13:42:49
not a real question
Regex in Python and save in csv === Input text file view: 64120655007 6173 0578 111 8th Avenue, 7th Floor 30319. File consist a lot of lines how to use regex save in scv file - 64120655007 6173 0578 30319. only need the numbers, where numbers + letters that do not need to
1
5,445,322
03/26/2011 21:08:21
421,109
08/15/2010 17:35:13
626
3
ImageMagick requirement for Paperclip plugin
The paperclip plugin says that I need to install ImageMagick in order to use Paperclip. I'm typically really bad at getting things installed and running, so I was wondering if anyone could explain to me the exact specific steps I should take to get it installed and communicating with Paperclip.
ruby
ruby-on-rails-3
installation
imagemagick
paperclip
03/27/2011 09:33:35
off topic
ImageMagick requirement for Paperclip plugin === The paperclip plugin says that I need to install ImageMagick in order to use Paperclip. I'm typically really bad at getting things installed and running, so I was wondering if anyone could explain to me the exact specific steps I should take to get it installed and communicating with Paperclip.
2
5,686,278
04/16/2011 11:54:13
711,109
04/16/2011 11:54:13
1
0
change dotnetnuke file manager default addres
I need to change dotnetnuke file manager default address, to save files in another system. do you can help me?
dotnetnuke
null
null
null
null
null
open
change dotnetnuke file manager default addres === I need to change dotnetnuke file manager default address, to save files in another system. do you can help me?
0
2,640,138
04/14/2010 18:49:43
313,555
04/10/2010 17:23:16
32
0
Recognizing file - Python
Ok, so the title may trick you a bit, and I'm sorry for that but didn't find a better title. This question might be a bit hard to understand so I'll try my best. I have no idea how this works or if it is even possible but what I want to do is for example create a file type (lets imagine .test (in which a random file name would be random.test)). Now before I continue, its obviously easy to do this using for example: filename = "random.test" file = open(filename, 'w') file.write("some text here") But now what I would like to know is if it is possible to write the file .test so if I set it to open with a wxPython program, it recognizes it and for example opens up a Message Dialog automatically. I'm sorry if I'm being vague and in case you don't understand, let me know so I can try my best to explain you.
python
file
open
null
null
null
open
Recognizing file - Python === Ok, so the title may trick you a bit, and I'm sorry for that but didn't find a better title. This question might be a bit hard to understand so I'll try my best. I have no idea how this works or if it is even possible but what I want to do is for example create a file type (lets imagine .test (in which a random file name would be random.test)). Now before I continue, its obviously easy to do this using for example: filename = "random.test" file = open(filename, 'w') file.write("some text here") But now what I would like to know is if it is possible to write the file .test so if I set it to open with a wxPython program, it recognizes it and for example opens up a Message Dialog automatically. I'm sorry if I'm being vague and in case you don't understand, let me know so I can try my best to explain you.
0
7,462,308
09/18/2011 15:00:29
951,322
09/18/2011 15:00:29
1
0
Best way to publish information without overloading people
I run a football (soccer) website that currently publishes live scores to several twitter accounts. What I want to do is enable facebook users to choose a league/team and receive updates on their news feed from relevant matches. What is the best way of doing this without publishing every score from every match to every user? Is there any way for users to select a league/team and for my posts to be tagged in such a way that they only appear on the feeds of those who are interested? I also want to avoid having to make 50 posts if 50 users need to see the post... Any help much appreciated. I don't want to start down the wrong route.
facebook-graph-api
feed
news
null
null
09/19/2011 12:19:50
off topic
Best way to publish information without overloading people === I run a football (soccer) website that currently publishes live scores to several twitter accounts. What I want to do is enable facebook users to choose a league/team and receive updates on their news feed from relevant matches. What is the best way of doing this without publishing every score from every match to every user? Is there any way for users to select a league/team and for my posts to be tagged in such a way that they only appear on the feeds of those who are interested? I also want to avoid having to make 50 posts if 50 users need to see the post... Any help much appreciated. I don't want to start down the wrong route.
2
3,414,403
08/05/2010 11:56:15
411,915
08/05/2010 11:56:15
1
0
Are there any visually impaired PHP programmers?
I'm a PHP programmer from Bulgaria. I have a visual impairment called Keratoconus which worsens my vision with time, and although it's not very probable that it's going to develop much further I'm a bit worried about my programming career. Especially dealing with the front end work technologies like HTML/CSS/AJAX coding. Do you know any visually impaired PHP programmer out there? I was even thinking if I would switch to another language so I can concentrate solely on backend work .... but it would take several more years to gain the same experience with another platform :/ Do you know any PHP programmers with visual disabilities?
php
disability
null
null
null
08/06/2010 01:36:53
not a real question
Are there any visually impaired PHP programmers? === I'm a PHP programmer from Bulgaria. I have a visual impairment called Keratoconus which worsens my vision with time, and although it's not very probable that it's going to develop much further I'm a bit worried about my programming career. Especially dealing with the front end work technologies like HTML/CSS/AJAX coding. Do you know any visually impaired PHP programmer out there? I was even thinking if I would switch to another language so I can concentrate solely on backend work .... but it would take several more years to gain the same experience with another platform :/ Do you know any PHP programmers with visual disabilities?
1
8,791,533
01/09/2012 16:17:12
817,452
06/27/2011 13:29:58
1,747
89
Does it make sense to use Hungarian notation prefixes in weakly-typed, interpreted languages?
First of all, I have taken a look at the following posts to avoid duplicate question. http://stackoverflow.com/questions/1184717/hungarian-notation http://stackoverflow.com/questions/111933/why-shouldnt-i-use-hungarian-notation http://stackoverflow.com/questions/309205/are-variable-prefixes-hungarian-notation-really-necessary-anymore http://stackoverflow.com/questions/5428/do-people-use-the-hungarian-naming-conventions-in-the-real-world Now, all of these posts are related to C#, C++, Java - strongly typed languages. I do understand that there is no need for the prefixes when the type is known before compilation. Nevertheless, my question is: **Is it worthwhile to use the prefixes in weakly typed languages, interpreter based languages, considering the fact that you cant see the type of the object before runtime?**
python
matlab
interpreter
interpreted-language
weak-typing
01/10/2012 02:02:41
not constructive
Does it make sense to use Hungarian notation prefixes in weakly-typed, interpreted languages? === First of all, I have taken a look at the following posts to avoid duplicate question. http://stackoverflow.com/questions/1184717/hungarian-notation http://stackoverflow.com/questions/111933/why-shouldnt-i-use-hungarian-notation http://stackoverflow.com/questions/309205/are-variable-prefixes-hungarian-notation-really-necessary-anymore http://stackoverflow.com/questions/5428/do-people-use-the-hungarian-naming-conventions-in-the-real-world Now, all of these posts are related to C#, C++, Java - strongly typed languages. I do understand that there is no need for the prefixes when the type is known before compilation. Nevertheless, my question is: **Is it worthwhile to use the prefixes in weakly typed languages, interpreter based languages, considering the fact that you cant see the type of the object before runtime?**
4
7,564,234
09/27/2011 04:34:50
919,434
08/30/2011 09:53:05
15
3
Make a Buttonistener in a second layout
How would I implement a Buttonlistener for a second layout which is still be called in the main Acitivity? I already tried it by a named Button listener and via an anonymous. But still get nullpointer Exceptions. Code: back = (Button) findViewById(R.id.backToMain); if(back != null) back.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { setLayout(R.layout.main); } }); Layout.xml <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:id="@+id/backToMain" android:text="Zurück"> </Button>
android
android-layout
null
null
null
null
open
Make a Buttonistener in a second layout === How would I implement a Buttonlistener for a second layout which is still be called in the main Acitivity? I already tried it by a named Button listener and via an anonymous. But still get nullpointer Exceptions. Code: back = (Button) findViewById(R.id.backToMain); if(back != null) back.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { setLayout(R.layout.main); } }); Layout.xml <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:id="@+id/backToMain" android:text="Zurück"> </Button>
0
5,813,470
04/28/2011 04:01:54
728,510
04/28/2011 04:01:54
1
0
Objective-C division is off, incorrect mathematical results disrupting my program
In my calculator program, objective-c seems to think that 41137447 / 13 = 3164419. However, this is quite off. I don't think that this is an error with integers losing decimal places... does anyone know what could cause this? Here's my code: #import <Foundation/Foundation.h> //Calculator int, imp. @interface Calculator : NSObject { double accumulator; } -(void) setAccumulator: (double) n; -(void) clear; -(double) accumulator; -(void) divide: (double) n; -(void) subtract: (double) n; -(void) multiply: (double) n; -(void) add: (double) n; @end @implementation Calculator -(void) setAccumulator: (double) n{ accumulator = n; } -(void) clear{ accumulator = 0; } -(double) accumulator{ return accumulator; } -(void) divide: (double) n{ if (n == 0.0) NSLog(@"Dividing by 0."); else accumulator /= n; } -(void) subtract: (double) n{ accumulator -= n; } -(void) multiply: (double) n{ accumulator *= n; } -(void) add: (double) n{ accumulator += n; } @end //main pgm int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; Calculator *deskCalc = [[Calculator alloc]init]; double value1, value2; char operator; NSLog(@"Enter your equation:"); scanf("%lf %c %lf", &value1, &operator, &value2); [deskCalc setAccumulator: value1]; if (operator == '+') [deskCalc add: value2]; else if (operator == '-') [deskCalc subtract:value2]; else if (operator == '*') [deskCalc multiply:value2]; else if (operator == '/') [deskCalc divide: value2]; else { NSLog(@"Error: unknown operator"); } NSLog(@"The result is %.3f", [deskCalc accumulator]); [deskCalc release]; [pool drain]; return 0; }
objective-c
math
calculator
foundation
null
04/28/2011 11:00:49
not a real question
Objective-C division is off, incorrect mathematical results disrupting my program === In my calculator program, objective-c seems to think that 41137447 / 13 = 3164419. However, this is quite off. I don't think that this is an error with integers losing decimal places... does anyone know what could cause this? Here's my code: #import <Foundation/Foundation.h> //Calculator int, imp. @interface Calculator : NSObject { double accumulator; } -(void) setAccumulator: (double) n; -(void) clear; -(double) accumulator; -(void) divide: (double) n; -(void) subtract: (double) n; -(void) multiply: (double) n; -(void) add: (double) n; @end @implementation Calculator -(void) setAccumulator: (double) n{ accumulator = n; } -(void) clear{ accumulator = 0; } -(double) accumulator{ return accumulator; } -(void) divide: (double) n{ if (n == 0.0) NSLog(@"Dividing by 0."); else accumulator /= n; } -(void) subtract: (double) n{ accumulator -= n; } -(void) multiply: (double) n{ accumulator *= n; } -(void) add: (double) n{ accumulator += n; } @end //main pgm int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; Calculator *deskCalc = [[Calculator alloc]init]; double value1, value2; char operator; NSLog(@"Enter your equation:"); scanf("%lf %c %lf", &value1, &operator, &value2); [deskCalc setAccumulator: value1]; if (operator == '+') [deskCalc add: value2]; else if (operator == '-') [deskCalc subtract:value2]; else if (operator == '*') [deskCalc multiply:value2]; else if (operator == '/') [deskCalc divide: value2]; else { NSLog(@"Error: unknown operator"); } NSLog(@"The result is %.3f", [deskCalc accumulator]); [deskCalc release]; [pool drain]; return 0; }
1
5,489,828
03/30/2011 17:25:49
471,810
10/11/2010 00:14:48
1
0
Extending how Win 7 (Aero) draws it's default Windows and Controls
I'm looking to extend/override how Windows 7 draw's its standard Windows and controls. Right now I'm doing preliminary research on how to modify the standard UI to make it just a little bit more touch friendly for a project I'm working on. Specifically what I would like to do is modify how W7 draws borders around its Windows, and how to modify the *Window Control Buttons* (close, minimize, exit etc). This is intended to be a Global change, and would affect how all windows on the system are drawn. Honestly, I'm looking for functionality that is very similar to what WindowBlinds does, at least for this part of the project... As for how to accomplish the goal, I believe the best course of action would be to create a service that watches each process, or inject a DLL in to each process, that would watch its Message Queue for any messages involved with painting the window. It would then override that event, drawing the window (or control) how I want it to be drawn. Unfortunately I'm a bit sketchy on how to actually do that... Does anyone have any suggestions on how best to approach this? Any examples, in any language (I will probably use C# or C++) would be appreciated!
c#
c++
windows
winapi
dwm
null
open
Extending how Win 7 (Aero) draws it's default Windows and Controls === I'm looking to extend/override how Windows 7 draw's its standard Windows and controls. Right now I'm doing preliminary research on how to modify the standard UI to make it just a little bit more touch friendly for a project I'm working on. Specifically what I would like to do is modify how W7 draws borders around its Windows, and how to modify the *Window Control Buttons* (close, minimize, exit etc). This is intended to be a Global change, and would affect how all windows on the system are drawn. Honestly, I'm looking for functionality that is very similar to what WindowBlinds does, at least for this part of the project... As for how to accomplish the goal, I believe the best course of action would be to create a service that watches each process, or inject a DLL in to each process, that would watch its Message Queue for any messages involved with painting the window. It would then override that event, drawing the window (or control) how I want it to be drawn. Unfortunately I'm a bit sketchy on how to actually do that... Does anyone have any suggestions on how best to approach this? Any examples, in any language (I will probably use C# or C++) would be appreciated!
0
3,279,322
07/19/2010 08:00:47
164,769
08/28/2009 10:15:11
55
3
Searching MySQL with iphone SDK?
I am a bit of a newbie when i comes to iphone dev, but was wondering the best way to retrieve informations form a MySQL database. I have a load of information via a website all stored on a database which changes daily and wanted to build an app that pulled in the information depending on parameters. What would be the best way to achieve this? Can you grab info from MySQL or would a XML feed be a safer bet?
iphone
mysql
null
null
null
null
open
Searching MySQL with iphone SDK? === I am a bit of a newbie when i comes to iphone dev, but was wondering the best way to retrieve informations form a MySQL database. I have a load of information via a website all stored on a database which changes daily and wanted to build an app that pulled in the information depending on parameters. What would be the best way to achieve this? Can you grab info from MySQL or would a XML feed be a safer bet?
0
7,460,654
09/18/2011 09:38:03
337,504
05/10/2010 17:24:07
160
9
How was DOS Games written?
I always wondered how was the DOS games like [Sky Roads](http://www.dosgamesarchive.com/download/skyroads/), [Turbo](http://www.dosgamesarchive.com/download/turbo/), [Aladdin](http://www.abandonia.com/en/games/2/Aladdin.html), [Duke Nukem](http://www.dosgamesarchive.com/download/duke-nukem/), [Commander Keen 6](http://www.dosgamesarchive.com/download/commander-keen-6-aliens-ate-my-baby-sitter/) written. I cannot find a good source. If I write a console application in C#, C++, Java etc.. It is always displayed and remains still. And it is always Text. 1. How did they generate graphics? 2. Were there any libraries to use? 3. What languages they used? Any good source will be appreciated.
graphics
dos
null
null
null
09/19/2011 12:51:28
off topic
How was DOS Games written? === I always wondered how was the DOS games like [Sky Roads](http://www.dosgamesarchive.com/download/skyroads/), [Turbo](http://www.dosgamesarchive.com/download/turbo/), [Aladdin](http://www.abandonia.com/en/games/2/Aladdin.html), [Duke Nukem](http://www.dosgamesarchive.com/download/duke-nukem/), [Commander Keen 6](http://www.dosgamesarchive.com/download/commander-keen-6-aliens-ate-my-baby-sitter/) written. I cannot find a good source. If I write a console application in C#, C++, Java etc.. It is always displayed and remains still. And it is always Text. 1. How did they generate graphics? 2. Were there any libraries to use? 3. What languages they used? Any good source will be appreciated.
2
7,804,056
10/18/2011 07:52:10
976,899
10/03/2011 14:52:40
1
2
How can i make an animation where the Earth is spinning?
This thing is completely over my head.I thought that putting many images in cascade would solve my problem but it wasn't like that.Some source code would be much appreciated!
android
null
null
null
null
10/18/2011 12:12:58
not a real question
How can i make an animation where the Earth is spinning? === This thing is completely over my head.I thought that putting many images in cascade would solve my problem but it wasn't like that.Some source code would be much appreciated!
1
9,754,544
03/17/2012 22:59:58
1,145,086
01/12/2012 09:05:50
1,483
144
iterating over Zend_Paginator object for display
I have a Zend_Paginator_Adapter_DbTableSelect object from this query: public function fetchPagedTracks() { $select = $this->select(Zend_Db_Table::SELECT_WITH_FROM_PART) ->setIntegrityCheck(FALSE); $select->join(array('ar' => 'artist'), 'ar.id = track.artist_id', array('artist_name' => 'name')); $select->join(array('al' => 'album'), 'al.id = track.album_id', array('album_name' => 'name', 'artist_id', 'year')); $select->order('artist_name', 'ASC'); $select->order('album_name'); $select->order('track', 'ASC'); //create a new instance of the paginator adapter and return it $adapter = new Zend_Paginator_Adapter_DbTableSelect($select); return $adapter; } The data returns as expected and works, my issue is with my viewscript. I want to iterate over the result set in a specific way. Basically i want to have the artist at the top of a table with sub tables for each album with the tracks listed in each in order. I have accomplished this...but not properly, I had to do what I feel is a hack and I'm hoping SO can help me fix it.<br /> Here is the view: <?php echo $this->paginationControl( $this->paginator, 'Sliding', '_paginatorControl.phtml' ) ?> <table> <?php foreach ($this->paginator as $track):; // Zend_Debug::dump($track, ''); $artist = $track->artist_name; $album = $track->album_name; ?> <?php if ($end_artist != $artist): ?> <tr> <th colspan="4"><?php echo $track->artist_name ?></th> </tr> <?php endif ?> <?php if ($end_album != $album): ?> <tr> <th colspan="4"><?php echo $track->album_name . ' ' . $track->year ?></th> </tr> <tr> <th>Track #</th> <th>Title</th> <th>Bitrate</th> <th>Play Time</th> </tr> <?php endif; ?> <tr> <td><?php echo $track->track ?></td> <td><?php echo $track->title ?></td> <td><?php echo $track->bit_rate . 'Kbps' ?></td> <td><?php echo $this->playtime($track->play_time) ?></td> </tr> <?php $end_artist = $track->artist_name; $end_album = $track->album_name ?> <?php endforeach ?> </table> <?php echo $this->paginationControl( $this->paginator, 'Sliding', '_paginatorControl.phtml' ); ?> The big issue is that this code causes two notices: > Notice: Undefined variable: end_artist in > E:\www\home.local\application\modules\music\views\scripts\index\display.phtml > on line 13... and on line 18 The offending variables are `$end_artist` and `$end_album` and for life of me I can't figure out how to do this a different way. Suggestions? P.S. a dump of the paginator object can be seen at [Pastbin][1] [1]: http://pastebin.com/b3mWsT5m
php
zend-framework
null
null
null
03/19/2012 14:48:15
too localized
iterating over Zend_Paginator object for display === I have a Zend_Paginator_Adapter_DbTableSelect object from this query: public function fetchPagedTracks() { $select = $this->select(Zend_Db_Table::SELECT_WITH_FROM_PART) ->setIntegrityCheck(FALSE); $select->join(array('ar' => 'artist'), 'ar.id = track.artist_id', array('artist_name' => 'name')); $select->join(array('al' => 'album'), 'al.id = track.album_id', array('album_name' => 'name', 'artist_id', 'year')); $select->order('artist_name', 'ASC'); $select->order('album_name'); $select->order('track', 'ASC'); //create a new instance of the paginator adapter and return it $adapter = new Zend_Paginator_Adapter_DbTableSelect($select); return $adapter; } The data returns as expected and works, my issue is with my viewscript. I want to iterate over the result set in a specific way. Basically i want to have the artist at the top of a table with sub tables for each album with the tracks listed in each in order. I have accomplished this...but not properly, I had to do what I feel is a hack and I'm hoping SO can help me fix it.<br /> Here is the view: <?php echo $this->paginationControl( $this->paginator, 'Sliding', '_paginatorControl.phtml' ) ?> <table> <?php foreach ($this->paginator as $track):; // Zend_Debug::dump($track, ''); $artist = $track->artist_name; $album = $track->album_name; ?> <?php if ($end_artist != $artist): ?> <tr> <th colspan="4"><?php echo $track->artist_name ?></th> </tr> <?php endif ?> <?php if ($end_album != $album): ?> <tr> <th colspan="4"><?php echo $track->album_name . ' ' . $track->year ?></th> </tr> <tr> <th>Track #</th> <th>Title</th> <th>Bitrate</th> <th>Play Time</th> </tr> <?php endif; ?> <tr> <td><?php echo $track->track ?></td> <td><?php echo $track->title ?></td> <td><?php echo $track->bit_rate . 'Kbps' ?></td> <td><?php echo $this->playtime($track->play_time) ?></td> </tr> <?php $end_artist = $track->artist_name; $end_album = $track->album_name ?> <?php endforeach ?> </table> <?php echo $this->paginationControl( $this->paginator, 'Sliding', '_paginatorControl.phtml' ); ?> The big issue is that this code causes two notices: > Notice: Undefined variable: end_artist in > E:\www\home.local\application\modules\music\views\scripts\index\display.phtml > on line 13... and on line 18 The offending variables are `$end_artist` and `$end_album` and for life of me I can't figure out how to do this a different way. Suggestions? P.S. a dump of the paginator object can be seen at [Pastbin][1] [1]: http://pastebin.com/b3mWsT5m
3
2,101,362
01/20/2010 12:43:23
246,608
01/08/2010 17:54:17
100
7
Why is QMutex unknown?
I've included the QMutex header and using it as seen below. But I get the following error: > 2>c:\projekte\recorder\recorderinterface.h(166): > error C2146: syntax error : missing > ';' before identifier > '_RecorderParamsMutex' #ifndef RECORDERinterface_h #define RECORDERinterface_h #include "qstring.h" #include "ccc.h" #include "ddd.h" #include <qmutex.h> #include "eee.h" using namespace Common; //for aaaaa class RecorderInterface{ //the implemented recorders are my friends, the may access all my private stuff :) friend class A; friend class B; public: RecorderInterface(); bool setParam(RecorderPrintParam *up); private: QMutex _RecorderParamsMutex; }; #endif
c++
mutex
qt
null
null
null
open
Why is QMutex unknown? === I've included the QMutex header and using it as seen below. But I get the following error: > 2>c:\projekte\recorder\recorderinterface.h(166): > error C2146: syntax error : missing > ';' before identifier > '_RecorderParamsMutex' #ifndef RECORDERinterface_h #define RECORDERinterface_h #include "qstring.h" #include "ccc.h" #include "ddd.h" #include <qmutex.h> #include "eee.h" using namespace Common; //for aaaaa class RecorderInterface{ //the implemented recorders are my friends, the may access all my private stuff :) friend class A; friend class B; public: RecorderInterface(); bool setParam(RecorderPrintParam *up); private: QMutex _RecorderParamsMutex; }; #endif
0
989,981
06/13/2009 04:32:43
22,471
09/25/2008 23:40:51
1,290
29
How can I free-up or release the memory I've allocated to a .wav file?
I load some .wav files in my iPhone app like this: SoundEngine_LoadLoopingEffect([[bundle pathForResource:@"loop" ofType:@"wav"] UTF8String], NULL, NULL, &MySounds[Loop]); SoundEngine_LoadEffect([[bundle pathForResource:@"intro" ofType:@"wav"] UTF8String], &MySounds[IntroMusic]); The "intro.wav" file takes up some space (approx 2 meg). I play it only once when the app starts up. I'd like to free-up or release the memory allocated for this .wav file. How can I do this? Does: SoundEngine_Teardown(); release all the memory I've allocated by calling SoundEngine_LoadEffect?
iphone
xcode
audio
null
null
null
open
How can I free-up or release the memory I've allocated to a .wav file? === I load some .wav files in my iPhone app like this: SoundEngine_LoadLoopingEffect([[bundle pathForResource:@"loop" ofType:@"wav"] UTF8String], NULL, NULL, &MySounds[Loop]); SoundEngine_LoadEffect([[bundle pathForResource:@"intro" ofType:@"wav"] UTF8String], &MySounds[IntroMusic]); The "intro.wav" file takes up some space (approx 2 meg). I play it only once when the app starts up. I'd like to free-up or release the memory allocated for this .wav file. How can I do this? Does: SoundEngine_Teardown(); release all the memory I've allocated by calling SoundEngine_LoadEffect?
0
6,512,599
06/28/2011 20:19:02
781,636
06/02/2011 18:20:10
3
0
.htaccess subdomain to directory: problem with trailing slash
I've got a problem with my htaccess file. The last part of the file is supposed to redirect filip.novotny.je to /subdom/filip/. When the URL ends with a slash, everything is fine but when it doesn't, it reveals the ugly subdomain directory in the address bar. Does anyone know why that might be? Try it yourself here: [with][1] x [without][2] trailing slash RewriteEngine On RewriteCond %{HTTP_HOST} ^www.novotny.je$ [NC] RewriteRule ^(.*)$ http://novotny.je/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^www.filip.novotny.je$ [NC] RewriteRule ^(.*)$ http://filip.novotny.je/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^novotny.je$ [nc] RewriteRule ^(.*)$ http://filip.novotny.je/$1 [r=301] # cele domeny (aliasy) # RewriteCond %{REQUEST_URI} !^/domains/ # RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ # RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d # RewriteRule (.*) /domains/%2/$1 [L] # subdomeny (s nebo bez www na zacatku) RewriteCond %{REQUEST_URI} !^/subdom/ RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$ RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d RewriteRule (.*) /subdom/%2/$1 [L] [1]: http://filip.novotny.je/mu/ [2]: http://filip.novotny.je/mu
.htaccess
null
null
null
null
null
open
.htaccess subdomain to directory: problem with trailing slash === I've got a problem with my htaccess file. The last part of the file is supposed to redirect filip.novotny.je to /subdom/filip/. When the URL ends with a slash, everything is fine but when it doesn't, it reveals the ugly subdomain directory in the address bar. Does anyone know why that might be? Try it yourself here: [with][1] x [without][2] trailing slash RewriteEngine On RewriteCond %{HTTP_HOST} ^www.novotny.je$ [NC] RewriteRule ^(.*)$ http://novotny.je/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^www.filip.novotny.je$ [NC] RewriteRule ^(.*)$ http://filip.novotny.je/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^novotny.je$ [nc] RewriteRule ^(.*)$ http://filip.novotny.je/$1 [r=301] # cele domeny (aliasy) # RewriteCond %{REQUEST_URI} !^/domains/ # RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ # RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d # RewriteRule (.*) /domains/%2/$1 [L] # subdomeny (s nebo bez www na zacatku) RewriteCond %{REQUEST_URI} !^/subdom/ RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$ RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d RewriteRule (.*) /subdom/%2/$1 [L] [1]: http://filip.novotny.je/mu/ [2]: http://filip.novotny.je/mu
0
9,951,019
03/30/2012 22:08:49
1,304,193
03/30/2012 21:31:04
1
0
Is it possible to postpone the delivery of a post on a wall? (using Facebook IOS SDK)
I will click 'post' and then I will close the app, but I want the post to be delivered after 1hour. Is it possible or How can I do this? Thanks in advance
iphone
objective-c
ios
facebook
sdk
03/31/2012 09:26:44
not a real question
Is it possible to postpone the delivery of a post on a wall? (using Facebook IOS SDK) === I will click 'post' and then I will close the app, but I want the post to be delivered after 1hour. Is it possible or How can I do this? Thanks in advance
1
2,483,321
03/20/2010 14:08:32
39,590
11/21/2008 07:45:38
1,055
36
How many WCF connections can a single host handle?
I'll try to explain this with an example. I'm writing a chat application. There are users that can join chat rooms. A user has to log in before he can join any room. Currently, there is a single service. A user logs in using this service. Then, the user sends and receives messages for all joined rooms via this single service. channel.Login("Hans Moleman", "password"); channel.JoinRoom("name of room"); channel.SendChat("name of room", "hello"); I'm thinking about changing the design so there is a new WCF connection for each joined room. In the actual app, the number of connections is likely going to be in the range of 10-100, possibly more. Is this a good idea? Or are ~100 connections per client too much? The server should be able to handle many clients (range 100-1000, later up to 10k). In case it matters, I'm using NetTcpBinding.
wcf
null
null
null
null
null
open
How many WCF connections can a single host handle? === I'll try to explain this with an example. I'm writing a chat application. There are users that can join chat rooms. A user has to log in before he can join any room. Currently, there is a single service. A user logs in using this service. Then, the user sends and receives messages for all joined rooms via this single service. channel.Login("Hans Moleman", "password"); channel.JoinRoom("name of room"); channel.SendChat("name of room", "hello"); I'm thinking about changing the design so there is a new WCF connection for each joined room. In the actual app, the number of connections is likely going to be in the range of 10-100, possibly more. Is this a good idea? Or are ~100 connections per client too much? The server should be able to handle many clients (range 100-1000, later up to 10k). In case it matters, I'm using NetTcpBinding.
0
9,864,467
03/25/2012 21:57:33
1,288,839
03/23/2012 17:47:39
4
0
I want to use click for function
var widgetOverlay = jQuery('#widgetOverlay'); var widgetOpen = jQuery('#widgetOpen a'); var widgetOverlayHeight = widgetOverlay.height() - 3; widgetOverlay.css({ marginBottom : -widgetOverlayHeight, display : 'block' }); widgetOpen.toggle( function() { widgetOverlay.animate({ marginBottom : 0 }, 600); widgetOpen.addClass('hide'); }, function() { widgetOverlay.animate({ marginBottom : -widgetOverlayHeight }, 400); widgetOpen.removeClass('hide'); }); I want to replace "toggle" with "click", and I don't know how. I tried just to replace it, and it's working just the first function. Help !
function
click
toggle
null
null
null
open
I want to use click for function === var widgetOverlay = jQuery('#widgetOverlay'); var widgetOpen = jQuery('#widgetOpen a'); var widgetOverlayHeight = widgetOverlay.height() - 3; widgetOverlay.css({ marginBottom : -widgetOverlayHeight, display : 'block' }); widgetOpen.toggle( function() { widgetOverlay.animate({ marginBottom : 0 }, 600); widgetOpen.addClass('hide'); }, function() { widgetOverlay.animate({ marginBottom : -widgetOverlayHeight }, 400); widgetOpen.removeClass('hide'); }); I want to replace "toggle" with "click", and I don't know how. I tried just to replace it, and it's working just the first function. Help !
0
7,526,476
09/23/2011 08:51:57
429,620
08/24/2010 14:17:19
303
2
Getting top and left of a CSS scaled element's normal state with jQuery?
I'm scaling an element on hover with transform: scale(1.2); Now I need to get the top and left position on hover, but it gives me the top and left of the scaled position.. Makes sense, but I'd like the normal state top and left? Is there an easy way to get this?
jquery
css
position
transform
scale
null
open
Getting top and left of a CSS scaled element's normal state with jQuery? === I'm scaling an element on hover with transform: scale(1.2); Now I need to get the top and left position on hover, but it gives me the top and left of the scaled position.. Makes sense, but I'd like the normal state top and left? Is there an easy way to get this?
0
5,637,934
04/12/2011 15:42:00
375,456
06/24/2010 16:00:33
65
2
Text editor Ideas
I'm doing a bit research on gathering possible technologies to program a Text editor/Word Processor. The language used will be C# with the possible to interop to unmanaged code via Pinvoke or Com. So far the Ideas I have come up with are. 1. Using Xml- Total Control of the process with the ability to use Xlst to style the document. 2. The rich Text editor Control - has out of the box word editing capabilities. 3. Html using Html Control with Design mode On - available formating tags already available and a easily distributable format. I'm curious if anyone is aware of any other technologies or frameworks to build a Text editor I may have missed. Thanks in advance.
c#
html
xml
richtextbox
null
null
open
Text editor Ideas === I'm doing a bit research on gathering possible technologies to program a Text editor/Word Processor. The language used will be C# with the possible to interop to unmanaged code via Pinvoke or Com. So far the Ideas I have come up with are. 1. Using Xml- Total Control of the process with the ability to use Xlst to style the document. 2. The rich Text editor Control - has out of the box word editing capabilities. 3. Html using Html Control with Design mode On - available formating tags already available and a easily distributable format. I'm curious if anyone is aware of any other technologies or frameworks to build a Text editor I may have missed. Thanks in advance.
0
6,490,844
06/27/2011 09:22:34
726,803
04/27/2011 08:28:18
71
2
Real-world example of how to structure the MVC part of an already existing website
I am looking for a real-world example of how to structure the MVC part of an already existing website to help me, and others, better understand MVC and OOP. I am using Yii and during the next few weeks I will spend each day learning all I can from the comments and answers provided. I just read the book, "PHP Objects, Patterns and Practice", and have read "Agile Web Application Development with Yii 1.1 and PHP5", and gone through many examples of code, but am having difficulty with how to use MVC effectively. Being able to view the thoughts of those with more experience and able to relate it to a real-world site we are all familiar with should make MVC a bit easier to grasp. Since we have a good understanding of the features here at StackOverflow, let's use StackOverflow for our real-world example. How would you structure the MVC? StackOverflow has users, tags, badges, admin tasks, user profiles, and of course questions, comments, and answers. Would you use separate controllers for user registration, logins, profile management, etc, or have a single users controller to handle all of it? Single controller for questions, comments, and answers, or separate controllers? Front end controller and a backend controller? How would you set the db up to handle the many-to-many relationships and how would that affect the MVC makeup? Thank you so much, and looking forward to your thoughts.
oop
mvc
yii
concepts
real-world
06/27/2011 14:22:37
not constructive
Real-world example of how to structure the MVC part of an already existing website === I am looking for a real-world example of how to structure the MVC part of an already existing website to help me, and others, better understand MVC and OOP. I am using Yii and during the next few weeks I will spend each day learning all I can from the comments and answers provided. I just read the book, "PHP Objects, Patterns and Practice", and have read "Agile Web Application Development with Yii 1.1 and PHP5", and gone through many examples of code, but am having difficulty with how to use MVC effectively. Being able to view the thoughts of those with more experience and able to relate it to a real-world site we are all familiar with should make MVC a bit easier to grasp. Since we have a good understanding of the features here at StackOverflow, let's use StackOverflow for our real-world example. How would you structure the MVC? StackOverflow has users, tags, badges, admin tasks, user profiles, and of course questions, comments, and answers. Would you use separate controllers for user registration, logins, profile management, etc, or have a single users controller to handle all of it? Single controller for questions, comments, and answers, or separate controllers? Front end controller and a backend controller? How would you set the db up to handle the many-to-many relationships and how would that affect the MVC makeup? Thank you so much, and looking forward to your thoughts.
4
8,208,200
11/21/2011 06:45:46
863,771
07/26/2011 15:29:02
24
0
Logged In PHP Status Updates
Looked around a bit and found a few things when googling "commenting system" but, what im really looking for is more of status update like fb ,logged in users currently have a profile, but i want them to be able to post status updates to it that can be commented on , they also have to go to a feed eventually of all the comments combined news feed style. Whats the best way of doing this these days with everything thats out there? anyone have any good links?
php
ajax
update
status
comments
11/21/2011 13:41:34
not constructive
Logged In PHP Status Updates === Looked around a bit and found a few things when googling "commenting system" but, what im really looking for is more of status update like fb ,logged in users currently have a profile, but i want them to be able to post status updates to it that can be commented on , they also have to go to a feed eventually of all the comments combined news feed style. Whats the best way of doing this these days with everything thats out there? anyone have any good links?
4
10,269,535
04/22/2012 16:01:30
1,349,732
04/22/2012 15:55:20
1
0
jQuery Return false not working
Hi I have some jQuery I wrote, and I can't figure out why the return false isn't working on any of the links. Would much appreciate some advice. $(document).ready(function() { var tabPanelContainers = $('div.tabPanel > div'); $('div.tabPanel ul.tabPanelNavigation a').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $(this).addClass('selected'); return false; }).filter(':first').click(); $('a.cleanupLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.cleanupTab').addClass('selected'); return false; }); $('a.defragmentLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.defragmentTab').addClass('selected'); return false; }); $('a.recoverLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.recoverTab').addClass('selected'); return false; }); $('a.specificationsLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.specificationsTab').addClass('selected'); return false; }); });
jquery
null
null
null
null
04/23/2012 02:47:17
not a real question
jQuery Return false not working === Hi I have some jQuery I wrote, and I can't figure out why the return false isn't working on any of the links. Would much appreciate some advice. $(document).ready(function() { var tabPanelContainers = $('div.tabPanel > div'); $('div.tabPanel ul.tabPanelNavigation a').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $(this).addClass('selected'); return false; }).filter(':first').click(); $('a.cleanupLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.cleanupTab').addClass('selected'); return false; }); $('a.defragmentLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.defragmentTab').addClass('selected'); return false; }); $('a.recoverLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.recoverTab').addClass('selected'); return false; }); $('a.specificationsLink').click(function() { tabPanelContainers.hide(); tabPanelContainers.filter(this.hash).fadeIn(); $('div.tabPanel ul.tabPanelNavigation a').removeClass('selected'); $('div.tabPanel ul.tabPanelNavigation li a.specificationsTab').addClass('selected'); return false; }); });
1
5,777,085
04/25/2011 09:40:28
265,103
01/16/2010 09:00:37
498
5
How to consume List.asmx from sharepoint in WP7
I am developing wp7 application. I have done the authentication of the user through authentication.asmx. For this I have referred the following link http://blogs.msdn.com/b/pstubbs/archive/2010/10/04/developing-windows-phone-7-applications-for-sharepoint-2010.aspx Now I am trying to consume the lists.asmx as described in the above code. For this I have dowloaded the sample code from the given link. In the sample link there is one folder SampleData and SPTasksSampleData.xml. These are the two things I am completely unable to unserstand. I think thats why I am getting the following error "The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '" I am getting the above error after passing through the code lists.GetListItemsAsync( "ABC", //List Name String.Empty, //View Name null, //query null, //view fields null, //row limit null, //query options null); //webID Also I am not able to understand what is element.Attribute("ows_LinkTitle") means ows_LinkTitle is referring to what ? Is it referring to column name of list or something else. Can you please tell me where I am going wrong ? Can you please tell me what modifications I need to do in my code so that I can display the list data on my WP7 application ? If I am doing anything wrong then please guide me.
web-services
sharepoint
windows-phone-7
httpwebrequest
linq-to-xml
null
open
How to consume List.asmx from sharepoint in WP7 === I am developing wp7 application. I have done the authentication of the user through authentication.asmx. For this I have referred the following link http://blogs.msdn.com/b/pstubbs/archive/2010/10/04/developing-windows-phone-7-applications-for-sharepoint-2010.aspx Now I am trying to consume the lists.asmx as described in the above code. For this I have dowloaded the sample code from the given link. In the sample link there is one folder SampleData and SPTasksSampleData.xml. These are the two things I am completely unable to unserstand. I think thats why I am getting the following error "The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '" I am getting the above error after passing through the code lists.GetListItemsAsync( "ABC", //List Name String.Empty, //View Name null, //query null, //view fields null, //row limit null, //query options null); //webID Also I am not able to understand what is element.Attribute("ows_LinkTitle") means ows_LinkTitle is referring to what ? Is it referring to column name of list or something else. Can you please tell me where I am going wrong ? Can you please tell me what modifications I need to do in my code so that I can display the list data on my WP7 application ? If I am doing anything wrong then please guide me.
0
5,107,193
02/24/2011 16:06:22
397,488
07/21/2010 03:50:41
46
1
Form not showing in ie7
I have a form in the nave bar of my site that is visible in all browsers except ie7 (and of course ie6). When I view it through Adobe Browse labs, for ie7, it seems that it recognizes the space of form, but doesn't show it. www.savingsulove.com I have been troubleshooting this problem for hours and can't figure it out. I would appreciate some help on this. Thanks a mil.
php
css
null
null
null
02/26/2011 08:23:37
not a real question
Form not showing in ie7 === I have a form in the nave bar of my site that is visible in all browsers except ie7 (and of course ie6). When I view it through Adobe Browse labs, for ie7, it seems that it recognizes the space of form, but doesn't show it. www.savingsulove.com I have been troubleshooting this problem for hours and can't figure it out. I would appreciate some help on this. Thanks a mil.
1
7,194,840
08/25/2011 17:44:29
472,614
01/25/2010 20:29:21
1,271
69
MVVM and naming conventions
**Disclaimer:** For starters, I realize how this question and possible answer isn't very black and white, but I am at an impasse and I need some different points of view. **Question:** When I am working in WPF, I often use the MVVM pattern to make things happen. In any given program I will have a bunch of View Model classes that all derive from a class called 'ViewModelBase' and it has been my habit to suffix the class names with 'ViewModel' However I am finding that I wind up with a lot of classes that have very long names such as... InputDataViewModel CalculationsViewModel and so on. I like that they have some context in their name, but they can be a bit cumbersome when it comes to generic programming, etc. I am beginning to come to the opinion that the fact that they all derive from 'ViewModelBase' is enough information to identify them as view models and so the suffix on the names is becoming more trouble than it's worth. Does anyone else have a similar experience or insight to offer on this issue? Pros, cons, etc? **Also:** No, I am not using an MVVM framework like caliburn, MVVMLight or anything like that.
c#
mvvm
naming-conventions
null
null
08/25/2011 17:55:50
not constructive
MVVM and naming conventions === **Disclaimer:** For starters, I realize how this question and possible answer isn't very black and white, but I am at an impasse and I need some different points of view. **Question:** When I am working in WPF, I often use the MVVM pattern to make things happen. In any given program I will have a bunch of View Model classes that all derive from a class called 'ViewModelBase' and it has been my habit to suffix the class names with 'ViewModel' However I am finding that I wind up with a lot of classes that have very long names such as... InputDataViewModel CalculationsViewModel and so on. I like that they have some context in their name, but they can be a bit cumbersome when it comes to generic programming, etc. I am beginning to come to the opinion that the fact that they all derive from 'ViewModelBase' is enough information to identify them as view models and so the suffix on the names is becoming more trouble than it's worth. Does anyone else have a similar experience or insight to offer on this issue? Pros, cons, etc? **Also:** No, I am not using an MVVM framework like caliburn, MVVMLight or anything like that.
4
4,032,782
10/27/2010 11:37:12
325,852
04/26/2010 09:59:12
66
9
best E-Commerce Shopping Carts for Zend Framework developer
What is the easiest, most friendly and robust E-Commerce Shopping Carts for a Zend Framework developer. I want invest my time in somethink forward-looking. I'm also interested in a solution with a big tutorial base. It should be free. <br/> I found this solutions for PHP/MySQL : - Magento Commerce - Opencart - PrestaShop - OsCommerce - Zen Cart - Digistore - CREloaded - Zeuscart - ShopperPress
php
mysql
zend-framework
e-commerce
shopping-cart
06/30/2011 12:18:51
not constructive
best E-Commerce Shopping Carts for Zend Framework developer === What is the easiest, most friendly and robust E-Commerce Shopping Carts for a Zend Framework developer. I want invest my time in somethink forward-looking. I'm also interested in a solution with a big tutorial base. It should be free. <br/> I found this solutions for PHP/MySQL : - Magento Commerce - Opencart - PrestaShop - OsCommerce - Zen Cart - Digistore - CREloaded - Zeuscart - ShopperPress
4
6,805,130
07/24/2011 05:37:40
834,310
07/07/2011 20:22:56
8
0
App "Ready for Sale", appeared in App store, then disappeared after 2 hours?
I just submitted my first app July 16th and it got the "ready for sale" signal yesterday. About 22 hours later it was finally in the app store via direct link (not searchable). I got a few of my friends to download it and it worked flawlessly. But 2 hours later, the app was no longer available in the app store, the direct link doesn't even work :/ I was just wondering if this is normal or unusual. Please share your experience/thoughts. Thank you very much.
iphone
apple
application
app-store
itunes
07/24/2011 07:17:16
off topic
App "Ready for Sale", appeared in App store, then disappeared after 2 hours? === I just submitted my first app July 16th and it got the "ready for sale" signal yesterday. About 22 hours later it was finally in the app store via direct link (not searchable). I got a few of my friends to download it and it worked flawlessly. But 2 hours later, the app was no longer available in the app store, the direct link doesn't even work :/ I was just wondering if this is normal or unusual. Please share your experience/thoughts. Thank you very much.
2
9,106,473
02/02/2012 02:44:24
1,090,555
12/09/2011 21:43:19
54
0
Which Java language allow object reference variable to be different than the type of object it refers to?
The questions asks "What two Java language mechanisms allow the type of an object reference variable to be "different" than the type of the object to which it refers? Give specific examples to illustrate. In what sense are they not different at all?" I am not sure if I am understanding this correctly. At first I thought it would be Polymorphism but doesn't that only determine which object a method will reference when there are multiple objects? Then I think it is upcasting and downcasting. Since that seems like the correct answer. I am not sure if I am missing another mechanism. Can someone help me clarify this, my book really does not do a good job of explaining this for m.e
java
homework
null
null
null
null
open
Which Java language allow object reference variable to be different than the type of object it refers to? === The questions asks "What two Java language mechanisms allow the type of an object reference variable to be "different" than the type of the object to which it refers? Give specific examples to illustrate. In what sense are they not different at all?" I am not sure if I am understanding this correctly. At first I thought it would be Polymorphism but doesn't that only determine which object a method will reference when there are multiple objects? Then I think it is upcasting and downcasting. Since that seems like the correct answer. I am not sure if I am missing another mechanism. Can someone help me clarify this, my book really does not do a good job of explaining this for m.e
0
11,090,357
06/18/2012 20:14:31
997,293
10/15/2011 21:43:06
67
7
Cocos2D not updating after view popped and pushed
I'm writing an iPhone game which has a number of levels. During play the user can use a menu to quit the game and return to the level select screen. To do this I'm using a UINavigationController with series of UIViewControllers. When the player chooses to quit, the game view is popped from the stack and the level select menu is displayed. The game runs fine the first time through but if the player quits the level and then tries to play the same or another level this causes a problem. The game view controller (which displays the cocos2d scene) is a member variable of a game controller singleton. When the user clicks "play again" this game controller resets the game state. The cocos2d layers are cleared and the game is reset to it's starting condition. After this the game view is pushed onto the stack again. This time however cocos2d doesn't update. The screen is just the last frame from the previous game frozen. It seems that for some reason when the cocos2d view is popped and then pushed it stops updating even though I use: [[CCDirector sharedDirector] resume]; Does anyone have any experience of this problem and how it could be avoided?
iphone
uiviewcontroller
cocos2d
null
null
null
open
Cocos2D not updating after view popped and pushed === I'm writing an iPhone game which has a number of levels. During play the user can use a menu to quit the game and return to the level select screen. To do this I'm using a UINavigationController with series of UIViewControllers. When the player chooses to quit, the game view is popped from the stack and the level select menu is displayed. The game runs fine the first time through but if the player quits the level and then tries to play the same or another level this causes a problem. The game view controller (which displays the cocos2d scene) is a member variable of a game controller singleton. When the user clicks "play again" this game controller resets the game state. The cocos2d layers are cleared and the game is reset to it's starting condition. After this the game view is pushed onto the stack again. This time however cocos2d doesn't update. The screen is just the last frame from the previous game frozen. It seems that for some reason when the cocos2d view is popped and then pushed it stops updating even though I use: [[CCDirector sharedDirector] resume]; Does anyone have any experience of this problem and how it could be avoided?
0
2,848,134
05/17/2010 10:06:25
324,381
07/29/2009 08:07:00
1,943
126
What are best practices for securing the admin section of a website?
I'd like to know what people consider best practice for securing the Admin sections of websites, specifically from an authentication/access point of view. Of course there are obvious things, such as using SSL and logging all access, but I'm wondering just where above these basic steps people consider the bar to be set. For example: - Are you just relying on the same authentication mechanism that you use for normal users? If not, what? - Are you running the Admin section in the same 'application domain'? - What steps do you take to make the admin section undiscovered? (or do you reject the while 'obscurity' thing)
web-security
security
authentication
null
null
03/30/2012 01:40:51
off topic
What are best practices for securing the admin section of a website? === I'd like to know what people consider best practice for securing the Admin sections of websites, specifically from an authentication/access point of view. Of course there are obvious things, such as using SSL and logging all access, but I'm wondering just where above these basic steps people consider the bar to be set. For example: - Are you just relying on the same authentication mechanism that you use for normal users? If not, what? - Are you running the Admin section in the same 'application domain'? - What steps do you take to make the admin section undiscovered? (or do you reject the while 'obscurity' thing)
2
8,668,982
12/29/2011 14:21:38
1,011,424
10/24/2011 18:10:06
8
0
if unchecked script still working :( with ui.boxer whats wrong?
Hello I have a problem with this [http://jsfiddle.net/E7dGA/1/][1] When U starting working and U won't check the checkbox everything is ok, next when U check still everything is ok (U can draw divs) but when U unchecked second time the checkbox the script still working U can draw divs even if the checkbox is unchecked??? Whats wrong? [1]: http://jsfiddle.net/E7dGA/1/
javascript
jquery
jquery-ui
null
null
12/30/2011 17:41:23
too localized
if unchecked script still working :( with ui.boxer whats wrong? === Hello I have a problem with this [http://jsfiddle.net/E7dGA/1/][1] When U starting working and U won't check the checkbox everything is ok, next when U check still everything is ok (U can draw divs) but when U unchecked second time the checkbox the script still working U can draw divs even if the checkbox is unchecked??? Whats wrong? [1]: http://jsfiddle.net/E7dGA/1/
3
9,298,717
02/15/2012 18:01:36
395,255
01/28/2010 09:25:14
885
26
Composite foreign key in SQL Server
I have a table named Books which contains 3 columns. TableName: Books Columns: BookId (PK), BookName, Book_Publisher_XRef_Id (FK), IsInternal I have 2 tables that contains publisher information TableName: InternalPublishers Columns: PublisherId (PK), PublisherName, .... TableName: ExternalPublishers Columns: PublisherId (PK), PublisherName, .... I have a link table that contains information about which book belongs to which publisher. One book can have multple publishers. TableName: Books_Publishers_XRef Columns: Book_Publisher_XRef_Id (PK), PublisherId If i want to create a Foreign Key constraint on PublisherId, i need to create sort of Composite Foreign Key constraint which i am not sure can be created. So in this scenario, what is the best way to achieve FK on PublisherId in Books_Publishers_XRef table? 1) Break Books_Publishers_XRef table in 2 tables i.e. one for Internal Publishers and another one for External Publishers and have 2 columns in Books table for Books_Internal_Publishers_XRef and Books_External_Publishesr_XRef tables? 2) Dont create FK on Publisher_Id column and leave the design as it is? 3) Create composite FK by adding Publisher_Type_Id column in Books table and Books_Publishers_XRef table where if Publisher_Type_Id = 1, it belongs to Internal_Publishers table and Publisher_Type_Id = 2, it belongs to External_Publishers table ? (Not sure if this is possible) 4) Some other schema design? Please advice.
sql-server
database
sql-server-2005
database-design
table
null
open
Composite foreign key in SQL Server === I have a table named Books which contains 3 columns. TableName: Books Columns: BookId (PK), BookName, Book_Publisher_XRef_Id (FK), IsInternal I have 2 tables that contains publisher information TableName: InternalPublishers Columns: PublisherId (PK), PublisherName, .... TableName: ExternalPublishers Columns: PublisherId (PK), PublisherName, .... I have a link table that contains information about which book belongs to which publisher. One book can have multple publishers. TableName: Books_Publishers_XRef Columns: Book_Publisher_XRef_Id (PK), PublisherId If i want to create a Foreign Key constraint on PublisherId, i need to create sort of Composite Foreign Key constraint which i am not sure can be created. So in this scenario, what is the best way to achieve FK on PublisherId in Books_Publishers_XRef table? 1) Break Books_Publishers_XRef table in 2 tables i.e. one for Internal Publishers and another one for External Publishers and have 2 columns in Books table for Books_Internal_Publishers_XRef and Books_External_Publishesr_XRef tables? 2) Dont create FK on Publisher_Id column and leave the design as it is? 3) Create composite FK by adding Publisher_Type_Id column in Books table and Books_Publishers_XRef table where if Publisher_Type_Id = 1, it belongs to Internal_Publishers table and Publisher_Type_Id = 2, it belongs to External_Publishers table ? (Not sure if this is possible) 4) Some other schema design? Please advice.
0
5,954,485
05/10/2011 18:13:31
661,229
03/15/2011 19:04:31
1,006
87
Using interface builder to connect a View
I want to create a UIView subclass and I want to create an Interface builder file for the UIView. How would I connect the files owner to itself. I want to be able to Design the view and have it create the connections but I dont have a need for a view controller. Other than loading the nib into an array can I use the nib file as a connector to the view itself ? I hope i am Asking this properly. I will elaborate tho. Creating a UIViewController I am given the choice to create an xib file for it. At which time i can add the UIViews to the xib and those connections would be made. However the files owner does not appear to have a UI Editor associated to it so I want to create a UIView that will become a sub view in another view. I dont really want to create it with code because Its a pain to layout the items manually. So I want to use the same construct to create a small uiview to put into another
iphone
uiview
interface-builder
null
null
null
open
Using interface builder to connect a View === I want to create a UIView subclass and I want to create an Interface builder file for the UIView. How would I connect the files owner to itself. I want to be able to Design the view and have it create the connections but I dont have a need for a view controller. Other than loading the nib into an array can I use the nib file as a connector to the view itself ? I hope i am Asking this properly. I will elaborate tho. Creating a UIViewController I am given the choice to create an xib file for it. At which time i can add the UIViews to the xib and those connections would be made. However the files owner does not appear to have a UI Editor associated to it so I want to create a UIView that will become a sub view in another view. I dont really want to create it with code because Its a pain to layout the items manually. So I want to use the same construct to create a small uiview to put into another
0
6,703,811
07/15/2011 07:23:48
658,637
03/14/2011 10:54:58
32
0
Can't Upload Files Using FTP Clients || Windows Explore WINDOWS XP
I am Using Windows XP and File zilla to upload files. My Pc every time said "requested time out" when i try to upload files. It happens in Windows Explore also(by typing ftp://host.com). But above both methods (filezill and windows explore) will work in different computer. There might be a problem with my PC. What will be it?
ftp
filezilla
null
null
null
07/15/2011 07:50:28
off topic
Can't Upload Files Using FTP Clients || Windows Explore WINDOWS XP === I am Using Windows XP and File zilla to upload files. My Pc every time said "requested time out" when i try to upload files. It happens in Windows Explore also(by typing ftp://host.com). But above both methods (filezill and windows explore) will work in different computer. There might be a problem with my PC. What will be it?
2
3,047,014
06/15/2010 16:19:44
80,040
03/19/2009 14:13:39
245
36
About unit testing a function in the zend framework and unit testing in general
I am diving into the world of unit testing. And i am sort of lost. I learned today that unit testing is testing if a function works. I wanted to test the following function: public function getEventById($id) { return $this->getResource('Event')->getEventById($id); } So i wanted to test this function as follows: public function test_Event_Get_Event_By_Id_Returns_Event_Item() { $p = $this->_model->getEventById(42); $this->assertEquals(42, EventManager_Resource_Event_Item_Interface); $this->assertType('EventManager_Resource_Event_Item_Interface', $p); } But then I got the error: 1) EventTest::test_Event_Get_Event_By_Id_Returns_Event_Item Zend_Db_Table_Exception: No adapter found for EventManager_Resource_Event /home/user/Public/ZendFramework-1.10.1/library/SF/Model/Abstract.php:101 /var/www/nrka2/application/modules/eventManager/models/Event.php:25 But then someone told me that i am currently unit testing and not doing an integration test. So i figured that i have to test the function getEventById on a different way. But I don't understand how. What this function does it just cals a resource and returns the event by id.
php
unit-testing
zend-framework
phpunit
null
null
open
About unit testing a function in the zend framework and unit testing in general === I am diving into the world of unit testing. And i am sort of lost. I learned today that unit testing is testing if a function works. I wanted to test the following function: public function getEventById($id) { return $this->getResource('Event')->getEventById($id); } So i wanted to test this function as follows: public function test_Event_Get_Event_By_Id_Returns_Event_Item() { $p = $this->_model->getEventById(42); $this->assertEquals(42, EventManager_Resource_Event_Item_Interface); $this->assertType('EventManager_Resource_Event_Item_Interface', $p); } But then I got the error: 1) EventTest::test_Event_Get_Event_By_Id_Returns_Event_Item Zend_Db_Table_Exception: No adapter found for EventManager_Resource_Event /home/user/Public/ZendFramework-1.10.1/library/SF/Model/Abstract.php:101 /var/www/nrka2/application/modules/eventManager/models/Event.php:25 But then someone told me that i am currently unit testing and not doing an integration test. So i figured that i have to test the function getEventById on a different way. But I don't understand how. What this function does it just cals a resource and returns the event by id.
0
1,865,014
12/08/2009 06:33:41
183,828
10/04/2009 03:38:22
218
10
F# to subsititute VBA in Office
Excel is a great spreadsheet software, a even greater front UI for Business Intelligence in many companies. Often VBA is used to write the extensions, or to call other DLLs. I am thinking whether F# will become next VBA in office. Any news or rumors?
f#
excel
vba
null
null
12/08/2009 18:56:55
not a real question
F# to subsititute VBA in Office === Excel is a great spreadsheet software, a even greater front UI for Business Intelligence in many companies. Often VBA is used to write the extensions, or to call other DLLs. I am thinking whether F# will become next VBA in office. Any news or rumors?
1
6,850,986
07/27/2011 20:44:13
442,506
09/08/2010 14:08:27
72
7
Profiler tool in VS
Does anyone know a debug tool for VS2008 that can be used to see what methods are executing and how long it takes?
visual-studio-2008
debugging
profiler
null
null
null
open
Profiler tool in VS === Does anyone know a debug tool for VS2008 that can be used to see what methods are executing and how long it takes?
0
4,226,083
11/19/2010 14:46:24
148,510
07/31/2009 14:02:30
371
19
Is this valid to use a resource in exe found by signature scanning?
I suppose there's no way to use resource from exe without full loading it into memory. Let's say I have plans to use large RC_DATA resource I prepared myself. Is it ok to find it inside my executable by signature scanning and use it with CreateFile and offset after that? Thanks
winapi
file
resources
null
null
null
open
Is this valid to use a resource in exe found by signature scanning? === I suppose there's no way to use resource from exe without full loading it into memory. Let's say I have plans to use large RC_DATA resource I prepared myself. Is it ok to find it inside my executable by signature scanning and use it with CreateFile and offset after that? Thanks
0
11,545,991
07/18/2012 16:23:39
945,672
09/14/2011 22:54:51
44
1
Java API to convert Array to CSV
simple question..Suppose I have an array of int, float , string etc.. , is there any utility API ( commons, guava....? ) that will give me a comma separated string .? Like so, int[] a = {1,2,3,4,5}. magicAPI.getCSV(a) = "1,2,3,4,5"; I could write my own , but wanted to check if anything is already available. :)
java
csv
utilities
null
null
null
open
Java API to convert Array to CSV === simple question..Suppose I have an array of int, float , string etc.. , is there any utility API ( commons, guava....? ) that will give me a comma separated string .? Like so, int[] a = {1,2,3,4,5}. magicAPI.getCSV(a) = "1,2,3,4,5"; I could write my own , but wanted to check if anything is already available. :)
0
1,683,334
11/05/2009 20:22:43
171,136
09/09/2009 21:46:33
141
6
How can I show a message when I open a File in VS 2008?
I want to show a warning when a certain file is opened, how can this be done? for example if I open the Program.cs a warning dialog pops up: "If you edit this you are gonna die"
visual-studio-2008
null
null
null
null
null
open
How can I show a message when I open a File in VS 2008? === I want to show a warning when a certain file is opened, how can this be done? for example if I open the Program.cs a warning dialog pops up: "If you edit this you are gonna die"
0