instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I am creating the Android application where C2DM push notification is used. But i have a problem in creating the php code to use c2dm for sending messages. please guide me how to use the php code to send the messages. Actually there is a problem regarding this that how to get client auth token. I have seen the http://c...
stackexchange/codereview
I am coding in C++ in Linux. I have handled the ctrl C signal so that I could clean up all the resources upon exit. However, I have the problem when I run gdb. Ctrl C is also the stopping of the gdb command. Hence, how do I send the ctrl C to my programme so that I could test my written resource clean up code? Thanks.
stackexchange/codereview
I'm having problem with custom VertexRenderingFunction showing at different sizes for different graphs. An example is below, the default vertex rendering function has the desired behavior since vertices look the same in all graphs, any suggestion how to achieve that with custom vertices? (source: yaroslavvb.com) edg...
stackexchange/codereview
These days, I've seen a URL pattern like this: http://stackoverflow.com/questions/How-to-do Not a usual and old one like this: http://stackoverflow.com/questions.php?id=123 or http://stackoverflow.com/questions.php?q=How-to-do As you know, the difference is that the former is using / directory pattern, and the latt...
stackexchange/codereview
I'm a little new to Rails, and I have a simple app with some stories. I want to have this function to easily hide stories I don't want to appear right now. Other functions set up the same way work fine, except this one with the boolean value. def hide @story = Story.find(params[:id]) @story.hidden = true ...
stackexchange/codereview
Can someone show me an example of how to use AlphabetIndexer with a Custom Adapter that uses a getView? I have it working with a standard adapter, but have no clue how to implement it with a custom adapter. Thanks
stackexchange/codereview
Trying to configure my java GAE instance via yaml. The JS library I am using generates a dir structure as part of its build process; I am trying to map urls to the static dir structure. application: scserver version: 1 runtime: java handlers: - url: /static/(.*)/detect-browser static_files: static/\1/detect-browser...
stackexchange/codereview
I have an MS Access ADP with a SQL server backend. I want to take a bunch of values from a form and insert them into a table. Some of the values can be null. How do I use vba to insert null into an integer field in the SQL Server table? I tried "insert...values(" & nz(me.myInt, null) & ",..." and "insert...values(" &...
stackexchange/codereview
My application want to read each frame from a movie file and used to other. How can I do it?
stackexchange/codereview
show uniques???
stackexchange/codereview
Try to compile the following code in JDK7: import java.nio.file.*; public final class _DiamondSyntaxErrors { public interface InterfaceA<T> { } public abstract static class ClassA<T> implements InterfaceA<T> { protected ClassA() { } } public static void main(String... args) { // no error ...
stackexchange/codereview
When drawing arc segment using Core Graphics I noticed that zero angle is not what I was expecting to be, so to draw the segment arc like in picture, I used 330 and 210 as starting and ending values. CGContextSetFillColorWithColor(ctx, [[UIColor grayColor] CGColor]); CGContextMoveToPoint(ctx, 300, 300); CGContextAddAr...
stackexchange/codereview
I am doing a picture mingling project using QGraphics Scene. So I am placing the pictures inside the QGraphicsscene as QgraphicspixmapItem. But the problem is when I am moving the itm(by mouse drag), the QGraphics view is automatically expanding. I want to constrain this action. Can anybody help me in this?
stackexchange/codereview
I'd like to mask the url of one domain in favor of other domain. To be specific... visitor types http://www.whatever.com/admin into his browser and instead of this, the content from http://www.better.com/admin is shown, but visitor still sees whatever.com domain. This should work even with subpages, http://www.better.c...
stackexchange/codereview
Some of the properties in a class generated by EF are nullable, and some arent. My first instinct was that this should be driven by Nullable property returned by sp_help MyView. But that doesn't seem to be the case. Some of my types that are returned as Nullable by sp_help get generated as Nullable , while others, ge...
stackexchange/codereview
We've got an EF model that's using POCO generation for its types. We added a stored procedure and created a function import for it. We then generated a Complex Type for the result set and let the T4 template generate the business contract (POCO). Everything works great in our development, devint, and QA environments. W...
stackexchange/codereview
I have read the tutorials, searched forums for 2 weeks, and not found the assistance I require. I now jump in to ask my questions... I am new to this arena, so I honor your kindnes to my situation. I have 2 Solar Inverters I have at my home, and I have a RS232 data port on each that is now connected to my home network ...
stackexchange/codereview
What is the current state of hand gesture recognition in OpenCV? I have seen great examples of being able to detect hand gestures (e.g. https://www.andol.me/1661/) but recognising gestures and performing some action (e.g. manipulating on-screen objects) seems much harder. Does anyone know of any examples? Thanks!
stackexchange/codereview
Boost::Serialization has builtin support for boost::shared_ptr<>. Is there a way to use this support for std::tr1::shared_ptr<> too? Is it possible to cast from std::tr1::shared_ptr<> to boost::shared_ptr<>?
stackexchange/codereview
I'm trying to DRY out some lambda expressions for security rights. Is it possible to take a lamda expression and apply it to a single entity for true? Like lets say I have a Person and a DocumentFolder Expression<Func<Person, bool>> CanSeePerson() { return c => !c.IsPrivate; } And one for the fold...
stackexchange/codereview
Edit: I mixed a.com and b.com in my original post, I'll try to rephrase stuff correctly: A HTML page is loaded from a.com The HTML embeds a Flash client from b.com HTML contains a Javascript function that makes a connection to a.com, ie the origin of the HTML, not the origin of Flash The Flash calls that Javascript fu...
stackexchange/codereview
I am having error using the following code in Grails executing HQL to get the first 30 Item objects: def items = Item.executeQuery('SELECT i FROM Item as i LIMIT 30 OFFSET 0') my backend database is Postgres. However, I got: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: LIMIT near line 1, column ... ...
stackexchange/codereview
What is a good book or tutorial to learn Lisp?
stackexchange/codereview
I assume the browser contacts the web server and asks for the "src" (in those situations where there's something to src). Can that interaction be controlled in any way? How much information is available to the server about who wants the src and when? Alternatively, could one deliberately 404 the request, then control...
stackexchange/codereview
I would like to be able to iterate over all the base classes, both direct and indirect, of a given class, including the class itself. This is useful in the case where you have a metaclass that examines an internal Options class of all its bases. To do this, I wrote the following: def bases(cls): yield cls for ...
stackexchange/codereview
void multiLine (int x, int y, String label, Graphics2D g) { AffineTransform fontAT = new AffineTransform(); Font theFont = g.getFont(); fontAT.rotate(-Math.PI / 2); Font theDerivedFont = theFont.deriveFont(fontAT); g.setFont(theDerivedFont); AttributedString attrStr = new AttributedString(labe...
stackexchange/codereview
I don't know what type it is. How do I check and print it out to console?
stackexchange/codereview
I am a PHP programmer.But i have a website code which was developed in jsp technology.. I dont know the environment of jsp engine. I wan to run my website in my localhost using Tomcat server..Please help me to do that...
stackexchange/codereview
struct node{ struct node next; int id; } gives "field next has incomplete type error ". what is wrong with this struct ?
stackexchange/codereview
I have a double[] of huge size. (Ex : Eg.double[] array = new double[] {2.0, 3.1, 4.2, 8.9, 10.11, ........}) I want to get the sum of all the elements of that array at once. (Without using a loop). Do you have any idea to do this?
stackexchange/codereview
What I am talking about is similar to what Google Docs did with the word processor. I want to be able to enter text without using a <textarea> but the javascript hard coding it in. How would you do this? Any ideas?
stackexchange/codereview
Right now my webapplication will dynamically add content via ajax, and then slide down. It's normally got two divs on either side with height: 100%, and a repeating image so as to be a border. When the content gets added however, the borders don't extend down along with it. How can I fix this?
stackexchange/codereview
How can you get the Facebook Places API to show how many people have check in at a venue in the last 3 hours?
stackexchange/codereview
So I've run into a case where I have a class that can store either a string or a numeric value, and I want a single property to return one or the other (it would be a failure for both to be set). I'm using a custom generic class to deal with the numerics (so I can use signed, unsigned, and nullables), and will be stor...
stackexchange/codereview
I have a function searchWorkByName that takes "key" as an argument and use SQOL to retrieve the data. In visualforce side, I have a link that calls searchWorkByName but would like to be able to pass argument such as character 'a' example, (this throws an error) <apex:commandLink value="search!" action="{!searchWorkByNa...
stackexchange/codereview
which is best sourcesafe system for iphone xcode on backup and proper check-in & check-out on codes Regards, sathish
stackexchange/codereview
Is it possible to get the values of a BLOB/CLOB columns in an oracle database table that has more than 1 BLOB/CLOB column and most likely more that one row of data using a SELECT * FROM table_name Query. example of such a table will be made as follows CREATE table_name ( col1 CLOB, col2 BLOB ); example of the kind of ...
stackexchange/codereview
I would like to write to an Android screen as if it were a simple terminal. I want the output to appear at the time I write it. My application does some cpu intensive churning, writes a bit to the screen and continues. I am using a list adapter for the output. The problem is that the output is not displayed until the a...
stackexchange/codereview
I want to know how I can check if the domain is a live in c#? I made this IPAddress[] addresslist = Dns.GetHostAddresses("domain"); it returns the IP(s), which is good, but I want to check if it is live (like ping)? I just need to know if the PC is in the same network as the server, so I have a function to check but ...
stackexchange/codereview
I am using ffmpeg for video conversion, it is working fine in local. But when I upload the site in online it is not converting the videos. It is showing operation failed should I install the ffmpeg in server also. public void convertFile() { lblStatus.Visible = false; try { int i = sFile.LastInde...
stackexchange/codereview
I have following queries. How can I display icon in Signal Area(what it is called?) ? Like default audio player when playback is on and u press HOME or BACK at last screen of audio player, Play icon is displayed in that areA? Kind of minimize application. How to display shortcut of media player? the minimal version of...
stackexchange/codereview
I have recently started work at a company that has a website. The previous programmers have not used any protection whatsoever on the input fields. Now I need to do something. The site consists of hundreds of PHP files included in just two files (index.php and main.php - first one for visiting users, second one-for reg...
stackexchange/codereview
I've read about the task-based asynchronous pattern and it sounds great. Now, I have a WCF service that needs to call other WCF services. Those services return differnet result. How can async call those services with the new pattern and await all to complete?
stackexchange/codereview
I ran into ss64.com which provides good help regarding how to write batch scripts that the Windows Command Interpreter will run. However, I have been unable to find a good explanation of the grammar of batch scripts, how things expand or do not expand, and how to escape things. Here are sample questions that I have not...
stackexchange/codereview
I have a classifieds website, where users must fill in a form to post a classified (offcourse). I wonder, do you think I need some form of captcha on the form? Also, I am working on a "register" page where users may get their own username/pass and login to post classifieds more easily. Also, I have a mail-server setup....
stackexchange/codereview
In my application, I'm calling a web service and by using SoapExtension and SoapExtensionAttribute I can intercept the incoming and outgoing SOAP messages for logging purposes. I used the example in http://msdn.microsoft.com/en-us/magazine/cc164007.aspx as input. But now I want to go one step further. I have a Windows...
stackexchange/codereview
this is my code: url = "/aa" result = urlfetch.fetch(url) but it will be error , because you have to get the full url , like this :http://digu.com so any easy way to get the full url in my code , thanks
stackexchange/codereview
Default Rails will render 404.html, then it thinks an error 404 is appropriate. However, I want make it by custom page. Please suggest the proper way do it.
stackexchange/codereview
@Transactional public void start() { ... ... int result = entityManager .createQuery("update Users set name=" + value + " where user.id=5").executeUpdate(); ..... } Above code gives javax.persistence.TransactionRequiredException exception. Update database in the middle of the transacti...
stackexchange/codereview
I'm currently trying to parse some files with my DICOM parser, and I've come across a problem with multiple US (usigned short) values in a Data element (0018,1310) Aquisition Matrix: 0x55 0x53 {tag} 0x08 0x00 {lenght} 0x00 0x00 0x00 0x01 0x00 0x01 0x00 0x00 {value} Only, as far as I can find in the specification, a...
stackexchange/codereview
Don't you think the TCPDF solution force you to reivent the wheel, in term of layout rendering? I think TCPDF doesn't allow a good separation of concerns, and is just too limited when you try to render dynamic tables, or wide portions of text. I'm pretty interested in alternative solutions like wkhtml2pdf or XSL-FOP, b...
stackexchange/codereview
I have dynamic content i'm outputting in a Footer element in a PDF w/ DDX & Coldfusion. Some of the records have long text, and do not automatically wrap, I have placed tags, tried padding/margin, all to no avail. Any ideas?
stackexchange/codereview
Working through a tutorial on Transactional Replication on SQL Server 2008 R2 with AdventureWorks. Publisher, Distributor and Subscriber are all in the same instance. I am getting this error... Cannot DROP TABLE 'Production.ProductModelProductDescriptionCulture' because it is being referenced by object 'vProduct...
stackexchange/codereview
A number of images are "built in" to my app. They are stored in the drawable folder. I'd like to give the option of sending one of these images via mms (or even email) to someone in the user's address book. All the examples I've seen are sending images that are stored somewhere other then the default Eclipse drawable f...
stackexchange/codereview
Can any one provide me some information regarding iphone Device Management with iOS4. 1) How to implement it with & how this will works. 2) Can it work with only Enterprise licensee or can we implement it simply Developer License. 3) Any specific documentation or help. Thanks
stackexchange/codereview
I need help with my code on Cocoa Touch (for iOS/iPhone). I want a function when dismiss SecondViewController finish, because I need to pass one string to from second view controller to first view controller. When I include First View Controller in Second View Controller, the debugger return this: "Expected specifier-q...
stackexchange/codereview
I have a master page that relies on a specific model coming from my pages. So the ending code for basically every ViewResult ends up something like this public ActionResult Details(long store_id) { var store = getStore(); var model = new ClientModel<StoreModel>(store) { UserNotifications =...
stackexchange/codereview
I am writing an iPad piano-like app. I firstly created the keys by UIButton, everything worked fine but when I want to slide from one key to another I found that it's a drag-out action (of the first button) rather than touch down action (of the second button) so Just wondering does anyone know any ways to disable the ...
stackexchange/codereview
I want to have multiple launcher icons for my application. I can get this to work fine on some phones simply by adding the following to the Activity definitions <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </in...
stackexchange/codereview
I've got a form that has a "detail" section iframed in. Take a look here: [URL Removed] click add item, then you'll see that you can type in the first 5 fields and hit update. These will save as expected. Try adding in some data into the "vintages" section (fill in all fields) and click "Save and Add". This will save ...
stackexchange/codereview
// instead of 'width' could be 'font-size', 'color', 'position', etc var result = getCSS('some_id_name_or_class_name', 'width'); // may be the value or 'null' if there is no style for such an id name or a class name alert(result); (The matter is that there is yet no element created with such id or class.)
stackexchange/codereview
I know how to read a bitmap file into a byte array. How is the byte array then converted to a Java Bitmap?
stackexchange/codereview
the XML <bookstore xmlns="http://www.contoso.com/books" xmlns:g="http://www.contoso.com/genre"> <book g:genre="novel" publicationdate="2010-03-01" ISBN="1-123456-15-0"> <title>61 Hours</title> <author xmlns="http://www.contoso.com/author"> <first-name>Lee</first-name> <last-name>Child...
stackexchange/codereview
I have a json string something like this "{"price":1.0}", using the json-framework I am converting this json string to NSDictionary. Now I am retrieving the value from NSDictionary as below NSString *text = [[dictionary objectForKey:@"price] description]; I am getting back only "1" as a result the decimal place and th...
stackexchange/codereview
I want to move an image from 0,0 to 100,100 on android. I'm using translate animation to do so: public void moveImage() { // move image from 0,0 to 100,100 mAnimationTranslate = new TranslateAnimation(0, 100, 0, 100); mAnimationTranslate.setDuration(1000); mAnimationTranslate.setAnimationListener(this);...
stackexchange/codereview
I just did a quiz for my programming class and got this question wrong: The return type of the function to overload the operator << must be a reference to an ostream object. This does not seem right at all to me. Surely C++ is a bit more open ended than this. But I thought I'd ask here anyway. How is this right (...
stackexchange/codereview
Basically, I've got a bunch of phrases and I'm only interested in the ones that contain certain words. What I want to do is 1) find out if that word is there and if it is, 2) erase all the other words. I could do this with a bunch of if's and for's but I was wondering if there'd be a short/pythonic approach to it.
stackexchange/codereview
Let G be a graph and δ(G) the minimum degree of a vertex. Describe an algorithm in pseudocode that, for a given tree T with k<= δ(G) edges, should be build (in polinomial time) a sub-graph H of G so that H is isomorphic with T. How do I even start ?
stackexchange/codereview
Clearly I don't know much about DNS, so bear with me on this issue, which has been puzzling me me for a while. Some WHOIS records show (say) ns1.example.com and ns2.example.com as name servers for example.com. Then how is the actual IP address found? Isn't this circular?
stackexchange/codereview
I'm developing an e-commerce community website, and i'm not sure which cms to use. Here are more specific details: It has to be themable, as i'm not a designer, with plenty of high quality templates online. (Wordpress, joomla and drupal are good examples of this). It has to have a good e-commerce plugin. (I'm leaning ...
stackexchange/codereview
I am using BeautifulSoup in a simple function to extract links that have all uppercase text: def findAllCapsUrls(page_contents): """ given HTML, returns a list of URLs that have ALL CAPS text """ soup = BeautifulSoup.BeautifulSoup(page_contents) all_urls = node_with_links.findAll(name='a') # if the...
stackexchange/codereview
What are the advantages of using cakePHP's CLI? Is it good to start learning cakePHP using CLI than starting with the blog tutorial?
stackexchange/codereview
hello I have a class that gives me an image in the server image is changed periodically the problem is that the image is not is that refreshed in my web page <a4j:region> <h:form> <a4j:poll id="poll" interval="500" enabled="true" reRender="poll,out" /> ...
stackexchange/codereview
Is there a tool that allows to see the whole page oulined in the browser? For example, I have a lot of hidden divs or images, may be overflown by some other elements and I want to see all the elements outlined, just to see what is placed in what place. If you ever used Adobe Illustrator, you could understand what I mea...
stackexchange/codereview
i read that WindowsFormsApplicationBase, is in the Microsoft.VisualBasic.ApplicationServices namespace Do I have to really add the full-blown Microsoft.VisualBasic.ApplicationServices just to get WindowsFormsApplicationBase in c# ? What's the consequence on the size and performance of my c# app if I do so ?
stackexchange/codereview
I am using a form that has a lot of validate rules and messages and I am using submitHandler to submit a AjaxSubmit then. This is OK, if I want to send form on demand which I usually do. But on the same page I'd like to do a validation without submit when user first visits the page, so he can see where the errors are. ...
stackexchange/codereview
I need some seo/mod-rewrite help. I have this .htaccess in my root folder : Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^corporate$ shop/corporate/ so basically...if I go straight to http://chocowrap.ie/shop/corporate it works but not if I go to http://chocowrap.ie/corporate There is another ...
stackexchange/codereview
I'm using WiX to create an installer and generate a bootstrapper. The bootstrapper comes out as a separate file that does its thing and then executes my MSI installer. I want to make this process as simple as possible. I don't want the user to have to unzip files or anything, I'd like to them to just be able to downloa...
stackexchange/codereview
I have a project that uses MANY dialogs. Each dialog performs much of the same code and business policies are an issue. For this reason I have created a method that accesses the controls on the form. foreach (Control control in this.Controls) I need to access the controls on of the DERIVED Form, as these controls chan...
stackexchange/codereview
how to load another nib file from viewbased application. I added button in root nib file.... on clicking button i need to load another nib file.
stackexchange/codereview
I am trying to find out how to run a ruby script(method) every hour on the hour and to have it quit upon key pressed. I have been trying to loop but it seems to run many times during the same second.
stackexchange/codereview
using (ZipFile zip = new ZipFile()) { foreach(string file in Directory.GetFiles(folder)) { zip.AddFile(file, Path.GetFileName(file)); } zip.Save("test.zip")); } Each time I add a file, it's creating a new subfolder for it. So I want to end up with: test.zip - myDoc.doc - myPdf.pdf bu...
stackexchange/codereview
Yes, I have Googled this and found absolutely nothing useful. I want to use LAME.DLL (NOT LAME.EXE) from C# to turn a WAV into an MP3. The two CodeProject examples (MP3compressor and Aumpel) that every screen scraping help forum points to are broken. In the EncodeChunk() function, it throws an MSCORLIB engine executio...
stackexchange/codereview
I need to get the CSS value Width of a DIV-Container. Then I will divide this width value through 245px. Pseudo Code: var articles = "#showroom ul" css width / 245px
stackexchange/codereview
I read the Groovy Codehaus article about Updating XML with XmlSlurper, this leads me to the following question. Consider we have a input XML structured as the upcoming: <customer> <address> <street /> <city /> <postalcode /> </address> </customer> Is it possible to change the XML without knowing its co...
stackexchange/codereview
In our application we have several (actuall many, about 30) web services. Each web service resides in its own WAR file and has its own Spring context that is initialised when application starts. We also have a number of annotation-driven aspect classes that we apply to web service classes. In the begining the poincut ...
stackexchange/codereview
I noticed that the google maps api has a option "sensor".
stackexchange/codereview
How do I include a .vbs file into a .xhtml file?
stackexchange/codereview
I've got a simple queue implementation in MS Sql Server 2008 R2. Here's the essense of the queue: CREATE TABLE ToBeProcessed ( Id BIGINT IDENTITY(1,1) PRIMARY KEY NOT NULL, [Priority] INT DEFAULT(100) NOT NULL, IsBeingProcessed BIT default (0) NOT NULL, SomeData nvarchar(MAX) NOT null ) I want to atom...
stackexchange/codereview
I have a DateTime instance that has a Date and a Time. How do I extract only the date or only the time?
stackexchange/codereview
Greetings all i want to know how to make good encryption and decryption for something in java and is is possible for anyone to decrypt something encrypted ?
stackexchange/codereview
All the examples I've found online for displaying a gallery of images require creating a custom Adapter and doing a ton of manual work. Is there not an Intent that I can simply pass a path or filter to in order to reuse the default image gallery functionality (display thumbnails, touch to view full pic, sharing option...
stackexchange/codereview
When the user selects the list of files from a page and hit's download selected, then a post back happens to server and starts zipping on the server. This works great until we hit the timeout on the page ( which is default to 90 seconds ) and just returns the process to the page even though the backend process is still...
stackexchange/codereview
I want to create indices on a table. I didn't realize it will grow so fast in size that I'm not even able to select a handful of rows. Now, I want this table to be so alike another table. So I want to check the indices and the exact create index statement used on that table.
stackexchange/codereview
I'm looking for a tutorial or for some ideas to make a custom controller that looks like the one in the Twitter app for iPad, I mean the stacked pages with a main menu on the left. Thanks in advance for any help!!
stackexchange/codereview
Am using Lucene.net 3.0 in my Application which as frequent updates to index. But when new data on a forum it's not available in the search . it's taking few minutes to update index. how can i overcome this.....
stackexchange/codereview
TeamCity allows me to report back from my MsBuild script using the ##teamcity interaction. I can use this to tell TeamCity that the build has FAILED, or indeed SUCCEEDED, however I would like to tell it to CANCEL the build instead. Does anyone know of a way to do this? I can use this to inform TeamCity of failure... <...
stackexchange/codereview
I have a problem. My program is using config file to set options, and one of those options is a tuple. Here's what i mean: [common] logfile=log.txt db_host=localhost db_user=root db_pass=password folder[1]=/home/scorpil folder[2]=/media/sda5/ folder[3]=/media/sdb5/ etc... Can i parse this into tuple with ConfigParser ...
stackexchange/codereview
Im trying to build some of my plugins for Linux using Cygwin (keep screwing up Linux virtual machines so I decided to try setting up Cygwin since I wouldn't have to move all my SDKs and what not). Everything seemed okay except I got the error "gcc: error trying to exec 'cc1plus': No such file or directory" so I install...
stackexchange/codereview
with Rails there is the path, edit_user_registration_path to allow users to edit their profile. I'm setting up my own Account Control to present the user with a better UI to edit their profile etc.. which is routed at /account/profile, /account/notices, etc.... Problem is this URL, /users/edit still works and takes us...
stackexchange/codereview