instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
In ActionScript 3 (and IIRC 2), the x and y properties on a display object are always stored as multiples of 0.05. so something like obj.x = 66.6666 is the same as obj.x = 66.65 Most of the time, this doesn't matter. But sometimes I can end up with really slow-moving objects, eg 1 pixel per second. 1/60 (fps) = 0.017 p...
stackexchange/codereview
Assume I have a working copy of a project versioned with svn. For a particular reason I want to keep a particular revision x of that project as my working copy. But sometimes I'm clumsy and I accidentally do an svn update to the latest revision y>x. Is there an easy way, to prevent svn updates on a working copy, like d...
stackexchange/codereview
I have a number crunching C program which involves a main loop with two conditionals: for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { for (k = 0; k < N; k++) { if (k == i || k == j) continue; ...(calculate a, b, c, d (depending on k) if (a*a + b*b + c*c < d*d) {break;} } //k } //j } //i The har...
stackexchange/codereview
What is the "correct" way to deactivate tooltips on a given page so that the title attribute of a tag does not get shown?
stackexchange/codereview
Using the filemanager Path Finder on mac os x, i wanna retrieve the selected files/folders with python by using py-appscript. py-appscript is a high-level event bridge that allows you to control scriptable Mac OS X applications from Python. In applescript it would be something like tell application "Path Finder" set ...
stackexchange/codereview
I have no idea on matching the input parenthesis with JavaScript. Input string example: (pen) ((pen) and orange) it should return false if the input string is like the following: (pen pen) (pen) and orange) ((pen and orange ) ((pen) and orange )(pen and orange )( (pen and )orange()
stackexchange/codereview
I have a HSQLDB table in which the MAC address is stored as a varchar, which is not quite efficient. I'd like to convert it to BIGINT, but I found no conversion function from VARCHAR hex to BIGINT/INTEGER. I tried to use convert like this: convert(client_mac, BIGINT), but it fails with the first non digit encountered. ...
stackexchange/codereview
I have some troubles re-writing this query to using joins instead of the two subqueries. I have a problem untangling it, if you know what i mean. SELECT o.order_id, n.title, c.first_name, t1.name, o.product_id, (SELECT ttd2.tid FROM term_data ttd2, term_node ttn2 WHERE ttd2.vid = 5 AND ttn2.nid = p.nid AND ttd2.tid...
stackexchange/codereview
In python i'm creating .an file using commandStr="dpan.exe -np -Lwork_%s.lib -Owork_%s.lib %s %s.an" %( option1, option2, Sourcefile, Destination file) os.system( commandStr ) This will create the .an file (Destination file) from Sourcefile. Now i'm converting this line of code from Python to C# So how do i do this i...
stackexchange/codereview
Business purpose: I'm creating a CMS, and allowing the user to "delete" images that they've previously uploaded to the server. Issue: if I allow them to really delete the images, they are left with old posts they've created with now-broken images. Example: user uploads vtWinsACC2005.jpg, writes an article about it lin...
stackexchange/codereview
Does anybody know of a photo camera that is bluetooth capable, and can be programmatically accessed through the iPhone/iPad using (probably) the External Accessory framework? I know it has to be developed under Apple's MFi licensee program, but I can't seem to find any cameras that are. Thanks, Mihai
stackexchange/codereview
I am going to develop my own window where I'll have my own Caption Buttons (Minimize, Maximize, Restore and Close) and all the properties related to these buttons and can add any control at the title position of the window. Suggest me the way how I'll proceed for it please...... Thanks in advance
stackexchange/codereview
I'm trying to do: String sql = "SELECT email FROM users WHERE (type like 'B') AND (username like '?1')"; List results = em.createNativeQuery(sql).setParameter(1, username).getResultList(); But I get IllegalArgumentException that tells me that the parameter is out of bounds. What am I doing wrong?
stackexchange/codereview
If for example my userControl has a CheckBox called IsGreatCoder and the userControl is embedded in a main page (parent page). I normally have gained access to the IsGreatCoder.Checked value in the main-page by exposing it through a public property that I have to manually write (say "IsAGreatCoder"). If UserControl is ...
stackexchange/codereview
My host C application, that embed a Lua interpreter, needs to be notified that certain object/table in running Lua script is garbage collected, so it will do something, like record this event to log file. How can I do that?
stackexchange/codereview
I have three classes having to import each others methods. The statements would be as follows in the corresponding files with classes: File A with class a from B import b File B with class b from C import c File C with class c from A import a Why does this not work in python? I rather get the error message: ImportEr...
stackexchange/codereview
I am building a two-level navigation menu for a website. Both levels will always be visible. My problem: I would like to Have 1st and 2nd level menus horizontal, occupying one line each Left-align the sub-level menu with the currently active 1st-level menu item Not have the sub-level menu push the remaining 1st level ...
stackexchange/codereview
Older versions of Internet Explorer are being phased out, but they will stick around. Which of their quirks should a web developer have in mind when coding a website in order to avoid major breakage?
stackexchange/codereview
I am using a DirectoryCatalog in MEF to satisfy imports in my application. However, there are sometimes obfuscated assemblies in the directory that cause a ReflectionTypeLoadException when I try to compose the catalog. I know I can get round it by using a separate directory or by using a search filter on the DirectoryC...
stackexchange/codereview
I am trying to write t-sql in C# (visual studio). I have this code to connect to the database: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using...
stackexchange/codereview
I'm trying to write a test for the Jasmine Test Framework which expects an error. At the moment I'm using a Jasmine Node.js integration from GitHub. In my Node.js module I have the following code: throw new Error("Parsing is not possible"); Now I try to write a test which expects this error: describe('my suite...', fu...
stackexchange/codereview
I tried connecting to MSN messanger using Smack library with follwiing code import org.jivesoftware.smack.ConnectionConfiguration; import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; ConnectionConfiguration confi...
stackexchange/codereview
I created a thread in WinMain, and after that I have a classic msg loop: while(GetMessage(&msg, NULL, 0, 0)) { if (!done){ GetExitCodeThread(dThread,&dwCode); if (dwCode!=STILL_ACTIVE){ //thread done } } if (!IsDialogMessage (UWnd, & msg)) { TranslateMessage ( ...
stackexchange/codereview
I have some Matlab code that checks if an array is non zero before operating and it's being skipped even though the array is 3 by 1000+. The code is just: if X The array is read from an excel file using 'xlsread' and only gives the error for a particular data file but works for any other input data file I use. Any ide...
stackexchange/codereview
This is probably a dumb question but I have hit a brick wall. I'm stuck. I want to add the contents in index 4 of array 1 into index 0 of array 2 then add the contents of index 4+32 in array 1 to index 1 of array 2 and so forth. Array 1 is an existing array and array 2 is being filled by a "jumping" selection coming o...
stackexchange/codereview
Possible Duplicate: Any reason to clean up unused imports in Java, other than reducing clutter? Please let me know if we put 1000 of import statement will it slow down execution of code?
stackexchange/codereview
I have an application which contains multiple state machine instances when running. I would like these to be implicitly persisted to a database in order that if the application is restarted, they can be re-loaded from the database and they will resume in the same state they finished in, along with any object properties...
stackexchange/codereview
This line works fine :- Storyboard.SetTargetProperty(animation, new PropertyPath(ShiverDirection == Orientation.Horizontal ? "X" : "Y")); where animation is :- private DoubleAnimation animation = new DoubleAnimation(); private TranslateTransform transform = new TranslateTransform(); ease.Springiness = 2; animati...
stackexchange/codereview
I've encountered a problem while developing in Ruby on Rails: After I update my app's Gemfile with a new gem dependency (for example AnnotateModel) and run 'bundle install' command the gem bin command (e.g. 'annotate'), I get a "No such file" error, so I have to add the corresponding bin folder to $PATH manually. After...
stackexchange/codereview
I have 1 main website, and I want to insert data in that my main website from an iPhone app. In this case, I was thinking of inserting data via $_GET, what are some precautions I should take if I do it this way? Any other solutions? Would this be called an API?
stackexchange/codereview
Are there any particular tools available for "Debugging" ExtJS script ? Especially, I findi it difficult to debug when the screen goes blank.!
stackexchange/codereview
I have created an app which has a library of images. I have imported the images in to my resources folder in Xcode and am currently loading them in to an array in the appDelegate when the app loads. This is happening each time. I am now worried that as the library grows the app will run out of memory. Is there a better...
stackexchange/codereview
Is it possible to have the pagination links that appear at the bottom of a list of objects in Django's admin interface at the top as well? Can this be done without changing the admin templates? I suspect not, given the lack of a ModelAdmin option, but thought I'd see if anyone had done this before I dug into the templa...
stackexchange/codereview
I'm trying to prepend require_once 'bootstrap.php'; string to each schema.yml file in specific dirrectory. I'm linux newbie. Could someone show me the one-line-magic-command? Any help is very appreciated! EDIT I need to search for schema.yml recursively.
stackexchange/codereview
just built a small webapp for previewing HTML-documents that generates URL:s containing the HTML (and all inline CSS and Javascript) in base64 encoded data. Problem is, the URL:s quickly get kinda long. What is the "de facto" standard way (preferably by Javascript) to compress the string first without data loss? PS; I ...
stackexchange/codereview
YUI Compressor has a known bug where some media queries, including those used to serve styles to iOS and Android devices (e.g. @media screen and (max-device-width: 480px) {...}), are broken when compressed, because the space between the and and the opening brace is removed. http://yuilibrary.com/projects/yuicompressor...
stackexchange/codereview
Hello I searched a bit here and didnt find anything for what i need... I generate a css html menu from php every time a page is requested.However this menu is large... and when on remote server i can see each menu item drawing on the screen(every item is 3 level deep)... So iam looking for an efficient way to cache the...
stackexchange/codereview
I need more then one form in a jsp page. Is it possible? Is this a good practice? And how can i do? Give me example. Thanks.
stackexchange/codereview
Hey guys, My array is printing it's values on page when: document.write(unsorted[i]+"<br/>"); but not when trying to put it in a div referring the element by jquery $("#no1").write(unsorted[i]+"<br/>"); Here's my code: $(function(){ var unsorted = new Array(); function randomNumber(x,y) { //gives a random n...
stackexchange/codereview
I am using Google Maps API (v3) to render a world map. When I zoom all the way out (to zoom level 1) and start dragging the canvas, I am able to move out of the map boundaries, and the area outside shows up in grey color. I want to prevent the user from dragging the map outside the boundaries of the world map. How do I...
stackexchange/codereview
I would like my eclipse PMD plugin configuration to access the same standard ruleset files as the maven-pmd-plugin. You can configure the maven pmd plugin to use a custom set of rule sets like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>2.5</...
stackexchange/codereview
I wish to set a table to a fixed height and then for rows extending beyond the height, to show a scrollbar. If the rows do not extend beyond the height of the table i still wish to show a scrollbar but obviously its not scrollable. I'm doing testing on IE7 and it only appears to like overflow:scroll, but when i test in...
stackexchange/codereview
I am trying to record my test on a major web based application in Firefox using Selenium IDE. There are some textboxes in one web page where I want to input some values. The problem is whenever I run the test to record it, the id of the textbox elements change in every session. I used xpath to locate the textboxes but ...
stackexchange/codereview
I'm very new to soap programming and I'm stuck on something that looks very simple but I don't how to follow... Here's my situation. I ask to wsdl soap server for a list of functions, i use __getFunctions() .. and I got this : array(10) { [0]=> string(68) "inserirClaustreResponse inserirClaustre(inserirClaustre $parame...
stackexchange/codereview
i'm trying to get the number of weeks i a month in javascript. I read a thread on the same subject -> Get Weeks In Month Through Javascript but when using the advised js lib, called "time.js", i havent good results for 2010. Example: When i use weeksInMonth() for september 2010 like : weeksNbr = new Time(2010, 9).weeks...
stackexchange/codereview
I've never had such a mission scraping a web page as I do with this specific one. I am trying to parse the reviews from Omgili's API results page. An example page is located here: Omgili I have scraped lots of pages before, but the exact XPATH of the results of this page is really tricky, since there are no DIV class n...
stackexchange/codereview
How can i localize the image which I have downloaded from website? I know how to localize image in the resources through IDE. But I don't know how to localize the image which is downloaded from the website. Is there any way to localize the downloaded image? Many Thanks
stackexchange/codereview
I've been using the spark view engine bindings and I have a problem with it not correctly recognizing overloads. I have 2 overloads that look like this: <element name="Editor">Html.EditorFor(x => x.@For, new {"@*"}) </element> <element name="Editor">Html.EditorFor(x => x.@For)</element> Now, the documentation says th...
stackexchange/codereview
I'd like to understand what this line of JavaScript means... (/^\w+, ?\w+, ?\w\.?$/) i understand 'w stands for 'word', but need your help in understanding '/', '^', '+', '?', '.?$/' Thank you..
stackexchange/codereview
I have a python script that generates a bunch of data in a while loop. I need to write this data to a CSV file, so it writes by column rather than row. For example in loop 1 of my script I generate: (1, 2, 3, 4) I need this to reflect in my csv script like so: Result_1 1 Result_2 2 Result_3 3 Result_4 4 O...
stackexchange/codereview
I want to create a model that doesn't map to a database table. Instead, stays in memory as a python object. Actually, this model is supposed to represents normalised data from many other table-mapped models. The other models store data which can be edited multiple times in a single day. Because of these multiple edit...
stackexchange/codereview
I have some URLs to play content from, but I have to identify whether the given URL contains video or audio. How can I do this?
stackexchange/codereview
Suppose I have a style like <Style x:Key="NotificationItemTemplate" TargetType="{x:Type ListBoxItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <DockPanel LastChildFill="False"> <DockPanel.Background> ...
stackexchange/codereview
In iphone the UIProgressView height is fixed, i need to create UIProgressView for height 40(variable height), how to write my custom code in drawRect method? i am new to Quartz drawing any samples available. Thanks in advance.
stackexchange/codereview
I want to calculate the driving distance between two locations [the user's specified locations], before user starts the driving. I used many formulas and getDistanceFrom in CLLocation also, but I am not able to get the perfect the driving distance between those locations. There is much difference in actual and calculat...
stackexchange/codereview
I'm trying to using pop up button in my code. This is how it look: This is binding configuration: Import Choice List local attributes is array controller has reference outlets in appDelegate main code, and i update it as [tempArray setContent:carriersListArray]; Everything work fine, but when i select something from...
stackexchange/codereview
Note: also posted on the nopCommerce forum. I've been developing an application based on nopCommerce 1.60. I'm developing on Windows 7 Pro 64bit. I'm deploying the application to Windows server 2003 R2 (32bit) for staging and this works fine. It works perfectly and exactly like when I run it on the Visual Studio dev s...
stackexchange/codereview
I am refurbishing a site that contains a lot of invalid HTML that looks little like this: <p>I was written by someone who knows a little, but not enough, HTML, & now I need to be cleaned.</p> I need to be able to convert this HTML to make it valid. The conversion needs to be smart and not muck with the content. Is...
stackexchange/codereview
I published an application that stores data in a local database. Now I have to publish an update to this application to fix some little bugs, but I am afraid that downloading and installing the update will delate the local database associated with the previous version. I would like to know how the update system works. ...
stackexchange/codereview
I've got a pre-formatted report in Reporting Services 2005, and I need to change it to insert a series of textboxes (some static some using data) at various places in the report. Can I do this and keep all the rest of the spacing the same? So I have: aaa bbb ccc ddd eee And I want to insert a new textbox below ccc b...
stackexchange/codereview
I am currently doing a system on Google App Engine and am very new to it, I am developing using the Java plattform . I have a problem about sending the session object between servlets. I have already enabled sessions on the appengine.webxml. I can send the session object from my login page to a VIEW page but after whic...
stackexchange/codereview
I've seen people's code as: char *str = NULL; and I've seen this is as well, char *str; I'm wonder, what is the proper way of initializing a string? and when are you supposed to initialize a string w/ and w/out NULL?
stackexchange/codereview
How would you get a button to look and perform similar to that of the buttons in the volume mixer on Win7? What I mean is that in the volume mixer there are icons that doesn't look like buttons until you hover them, they also haven't got the standard blueish color when hovered. So far I haven't found a way to do this ...
stackexchange/codereview
Look at this simple script please $a = "test"; echo $b = preg_replace('/[^a](e)/',"<b>$1</b>",$a); // returns <b>e</b>st I want to bold the "e" characters, when there is no "a" character before it. Logically in $0 it must match "te", and in $1 - "e", but why it strips the first character in my example? I can solve the...
stackexchange/codereview
i am fetching some data from MySql database and i want to write it to rtf file,everything is working fine means rtf generation,and the values from database are also correct but when i open up rtf file it shows no data.below is the code snippet i am using. **$rtf = new Rtf (); // Headear of rtf $head = &$rtf->addHea...
stackexchange/codereview
I have a class from an external library that I want to extend with a category. However, this class uses several static variables, such as: static SomeClass* someClass; The category method I'm extending must make a call to this class, as in -(void) categoryMethod { [someClass someMethod]; } If I do that the compile...
stackexchange/codereview
Is there a way to import existing data or schema into the xcdatamodel in xcode? If not, is it possible to programmically write the xcdatamodel? I was thinking if it is possible to create the xcdatamodel programmically then I can write a utility that can generate the xcdatamodel from a give .sql file
stackexchange/codereview
I am using Sql Server 2008 R2 Enterprise. I am coding an application capable of inserting, updating, deleting and selecting records from a Sql tables. The application is making errors when it comes to the records that contain special characters such as ć, č š, đ and ž. Here's what happens: The command: INSERT INTO Acc...
stackexchange/codereview
I wish a page to fully load before issuing an ajax call to update database. I can call a javascript function in the body onload event so the page is fully loaded, but I'm not sure how to trigger the Ajax call from there.Is there any better way of achieiving this (Upadating database after page load)?
stackexchange/codereview
hi, please tell me how can i perform editing in mvc contrib grid itself without opening a seperate view for that thanks in advance
stackexchange/codereview
Using MEF, from inside the exporter, is it possible to find out who is importer using metadata ? for example is this possible: [Export("Config")] String Config() { if (importer.metedata["name"] == "Circle") return "R=10"; } This way importer doesn't need to pass something (his name, here) to tell the exporter wh...
stackexchange/codereview
now i have three tables ok? catgories | cat_id areas | area_id ads | cat_id - area_id now i want get the the areas under the catgories with contain the ads this mean - catgorty -- area contant catgorty ads example i have cars as a catgory and egypt as area and a car for sale as ads now i want show the areas under the...
stackexchange/codereview
I am creating some reports using object datasources. I have the following scenario: in my software the user can create a list of products specifying a code, the product name, the price and the vat rate (this last two attributes will be used as suggestions when the user will place the product inside an order). When a us...
stackexchange/codereview
I am retrieving json from a php file that connects to the database and then creates the json to be imported into my page via an ajax call. Some of the database columns have file paths in them, ie images/myfolder/myfile The json that I see when I open the page in a web browser formats the file path like this: \/images\/...
stackexchange/codereview
From the world of PHP I have decided to give C# a go. I've had a search but can't seem to find the answer of how to do the equivalent to this. $object = new Object(); $vars = get_class_vars(get_class($object)); foreach($vars as $var) { doSomething($object->$var); } I basically have a List of an object. The objec...
stackexchange/codereview
I have some script that loads a lot of data to memory. I want to know how efficient the data stored in memory. So, I want to be able to know how many memory was used by python before I loaded data, and after I loaded data. Also I wondering, if it is some way to check memory usage of complex object. Let say i have nest...
stackexchange/codereview
I have a SolR index where each record is a page from a file. So for every record we have the full text, the page number and the file ID. When we do a search, often a single file will overwhelm the results as it contains the search term repeatedly. What I would like to do is to have the search query only return a maximu...
stackexchange/codereview
what is the internal encoding from .NET applications?(for example string objects) Can I define what encoding my appliction should use? If i write a .net string to a file. What encoding has the string? //edit Dim test as String="Das ist ein Test" <---what Encoding has this String? Dim reader as New IO.StreamReader(docP...
stackexchange/codereview
I have this query: SELECT ROUND(AVG(temp)*multT + conT,2) as temp, FLOOR(timestamp/$secondInterval) as meh FROM sensor_locass LEFT JOIN sensor_data USING(sensor_id) WHERE sensor_id = '$id' AND project_id = '$project' GROUP BY meh ORDER BY timestamp ASC The purpose is to select data for dr...
stackexchange/codereview
I used Axis2 to create a web services. And it was very easy to write, test and run it. But now I have existing Java Web App running under Tomcat and I want to add Web Services to it. E.g. instead to process POST and GET parameters and generate HTML I want to receive SOAP messages, to process it and to return response a...
stackexchange/codereview
I am trying to set up two versions to my Wordpress website: Full website, for computers, and Mobile version, for smartphones. I achieve this by means of a user-agent detection script included in the header.php of the full theme (path is whatevercorp.net/wordpress/wp-content/themes/moneyblog/mobiledetect.php ). If it...
stackexchange/codereview
I want split Javascript code by newlines, but the compiler gives me an error: <%= Html.ActionLink("Delete", "delete", new { id = Model.Id }, new { @class="button-link", onclick = " javascript; javascript goes here; javascript goes here;...
stackexchange/codereview
I have a bunch of files(nearly 1500, some of them are more then 500MB). Basically, we have an Defect Management System(Serena Business Mashups, some of them may know it) and I need to attach those files to related issues through their web service. the maximum file size which can be attached is 500mb. Therefore, I have ...
stackexchange/codereview
whenever I make a tap action on a UIWebView, for example clicking a link, there is a slightly delay between the tap and the actual highlighting / activating of the link. Is there a way to disable this delay? I've read that this would be possible in UIScrollView with setDelaysContentTouches:NO Is this also possible in ...
stackexchange/codereview
I'm using git post-receive hook to deploy versions of the web application from three branches (master, staging, and stable) on three servers (development, testing and production). The pairing between branches and servers is currently hard-coded in the script. However I'd like to remove this restriction and make this ho...
stackexchange/codereview
One of my junior programmers has created a singleton, but it is acting strangely: I know you aren't supposed to access object like this, but that's how they did it and I can't explain why this is occurring - After calling remove instance, I put a breakpoint on the line after and I can still access the someObject object...
stackexchange/codereview
I am using Lucene seacrh engine for fulltext search it give search result for non ascii character also but the problem is suppose I added a text 帕普部分分配数量 and will search with only one character 帕 it will give result but when will search with full non-ascii word 帕普部分分配数量 it is not giving any result, the strange thing ...
stackexchange/codereview
I know /sbin/init has special protection against SIGKILL and SIGSTOP from kernel for obvious reasons. I have tried telling kernel I want to receive SIGSTOP with ioctl() (similar to SIGABRT and SIGSEGV reqs in main()): if (ioctl (0, KDSIGACCEPT, SIGSTOP) == 0) { nih_signal_set_handler (SIGSTOP, stop_handler); but S...
stackexchange/codereview
I'm using the repository pattern with nHibernate at the moment. I'm able to use expression trees without any problems when selecting from just one entity (one table) but I'd like to make an inner join with another table to get a related row. Here's what I've got so far: public abstract class QueryBase<T> { public a...
stackexchange/codereview
I'm installing third party software that must read from HKEY_CURRENT_USER\SOFTWARE... using inno-setup. I need to write this value to all users, how can I do it?
stackexchange/codereview
My php script creates thumbnails of images. Sometimes when it handles a lot of images, the script have to run a long time and ends after 60 seconds because of the time limit on my server. Can I tell the script to time out after 59sek and then repeat itself? I need some ideas. Edit: I don't think my web hosting allows m...
stackexchange/codereview
I'm working on application built years ago, that has recently stopped working correctly. Old programmer said, that he might be accessing $_GET or $_POST variables without reading them from $_GET[] array, but through the register_globals I want to ask: What are different ways to access $_GET variables without using $_GE...
stackexchange/codereview
I've written an application that uses Outlook and Redemption to do some syncing operations with Exchange server over IMAP. It works great until it tries to exit. It executes the very last line of code, which is print "Service exiting" just fine, but this line occurs after the Application.Quit() call I make on Outlook. ...
stackexchange/codereview
I have a Capfile for Multistage deploys that needs to deploy the code to one server (NFS) and finally restart several application servers. Roles can therefore not be used easily since application servers do not need to be used for deploy:update_code. I have come up with something that might work, but have a issue that ...
stackexchange/codereview
I am doing some access to content using hook_form_alter as there are problems using hook_access with content types defined outside of your module. If a user does not have access I am setting a message at the top of the page and I don't want to output the form. I have the following code. function mymodule_form_alter(&$f...
stackexchange/codereview
When I visit some sites and take mouse pointer over some menu item, another sub menu items comes up in another panel adjacent to main menu item. Thus giving an effect like onmouseover. But when I see the source code (like View source option in IE) there is no onmouseover / onmouseout event defined in the menu item list...
stackexchange/codereview
Have a curiosity related to Prolog predicate control. Supposedly I have a predicate f(A,X) and g(B). f(A,X):- a,b,c, g(X). g(B):- true. a - returns true b - returns true. c - returns false. where a,b and c are random predicates. How can I continue to evaluate g(X) in the predicate f(A,X) if c returns false?
stackexchange/codereview
I am making a program that will run a persons C++ code from PHP. How can I compile, run, return the output of a C++ program securly? By securly I mean how can I do it without making my system vulnerable to hackers? I guess I would just use the exec comman to GCC to compile the program then run the program using exec. B...
stackexchange/codereview
Say I have an array of n integers I need to create a data structure that can allow me to find the number of integers in some range [a,b] in the array. I was thinking some form of counting sort?
stackexchange/codereview
I saw a demo of Code Contracts the other day and decided to give it a shot in a little test project. I can setup my Code Contracts code appropriately after adding a 'using System.Diagnostics.Contracts' statement to the classes, but the contracts don't seem to be enforced. Is there a reason why I don't see the 'Code Co...
stackexchange/codereview