text stringlengths 8 267k | meta dict |
|---|---|
Q: looping through each array to create shapes I'm trying to make the paintCOmponent method loop through each element of an array and call a display method, so far i did this
public void paintComponent (Graphics g)
{
super.paintComponent(g);
for(int i = 0; i < drawObjects.length; i++){
drawObj... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624047",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: EXC_BAD_ACCESS crash when switching back and forth between views I'm getting a EXC_BAD_ACCESS crash when switching back and forth between views. I'm having a problem finding the cause of this crash. In the simulator it always goes back to the main.m file and reports the crash in it.
But on my device the EXC_BAD_ACCE... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624051",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Memory management of vector I have a C++ class with a private "pointer to vector" member pV, I assign a new vector to it in the constructor...
pV = new vector<FMCounter>(n, FMCounter(arg1))>;
However when I delete in the destructor of the class
delete pV;
I get a segfault and a message that I'm trying to free pv t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624052",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How to have a fixed width/height image always centered in a div? I am looking for a way to have an image dynamically centered on any div size. How is this possible?
I have posted a jsFiddle for better understanding here http://jsfiddle.net/4exmm/ but as I said the div size is changed using a PHP script.
A: Make you... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624056",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Compiling a .cpp file from the body of another .cpp file I've been working on an application that compiles raw .cpp files and analyzes their outputs, using Microsoft Visual Studio 2010 Command Prompt. I'm having a lot of trouble, and there doesn't seem to be much material about this online. Here's the troublesome co... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624064",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: mojoportal - do i need the source code? I just inherited a site built on the mojoPortal CMS but we don't have the source code. Do I need it to continue developing the site? It seems like I do, but I'm wondering if there are any workarounds (something stored in the db?) that I'm unaware of considering I'm pretty new ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624085",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Checkbox actions I need the checkbox to be checked ONLY if $c (POST) is 1 or if $d['is'] is 1.
Here is my code:
if ( ($d['is'] == 1) OR $c == 1)
$data = 'checked="checked"';
The problem is, if checkbox is checked, and I uncheck this and hit the submit button it is still checked because $d['is'] is still 1. So at t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624086",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Get Amazon EC2 Instance ID via PHP I'm looking to create a PHP script that will echo the unique ID of an Amazon EC2 instance. Anyone know how to do this?
Found a way via command line: http://af-design.com/blog/2010/07/27/testing-your-aws-elastic-load-balancer/
Can I just use PHP w/ CURL to submit the query?
A: You ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624091",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Issue with qTip2 I have 10 divs. Each one has an attribute data-tooltip="text here".
I would something like:
$('.my_div').qtip({
content: $(this).attr('data-tooltip'),'bottom middle'
},
style: {
tip: true,
classes: 'ui-tooltip-red'
}
});
But it doesn't work. How can I g... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624092",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Any possible way to call drawRect from a UIViewcontroller class? I have a UIViewController class called AppController.h, AppController.m. I have thousands of lines of code in there, and that is the only reason why I didn't test this before I asked it. Is there any possible way to use drawRect in a UIViewController? ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624099",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: HTTP server correctness testing I've written a simple HTTP server, and I've stumbled upon a few bugs so far that proved difficult to track down. For example, not adding a blank line between headers and content of a response, or giving an incorrect challenge response for a WebSocket connection. With such bugs, it see... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624104",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: how to associate view controller and xib file When I create a uiviewcontroller from the "new file..." wizard with "create xib file" option, I can load it by just SomeViewController *view = [[SomeViewController alloc] init]. But when I rename the xib file name, this code stops working, even though the file owner in t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624108",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Security for AJAX requests from the client side accessing an API Let's say you want a third party site to copy and paste a snippet of javascript code you provide. This code uses an AJAX request to access a JSON API on your servers. How would you implement security so that, while associating API usage to a website th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624110",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Session handling in GWT RequestFactory Can somebody show me a simple example about session handling with GWT RequestFactory.
Maybe it is very simple, but I can't figure it out.
I read somewhere that I should use ThreadLocal. Well I did. Here is my code:
public class EC_RequestFactoryServlet extends RequestFactorySer... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624111",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: W3 VALID cross browser css gradient, I am trying to find html conditional statement so that I can reference the required additional .css file. Opera, Ie8, Safari.
I am using:
background: -moz-linear-gradient(#ADD58A, #FFFFFF);
for Firefox which is great. But having other browser css properties causes W3 css valida... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624115",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Somehow accessing Javascript output? So,
Say there's a remote PHP file that's generating some output in JavaScript.
I can do <script src='some_file.php type='text/javascript'></script>, and the code will run, but when I click View Source it just shows the above code. Is there any way I can access the actual code th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624118",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Why is root required for listening on the loopback in Java? How come when I try listening to a loopback host in Java (using a plain old socket), it requires root access, yet if I use nio, it doesn't? If I tried listening on any other language on the loopback, it doesn't require any elevated privileges too.
This is m... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624120",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Error in XML Code? So I just finished creating a new UI in DroidDraw (relativelayout throughout), and I've imported it into my main.xml file. The problem is, whenever I run "check for xml errors" the output return states "cvc-elt.1: Cannot find the declaration of element 'RelativeLayout'. [8]" It's really bothersome... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624122",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Trying to limit a RegEx to With or Without a space, including a '-' without spanning more than 2 words Thankyou in advance, complete noob at regular expressions here!
I'm searching HTML for a model number, for example.
"ER-A320"
Which can be expressed on a webpage as "ERA320", "ER A320" or "ER-A320"
I've got stuck a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624125",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Finding the owner and group of a file (as a string) I am trying to get a C string of the owner and group of a file, After I do a stat() I get the user ID and group ID, but how do I get the name?
A: You can use getgrgid() to get the group name and getpwuid() to get the user name:
#include <pwd.h>
#include <grp.h>
/... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624127",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Doubled quotes when using sqlite_escape_string I'm escaping blog posts with sqlite_escape_string(), and connecting to the database using the old object-oriented way.
(Yes, I know, I should use PDO, I'll get to that later; converting this script would take quite a while.)
When I have data like: It's raining cats and... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624139",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Validating and matching a specifically formatted string I have the following regex pattern which works fine:
#^(.+?)=(.+?)$#D
However I want to extend it so it supports the following example inputs:
some text=some more text;something
some text=some more text;something;something
some text=some more text;something;s... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624145",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How do I call static method for a generic type in a class? interface TerminationCondition
{
static bool IsSatisfied(some parameters);
}
Let's say some classes A and B implement this interface.
Some other class C has a generic type:
class C<termCondition> where termCondition : TerminationCondition
I need to ca... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624151",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Is it possible to use context processors in Django without a request object? The Django documentation describes the use of context processors when you have a request instance -- typical usage is to use RequestContext instead of Context when rendering a template.
But what if you want context processors, but are not o... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624155",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Updating 'hidden' binary data in ASP.NET MVC on HTML5 'drop' event I need to figure out how to base64 encode the response from an HTML5 FileReader ...
Here's the problem - I've added a 'drop' event listener on a div so you can drag-n-drop an image file on to my page ... this is an ASP.NET MVC3 Razor form which has a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624157",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: PHPMailer: Hide body text from email address I was wondering if it was possible to hide certain parts of the body message in PHPMailer depending on the email address. I have 2 email addresses that are being sent the message, and the second email address needs to only see parts of what the first email address is seei... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624159",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How do I upgrade to IIS 7 in order to run ASP.NET application? On the IIS download page there is no one installer just a lot of items that could be installed. What do I need to install to run a ASP.NET application? I'm running Windows 7.
A: IIS is part of Windows.
Go to Programs and Features and click Turn On or ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624166",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to make PlotLegend work with ParametricPlot in Mathematica? It seems I cannot use PlotLegend with ParametricPlot. Here's what I tried:
ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 2 Pi},
PlotLegend -> {"My Plot"}]
A: If you call the PlotLegends package first, it should work, though you might be better usin... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624169",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: SQL Query to get number of appearence of a integer in Columns Values (Or Tips to do it in code) The title is a little confusing but I couldn't find a better one.
here is what i want to do. I have a Table of this form:
Name | Gender | Answers
Tom | Male | 1,2,3
Kate | Female | 1,4
John | Male | 2,4
Maggy | Female | ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624173",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Specify SQL Server connectionstring on a messed up network The current scenario before i start asking my question
*
*A C# Winforms application needs to be deployed on our LAN.
*The network contains 200+ computers running Windows XP (& above) having the same domain/workgroup.
*Unfortunately, there's still some ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624180",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How can I create a java GUI so when I double click a .jar it launches a java GUI that acts like a console I have some code that requires input and output and I want to make this into a .jar file that when double clicked can launch a GUI console like application that will work with my code.
The closest I've been abl... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624187",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Why does my index page disappear only in Safari? I have tried everything I can think of to track down this issue but can't turn up anything. I'm using the jquery address plugin for my site.
After I login to my site the user gets redirected to the home page at which time I initialize the jquery address plugin. This... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624188",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Group Listbox for Windows Phone 7? I'm looking for a way to group items similar to the way the applications below have it for there grouping. Is it possible to create a group listbox using View Models? I plan on having multiple customer groups for example:
"AAA" (Group)
-- "XDN" (Contact)
"NCB" (Group)
-- "XDN" (Con... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624189",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How can I parse XML from a script tag in an HTML doc? I've been using Jsoup to scrape HTML data from a website, but there is one section of XML inside a javascript tag that I need to get because it has a bunch of URLs I need to pull out and download the images. Here is what it looks like:
<script type="text/javascr... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624191",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Single step trap and sysenter on windows 7 Working on my own little user mode debugger, mainly for learning purposes. I am running into a problem here; I understand that a blocked syscall means that the calling thread must wait for the routine to finish. I seem to have an issue with having the trap flag set while hi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624193",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How do you link correctly in C to stop symbols being stripped? I'm having some trouble linking properly against libraries in C.
I'm sure this is one of those arcane C linking rules I don't fully understand, but I can't figure it out.
I have libn, which I compile into a static libary, libn.a
nm libn shows:
doug@ninja... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624194",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Find all strings wanted and select them with QPlainTextEdit::setExtraSelections() I'm trying to highlight all strings find in a QPlainTextEdit widget , but find() will
only return the first result. The following code isn't working out , why ?
(textview is a class derivated from QPlainTextEdit)
And please don't ask m... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624196",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Texturing with Slick Library? So I have 2 issues.
*
*I have a 16x16 image that works fine...
When I say the info the image size is 16x16
and the texture size is 16x16
I have a 100x100 image that when I say the info...
The image size is 100x100 but,
The texture size is 128x128...
I don't know why this is but it ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624197",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
} |
Q: Comparing two times using strtotime and time in PHP I have a start time of 3:30 pm and end time of 4:14:59 pm. Both the values are strings so I used strtotime() to convert them. I'm not sure it is taking into account the am while testing. I want to get the current time and check to see if the current time is between... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624198",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Preventing Ctrl-C from closing program This is an extension to a question I asked before.
Override Ctrl-C
I have this code that is handling the signal for ctrl-c, while this worked on one machine, I ran it on another and it now once again exits the program after ctrl-c is pressed.
When I asked my professor he told ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624200",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
} |
Q: Get peer address within a thrift handler function I am implementing a small thrift (0.6.0) server in ruby to play a role of proxy to another protocol with several connections (multiple clients) to a single server. I want to be able and keep per-client data on the server side and track "session" parameters across mu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624201",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: 2D Non-OpenGL Game : ViewControllers I'm building a very simple iOS game that doesn't require any OpenGL; I'd like to stick with Core Graphics & Core Animation.
It seems as though I need two types of ViewControllers: Basic VCs for navigating between menu screens (ie. Settings, Main Menu, Level Select, etc.), and Gam... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624212",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: facebook graph api returning empty json Using the link to my events automatically generated in the docs here: http://developers.facebook.com/docs/reference/api/ (Events: https://graph.facebook.com/me/events?access_token=...), I can get a json object populated with the events I'm RSVP'ed to.
When I request them from ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624213",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: My list of pointers to std::string objects is not working right, and I can't figure out why Can you help me figure out this code:
onCreate(xMsg) is called by the WindowProcedure on a WM_NCCREATE message. The problem is within the iterator dereferencing. I can't seem to set the iterator to the list's begin() and th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624217",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Extending the line to the end while plotting? In reference to this question here, I managed to plot an ECDF for my data. However, I was wondering if it is possible to extend the lines to the extreme left/right of the graph much like how base R plots it? Any suggestions?
I want the lines to look more like this (exte... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624219",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How do you get the most popular items based on visits? Let's say we have a table for items that looks like this
item_id
item_visits
What should we add to this table, to be able to sort these items based on how many visits they have had in the last 7 days.
And how do we query that to the db?
A: Sorry, I misundersto... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624220",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: java Desktop Browser popup window I use the below code to launch a web page in default system browser:
String url = "http://www.google.com";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
however i want my web page to be displayed in a popup browser window with a given size (with,height) like we ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624223",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Java: Upload files to dropbox So i have a simple problem and am looking for a few pointers to a simple solution. I have a java app that must upload a file to dropbox. It will know the username and password of the dropbox account to upload to by default. All i need now is some way to put a file on my computer in any ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624224",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Python 'in' Operator Inexplicably Failing My simple script to check for a certain word in files seems to be failing, and I cannot seem to explain it through documentation or searching. The code is below. I believe I have narrowed it down to the 'in' operator failing by printing the code itself and finding the word t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624227",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: CSS - Div padding "all except z pixels" I have a div that needs to stretch the whole way across the page, but the actual content should only be z pixels wide, and centered. That is, the text is not centered, but the area where the content is - the interior of the div, if you will - is centered.
The logical approach ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624230",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: rspec isn't finding examples I have an almost-new Rails 3.1.0 application, and rspec can't find my examples.
duncan@duncan-notebook:~/myapp$ bundle exec rspec
No examples found.
Finished in 0.00004 seconds
0 examples, 0 failures
My spec directory looks like this:
spec/
|-- controllers
| `-- welcome_controller_sp... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624233",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Aweber Wordpress Widget Wont work Im using the Aweber Wordpress plugin and every time I try to hit the submit button on the form, all it does is refresh the page without actually submitting. The form is supposed to behave like this:
http://forms.aweber.com/form/01/2069621401.html
however, when you check the form on ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624234",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: centering FB html5 code Trying to get html5 code from Facebook Like box centered.
Here is the default code:
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs =
d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id; js.src =
"//connect.faceb... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624235",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to handle packet send/ack I'm building an application to communicate to an Xbee module via the Xbee API.
Currently I have something working, but its fairly simple and has quite a few limitations.
Sub processPackets() ' this runs as its own thread
'remove data from serial buffer and format in to packet
'if IO res... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624237",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "17"
} |
Q: most appropriate form to make re-usable Ruby on Rails code more re-usable? I make a lot of rails applications, and there seems to be lots of way to make code reusable.
Among the things I reuse are the following:
css files,
initializers,
views/shared/ partials
admin images
application helpers
haml view templates
gem... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624240",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: jar file with admin privilege Is there a way in java to execute the jar file with administration privilege, when double click on jar file open with admin privilege ?
i know this way: go to C:\Program Files\Java\jre6\bin and right click on javaw.exe file
choose compatibility and click on run this program as an admini... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624241",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: jQuery tooltip when hovering text I currently have a custom tooltip which appears when a user hovers over text, and disappears when the cursor goes elsewhere. However, because of the spaces between text, the tooltip disappears and reappears in a very jittery fashion.
What behavior should I keep in mind to avoid thi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624242",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How can I look into the memory addresses of automatic variables in GDB? Follow-up
Hmmm I am not sure if I am doing the right thing. Thanks for all the helps thus far.
My previous thread:
Is this really the address
I am making new thread because this is really a separate problem, and the core problem.
Please bear w... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624246",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: JTextPane - a phrase with TWO styles I just faced an interesting thing.
I was changing selected text style. The thing is when I change style for ONE WORD one by one it's fine but next if I select a whole styled phrase and change its font color the whole phrase becomes ONE styled (the first style within the selected... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624247",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: Which row was chosen by the user How can I tell which row (doesn't really matter to me which text field exactly) was chosen in the JTable. I want to be able to edit a row that was chosen by the user.
I will appreciate any help.
Thanks.
A: Add a ListSelectionListener to the table's ListSelectionModel. It's quite eas... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624249",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Why is my deleted function not typeof "undefined" in Node.js? I'm using Node.js.
After my "sum" function gets deleted, I would expect the typeof(sum) to return "undefined", but it doesn't.
// functions are data in Javascript
var sum = function ( a,b ) { return a + b; }
var add = sum;
delete sum;
console.log ( typeo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624250",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: ASP.NET MVC3: model binding with hidden field Here's the view
@using (Html.BeginForm("Deleted", "Location"))
{
Html.Hidden("LocationID", Model.LocationID );
<input type = "submit" value = "Delete" />
}
And here's the method that's supposed to receive the data.
public ActionResult Deleted(int LocationID)
{
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624252",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Codeigniter - should I access session data in a view? Should I grab some data from a session variable for my header from the header which needs to display a few details for the user currently logged in. Or, in each controller, load user data then send it to the corresponding view? Seems like I should do it from the ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624256",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Ruby on Rails: embed ActiveRecord object into JavaScript I have /invoices/ controller and @service object.
When /services/1/invoices/new is called, a new @invoice form is created.
The @service there is used to get quantity, price and discounts.
I want to use @service.discounts in my Javascript to be able to update t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624264",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How do I avoid Persistance and Mapping exceptions in NHibernate? So I've got the following code:
try
{
var config = new Configuration();
config.Configure();
config.AddAssembly(typeof(Address).Assembly);
var factory = config.BuildSessionFactory();
using (var session = factory.OpenSession())
u... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624270",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: PHP mysql connection in index.html? I have noticed that on my website index.html file that contaisn php code to connect to a mysql database does not run and it's also possible to view the php source. Is this normal? I noticed that when I removed the code and put it in its own php file it was fine.
A: By default, PH... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624281",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: rijndael function
i'm working at rijndael decryption, writing inverse function and get stack at InvMixColumns();
So, ref to wiki = http://en.wikipedia.org/wiki/Rijndael_mix_columns -- algorythm for MixColumns (there's also info about inverse MixColumns);
Here my MixColumns():
protected static function MixColumns($... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624284",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Binding to Custom Control Property I am developing an Account List dropdown control which is to be used across my application. The dropdown will make a call to a service and retrieve the list of available accounts, and will expose a property "SelectedAccount" for the selected item in the dropdown. The SelectedAccoun... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624287",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to get word under current cursor position in textarea in flex 4 I'm using flex4 for creating an editor. There I need to get word under current cursor position. say for example, this is the text in textarea, "Hi, this is a sample" and cursor under "this" word. If I click a button, then this "this" word must be re... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624290",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: CABasicAnimation increase width with static left-side origin point I'm trying to make a simple animation using Core Animation to draw a simple bar that grows (like a progress bar).
So, the bar starts at x = 0 with 0 width and grows to fit the frame.
But, when I animate bounds.size.width, the origin point is consider... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624292",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: OpenCV-"Homogeneous coordinates are not supported" when using cvProjectPoints2 "OpenCV Error: Bad argument (Homogeneous coordinates are not supported ) in unknown function, file ......\modules\calib3d\src\calibration.cpp, line 826"
I think I'm getting this error when passing the following matrix into cvProjectPoints... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624293",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How can I automatically create an email address for anyone who signs up at my website? I know that just about the same thing was asked here: How can I... but I would like to use Google's servers because of blacklisting, is there any way for me to do this?
Basically how can I have Google's servers route/forward the e... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624294",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Garbage collection and property syntax I have a class that needs information from an xml file. I have another class which is constructed to meet that need. Once the information required is in the first class I want the xml reader to be garbage collected.
Now the xml reader gets the information required and stores it... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624296",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: NoSuchElementException error for which I have created a catch clause int num_lines = 0;
try {
if (file_stream.hasNextInt()) //line 81
{
num_lines = file_stream.nextInt();
}
} catch (NoSuchElementException e) {
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624297",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
} |
Q: How to check whether the UITableViewCells are blank I am using indexpathforvisiblerows which gives the indexpaths of the visible rows in uitableview. How can i check for the blank cells in the returned indexpaths?.
` NSArray *visiblePaths = [self.rootViewController.accountTableView indexPathsForVisibleRows];
for (NS... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624298",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Scala final variables in constructor I'm still pretty new to Scala, but I know you can define class variables that are initialized in the constructor like
class AClass(aVal: String)
which would be like doing the following in java
class AClass {
private String aVal;
public AClass(String aVal) {
this... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624302",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: Unable to run Leak Instruments in xcode I am using xcode 4 and tried to run the leaks tool by clicking on the Product > Profile button in the top menu.
I checked that I am using the development provisioning profile when running the tool (no issues with running the app in 'run' mode'.
However, I got the following er... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624305",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Android Stack Trace - Where is error shown? Why can't I see the method that throws the runtime exception in Android? Or is it there and I don't understand how to read the stack trace? In Flash, it's easy to see where the error is thrown. In Android, it not easy. Maybe because it throws in a different thread. I have ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624309",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Convert a 'const wchar_t *' to 'unsigned char *' In C++ is it possible to convert a 'const wchar_t *' to 'unsigned char *'?
How can I do that?
wstring dirName;
unsigned char* dirNameA = (unsigned char*)dirName.c_str();
// I am creating a hash from a string
hmac_sha256_init( hash, (unsigned char*)dirName.c_str(), (d... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624310",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: overriding axis labels after plot in R -- not working if plotting an scb object? What should I check about the object I plot to be able to override the axis labels, which remain variable names generated be the scb call instead of my specification below? scb is in the locfit library: http://cran.r-project.org/web/pac... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624313",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Which Merge do I need? I am finding merge a difficult concept (inner, outer, right, left...) so forgive the simplistic question.
I want to merge each column that is generated to the column that came before.
labelA <- array(letters[1:10], dim=c(10,1))
## Function: test_values ##
test_func = function(df, nameA, nam... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624314",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: XPath select descendent of parents sibling This html is within my page:
<tr>
<td class="padded2" bgcolor="#103A74"><font color="White">Refine by Vehicle Types</font></td>
</tr><tr>
<td class="padded2" bgcolor="White"><div>
<table border="0">
<tr>
<td cl... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624315",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Error : Thread was being aborted when writing to xml document on asp.net I have this code to write a XML document:
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
MemoryStream stream = new MemoryStream();
XmlTextWriter myXmlTextWriter = new XmlTextWriter(stream, Encoding.UTF8);
// bui... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624316",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: VB.net Cascading ComboBoxes Connected to DataSet from Access - Changing Units, & Decimal to Fractions I've got a fairly complex ComboBox scenario, and being new to programming I'm struggling with what the best approach to take is.
I have a DataSet with a DataTable that has several numeric columns of Data. The nume... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624318",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: VirtualStringTree Correct/recommended use I have been using virtualstringtree for a while now. I use it for two different things, first a s a normal tree for selecting ,displaying data and secondly as a grid to show outputs from SQL statements.
All my data loaded in to the trees is from a database. For the tree exam... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624319",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: How to create unix process binary trees? Can some one help me out here, not necessarily complete my homework.
I need to create a process tree using fork(); in Unix/C so far the best I can get to to the 4th level here is my code:
/* Includes */
#include <unistd.h> /* Symbolic Constants */
#include <stdio.h> /* Input/... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624325",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Shouldn't css3 transitions animate between height: 100% and height: 200px? css3 transitions will interpolate the state of the height of a div.
Currently, chrome13 will not interpolate if you set the height with a different unit than the previous height
i.e.:
*
set height to 100%
*
set height to 50% (on a differ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624328",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Combining shape objects to create a composite i have a program i have to do where i have to take individual shape objects and combine them to create a final car shape. we are given premade shapes such as front tire, back tire, body, windshield, and roof and supposed to combine them into one car shape. the code alrea... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624329",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Replacing the last lines of a group of text using AWK I have this output from doing various commands
d41d8cd98f00b204e9800998ecf8427e 1317522632 /home/evan/school_work/unix/Projects/Project2/finddups/test/New Text Document.txt
d41d8cd98f00b204e9800998ecf8427e 1317522632 /home/evan/school_work/unix/Projects/Project2... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624331",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: randomly select some numbers c# Let's say we have this numbers 51,53,58,60,78. How can we select a number randomly in such a way if its already selected/picked, it will not be selected in the next run.
Also, after all numbers are selected, everything is restarted and the process repeats itself.
A: Put the numbers i... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624332",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Applescript in Objective C project I am trying to run this shell script command through applescript on my mac application. It works fine in the applescript editor but when I run it in xcode as shown below, it does not work. Am I doing it wrong?
NSString *asString = [[NSString alloc] initWithFormat:@"property MACaddr... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624333",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to "accept" nested class object instances by running a custom method before to store those? I am using Ruby on Rails 3.1.0 and I would like to run a :reject_if method (as described in the official documentation related to the accepts_nested_attributes_for method in the "One-to-many" association section) on class... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624349",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Is there a 'IsInDesignMode' property in WinRT? I'm trying to port my application from Phone 7 and can't find the way to detect when control is in Design mode.
Got it - Windows.ApplicationModel.DesignMode.DesignModeEnabled
A: I am using this:
if (Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator)
a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624351",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "15"
} |
Q: Combo preference in Android My desired custom preference looks very much like the out-of-box EditTextPreference, only that it behaves like a "split button" which combines two Preferences: if user clicks on the text on the left, the edit text dialog pops up; which allows user to set the "label" for the preference; if... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624365",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Any way to extend the line in the legend? Let us say I have the following graph plotted using ggplot:
Is there anyway to extend how much line length is displayed in the legend? Sometimes, it just gets impossible to identify which line correspond to which line in the graph using the legend.
A: here is an option leg... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624368",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "9"
} |
Q: Python: Novice Class object prac and __main__ I've been trying to practice testing my modules by adding
if __name__ == '__main__':
to the end of the module. The idea is to run the module as a script, and get an output
and able to import it from another script or an interactive python session.
I'm using Python 2.6.... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624372",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-4"
} |
Q: Preferred way of creating links with backbone.js I'm trying to wrap my head around backbone.js but I'm finding it hard due to the lack of (IMO) good examples.
First of all, what is the best way of getting a link to an object.
If I want to get the edit url of an Album model I could do album.url() + '/edit', is this r... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624373",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: What is Select 'X'? sSQL.Append(" SELECT 'X' ");
sSQL.Append(" FROM ProfileInsurancePlanYear ");
sSQL.Append(" WHERE ProfileID = " + profileid.ToString() + " AND CropYear = " + cropyear.ToString());
This was a query that was originally hitting an access back end. I have moved it over to SQLCE and a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624376",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: LINQ to Entities integer division incorrect? I'm trying to do a little partitioning, dividing list entries into 6-month blocks. Using this LINQ to Entities query, I get results that imply that integer division is not taking place:
from e in enrollments
let AgeInHalfYears = e.AgeMonths / 6
select new { e.AgeMonths... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624377",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: StructureMap with Windows Forms I'm used to work with StructureMap with Web Apps... but now, I'm working on a Windows Forms project and I'd like to use it, but I don't how to configure it.
In web, I'd have a bootstrapper class that is invoked on Application_Start on Global.asax, but I don't know how to do the same ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/7624380",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.