instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
#include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main(int argc,char *argv){ fstream inout("C:\\Users\\7\\Desktop\\test.txt",ios::in | ios::out | ios::binary); if (!inout){ cout<<" cannot open input file.\n"; return 1; } long e,i,j; char c1,c2; e=5; for (i=0,j=e;i<j;i++,j--){ ...
stackexchange/codereview
Hi need help creating a script to convert the extension of a tif image to a .png and removing the original from the file. This is what I have. @echo off image1.tif >> image1.png when it run it show it as a .png but with a blank image. Still haven't figure out how to remove the original one from the folder.
stackexchange/codereview
Suppose I have either an ASP.NET displaying my results, or a Silverlight client. And I'd like to show the current status of my server, or embedded device. (pretend the device reads temperature and humidity stats) How should I send the status information from my device to the front end? Should I poll the device and s...
stackexchange/codereview
I would like to use the Core Audio extended audio file services framework to read a mp3 file, process it as a PCM, then write the modified file back as a mp3 file. I am able to convert the mp3 file to PCM, but am NOT able to write the PCM file back as a mp3. I have followed and analyzed the Apple ExtAudioFileConvertTe...
stackexchange/codereview
Ok, really simple question. I'm taking a crash course in javascript. If I use timer = setTimeout(..., 500) to set a timer, and then clearTimeout(timer) to clear the timer, the integer value of timer doesn't change, so my question is how to know if a timer is timed out or cleared? I want to use if (timer) {...} , but o...
stackexchange/codereview
i have written a php script to insert the contents of a text file into mysql database and the content of my file a.txt is \n is used for a new line i want it to be loaded into the database including the special character \n as it is... But it is loading only " is used for a new line" kindly help me ou...
stackexchange/codereview
In pthreads, you can associate a destructor function with each per-thread storage slot. When a thread dies, if the slot is non-0, the destructor is called. In a Win32 DLL, the DLLMain function, called at thread exit, can do the same thing. What can I do in code that lives in a purely static library?
stackexchange/codereview
a malloc question. First, I generate some strings. And second, I allocate none-space for copying pointers which point to those strings. At this moment the program should probably crash, since I ve tried to copy those pointers to nowhere, but it doesn’t crash. How is it possible? Any comments would be appreciated. #incl...
stackexchange/codereview
i don't understand assignment in the following line. i think, setBit is a function but it's assigned a value. bool setBit(const unsigned int which) = 0;
stackexchange/codereview
<html> <body> <iframe width='500' height='500' frameborder='0' src='https://spreadsheets.google.com/ccc?key=0ApILEVmEy4YHdGRTdGZNTWd1cmc2c0RPN0dtSnZGWHc&hl=en'> </iframe> </body> </html> This Code dispays spreadsheet in some bowsers.In all bowsers it shows spreadsheets but ie it shows login page
stackexchange/codereview
In a start activity of our android application we're using a linearlayout with an background image for whole space. The image size is 320x480 - the same as device resolution, we're using for testing. The problem is, the image will be scaled und looks not so nice. I tried to use imageview instead, but I've got black bo...
stackexchange/codereview
How to I break out of the following jquery each method when a condition is met; var rainbow = {'first' : 'red', 'second' : 'orange', 'third' : 'yellow'}; $.each(rainbow, function (key, color) { if (color == 'red') { //do something and then break out of the each method alert("i'm read, now break."); } }...
stackexchange/codereview
I am working on a script that allows for an admin to assign multiple languages to a user. I have my multi select working like so: <%= fields_for :users_languages do |u| %> <div class="field"> <%= @lang_list.inspect %> <%= u.label :Assign_Languages %><br /> <%= select_tag :languag...
stackexchange/codereview
I use the following code to pop up the soft input keyboard in my Activity InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.getInputMethodList(); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); This displays the alphabetic keyboard. But I want to display the n...
stackexchange/codereview
Is it okay to start using Iron Ruby and Iron Python in production systems? Also, are there any additional requirements for hosting them? And, for the bonus points, given that F# is a functional programming language in the same way that Python is, is there any advantage to using one over the other within the .NET frame...
stackexchange/codereview
How would i find out the amount of RAM and details about my system like CPU type, speed, amount of physical memory available. amount of stack and heap memory in RAM, number of processes running. Also how to determine if there is any way to determin how long it takes your computer to execute an instruction, fetch a wor...
stackexchange/codereview
I have a conceptual question to ask: I created a custom dialog (extends Dialog) and I want to draw a chart (dynamic data, not static) in the top third of the dialog. What's the best (only?) way to approach this? A) Get a canvas to the dialog and draw to it? Seems like I need access to the dialog's draw, yes, or can I d...
stackexchange/codereview
I've been setting up a Qt gui using QtJambi and JRuby. So far things have gone well. I'm ready to start setting up connections, however, many of the signals don't seem to be visible from jruby. For example, if I print out the methods of QPushButton, I don't see any method called "clicked" for me to build a connectio...
stackexchange/codereview
Hey guys, So I have this report that I am grouping into different age buckets. I want the count of an age bucket to be zero if there are no rows associated with this age bucket. So I did an outer join in my database select and that works fine. However, I need to add a group based on another column in my database. When ...
stackexchange/codereview
exedarken: darken.c gcc -o exedarken darken.c exeimagestats: imagestats.c gcc -o exeimagestats imagestats.c exelighten: lighten.c gcc -o exelighten lighten.c exerotate: rotate.c gcc -o exerotate rotate.c exeflip: flip.c gcc -o exeflip flip.c exematte: matte.c gcc -o exematte matte.c Theres...
stackexchange/codereview
I'm writing a Google App engine app that processes incoming mail, and here's the code I'm currently using to process mail messages: for content_type, body in email_bodies: #8bit bug in mail messages - see bug report here #http://code.google.com/p/googleappengine/issues/detail?id=2383 if body.encoding == '8bit': bod...
stackexchange/codereview
This question relates to this SO question and answer (rails-3-ssl-deprecation ) where its suggested to handle ssl in rails 3 using routes.rb and routes like: resources :sessions, :constraints => { :protocol => "https" } # Redirect /foos and anything starting with /foos/ to https. match "foos(/*path)", :to => redirect...
stackexchange/codereview
Let me rephrase to make it clearer: How can I have an "alarm" go off 20 minutes after my app has gone in the background? Old question: How can you have the simplest tast happen after 5-10-60 minutes on iOS? Essentially, have an NSTimer fire after a predefined interval. I do "begin task", sleep( for some time ); and th...
stackexchange/codereview
I have executed a process using CreateProcess, but I want to fetch or dump the memory area allocated to the process, preferably in real time. Unfortunately I do not know how to recieve the pointer to the memory are after creating the process. I've been searching around, but I have not found any useful answers so far. I...
stackexchange/codereview
There's this script called svnmerge.py that I'm trying to tweak and optimize a bit. I'm completely new to Python though, so it's not easy. The current problem seems to be related to a class called RevisionSet in the script. In essence what it does is create a large hashtable(?) of integer-keyed boolean values. In the w...
stackexchange/codereview
I try to get the correct speed in updates for the function onLocationChanged, this is my class: public class LocationService extends Service implements LocationListener { Putting the minTime on 6000 does not help, it wil keep updating constantly, what am i doing wrong? public void requestLocationUpdates (String provid...
stackexchange/codereview
I have looked through both the CodeBlocks and MinGW FAQ and wiki to no avail. As stated above I am a noob. I want CodeBlocks to act like a Unix compiler in that it overwrites a single output file every time it compiles unless told to do otherwise. In Unix: [cc example.c] -> [a.out], [cc example2.c] -> [a.out]. If I wa...
stackexchange/codereview
I run a Java program with the following command line (Edit: in NetBeans 6.8 project properties) toto has:"tutu titi" args is an array of 2 Strings toto has:tutu titi I want (two arguments indeed, the second) args[1] to be has:"tutu titi" How should I do that? Edit: I have already tried escaping the quotes with back...
stackexchange/codereview
I am using Core Plot alpha release 0.2 and generating a plot with custom labels. The labels are appearing in the correct location but I have no tick marks. I have tried every combination of these settings: x.majorIntervalLength = [[NSDecimalNumber decimalNumberWithString:@"5"] decimalValue]; x.minorTicksPerInterval = 0...
stackexchange/codereview
I created a subclass of an UIView called smartView. Then I created a NSInteger parameter viewID. Now in the IB I change the class of a standard UIView to my smartView. My question is how can I supply a value for my viewID parameter in IB? Is it possible? If not, is there another way besides "Tag" parameter to give a ...
stackexchange/codereview
I've this assignment to implement strcmp function. Sometimes it runs okay but other times it crashes. Please help me. #include <iostream> using namespace std; int mystrcmp(const char *s1, const char *s2); int main() { cout<<mystrcmp("A","A")<<endl; cout<<mystrcmp("B","A")<<endl; cout<<mystrcmp("A","B"...
stackexchange/codereview
This is a little side project I'm working on for fun. I begin by initializing with - (void)viewDidLoad { [super viewDidLoad]; rootArray = [[NSMutableArray alloc] initWithObjects:@"Earth",@"Mars",@"Pluto",nil]; moonArray = [[NSMutableArray alloc] initWithObjects:@"Clavius",@"Galileo",@"Ptolamy",nil]; marsArray = [[...
stackexchange/codereview
I want to build a large scalable database with millions of high dimensional vectors using LSH. Since I have to hold all the data in ram for fast querying, the data must be distributed onto multiple servers to hold all the objects. A naïve approach would be to spread all objects to different servers and send one query t...
stackexchange/codereview
What I'm trying to do: I create some controllers, for example: Home About Gallery Contact Now I want to create a navigation automatically. So is there a way to programmatically fetch the list of controllers/actions to build this navigation? I don't want to fix the navigation everytime I add a controller.
stackexchange/codereview
I am trying to write Prolog code to determine whether the bound variable X is in the scope of the bound variable Y in a list. Lists may be nested and X is in the scope of Y if X and Y are members of the same list or if X is a member of a list that is a member of a list that is a member of a list...(nested indefinitely)...
stackexchange/codereview
I am making a Menu using Tkinter, but I wanted to put "add_checkbutton" instead of "add_command" into the menu options, but problem is: how i deselect/select a checkbox? menu = Menu(parent) parent.config(menu=menu) viewMenu = Menu(menu) menu.add_cascade(label="View", menu=viewMenu) viewMenu.add_command(label = "Show...
stackexchange/codereview
Any one have the ultimate PHP function(s) to add/remove parameters from a query string? It needs to handle all possible cases, Ive seen ones that handle some cases, but not all. Some example cases: http://mysite.com?param1=1&param2=2 http://www.mysite.com/?param1[]=1&param1[]=2 ftp://user:pass@mysite.com/files/uploads...
stackexchange/codereview
Hey, this is a quick one. I have two models, Post and Term and I'd like to be able to tag and categorize (taxonomy) posts as well as other (future) models. My Post model has the following fields: title, content, published (date) and my Term is declared like this: class Term(models.Model): taxonomy = models.CharFiel...
stackexchange/codereview
I found that accessing Dictionary and Multi-Dimension array can be slow-- quite a puzzle since access time for dictionary and array is O(1). This is my code public struct StateSpace { public double q; public double v; public double a; } public class AccessTest { public Dictionary<int, Dictionary<double,StateSpace>>...
stackexchange/codereview
I tried to use convert of imagemagick 6.5.6 to make a smaller version from original JPEG file in both file size and geometry. The command I used is: convert tj/p1.jpg -resize 500x tj/456c2e75fe0faa57fd1cfd87117e0963/p1.jpg The result is funny, the original is 1102x1542+0+0 in 164kb, the converted one is 500x700+0+0 in...
stackexchange/codereview
I'v been looking and I can't seem to figure this out below is my code. import flash.net.Socket; var mySocket = new Socket mySocket.connect("127.0.0.1", 5331) var sym:SimpleButton; sym.addEventListener(MouseEvent.MOUSE_DOWN, symbtn); function symbtn(event:MouseEvent):void { mySocket.writeUTFBytes(1); }
stackexchange/codereview
I am new to repositories. I just read about implementing predicates and a Unit of Work (Fowler). I have seen repository interfaces like the following: public interface IRepository<ET> { ET Add( ET entity); ET Remove( int id); ET Get( int id); IList<ET> Get(Expression<Func<T, bool>...
stackexchange/codereview
What are some other names for a multi-column sort?
stackexchange/codereview
I stumbled upon this open source project Fake It Easy, and I have to admit, it looks very interesting, however I have my doubts, what are the difference between FIE fakes and say Moq Mocks? Is any one better for particular uses? EDIT: What is it about this new framework that would make it better than say Moq?
stackexchange/codereview
Are there constant-time algorithms for binary set intersection and union? I imagine using bitmaps with pointers to elements in the memory and using OR for union and AND for intersection. Does anyone now of a solution?
stackexchange/codereview
I'm developing an iphone app, I need to create a certain size file on filesystem and filled with NO data first, then seek to a offset and write data when get data from somewhere else How can I do it?
stackexchange/codereview
I want to publish some kind of feed that outlook can read and use to populate its calendar. I'm not having any luck discovering how to do this. Can anyone point me in the right direction?
stackexchange/codereview
I have a client hosted with GoDaddy - but they're quite restrictive with their service and don't allow very many ports to be open. I have a script that needs to communicate on an arbitrary port (1129) via cURL but of course GoDaddy won't have any of it. Is there any alternative that I can implement to still confer with...
stackexchange/codereview
I have a survey with 90 statements, grouped in categories. Easy category has apporximate 10 statements. On each statement the user has to put a score from 0 to 3, presented by radiobuttons. When all statements of a category have a score, the mean has to be calculated. At the moment I have the calculation, but it's exec...
stackexchange/codereview
I've seen plenty of comparisons of Doctrine vs Propel, but none of them has actually convinced me to choose Doctrine over Propel. I've been using Propel for a while now and almost every comparison I read states that Propel is not well documented as the first problem and I've read Propel's docs and they're quite well. ...
stackexchange/codereview
I know that re.sub(pattern, repl,text) can substitute when pattern matches, and then return the substitute. My code is: text = re.sub(pattern, repl, text1) I have to define another variable to check whether it is modified: text2 = re.sub(pattern, repl, text1) matches = text2 != text1 text1 = text2 It has issues, for...
stackexchange/codereview
for (Season time : Season.values() ) system.out.println (time+ "\t" + time.getSpan()); I see an example for enumeration using :. What does this mean?
stackexchange/codereview
Hi I am trying to login salesforce through a webservice on Android platform. But I am facing some problems. I am getting a "Socket Exception:Operation timed out" error. I am using the Ksoap2 soap cient ported for Android and WSDL details are from the Partner WSDL of my developer account at Salesforce.I have anabled the...
stackexchange/codereview
I can't use shutdown() and awaitTermination() because it is possible new tasks will be added to the ThreadPoolExecutor while it is waiting. So I'm looking for a way to wait until the ThreadPoolExecutor has emptied it's queue and finished all of it's tasks without stopping new tasks from being added before that point. I...
stackexchange/codereview
I used to write PHP 10 years ago. For the last few years I've been much more into the C variant languages and Perl. Any recommendations for books or resources that seem particularly well geared towards the transition from Perl to PHP? EDIT: It turns out this has already been answered here, I just didn't see it in my ...
stackexchange/codereview
I have a DataGridView column header. When I click that header, the data is resorted according to the value. I don't want that. DataGrid has an AllowSort property. DataGridView doesn't have that. Anything I can do?
stackexchange/codereview
I need help with positioning two images on a web page. I want both the images to be fixed on the page, so one will be fixed to the top-left of the page and the other will be fixed to the bottom-right. But i also want the background to be black so if there is lots of text or content then both the images will lengthen. B...
stackexchange/codereview
According to this example, it goes in the same package as the controller it tests. Why is that necesssary? I think it would be tidier to have all of my unit tests in a testing package - would there be a problem with doing so? package com.example.web.controllers; ...imports... @RunWith(SpringJUnit4ClassRunner.class) ...
stackexchange/codereview
I have a method which is is meant to write information into a struct. I want to make it run as a thread. If I call it by itself, as childWriter((void*) &sa) it works. If I call pthread_create(&writerChild, NULL, childWriter, (void*) &sa), it no longer works. It doesn't write to the shared object. This is driving me mad...
stackexchange/codereview
In C++ UDP Socket port multiplexing, I found that using DNAT PREROUTING, I can redirect the packets for a particular UDP port and listen to packets being received on it. iptables -t nat -A PREROUTING -i <iface> -p <proto> --dport <dport> -j REDIRECT --to-port <newport> Unfortunately this works ONLY for packets re...
stackexchange/codereview
I am required to create 6 threads to perform a task (increment/decrement a number) concurrently until the integer becomes 0. I am supposed to be using only UNIX commands (Pipelines to be specific) and I can't get my head around how pipelines work, or how I can implement this program. This integer can be stored in a tex...
stackexchange/codereview
I have been trying to understand gwt Widgets showcase at the below link: http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellList I am not able to compile the code, this code is using UiBinder but they are not binding it to template which gives me error "Template file ContactInfoForm.ui.xml is missing (expecte...
stackexchange/codereview
What is the difference between applyTo and contentEl in extJS? They are two config properties of the panel.
stackexchange/codereview
preg_replace("/{{(.*?)}}/e","$$1",$rcontent); Please explain the statement to me...i cant understand this
stackexchange/codereview
What I want to do is add a number to the beginning of the file name so I don't have a duplicate file name in the folder. So I choose my file "example.pdf" and upload, I got the the part of the code that looks like this: move_uploaded_file($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1); In this line of code above ca...
stackexchange/codereview
I am fairly new to development, and Visual Studio 2010. I have a solution with a Test Project: In my solution, there are two projects: "TPS" and "TPS.Tests" In the TPS project, in the namespace "TPS.Models" I have defined a bunch of classes, and two interfaces. I have created a Test Class in the TPS.Tests project, and...
stackexchange/codereview
So I have an ObservableCollection of items called "Class1" and Class1 has a property named "ID". I use a datagrid from the WPFToolkit and bind to this collection. Within the datagrid is a combobox column and I bind it's ItemsSource to the ID property of the class. At this point, all is good and everything populates as...
stackexchange/codereview
If I have a text input name 'email', and if I set :message => 'Your email is wrong kind' the validation error message will have something like 'Email Your email is wrong kind.' I am wondering if there is any way to remove that orginal input name (in above case, its Email) from the validation error output in rails3.
stackexchange/codereview
I'm trying to set up piston on my Django project. I ran into a brick wall when I tried to POST (create) a new entry on a model that contains a ForeignKey: location. Here is the exact error I receive: Cannot assign "u'1'": "Fest.location" must be a "Location" instance. In the above example, I tried to send over locati...
stackexchange/codereview
The goal is to be able to invoke execution of a separate thread from within the main class. Some context: I have a program that must run a process. The process (a cmd one) should run only when the main program is done executing and is unloaded from memory. What code should I include in the main class?
stackexchange/codereview
Is there a way that I can track and intercept calls to values in properties that are auto implemented? I'd like to have code that looks a bit like this: [Tracked] public int SomeProperty { get; set; } Ideally the attribute would be able to intercept changes to the property values. Is this possible? What I don't want i...
stackexchange/codereview
I have a graph I've created in graphviz, but the problem is that edges overlap each other (I have 5-7 nodes in each row), so it is hard to tell for each node which are the nodes it connects. How can I make the edges not to overlap each other? Have them cross each other is OK.
stackexchange/codereview
I'm trying to do a web request from a webpage and I'm having problem on production server. The web application is a intranet web site with this configuration on web.config: <authentication mode="Windows" /> I use it to get the domain user authentication. Now I'm trying to load a web page to parse some information, I ...
stackexchange/codereview
I've got a data model where there is a Person entity, which has a transformable attribute which is an array of dictionaries containing information. The model is much bigger than that, this is just the part I'm having trouble with. It was designed this way by an old developer, and in taking over the project I need to mi...
stackexchange/codereview
I am developed application with google map in android 2.2 version using eclipse in ubuntu machine.In that case I can get the google map as well as the location perfectly. But now i have to run that same apps in Xp machine,there also am having android 2.2 .The apps run properly but the google map not displayed ,only w...
stackexchange/codereview
Using reporting services 2005. I have a set of reports that use a custom assembly for some basic calculations. It has been deployed several times in the past successfully. I am trying to install the reports and assembly on a new instance of SQL Server, and the repors work fine as far as pulling back and displaying da...
stackexchange/codereview
How do I alter column in sqlite? This is in Postgresql ALTER TABLE books_book ALTER COLUMN publication_date DROP NOT NULL; I believe there is no ALTER COLUMN in sqlite at all, only ALTER TABLE is supported. Any idea? Thanks!
stackexchange/codereview
The new Facebook Javascript SDK can let any website login as a Facebook user and fetch data of a user... So it will be, www.example.com including some Javascript from Facebook, but as I recall, that script is considered to be of the origin of www.example.com and cannot fetch data from facebook.com, because it is a viol...
stackexchange/codereview
I am working on a C assignment for uni, and I've been coding in TextMate and compiling in the command line. But TextMate wont (or cant) format C code, as it would for say, HTML, Ruby or PHP (using SHIFT + CTRL + F). Is there a plugin or some other tool I can use to fix my indenting and curly braces for .c files?
stackexchange/codereview
I need to draw text to a canvas (of a custom view), and need to first trim it to a maximum width, adding an ellipsis at the end if necessary. I see you can do it for a TextView, but I want to do it inside a custom view's onDraw() without having to add a child view. Is this possible? I know I could measure the strin...
stackexchange/codereview
Im working on my first app for the apple app store and I am in need of the code to be able to see a picture and save it to the photos, also where the code goes, so some what of a tutorial of how to save a picture to the photos app, I am working with the latest version of the iphone SDK.
stackexchange/codereview
I am not good at IIS management.I enabled gzip compression for my web site but In IIS Temporary Compressed Files folder,i dont see any aspx type file.I just see js,text,css and some html files.Is that normal?Why dont i see aspx pages as compressed.Thats my metabase.xml and i think that my settings are true. IIsCompress...
stackexchange/codereview
Here's how you get one css attribute using jQuery: $('someObject').css('attribute') How do you get them all? (without specifying and preferably in the following format so it can be reapplied with jQuery later): cssObj = { 'overflow':'hidden', 'height':'100%', 'position':'absolute', } ...
stackexchange/codereview
I have three controllers, Home, Blog and Misc. When I type mydomain.com/Home at the address bar, the browser displays the view for the home controller. When I type mydomain.com/Blog at the address bar, the browser displays the view for blog controller. And when I type mydomain.com/anything (not Home nor Blog) the brows...
stackexchange/codereview
I've got class A wrapped with method foo implemented using %extend: class A { ... %extend { void foo() { self->foo_impl(); } } Now I want to increase ref count to an A inside foo_impl, but I only got A* (as self). Question: how can I write/wrap function foo, so that I have an access both to A* and unde...
stackexchange/codereview
we are trying to add searching to our web site and want this search function to search only a few things: Files - Obviously we need to parse the text of PDF, PPT and DOC files in our case User comments. Users will be available to comment on the stuff and we want to catch if some user is searching for that relative inf...
stackexchange/codereview
I've written a web service and it's nice that you can just navigate to http://whatever... and see the response to GETs. Is there some nifty way I can do something similar for PUTs? (presumably involving some tool to write the info that's PUTed). Obviously I'll have automated tests for these methods, but I'd like to be...
stackexchange/codereview
I have a div with multiple spans inside. The spans contain text that cannot be split over multiple lines so I have set whitespace: nowrap. This does stop the wrapping within each child span correctly but also stop the parent div from wrapping the children so all spans are on a single line that stretches off the page. H...
stackexchange/codereview
Hello I have been trying to understand how to get data from model by the name of field. I am using cakePHP, and I need to retreive a column's data from a table. The syntax is > "select name from permissions" So I tried to find out on book.cakephp.org, so I got the field function, but that only gives me the first value...
stackexchange/codereview
Background: I have been running a site on the blogger platform for the past 5 years. I was using the option of hosting the site on my own server, publishing via FTP. My server is running ColdFusion, so I decided to take advantage of that. I created Coldfusion custom tags that provided additional functionality and in...
stackexchange/codereview
I'm doing K&R Exercise 5-4 (p107). Write the function strend(s,t) , which returns 1 if the string t occurs at the end of the string s, and zero otherwise. I figured the best way to do this was to... increment both pointers to the end count backwards through both strings whilst each char matches return 1 if we had f...
stackexchange/codereview
Cscope has eleven search input fields in interactive mode. But when I try to use it in line-oriented output mode and specify Find all symbol assignments: field using -10 switch it does not work. Any ideas? Thanks.
stackexchange/codereview
this is very annoying, since now my values are stored as if they contain something by default (like in C). All my OO stuff are now broken since my delegate are always something. I was wonderin why Xcode do this to me, since by default Xcode always set the variable value to 0 or nil. So if I do NSArray* anArray; and t...
stackexchange/codereview
I developed a script (mainly by visiting multiple solutions and mashing together my favorite) to find and replace words in files. The files are all contained in a directory. For some reason, my script goes into an infinite loop, however it appears that it works. I would appreciate any explanation as to why it won't exi...
stackexchange/codereview
I have a full screen UIScrollView that has several possible layout configurations. It is basically a "contact" card eith some buttons, imageViews, Labels , and text fields. When it loads, buttons will be moved or removed based on the content available. Oddly, the Scorll View does not always start in the same position. ...
stackexchange/codereview
I've just inherited an InstallShield 2009 project from a guy who left (oh joy) and am trying to get the setup.exe to run in silent mode. The project is a Basic MSI project and according to the documentation, I should be able to specify the /s switch combined with /v/qn to make the installer and MSI process silent. Ho...
stackexchange/codereview
I want to be able to pass a method as a parameter. eg.. //really dodgy code public void PassMeAMethod(string text, Method method) { DoSomething(text); // call the method //method1(); Foo(); } public void methodA() { //Do stuff } public void methodB() { //Do stuff } public void Test() { PassMeAMethod("...
stackexchange/codereview
I'm guessing all objects that are local to the action are passed into the view? I never see sample code that actually specifies which objects are passed to the view! Is it good practice to create a 'model' object and then assign, as properties to the 'model' object, all objects you want to pass to the view? How can you...
stackexchange/codereview
I have a string that I have read in from a Word document. I think it is in "Cp1252" encoding. Java uses UTF8. How do I search that string for those special characters in Cp1252 and replace them with an appropriate UTF8 character? specifically, I want to replace the "En Dash" character with a plain "-" The following co...
stackexchange/codereview
I have a ton of IP addresses that I need to visit to see if they are active. So my plan is to redirect the browser over and over again and then just use the back button to view each page. What is the best way to do this? I will most likely have an array of IP addresses. like: array(234.324, 2343.323432, 234.234, 234.45...
stackexchange/codereview