instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a REST WCF service defined as follows: [ServiceContract] public interface IRest { [OperationContract] [WebGet(UriTemplate = "/test")] int Test(); } With the following web.config: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="ServiceX.RestBehavior"> <webHtt...
stackexchange/codereview
I have an existing project that I've been working on and started using Subversion for version control. Since then, I've open sourced the project on Github and used Github's documentation on the "git svn" command to translate SVN history into a git repo. However, now I've made changes to the original project in SVN. ...
stackexchange/codereview
I have a question. I use the Cycle plugin on my website for a slideshow. There is a decent amount of images that are being loaded. I also use a technique to scale my background image according to the dimensions of the viewport so the image doesn't get scaled out of proportion. Now, i want to make sure the background im...
stackexchange/codereview
I am working on a web store app using C# 3.5 web forms and MS SQL Server 2008. The solution runs fine on VS2010, using the built-in web server. Then I upload the project to a testing sub-domain and the home page loads; as soon as I click on a menu link, I get this: Validation of viewstate MAC failed. This didn't occur...
stackexchange/codereview
If you update your working tree to an earlier revision, then bzr revno reports the latest revision in the repository, not the revision of your working tree. bzr version-info however, reports the revision of your working tree. Why the difference? > bzr up M file1.txt M file2.txt All changes applied successfully. ...
stackexchange/codereview
After setting up a repo on Github, there seems to be two ways to pull that repo into a local repo. Firstly, I could create a directory, initialize a blank repo, add a remote and then pull changes from the remote. > mkdir "exampleProject" > cd "exampleProject" > git init > git remote add origin git@github.com:exampleUse...
stackexchange/codereview
I'm trying to build an editable table to enter values of a buy order detail. I have a rich:datatable bound to a List, and I dinamically add rows to the table by adding elements to the list. The entity has two fields that must be entered manually so I'm using h:inputTexts to do it, but the values that are entered on tho...
stackexchange/codereview
I have a number of different roles in Sitecore. And I have set security permissions on my content items so that different roles can only access certain content items. It seems that Lucene will just index all of the content. And when I query Lucene it doesn't pay any attention to the security. Is there any way to ge...
stackexchange/codereview
I like perl the more I am getting into it but I had a question about a line I saw in a subroutine in a module I am looking through. my $var = 1; .... .... .... .... $var; What throws me is just seeing that $var all by itself on a line. Is that just a roundabout way of returning 1 ? Many thanks! Jane
stackexchange/codereview
I have a group of anchor tags that I want to have comma separated. <!-- Current --> <div id="wrapper"> <a href="some_url1" class="link">Something 1</a> <a href="some_url2" class="link">Something 2</a> <a href="some_url3" class="link">Something 3</a> <a href="some_url4" class="link">Something 4</a> </div...
stackexchange/codereview
I'm trying to add a MaskedEdit (for a serial) control to a Wix project I have. I have the following added: <Property Id="PIDTemplate"> <![CDATA[?????-?????-?????-?????-?????-?????]]> </Property> <Control Id="Edit" Type="MaskedEdit" X="97" Y="141" Width="191" Height="17" Property="SERIALNUMBER" Text="[PIDTemplate]" Ta...
stackexchange/codereview
Public Sub UpdateStaff(ByVal sr As StaffRecord) Dim oldSr As StaffRecord Dim q = From staff In db.StaffRecords Where staff.Employee_Number = sr.Employee_Number Select staff oldSr = q.First oldSr.Address_Line1 = sr.Address_Line1 oldSr.Address_Line2 = sr.Address_Line2 oldSr....
stackexchange/codereview
When developing apps for use in multiple languages, I see a real benefit to using localization over trying to build some ad hoc localization library specific to your application. I'm working on a website that will have 16 languages, and each language will have different images in various places, as well as full text tr...
stackexchange/codereview
I'd like to be able to create a string as %%variable%% and have it interpreted as a method object rather than a string object. So %%UserDatabase.name%% would be read like @DatabaseUser.name and subsequently return something like, "Michael". Here's what I have so far: def parse_block(component) component.gsub!(/%%([a-...
stackexchange/codereview
I have a bunch of Boy objects and a bunch of Girl objects. I want to keep a list of the girl that each boy likes the most. It is OK if multiple boys like the same girl. I was going to use an NSMutableDictionary, but the setObject: forKey: method of that class copies the key before adding the pair to the dictionary. ...
stackexchange/codereview
Is it possible to join applescript lines into one (in ruby it can be done using ;)?
stackexchange/codereview
Alright, be gentle, since I'm very much a novice to programming. So far I've only studied C++ and I'm running Visual Studio 2010 as my compiler. For this program, I'm trying to read from a text input file and write the information to a set of three arrays. One array will handle a list of names, and the other two are fo...
stackexchange/codereview
I want to get a meaningful error message from my WCF service for my Silverlight 4 application. After some investigation, I found that I need to change the reply code from 500 to 200 if I want silverlight enable to read the meaningful error message. Here is the article: http://msdn.microsoft.com/de-de/library/ee844556(V...
stackexchange/codereview
I'm looking for a tool that generates DB diagrams. Free (open source maybe) Works in Linux (cross-platform maybe) Supports PostgreSQL/MySQL
stackexchange/codereview
Possible Duplicate: Technology to write iPhone, BlackBerry and Android phone at the same time? Edit - guys, we need one more vote to close this. This question is a dup (read the comments) I've heard that Apple banned such tools. Ok, so Apple lifted their ban in September. Still, the question holds - is there a sane ...
stackexchange/codereview
I want to add first_name, last_name, and email fields to the UserProfile admin page. So you can change all the user's details from within the UserProfile admin instead of having to go to a different page to change email and some other fields. This is what my custom form looks like: class CustomProfileForm(forms.ModelFo...
stackexchange/codereview
I know this might sound silly but I am finding it hard to understand the need of a service layer and its differences with business layer. So, we are using asp.net mvc 2 and have Data Access layer which does all the querying with the database and then we have the Business Layer which has the business logic and validati...
stackexchange/codereview
Considering this: [Flags] public enum MyEnum { One = 1, Two = 2, Four = 4, Eight = 8 } public static class FlagsHelper { public static bool Contains(this MyEnum keys, MyEnum flag) { return (keys & flag) != 0; } } Is it possible to write a generic version of Contains that would work...
stackexchange/codereview
Operating with a dds library on i386, trying to pull samples repeatedly. I am explicitly 'reading' not 'takeing' the sample, so they should never expire or be removed. Start two blackboard applications, (1) and (2) Perform a read in both applications. This will return "Cache is empty". Write from (1), sensor id: 1, ev...
stackexchange/codereview
Hey. I am going to be setting up a a database which could get really really huge. I've been using standard mysql for most of my stuff but this particular problem will get up to the TBs and I will want to be able to do hundreds of queries a second. So aside from designing my database schema such that its not going to ch...
stackexchange/codereview
I have two HTML elements that share the same space- when one is visible, the other should not be. However, if I just set the other's visibility to 'hidden', it still occupies space in the display hierarchy, whereas I want it to go away. I don't want to remove the reference entirely, though, as I need to be able to to...
stackexchange/codereview
I need to select all images whose filename contain a certain string (variable) using jQuery. I am using: var str='-out.'; $('img[src*='+str+']'). //do something It works but fires the following warning in Firefox: " Expected ']' to terminate attribute selector but found '.' " Would someone know how to avoid this warnin...
stackexchange/codereview
I'm trying to write a bash function which will take all the arguments sent to it and push them through sed to delete lines in a file that match the arguments. A use case example: to_delete get the trash I can get it to "almost" work like this: function to_delete() { sed -i -e "/$@/d" /tmp/testfile; } The problem with...
stackexchange/codereview
I don't really want to know Django I am actually more interested in the administrator. The thing that interests me is how they introspect the models to create the administrator back-end. I browsed through the Django source code and found a little info but since it's such a big project I was wondering if there are small...
stackexchange/codereview
class Catalog { bool BookCopy; public: string BookTitle; Catalog() { BookCopy = false; } Catalog(string Title, bool Copy) { BookTitle = Title; BookCopy = Copy; } void SetTitle(string Title) {BookTitle = Title; } void SetBookCopy(bool Copy) {BookCopy = Copy; } string GetTitle() { return BookTitle; } ...
stackexchange/codereview
I'm getting some troubles with the tag and then updating my Date attribute from a model with the params sent. Here is my tag: <g:datePicker name="data" value="${controle.data}" precision="month" years="${(Calendar.getInstance().get(Calendar.YEAR)-70)..Calendar.getInstance().get(Calendar.YEAR)}"/> When I ...
stackexchange/codereview
Hi I'm looking to implement a similar feature to that seen on deviantART if a person clicks onto an external link: example: http://www.deviantart.com/users/outgoing?http://driz.co.uk/ What would be the best way of implementing such a feature? From the looks of it on dA they just edit all the external links to have the ...
stackexchange/codereview
I'd like to do something like: var scrollable; scrollable = $(window).scrollTo(99999, 99999); $(window).scroll(function() { // cancel the scrollTo scrollable = null; });
stackexchange/codereview
I need to make a small application to modify an exe file (any exe) by replacing an imported function address (in Import Address Table section) with another function address (i have created) so the Question is : how to use C# to parse an exe (pe) and find the address of Import Address Table to alter an imported function...
stackexchange/codereview
Seems that Rails has by default stopped checking authentication_token for ajax requests. per code request.xhr? is not checked anymore. It was not ignored in rails 2.3.2 but since 2.3.8 is ignored. Wanted to know what is the reason for this change and what uis the way to turn it on.
stackexchange/codereview
This might seem like a CS101 question, but I've managed to thoroughly confuse myself. //this is inside a service class ObjectToUpdate objectToUpdate = objectrepository.Get(objectToUpdate.Id); SecondObject secondObject = secondObjectRepository.Get(secondObject.Id); objectToUpdate.Update(secondObject); ...
stackexchange/codereview
I've eaccelerator running on my server, with PHP under FastCGI. All works fine, but i can't access to eaccelerator control panel (it shows the user/pass dialog, but it doesn't accept any) if i configure PHP to run as an Apache module it works fine and i can access to eaccelerator control panel, but i need to use FastCG...
stackexchange/codereview
Good Morning, I have created my first generic method pieced together from a bunch of Google Searches. I would like for someone to look this over and let me know if I am breaking any major rules or if there are ways to improve this method. The method calls a stored procedure in sql and then uses reflection to assign the...
stackexchange/codereview
I would like to make a file browser that will do two things: 1) Allow the user to browse and select a directory 2) Allow the user to browse all files on their sdcard I've looked for tutorials but can't seem to find any? Can someone please help me by either explaining how what my code would need to do in order to have a...
stackexchange/codereview
Im trying to use a shaking motion to clear the content of an inkpresenter, however shaking is just crashing my application. Here is the code: public class ShakeDetect { private Accelerometer _accelerometer = null; object SyncRoot = new object(); private int _minimumShakes; ShakeRecord[] _shakeRecor...
stackexchange/codereview
I'm working on a logging database in SQL Server 2008. It'll consist mainly of one table something like this: StepLog ---------------- StepLogID ClientID LogContent XML CreateDate Basically what will happen in this table is that various clients will log certain activities to this table. The LogContent fiel...
stackexchange/codereview
The [NSString stringWithFormat:]; can take multiple arguments even though it's declared as NSString not NSArray and there's only one colon. How can I have this for my own method, which is like a replacement for NSLog that writes to a text field so it's used often and I don't want to keep adding more square brackets.
stackexchange/codereview
After the user has entered name/password, I need to store some sort of session to give the user access to the web app features. I have done something similar in PHP, but how can I achieve this in Java?
stackexchange/codereview
For an app I'm developing on sub.domain.com, I have cookies that I need from domain.com and sub.domain.com. Firebug+Firecookie shows me all the cookies that go out with each request, however when I use Developer Tools in Chrome I only see the cookie set on sub.domain.com. Is there any way to fix this?
stackexchange/codereview
last week, I integrated successfully twitter with my "small" rails app. If I create a new record in my rails app it will be posted on twitter. But how Do I do this with facebook? Twitter was really easy (thanks to the Twitter gem) Can you recommend a gem? A link to an example app would also be nice. Thanks in advance...
stackexchange/codereview
I can't understand why my file uploaded through a form that used to be working just fine, is now returning an empty image type. Below is the printed array of $_FILES: [file] => Array ( [media_image] => Array ( [name] => 001_ac.jpg [type] => [tmp_name] => [error] => 1 [size] => 0 )
stackexchange/codereview
We are using JBoss 4.2.3 which in turn comes with version 3.2.1.ga of Hibernate. I would like to use Hibernate 3.5.1-FINAL which supports JPA 2.0. I've been trying to make this work by putting my own hibernate jars in my WEB-INF/lib folder and creating my own classloader for my WAR in jboss-web.xml <jboss-web> <load...
stackexchange/codereview
According to ISO 8601, the first week of the year is the week with the year's first Thursday in it. http://en.wikipedia.org/wiki/ISO_week_date#First_week. Unfortunately, SQL Server Analysis Services (SQL Server 2008) seems to have a bug in the ISO 8601 date implementation, since week 1 starts at January 1st, 2010 and n...
stackexchange/codereview
I am using Cactus to test a servlet which has an injected ejb (EJB 3.0) using @EJB annotation. The servlet is working fine when executed as part of the web application but while running the cactus test it is failing to inject the ejb. I am getting a null pointer exception. Please let me know if there is any limitation ...
stackexchange/codereview
I'm doing a shopping cart with wordpress using Shopp Plugin. How can i know the number of items added to cart here.Any code for this. Can any one please help me.
stackexchange/codereview
Possible Duplicate: Split string to equal length substrings in Java Given the following utility method I have: /** * Splits string <tt>s</tt> into chunks of size <tt>chunkSize</tt> * * @param s the string to split; must not be null * @param chunkSize number of chars in each chuck; must be greater than 0 * @retu...
stackexchange/codereview
I know this question has been raised in similar form multiple times, but none of the threads could give me the concrete answer to my question. I use Fluent NHibernate and Fluent`s auto-mapping to map my domain entities. Right now, I use this convention class to set all properties NOT NULL: public class NotNullColumnCon...
stackexchange/codereview
I am using multiple ui themes in one page. I create a custom theme with a css scope, lets say #scope. I use a datepicker field in the scope lets say #scope input#datepicker. the datepicker field does not get css styles from the the ui theme. I guess this is because it is dynamically created outside of #scope, how can I...
stackexchange/codereview
I must admit, I don't know much about JavaScript that is why my question might sound little bit silly. But what I'm trying to do is grab values from selected by name radio groups. It looks like this function calc() { var op1 = document.getElementsByName('form[radio1]'); var op2 = document.getElementsByName('for...
stackexchange/codereview
Im looking to create a sort of remote desktop software, and it is required that i transfer the users screen over the internet to the viewer. My goal is to create an optimized capture so that i dont have to transfer the whole screen 10 times a second.. The idea i had was take the screenshots on the local computer and th...
stackexchange/codereview
See the code, then you would understand what I'm confused. Test.h class Test { public: #ifndef HIDE_VARIABLE int m_Test[10]; #endif }; Aho.h class Test; int GetSizeA(); Test* GetNewTestA(); Aho.cpp //#define HIDE_VARIABLE #include "Test.h" #include "Aho.h" int GetSizeA() { return sizeof(Test); } Test* GetNewTes...
stackexchange/codereview
i am using automation (i.e. COM automation) to display some HTML in Internet Explorer (9): ie = CoInternetExplorer.Create; ie.Navigate2("about:blank"); webDocument = ie.Document; webDocument.Write(szSourceHTML); webDocument.Close(); ie.Visible = True; Internet Explorer appears, showing my html, which starts off as: <!...
stackexchange/codereview
I am writing a Silverlight 4 business application and have run into an issue. I need the text input in TextBoxes to be forced to UpperCase. What I understand from various forums is Silverlight does not Implement CharacterCasing and CSS Styling. Is there any other way to achieve this?
stackexchange/codereview
To validate my string, I need the string only contains lowercase or uppercase or both cases mixed characters from A(a) to Z(z), and string length should be in the range from 6 to 12 characters long. What's the regular expression for this restrain?
stackexchange/codereview
Im making a textbox which wont allow the user to use spaces but rather then clear the textbox it simply deleats the last character (which is the space) my code dosnt work can sombody look at it please? Private Sub Textbox1_keyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.Ke...
stackexchange/codereview
Friends, many a times I saw Corel Draw start up window. It has no shape; that means it contain balloon shape and has no border. I also created start up image and I placed on one window. Now I want to transparent the areas which are outside my image. Its a vb code; if anybody has tried this solution, please let me know ...
stackexchange/codereview
In VS 2010, Silverlight, C#. I have multiple .cs files. In some of them the 'Refactor' and 'Organize Usings' (among other items) in the right-click context menu are missing. Why are they missing? How can they be brought back?
stackexchange/codereview
I'm just getting into optimizing queries by logging slow queries and EXPLAINing them. I guess the thing is... I'm not sure exactly what kind of things I should be looking for.... I have the query SELECT DISTINCT screenshot.id, screenshot.view_count FROM screenshot_udb_affect_assoc INNER JOIN screensho...
stackexchange/codereview
I am using an NSMutableArray to store a struct with data. So I am having problem to get values from NSMutableArray/Struct. Take a look in my code below: .... { NSMutableArray * arrGameControl; arrGameControl = [NSMutableArray array]; //Struct definition typedef struct { int player; in...
stackexchange/codereview
I have an xml file which I am trying to process with Java. It turned out I needed a DTD for my XML document because I had non-xml standard entities in my xml document. So my question is how do I process an xml file with Java while making it aware that there is a DTD embedded into the XML document? Thanks,
stackexchange/codereview
I'm trying to use user_signed_in? to add a login area to my rails 3 application using devise 1.1.3 and I get a NoMethodErrorin Rules#index <% if user_signed_in? -%> <div id="user_login_box" style="float:right"> <%= current_user.email %> | <%= link_to 'My info', edit_user_registration_path %> | <%= link_to 'Sign o...
stackexchange/codereview
Is it possible to shift the contents of a file while writing to it using FileWriter? I need to write data constants to the head of the file and if I do that it overwrites the file. What technique should I use to do this or should I make make copies of the file (with the new data on top) on every file write?
stackexchange/codereview
I have a Silverlight Business Aplication (RIA Services) and I have a DataGrid attached to a DataSource's DataContext. In a Silverlight child Windows I create a new Entity and submit the changes to the server. The problem is that my DataContext does not know that so the grid does not show the newly added entity. How do...
stackexchange/codereview
IntelliJ highlights the 'foo' variable in gray, and says "assignment is not used". What I want to know is - it is right or not... If this were java and not groovy, I know it wouldn't be right. public class Foo { public Foo() { Foo foo = null; // this 'foo' instance is gray ("assignment not used") try { ...
stackexchange/codereview
What is the best way to calculate the qHash value of a QRect? I need to use QRect (and maybe QRectF) as the key of QCache. Right now I am using something like this: inline uint qHash(const QRect & r) { return qHash(QByteArray::fromRawData((const char*)&r, sizeof(r))); } It seems to work but I don't like casting it in...
stackexchange/codereview
I'm a visual designer creating a UI for an app for an android tablet. The resolution of the tablet is 1024x600 with a density of 160 - I'm building the UI in photoshop on a 1024x600 72dpi canvas - Is this right? I've seen some previews on the device and the graphics that are super crisp on my monitor are kinda fuzzy on...
stackexchange/codereview
I have this: import JPGEncoder; var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0); var bm:Bitmap = new Bitmap(bmd); bm.alpha = .5; stage.addEventListener(MouseEvent.MOUSE_DOWN, screenCap); function screenCap(e:Event):void { bmd.draw(this); var jpgVersion:JPGEncoder = new JPGEncoder( 80...
stackexchange/codereview
I noticed a difference between the way I code (badly ;) ) and the code I see from others. Can anybody explain why I see some people using self.varname.anotherpropertie When varname.anotherpropertie Seems to work just as well. I dont use self. a lot in my code. I'm wondering is this very bad or is there something tha...
stackexchange/codereview
I have a clear button that I want to tie into some php coding. how do I detect if the clear button is pressed. When the user press clear, i'm going to have it update a sql table to clear out entries. but first I need to know when the button is pressed. <input name="Reset1" type="reset" value="clear" />
stackexchange/codereview
I am trying to multiply two vectors together where each element of one vector is multiplied by the element in the same index at the other vector. I then want to sum all the elements of the resulting vector to obtain one number. For instance, the calculation would look like this for the vectors {1,2,3,4} and {5,6,7,8}...
stackexchange/codereview
Hope I can explain this one. I've got a regex for matching two words near each other. For example, if I want to find the word "account" and "number" within 5 words of each other: \baccount\W+(?:\w+\W+){1,6}?number\b This works perfectly. Now I need to find a way to search for a word as long as it is NOT within 2 words...
stackexchange/codereview
I am using ASP.NET MVC2 with EF4. I need to create POCOs for two of my classes PersonP and AddressP, which correspond to their EF4 'complex' classes (which include things like navigation properties and OnPropertyChanged()). Mapping just PersonP by itself works fine, but PersonP contains AddressP (foreign key) - how do ...
stackexchange/codereview
I started an Android OpenGL application and I have the following classes: class A extends Activity class B extends GlSurfaceView implements Renderer When class A's onCreate is called, it creates an object of type class B and calls: setContentView(Bobject) So far it works and I spent a few days on it. Now I wanted to...
stackexchange/codereview
I am designing a database where I need the following entities: Manufacturers: e.g. CocaCola Brands: e.g. Diet Coke, Coke Zero Continents: e.g. North America, Europe Territories: e.g. United States, Canada Regions: e.g. Alaska, California, Quebec Suppliers A Supplier is located within one, and only one, Region, which ...
stackexchange/codereview
i have a array with data,i want to load the dictiionary type element with array...... NSArray *thisArray = [[NSArray alloc] initWithContentsOfFile:path]; NSSdictionary *state; how to load the content with array.... any help appreciated...
stackexchange/codereview
So java has a long type suffix for literals: (123L), a double type suffix (43.21D), a floating point suffix (1.234F). So ... why no byte type suffix? For example, when writing some testing code you MUST cast all your bytes when they are used as function parameters. ByteBuffer b = ByteBuffer.allocate(100); b.put((byte...
stackexchange/codereview
I need to hide a WebVew while it is loading its web content. I tried to do it with other view like this: <WebView android:scrollbars="none" android:id="@+id/id_webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <View android:visibility="gone" android:scrollbars...
stackexchange/codereview
How can i read music(sound) from music library(sound library)?(like apps that read music from music library for set alarm for alarm clock)
stackexchange/codereview
I'd like to make this <hello> <one> <paragraph>p1</paragraph> </one> </hello> into this <x:hello y:an_attribute="a value for an_attribute" xmlns:x="some_new_namespace" xmlns:y="other_ns"> <one> <paragraph>p1</paragraph> </one> </x:hello> this is the stylesheet I came up with: <xsl:stylesheet version...
stackexchange/codereview
I'm creating a batch script which will get latest version of the code of an application, then build it using msbuild. Everything works until the msbuild part. Here's the line that runs msbuild: C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe "code/Solution.sln" /p:Configuration="Debug" And the thing errors all ove...
stackexchange/codereview
I have an iPhone app sending notifications and everything is working fine... Except sometimes :) Let me explain : I'm using a pretty simple PHP script to send the notifications (using the stream_context_create method) but some users told me they do not receive some notifications. Apparently, I may encounter some cases ...
stackexchange/codereview
How do I format date and time using iPhone SDK? For example, how would I extract the date from 9/4/2024 12:00:00 AM to NSDate?
stackexchange/codereview
I currently use balsamiq for ui mock ups, but sometimes it does not give me the detail I need for more specific functionality I want to show. e.g. Error messages, validation. Is there a similar, easy to use tool that allows more customisation than balsamiq's drag and drop? (I still plan to use balsamiq for simple mock-...
stackexchange/codereview
I'm looking for a database with UPC codes that match up a UPC code to a list of ingredients (if applicable). I've done a lot of searching and come up with some options (including some very expensive ones!) although most of the ones are not up to date and do not contain many recent products. I'm wondering if there is a...
stackexchange/codereview
I need to convert an xml document into json in jquery but without plugin and i m not able to find proper code and steps to proceed...
stackexchange/codereview
I have something like this <h1> I am Text </h1> in asp.net MVC If I want to write it by <%: mystring%> that he show the tags who filled by someone. How I can decode it then show " I am Text "? I just want to show the source from CKEDITOR to page without HTML tags. If I use regex then the all tags hide even user use to...
stackexchange/codereview
I have created an array inside a for loop and I am not able to release it. It shows memory leaks. Here is my code : for(int i = 0; i < [magArr count]; i++) { Magazine *magObj = [magArr objectAtIndex:i]; NSMutableArray *myArray = [data readEditions:[magObj.magazineID intValue]:0];//returns a array } [myArray relea...
stackexchange/codereview
Is there any way to do this? I tried putting the following into the subclass: - (BOOL)canBecomeFirstResponder { return YES; } But when I sent the object a becomeFirstResponder message, it still didn't become the first responder.
stackexchange/codereview
I have a controller/model called contacts and I have 2 other models that have a many to many relationship with contacts, ie: users and franchises. I have been playing with nested routes and I can make /users/1/contacts work fine but what if I wanted to do /franchises/1/contacts? Is there a dynamic way to solve this? o...
stackexchange/codereview
Using a sample from xSocket which will run xSocketHandler as a new process, I want to customize and moving all of these code into other java file, can I copy public class xSocketDataHandler implements IDataHandler and paste into different filename say main.java? import java.io.IOException; import java.nio.BufferUnderfl...
stackexchange/codereview
Does anybody know some web-based API that provides you page info ( title, etc ) from an url and argument? Point here is that I don't want to load whole page, but just to receive json ( preferably ) with short info and description.
stackexchange/codereview
what's a “open” command that is available on most or all linuxes? e.g. in OS X, i can do in shell open . and the folder is shown in Finder (i.e. desktop) Similarly, on Windows the command is “explore”. am asking because i want a cross-platform command in emacs. (defun open-in-desktop () "Open the current file in des...
stackexchange/codereview
How can I implement the following Windows function in Delphi? HRESULT URLDownloadToFile( LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB ); URLDownloadToFile Function: http://msdn.microsoft.com/en-us/library/ms775123(VS.85).aspx The question that pr...
stackexchange/codereview
is there any functions like atoi read the buffer to return a string? fgets(input, data_len, stdin); return atoi(input + 6); // i need the string thanks full code char *getInput2(char *param) { data_len=atoi(getenv("CONTENT_LENGTH")); char input[data_len]; fgets(input, data_len, stdin); char *r_str; ...
stackexchange/codereview
I want to ask a question about the HTML code. I have the following UI to let the users to input the data. text box button the following is the code: <input type="text" id="userid" name="userid" value="Please enter your user ID" /> <input type="button" id="enterButton" name="enterButton" value="Enter" /> I have imple...
stackexchange/codereview