instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I was trying to get all quoted (" or ') substrings from a string excluding the quotation marks. I came up with this: "((?:').*[^'](?:'))|((?:\").*[^\"](?:\"))" For some reason the matching string still contains the quotation marks in it. Any reason why ? Sincerely, nikita.utiu.
stackexchange/codereview
Hello I have the following code to retrieve data from my db using nhibernate 3.0 with linq - public IQueryable<myEntity> getEntityWithChild { get { return _currentSession.Query<myEntity>().Fetch(c => c.myOtherEntity); } } When I try to pass that to a view, I am getting the following error ...
stackexchange/codereview
When using dependency injection which dependencies do you inject? I have previously injected all dependencies but have found when doing TDD there are typically two types of dependency: Those which are genuine external dependencies which may change e.g. ProductRepository Those which exist purely for testability e.g. Pa...
stackexchange/codereview
I have problem, I can't get control which I added in DataGrid. I am adding it in OnRowDataBound event like: protected void RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowState == DataControlRowState.Edit || e.Row.RowState == (DataControlRowState.Alternate | DataControlRowState.Edit)) { ...
stackexchange/codereview
Using PHP I am running str_replace many times in a row to switch one thing out with another like this: $a = str_replace("cake", "c_", $a); $a = str_replace("backup", "bk_", $a); $a = str_replace("tax_documents", "tax_", $a); And so on for thirty lines. What is the most efficient way of doing this?
stackexchange/codereview
This is a c++ function header file. It gives loads of random errors. I know it will be obvious, but I have never made only header file with no class before. It has no linking cpp file. #include <vector> #include <sstream> #include <string> #ifndef SPLIT_H #define SPLIT_H void std::vector<std::string> &split(const std...
stackexchange/codereview
I have some class file.h where public: bool frameSendingFinished; is defined. So in class logic i create and encode video frame, now I want to send it to some server using ffmpeg. I want to send in separate thread so in one of my classes function (in file.cpp) I do: if (frameSendingFinished) { boost::thread U...
stackexchange/codereview
I'm attempting the modify this Modx Snippet so that it will accept multiple values being returned from the db instead of the default one. tvTags, by default, was only meant to be set to one variable. I modified it a bit so that it's exploded into a list of variables. I'd like to query the database for each of these var...
stackexchange/codereview
Possible Duplicate: threadpool in c++ I need to write my own or use already written thread's pool in C++ with priorities. Boost threadpool is too complicated. Please, advice me one.
stackexchange/codereview
Can any one help me to give me some answers on the below mention Queries: (i) Do we need to enroll for Enterprise Developer Program to implement MDM for iOS4.0. We also have some client agent . But I found some applications like "MobileIron" in AppStore which provides the MDM service. (ii) I have used the iPhone Conf...
stackexchange/codereview
i am searching is there is any good tutorial for zkoss in pure java i searched i dint get any one and i need to know how to create an combo box in zkoss and add and items to combo box using java
stackexchange/codereview
i need to use HTML 5 on my website. Videos are in H.264 format. Non-WebKit browsers, say, Firefox does't supports it. Firefox needs MPEG-4 instead. I surfed the Web a little, but not found anything for this task. The questions are: Could you recommend some free batch video encoder (command-line or not), that supports ...
stackexchange/codereview
Given the following program: /* Find the sum of all the multiples of 3 or 5 below 1000. */ #include <stdio.h> unsigned long int method_one(const unsigned long int n); int main(int argc, char *argv[]) { unsigned long int sum = method_one(1000000000); if (sum != 0) { printf("Sum: %lu\n...
stackexchange/codereview
I was wondering if I can manually add comments to a COM class or enum that I'm using in my project. Most of our programmers can use then without any trouble, but since we got some inexperienced programers in here, I was wondering if I could improve documentation adding some comments to the COM objects, interfaces and e...
stackexchange/codereview
This question was asked to me in an interview. I think the only way to get best solution is SOF. So the question was "How would you implement a custom HashMap in java(Assume there is no such data structure called HashMap)". The only answer I could think of was by implementing Associative Arrays (but then again, Java do...
stackexchange/codereview
Is there a way to define/customize a border around the currently selected Gallery item? I know, i can create a Drawable and draw four lines into that but there must be a simpler way.
stackexchange/codereview
I'm trying to render a Canvas as the Content of the ContentPresenter below. I load the canvas dynamically from a file and bind the control to the content. Everything works well and it gets displayed but if you click the ComboBox it crashes Silverlight and the Browser (any of them). Anybody got an idea what im doing (ho...
stackexchange/codereview
Some days ago I was searching on the net and I found an interesting article about python dictionaries. It was about using the keys in the dictionary to call a function. In that article the author has defined some functions, and then a dictionary with key exactly same as the function name. Then he could get an input par...
stackexchange/codereview
I'm currently inserting/updating fields like this (if there's a better way, please say so - we're always learning) public void UpdateChallengeAnswers(List<ChallengeAnswerInfo> model, Decimal field_id, Decimal loggedUserId) { JK_ChallengeAnswers o; foreach (ChallengeAnswerInfo a in model) { o = this....
stackexchange/codereview
I want to build a WDM driver in the latest WDK. What's the difference between the sources file for WDM and WDF? How can I specify the build taget as WDM instead of WDF?
stackexchange/codereview
I would like to make a FAQ page similar to here: Forum FAQ using an sql database. Does anyone have any ideas?
stackexchange/codereview
in my app, i used radio button now the problem is how to get the value from it in fbjs. I am using 10 radio buttons and have 10 values ie from 1 to 10.I tried using .getValue() but it returns only 1.
stackexchange/codereview
In Devise, I'm signing in my user like this: sign_in_and_redirect(:user, user) In the default sign in page, there's a checkbox that the user can select so that they don't have to sign in again when they return to the site. But when you do the sign in with the sign_in_and_redirect(:user, user) line, I can't work out ho...
stackexchange/codereview
I wrote a script that changes text based on user selection, which is working fine. I am not sure how using Jquery to capture the user selected selection and pass the value below to the hidden field ie replace the value="100" with the user selected value example value="trade"? -thanks JQUERY $(document).ready(func...
stackexchange/codereview
Our webform has a file upload, and just a regular picture box on it. Now we already have the code to save the pictures and retrieve them, but how would you display the picture they selected without first saving it, then refreshing the page and displaying it? Is this a javascript thing? Thanks in advance.
stackexchange/codereview
Can i use KXML framework for android application?
stackexchange/codereview
Having briefly studied databases in college, I haven't worked with them since and have drawn a bit of a blank, so I was wondering if someone could help me out. I have a database called Convert, which holds the following tables: **File** ID int PK ISBN nvarchar(MAX) UserName nvarchar(50) CoverID PDFID **PDF** PDFID i...
stackexchange/codereview
I am using joomla's jomsocial & I want to add a custom field on group creation. Has anyone played with it before?
stackexchange/codereview
in my application am loading my firstpage from startpage in codebehind by Response.redirect and here i need to hide the addressbar and standardbar of that firstpage while loading .can anyone help for this.Note:the firstpage is masterpage content.
stackexchange/codereview
I want to create an application with landing view that shows a list of icons, each will push a new view to the navController, something like Facebook iPhone app! Is there something that i can use, or should I build it myself? And where can i find samples that shows how to do that? When user hold her finger on one icon,...
stackexchange/codereview
I am subclassing UIView trying to load the view i have dropped in interface builder from a nib file. I get the following error on the return line: Terminating app due to uncaught exception 'NSGenericException', reason: 'This coder requires that replaced objects be returned from initWithCoder:' - (id)initWithCoder:(NSCo...
stackexchange/codereview
Adobe Flash Player is a browser plug-in that provides advantages for users and content creators in the browser, including the ability to deliver RIAs in the browser. Adobe AIR incorporates technologies originally developed in Flash Player and enables rich Internet applications on the desktop. Adobe AIR...
stackexchange/codereview
I am trying to create a web based PHP application which can allow chat to my Gmail friends. Something like meebo.com. I downloaded XMPPHP, and executed on localhost, and it is working fine, but when I uploaded everything to Yahoo Small business web hosting, it is throwing connection timeout error. Do anyone else faced...
stackexchange/codereview
I'm a bit confused I created a class called person, that has an age and name attributes (and get set methods). Then in another class I want to create an array of persons , where each person has a different age and name. But some how in the end all of my persons end up with the last name and age. If I manually create th...
stackexchange/codereview
what is the best way to find on which line certain string is on? I know I could iterate though all of the lines, but the catch is that the string being searched might be multiline. Would this be solvable by regex for example? Thanks
stackexchange/codereview
I need to backport some code that uses this method to .NET 3.5, and from Reflector I can't seem to discern what would be the correct way to provide my own C# implementation for it. Any help?
stackexchange/codereview
<div id="holder"> <div id="topleft"> </div> <div id="topright"> </div> <div id="main"> </div> </div> I have these divs on my page and no matter what I do, topright goes underneath topleft instead of to the right of it, making a T shape of content on the page with the topleft and topright fo...
stackexchange/codereview
Say I have two line segment paths, such as a subset of the examples below. How can I quantify the difference between them? |__ \_ __ /\ \/ | _ The two paths may have a different number of segments, and the length of each segment and the angle between them is variable. I was thinking it would be good to establish a c...
stackexchange/codereview
Is there a scaffold generator for Rails 3 that accommodates nested resources? Rails 2.3 had https://github.com/jeremyf/rspec_on_rails_nested_scaffold https://github.com/mahkhaled/NestedRestfulScaffold https://github.com/nilesh/nested-scaffold but I don't find anything similar for Rails 3. For quick prototypes, it'd be ...
stackexchange/codereview
I want to store different types in a Map like this: public Map< String, Void > common; MyClass object = new MyClass(); common.put( "Object1", object ); and then use it like this: Void object = common.get( "Object1" ); ( ( MyClass )object ).runAnyFunction(); This only works if I create my own empty class named Void an...
stackexchange/codereview
I have the default Eclipse spell checker enabled. When a spelling error is detected while I'm working in the Java editor, I can use Ctrl-1 to show a list of suggested spelling corrections. However, when I'm working in the default XML editor, Ctrl-1 doesn't appear to work. The misspelled words (in comments, mostly) are...
stackexchange/codereview
I'm trying to create a button that, when clicked will cycle ad nauseum through three distinct values: "Excluded", "Included" and "Not Sure", in that order. I'm able to create a simple button that switches values once, using something like this: function valChange() { document.myForm.myButton.value="Value has chan...
stackexchange/codereview
I've created an intent using browserIntent =new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)); How do I close it? Is it browserIntent.close or something... perhaps browserIntent.finish(); ?
stackexchange/codereview
I know that the plugin URL isn't actually performing the Like request. There's got to be a POST or PUT request around somewhere (in the Open Graph API?) that updates the Like counter of the thing you're trying to like. This is not for an auto-like bot or anything of that nature. Just curious if anybody knows how to mak...
stackexchange/codereview
Id It possible when an image (for example) is pasted from the clipboard into a webkit editable content region, and the source code looks like this: webkit-fake-url://DCAC99B9-BA40-4BA7-A419-9C60AAB081DA/image.png to be able to access the image via javascript to send back to the server along with the text?
stackexchange/codereview
Looking out for your valuable suggestion/inputs. Below are the actual xml files - ApplicationContext and JobSchedulerServiceContext. --- ApplicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"> <beans> <bean...
stackexchange/codereview
I'm trying to write a regular expression to test as string. The string must start or end with an alphanumeric character. eg. test - OK test$ - OK $test - OK $ - not OK $test$ - not OK I can test the beginning with ^\w.*$ and the end with ^\w.*$. But I can't seem to combine them into something like ^.*\w$ | ^\w.*$. Doe...
stackexchange/codereview
I have a sprite class that includes touch listeners for touching and dragging. This is all working fine. But I recently added hi-res images for all my sprites and have enabled retina display support using this in the app delegate: [director setContentScaleFactor:2]; The problem I'm having now is that when scale facto...
stackexchange/codereview
I'm having an issue getting an HttpHandler in my WCF Service Application to recognize the same session that a Silverlight client has for the WCF Services... that is: User logs in via SL app to WCF Service - HTTPContext.Current.Session["user"] is created as IPrincipal User successfully uses several other WCF services i...
stackexchange/codereview
I need to get some stuff sorted out about all this async stuff. Let's say I want to load a big file. From my understanding there is a difference in just calling File.Read() and queuing this up into the thread pool or using the Begin-/EndRead API.  As far as I know, if you use the BeginFoo/EndFoo API you are not even bl...
stackexchange/codereview
So I have a webservice call that is giving me back a JSON string. I've requested that the response send be back the content in UTF-8 encoding. When I inspect the value returned everything looks good. It's when I create a new JSONObject and pass the JSON text into the constructor that things start to cause problems. Spe...
stackexchange/codereview
$##@$%@ Why is it that it seems like when I do searching pertaining to the following error: java.lang.NoClassDefFoundError: CustomXmlBinding Caused by: java.lang.ClassNotFoundException: CustomXmlBinding at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Nati...
stackexchange/codereview
I have created a web service in .Net 4.0 framework as well as an ASP.NET 4.0 site. They are both hosted on the same server but different sites. I can access both sites with no issues and even invoke the web service methods with no problem by itself. When I try to call the web service from an ASP.NET page using JQuer...
stackexchange/codereview
anyone knows about OpenglGL calls (no extension or GLX) to convert from Logical coordinates to device coordinates? equivalent of Win32 LPtoDP function. I am actually trying to compute the pixel width and height. I can do that from device coordinates width_in_pixels == northeast.x - northwest.x. but i need device coordi...
stackexchange/codereview
How can I get a list of all the tables that have a specific column name?
stackexchange/codereview
I want to use nServicebus in a new project (pub/sub) but I would like to be able to provide a UI for managing messages i.e. moving messages from 1 queue to another, monitoring message throughput, etc. I was thinking of using a database as a kind of backing store for messages and to create a UI (Web) based on that DB. I...
stackexchange/codereview
If I want to deploy high privileged applets they need to be signed. For that a certificate is created and then a jar file is signed with a jarsigner. After that in the HTML code one has to specify code,codebase AND archive (jar) which we signed before. However I wrote a servlet which acts as two things: it sits at the ...
stackexchange/codereview
I have two Generic Lists with the same objects Type T within them. For example oGenList1.Items(0) is the same as oGenList2.Items(3) (their properties have the same values, etc). I'm doing something like this: oGenList2.Contains(oGenList1.Items(0)) It always shows false; I don't understand why. Do you have any idea? Do...
stackexchange/codereview
I am working on a task which basically is "Providing HTTP interface and move out of TCP". Thats what I know so far. What I am looking for is: 1] "Providing HTTP interface" What does this translate to exactly. I mean after achieving what steps I can conclude that this task to be done ? 2] What more information/questions...
stackexchange/codereview
(I rewrite the original question. The problem is the same.) The above example code do not print the image. It appears in the window but not printed. public static void main(String[] args) { final JEditorPane ed = new JEditorPane( "text/html", "<p>Test<br><img src='http://www.g...
stackexchange/codereview
I have this problem in a LINQ implementation. The errors I get are inclined within the code as comments public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { GridViewBind(string.Empty); } } private void...
stackexchange/codereview
I have the following setup: CREATE TABLE dbo.Licenses ( Id int IDENTITY(1,1) PRIMARY KEY, Name varchar(100), RUser nvarchar(128) DEFAULT USER_NAME() ) GO CREATE VIEW dbo.rLicenses AS SELECT Name FROM dbo.Licenses WHERE RUser = USER_NAME() GO When I try to insert data using the view... INSERT INTO dbo.rLic...
stackexchange/codereview
Is there a setting for smart objects in Photoshop (CS4) that change how they scale when using their handles. For some reason holding SHIFT is no longer maintaining their proportional aspect ratio and I'm not sure what's wrong. Seems like I must have accidentally hot-key toggled some setting off. Any ideas?
stackexchange/codereview
On the iPad, I am displaying a viewController using -presentModalViewController:animated: and then that viewController displays a second modal viewController by also calling -presentModalViewController:animated:. The problem is that the second viewController does not appear to load its NIB. Looking in the debugger, a...
stackexchange/codereview
I insert a record into the database by making an async AJAX call. After the browser was closed and I opened Access, it was added properly. The problem is that, after i made a call for update, i later made call for select to read updated values. But it still shows old values. Why doesn't the database get updated till I ...
stackexchange/codereview
Is it possible to define a margin for a text area? my wysiwyg editor places my text within <div> tags in stead of giving linebreaks <br /> So i thought giving the <div> a margin? Is this possible in css? and if yes how? Many thanks. EDIT: I can't define the divs because it gets no classes. For example the editor makes...
stackexchange/codereview
I am trying to develop an add-ins for MapPoint (with forms, and other feature) and I am trying to get some informations on how to do this. So far I don't have much info. Does anyone know a good site or have some examples of add-ins for developing for MapPoint ? Either language is fine with me, but I personally prefer V...
stackexchange/codereview
I've seen several projects where I work that use profiles.xml and various {username}.properties in the project for developer sandbox settings like the deployment directory for the deploy script, the ports to run on, which database and web service to use, etc. Now that Maven 3 has removed support for profiles.xml, it's ...
stackexchange/codereview
I am looping through an NSMutableArray and want to know how I can determine whether an array item is in fact an NSNumber or whether its something else e.g. NSString?
stackexchange/codereview
I am developing an app with tabs. On one of the tabs, I have two EditText fields and a couple of buttons. I want to add an ExpandableListView to the tab, below the rest of the elements. My problem is that the current class extends Activity. All the example I've found extend ExpandableListActivity, but I can't extend b...
stackexchange/codereview
I have a C# class library project with some settings in Settings.settings. I need to be able to change these settings at build time based on the configuration (Debug, Release, etc.). It's fairly straightforward to add a pre-build event to copy Settings.<configuration>.settings to Settings.settings, but as it turns out...
stackexchange/codereview
I have been searching concurrent linked list implementations/academic papers that allow for concurrent insertions to disjoint places in the list. I would prefer a lock based approach. Unfortunately, all the implementations I've checked out so far use list based locking as opposed to something akin to node based locking...
stackexchange/codereview
I'm sending parameters to paypal as hidden form vars. but my site's culture is Danish. So "50,00" is the value for "amount_1" <input type="hidden" name="amount_1" value="50,00" /> I'm using this code that converts the 50 to "50,00" item.PricePaid.ToString("#.00") I believe the number should be like: "1234.56" Is the...
stackexchange/codereview
I'm working no a site which stores individual page views in a 'views' table: CREATE TABLE `views` ( `view_id` bigint(16) NOT NULL auto_increment, `user_id` int(10) NOT NULL, `user_ip` varchar(15) NOT NULL, `view_url` varchar(255) NOT NULL, `view_referrer` varchar(255) NOT NULL, `view_date` date NOT NULL, ...
stackexchange/codereview
I have renamed a table in a SQL Server 2008 database, from eL_CourseStepUserNotes to StepUserNotes. I renamed the table using the SSMA. The table is used in a ASP.NET 4.0 app. I use LINQ to SQL for all CRUD. The problem is that the following code: dbDataContext db = new dbDataContext(); var k = (from c in db...
stackexchange/codereview
I have div block which comes on a mouseover of another div. div1 img // mouse over shows div2. I want to show div2 for 10 seconds and then hide it , can you please tell me how to achive this Thanks
stackexchange/codereview
I have a simple template system which calls a show_me method defined inside different classes of my model (kinda Widgets) when rendering a template. These widgets originally returned the html as a string. So in my erb I have somethink like this. <% @template.widgets.each do |widget| %> <%= widget.show_me %> <% e...
stackexchange/codereview
I wrote an smtp app as an experiment. It saves everything it gets and doesn't validate the to address. I forgot I left it running and when I went back to turn it off I noticed all these heard only emails or headers and a weired string for a message. I assume it's something to do with spam so I'm curious about what they...
stackexchange/codereview
We're having issues trying to update all of our user to lowercase usernames in SQL Server. We're doing this to support recent changes in our app. Specifically the following query is failing with an FK Constraint error on another table that references [User].[Username] Update [User] Set [Username] = 'someuser' where [us...
stackexchange/codereview
I am doing a project in 'Steganography' in which I want to encrypt the contents of file using 'Blowfish' algorithm and then want to embed the encrypted text in the image and do the reverse procedure for extracting the image. The 'update' method from class 'Cipher' encrypts only some no. of bytes but, here I want all t...
stackexchange/codereview
I am getting full path for some files from database and then zip those files inside that path. So problem here is the path contains wildcards even for the directory and files too. Eg: /myfolder/product/test/*.xml or /myfolder/*/*.xml So how can i get those xml files reside under that path to a file input stream to zi...
stackexchange/codereview
I recently redesigned my site, complete with a new database, but I wanted to grab all of the posts from my old wp site to have in the new one. There were only three. I imported all of the rows in the database that pertained to said posts to my new database. Only two of the posts showed up. When I tried to manually i...
stackexchange/codereview
Now, I can get video device(Webcam) and audio device(Microphone) and stream to make video capture. How to change device source from Webcam to screen to make screen capture video I use getdeviceofcat to set the source filter DsDevice.GetDevicesOfCat(FilterCategory.AudioInputDevice);
stackexchange/codereview
I've been playing with jquery for a week or two now and have something that resembles a hackey overgrown example. It needs structure - I've worked with MVC before in java etc.. but im finding it hard to translate my large .js file into a number of distinct and logically separated views. Within these views I'd like to...
stackexchange/codereview
I creating a system, which could be considered a wiki, and I am going to use either Disqus or Intense debate to display comments on the articles on the site. Is it possible using Disqus or Intense debate to ask their api to retrieve the username/userid of the user viewing the page, so I can log which users are editing ...
stackexchange/codereview
There's a collection of buildings each having multiple floors that are interconnected by stairs and lifts. Currently, I'm attempting to design a system that will find the shortest-path between two points across the any of the buildings, being the same building or in another building. At the moment each floor is modele...
stackexchange/codereview
I know there are tons of blogs, articles, and questions on SO about salting passwords, but one thing I haven't been able to find an answer to is this: If I am generating a password hash like this: $salt = randomString $password = $_POST['password'] hashedPassword = sha1($password.$salt) And I have a table like this: ...
stackexchange/codereview
I'd like to ask the user for overwriting files in a modal sheet using the NSFileManager 's delegatefileManager:shouldMoveItemAtPath:toPath: Is there a practice to block execution within the delegate, show a modal sheet and get a return value into the delegate ? - (BOOL)fileManager:(NSFileManager *)fileManager shouldMov...
stackexchange/codereview
Will you guys tell me whether or not this solution will work before I spend a lot of time learning/researching KML? (It looks like I need to learn it at some point, but I have a deadline to meet, first.) Background - I need to plot 1662 points on a map that fall into 7 categories. I would like to show all, as well as...
stackexchange/codereview
I am trying to create a new custom module in magento but the layout is not loading. It always load three column layout which is defined as a default in page.xml file. I think it is not considering the layout set for my module action even if it is mentioned in the config.xml file like this- <frontend> <routers> ...
stackexchange/codereview
i want to know about sprite technology used in css regarding fast accessing of the web pages.
stackexchange/codereview
http://blogs.xd.com.au/2010/07/15/radeditor-background-color/ I also can't find no EditorCustom.css and CustomOverride.css file..Where on earth are these stored? Now how am I supposed to fix the background when I can't find these files!? Where do I need to look for them? Plz help..thnx I am using demo version of teleri...
stackexchange/codereview
Is there a create_text() mode or technique that supports word wrap? I'm stuck using create_text() vs. a Label or Text widget because I'm placing text on top of an image on my Canvas. Also, is there a Tkinter API that truncates text that doesn't fit a certain width with an ellipsis like suffix, eg. Where very, very, ver...
stackexchange/codereview
popUpControl and listBoxControl below are returning NaN as the height and width. The ActualHeight is also 0.0 Why? and more importantly what is the workaround for this? <Popup Name="popUpControl" IsOpen="True" VerticalAlignment="Top" HorizontalAlignment="Left" > <ListBox Name="listBoxControl" SelectionChanged="_Lis...
stackexchange/codereview
Header: Id => identity, primary key ...other columns... Detail: Id => identity, primary key HeaderId => foreign key ...other columns... public bool CreateHeader(Header header, IEnumerable<Detail> details) { using (TransactionScope tran = new TransactionScope()) using (TemplateEntities ctx = new Templa...
stackexchange/codereview
Using DomIt to parse a valid XHTML document. For some reason, Domit is reverting valid & in links to plain & which breaks the validation. I would be expecting the other way around if any fix were to be made. This is the original tag: <link href="index.php?format=feed&amp;type=atom" rel="alternate" type="application/ato...
stackexchange/codereview
I'm writing some code and need to search for some kinds of symbols in a string. I use mb_strpos function for this and it works for alphabet symbols but it doesn't if I search for symbols like question mark, dots and etc. For example if I search for "aaaaa" (or any other unicode character) in a string mb_strpos works a...
stackexchange/codereview
I am sorry, that sounds like a noob question. I am trying to do this, maybe my question is not clear. I want to be able to pass something like this: make_thumbnail( array( 'width' => 60, 'height' => 40', 'title' => 'my image' ) ); Now the above line calls the function which already produces the thumbnails I have that ...
stackexchange/codereview
I'm confounded. The following MySQL query: SET @a := 0; SELECT * FROM users; Gives the error: Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM users' at line 2` When I switch the order of the st...
stackexchange/codereview
after serching up and down the internets, finding no proper answer, I am asking you: I want to implement a getAuthAdapter(array $form) private function getAuthAdapter(array $form) { $authAdapter = new Zend_Auth_Adapter_DbTable( Zend_Db_Table::getDefaultAdapter(), 'user', 'email', 'password', ...
stackexchange/codereview