instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
This is a split from discussion on earlier question. Suppose I need to define a function f which checks if given labeling of a graph is a proper coloring. In other words, we have an integer assigned to every node and no two adjacent nodes get the same answer. For instance, for {"Path",3}, f[{1,2,3}] returns True and f[...
stackexchange/codereview
I have an ActiveX control, which is supposed to be installed at the first visit of web-page. I have self-signed certificate, created with OpenSSL, and its child. The problem is that if I sign an activeX control with root certificate, Windows can't validate it while checking activex, even if it is installed as trusted. ...
stackexchange/codereview
HI All, I m looking for a software/tool, which can lead me to capture my application in simulator.. I saw so many videos of application, which performs their functionality of application and capture it in video. Please suggest me some video capturing tool for my app promotion. Suggestions are always appreciated. regard...
stackexchange/codereview
I've recently created a dropbox system using inotify, watching for files created in a particular directory. The directory I'm watching is mounted from an NFS server, and inotify is behaving differently than I'd expect. Consider the following scenario in which an inotify script is run on machine A, watching /some/nfs/di...
stackexchange/codereview
I am building a Windows Desktop software that will respond to SMS request and sending a SMS as reply automatically. The software is ready and working just fine but it works only and only with Nokia Mobiles and the prerequisite is that Nokia's PC Suit has to be installed first before my app can work. But now my customer...
stackexchange/codereview
I am just stuck in the strange calculation. I am trying to find distance by latitude and longitude by using this formula mentioned in this site. http://www.movable-type.co.uk/scripts/latlong.html every thing is Ok there when I do it by calculator but when I started doing it by programmatically there is a difference in ...
stackexchange/codereview
I'm using Rails 2.3.8 with Ruby 1.8.7 (both installed via CPanel) and gem 1.3.7 and I'm using MongoDB. Well, I get the following error when I'm trying to create an user (class User): Processing UsersController#create (for 127.0.0.1 at 2010-11-13 16:09:55) [POST] Parameters: {"commit"=>"Create", authenticity_token"=>...
stackexchange/codereview
I am currently learning about 'dereferencing' in Perl and need your help in understanding what the '\' means in the line below.. $ra = \$a;
stackexchange/codereview
I'm using the jQuery plugin, "uploadify" & what I'm trying to do is hide the upload button once the upload starts, however if they click it before selecting a file it still hides it anyway. Here is my submit function: $("#add_list").submit(function(){ // Set new list id $("#filename").uploadifySettings('script...
stackexchange/codereview
I'm trying to do a simple redirection after logging the user. I thought I could use the print "Location:..." method but that doesn't seem to do the trick. class MainPage(webapp.RequestHandler): def get(self): ip = self.request.remote_addr log = Log() log.ip_address = ip log.put() ...
stackexchange/codereview
I have just upgraded the application from Rails 2 to Rails 3 (ruby 1.9.2-head). Most models are recognized after the upgrade, however one model called "Villa" is not recognized at all and returns an "undefined method" error if you try to call any methods on it (e.g Villa.find(1) ). The simplified code for the model is,...
stackexchange/codereview
HI, I have a program in which a master processes spawns N workers who will invert, each one, each row of an image, giving me an inverted image at the end. The program uses shared memory and posix semaphores, unnamed sems, more spefically and I use shmctl with IPC_RMID and sem_close and sem_destroy in the terminate() fu...
stackexchange/codereview
I have a Batch Interface I've created for a DOS program I'm using and I want to add an Option at the End to save the Output of the Batch File to a File, BUT I don't want the Log to be created unless the user says Yes at the END of the Batch File. So Far the Only way I've found to Optionally create a Log file is to Laun...
stackexchange/codereview
Have been having an issue sine using the HABTM relationship in models instead of using a JOIN in the paginate variable in the controller, data comes out fine but I can't set the limit of projects to 20. I am selecting projects from the DB depeneding on their features. I havea feature called urgent. I'm on the urgent li...
stackexchange/codereview
I'm displaying a message between Saturday at 6pm and Sunday 4am. The last time I had to do this it didn't work because I didn't take into account UTC time going negative when changing it to NYC time. I am doing the math right (displaying at the appropriate times)?Should I put the UTC conversion code into its own functi...
stackexchange/codereview
I would like to generate several charts and save them as .png files. But it seems matplotlib is overlapping the next chart on the previous one : def do_pie(fic,data): import pylab # make a square figure and axes pylab.figure(1, figsize=(6,6)) ax = pylab.axes([0.1, 0.1, 0.8, 0.8]) pylab.pie(dat...
stackexchange/codereview
I have a hyper link as such <a href="#" id="someID">Link</a> that i have to scroll down the page to get to. This hyperlink is only there to trigger an Ajax request. When ever i click this hyperlink the page scrolls all the way to the top! How can i fix this? I use # because anything else would reload the page. Am ...
stackexchange/codereview
I have a simple problem. Living in Ch*na we don't have access to much of the social media sites. So I want to create a php file that fetches the content of a blocked rss file and output's itself as that rss. unblockedserver.com/twittfeed.php?id=23038034 <?php $id = (int)$_GET['id']; $url='http://twitter.com/statuses/u...
stackexchange/codereview
I currenty try to make a module translateable by using t() for all Hard-Codes-Strings. Since I simply call t() as advised in the documentation I don't have a clue what I might be doing wrong. I call in the block_theme of my module. Hook_theme(); Don't if this is important… /* # Themes {{{*/ function catchy_overview_th...
stackexchange/codereview
HI I would like to create vertical tabs using the rich faces tab controls. Is it possible to do it ? Are there any other jsf implementations that offer the same ?
stackexchange/codereview
Im using Flash Builder 4 on the Mac and I have a worrisome problem: The compiler is sometimes not detecting my code changes. For example I might write some code, compile and run, then add some logging statements, but they will not print. After a clean compile everything runs as expected. I cannot see a pattern to the e...
stackexchange/codereview
HTML: <ul class="menu"> <li><a href="http://google.com">Text</a> <ul> <li><a href="http://google.com">Text</a> <li><a href="#">Text</a> <li><a href="#">Text</a> </ul> </li> <li><a href="http://google.com">Text</a></li> <li><a href="http://google.com">Text</a></li> <li><a href="http://goo...
stackexchange/codereview
Is there a way to change the CSS border of a div, when an input field gets focus (e.g. when it loses focus, remove the border). HTML: <input type="text" name="title" id="title"></input> <div id="mainTitle">The Main Title</div> CSS: #mainTitle { border: 1px solid #ccc; }
stackexchange/codereview
I am having a problem initializing an array of structs. I'm not sure if I am doing it right because I get "initialization from incompatible pointer type" & "assignment from incompatible pointer type". I added in the code where I get these warnings, and when I try to print the data from the struct I just get garbage suc...
stackexchange/codereview
I have a war packaging Maven project, in which I have a Java properties files called myapp.properties. In this properties file, I store some parameters, for example, database connection parameters, which will be used by the webapp. Either in a continuous integration environment or in my development environment, I wan...
stackexchange/codereview
I'm using Moq to drive my Model-View-Presenter unit tests. The particular view I'm testing is composed of a subview, which is modeled as an interface as illustrated here: public interface ICustomerView:IView{ public int CustomerId {get;set;} public IDateRangeView DateRangeView {get;set;} } In certain tests,...
stackexchange/codereview
I noticed that the php flush(); doesn't work in Firefox 4 beta 7, as it works in 3.6.12. I recently installed firefox 4 beta 7, and the contents are not being flush immediately when flush() is called. It used to work fine in 3.6.12. Is there any thing else that could provide me with the flushing functionality. I've tr...
stackexchange/codereview
I want to have a priority queue with custom ordering, but lazy as I am, I don't want to define a comparator class implementing operator(). I really would like something like this to compile: std::priority_queue<int, std::vector<int>, boost::bind(some_function, _1, _2, obj1, obj2)> queue; where some_function is a ...
stackexchange/codereview
I am trying to develop a runtime stack tracer. I have a function that returns the EIP address whenever the program being traced segfaults. How can I get back to the ebp of the current function (the one during which the program under observation crashed) so that I can start tracing up?
stackexchange/codereview
I'm trying to upload a file using PHP. My HTML page with the form is stored at C:\wamp\www\myproject\upload.html PHP page is C:\wamp\www\myproject\upload.php, and the file I'm trying to upload is C:\wamp\www\myproject\openoffice.txt. When I try to upload the file, I get the following error: Warning: move_upload...
stackexchange/codereview
it is said http://www.darronschall.com/weblog/2006/02/actionscript-3-json-library-now-available.cfm You can download the JSON library as part of the core ActionScript 3 library. but when clicking on the link it doesn't work
stackexchange/codereview
I'm trying to run this php command: preg_replace($regexp, $replace, $text, $maxsingle); Where the vars are: $regexp = '/(?!(?:[^<\\[]+[>\\]]|[^>\\]]+<\\/a>))\\b(שלום)\\b/imsU'; $replace = '<a title="$1" href="http://stackoverflow.com">$1</a>'; $text is a long post $maxsingle = 3; When the text I'm trying to match (in...
stackexchange/codereview
What is the best way to validate a cost/price input by a user, validation rules below: Examples of formats allowed .23, .2, 1.23, 0.25, 5, 6.3 (maximum of two digits after decimal point) Minimum value of 0.01 Maximum value of 9.99
stackexchange/codereview
I was looking at the microformat of hProduct at http://microformats.org/wiki/hproduct-examples which lists websites that use it... But I went to GAP, Amazon, Target, Toys R Us, Macy's, Best Buy, and none of the product page actually uses this format. Is the microformat hProduct useful -- is it mainly for Search Engine...
stackexchange/codereview
Hi Anyway to stop people browsing the Drupal home page and redirect to my specific html page? Thanks you
stackexchange/codereview
I'm working on this menu: http://jsbin.com/useqa4/18 How can I prevent the divs from this behavior they have when they change? If I use show() alone there isn't problem, but I need to slide then and it has wrong behavior when I move fast my cursor. What can I do for this?
stackexchange/codereview
I have a problem deploying a Rails app to my server. Performing a cap deploy I get lots of errors, stating that chmod is not able to change permissions of (and only of) git object files: ... ** [out :: ██████████████] chmod: changing permissions of `/srv/www/kunsthof/releases/20101113162736/.git/objects/04/779c6d894b...
stackexchange/codereview
Clarification When I mention cross compiling I mean from one language to another (think GWT), rather than from a host platform to a targeted platform. Background I am developing an Arabic programming language which I cross compiled to Java, this saved me the platform specific hassles. Now I had to put this on hold and...
stackexchange/codereview
Does anyone know if there is a jquery slideshow script out there that appends parameters to the URL based on what image you are looking at in the slideshow? A client is worried that a page of featured images that is displayed in a slideshow won't allow users to direct link to a certain image, or share a URL directly to...
stackexchange/codereview
On Unix, we can create a new process with fork(); execvp(argv[0], argv); (with a bit of plumbing working out if we are the parent or child following the fork). In the child process, main(argc, argv) will see the strings exactly as they were passed to execvp. On Windows, the _spawn() family basically implements fork(); ...
stackexchange/codereview
I have a VB6 app that uses a C# COM DLL. In managed C++ I can write a function as follows: array<String^>^ GetAManagedArray() { //Do stuff and return a managed array } I can then assign the returned managed array to an array in VB6: Sub MySub() Dim strArray() As String strArray = myComObject.GetAManagedArr...
stackexchange/codereview
All I did was I added a single more argument (iterations) to this function: /** * saveImage : save the last image received. * @param pName name of the file */ void GVMsample::saveImageLocal(const std::string& pName, const std::string& pImageFormat, const int &iterations) { // Check that a video module has been re...
stackexchange/codereview
I'm trying to create a consent form, and having the user input their name. When the submit button is pressed, I post their text input to a PHP file which mails their name to me (I understand that there are easier ways to do this). However this form works inconsistently; sometimes it records the user's name and sometime...
stackexchange/codereview
i am currently learning MVC2. actually working on my first MVC2 project.As the MVC3 beta is launched and available to download. please suggest me should i use MVC3(Beta) or continue with MVC2 and second thing is, if i move to MVC3 then what major advantages i will get from it. My project is an ERP application. Please ...
stackexchange/codereview
I am able to query for queues by invoking a GET_DESTINATIONS operation using JMX. With that I will receive the queue info (attributes). I would like now to query the messages that are stored in this queue, is that possible? Could someone give me some direction? I have already tried using this code ConnectionFactory con...
stackexchange/codereview
Given this <div class='postpreview'> <a href="/some/image/xyz"><img alt="xyz" src="/some/image/xyz" /></a> Some content, etc. <a href='/forums/post/123'>Show</a> </div> How can I make the entire div 'postpreview' function as link to '/forums/post/123'? In haml? Basically this is within a rails partial, and the l...
stackexchange/codereview
OK guys this is tricky, and I haven't even found a suitable solution on the IPython website. I'm working on OSX Snow Leopard. I've installed IPython using easy-install, plus all the additional basic add-ons: $ sudo easy-install readline pexpect nose ipython Everything worked OK and installed correctly. The problem is t...
stackexchange/codereview
I am showing both discounted price and original price. but i want to show strike line through original price in c#.how can we do this
stackexchange/codereview
The following code below is from a winforms application that on a button event opens up an instance of business objects 6.5, refreshes the report and then dumps the data in the report into a csv file, and then quits the business objects instance. The first time i run the code it works perfectly, however if i run it aga...
stackexchange/codereview
I'd like to make a delegate that invokes a specific instance method, unfortunately, it seems that if the method is virtual, the override of the method for the inheriting class will be invoked rather than the base version. public class Base{ public virtual void Method(){ Console.WriteLine("Base")...
stackexchange/codereview
How to output in buffer console output? For example I just need output of command "ipconfig -all", and want to store that information in some buffer?
stackexchange/codereview
Can someone tell me why this won't work? var top = 0; for (divToPosition in $('.positionableDiv')) { divToPosition.css('top',top+'px'); top = top + 30; }
stackexchange/codereview
Lets I have C++ header such as: class Color { public: Boolean OnInitDialog(); }; Could I do the implementation in ObjectiveC with something like: -(BOOL) OnInitDialog { ... return TRUE; }
stackexchange/codereview
I need to use the MAX function in my where clause because it is giving me the wrong data if I do not. Here is my code: (SELECT Index, Company, FormType, MAX(DocumentDate) AS DocumentDate FROM dbo.FormInstance AS F WHERE f.company = 1234 AND ( CAST(FLOOR(CAST([DocumentDate] AS FLOAT))AS DATETIME) BETWEEN CA...
stackexchange/codereview
My question is something similar to this one: How to import Java EE classes to Eclipse? But I'm just creating a sample Message Producer and not a web project. My initial problem was how to import the needed classes. I've already had 2 different approaches to this: 1) Add the individual libraries (e.g. jms.jar) 2) Creat...
stackexchange/codereview
I am drupal user normally but we just landed a fairly big project that sort of feels as if it would be better made outside of drupal, because of flexibility and performance and all of that. Basically the only advantage in drupal is 2 or 3 things, the permissions system is in place, brilliant we would not have to create...
stackexchange/codereview
The app is Flash Cards Max on the Android market. I recently updated my app with a 1.6 only feature. However, I still want the app to work with those that have Android 1.5. I built it using Android 1.6 in Eclipse and I have the correct strings in the Android manifest file. <uses-sdk android:minSdkVersion="3" ...
stackexchange/codereview
I am upsizing an MS Access 2003 app to a SQL Server backend. On my dev machine, SQL Server is local, so the performance is quite good. I want to test the performance with a remote SQL Server so I can account for the effects of network latency when I am redesigning the app. I am expecting that some of the queries that s...
stackexchange/codereview
I am in a desperate situation. I am developing an Android application using the ADT in Eclipse on Ubuntu 10.04 on a netbook. Unfortunately the netbook is not powerful enough to run the Device Emulator (when I try there are always issues). Then, I tried to debug on-device, but unfortunately my phone (Pulse) seems to h...
stackexchange/codereview
Does new (>2.0) .NET framework provide any enhancements to code generation? I used CodeDom in 2.0 and I wonder if code generation can be simpler.
stackexchange/codereview
/usr/include/QtOAuth/interface.h:101: error: ‘QOAuth::Interface::Interface(const QOAuth::Interface&)’ is private Is the error I get. How to get around this? I've looked at the file interface.h and the method Interface is a public method. Is there any reason why this would make an error? QApplication a(argc, argv); QB...
stackexchange/codereview
Is there something ready for printing Booleans in PHP (usually for debug), rather than writing: echo ($flag ? "true" : "false") every time?
stackexchange/codereview
I would like to use asctime to assign the time to a string. time_t rawtime; time ( &rawtime ); vector<string> TTime; TTime.resize(10); TTime = asctime(localtime ( &rawtime )); I understand asctime is returning a pointer to a string. Would i have to create my own string and assign it the return value of asctime, or is ...
stackexchange/codereview
I'm trying to convert a raw mysql query to use doctrine. The table is full of rows of statistics, and my query is checking to see how far from the average the stat gain has deviated from the average increase each day. The SQL version works exactly how I'd expect it to act. Converting to Doctrine gives me an error. Her...
stackexchange/codereview
What difference that final makes between the code below. Is there any advantage in declaring the arguments as final. public String changeTimezone( Timestamp stamp, Timezone fTz, Timezone toTz){ return .... } public String changeTimezone(final Timestamp stamp, final Timezone fTz, final Timezone toTz){ ...
stackexchange/codereview
Document doc = Jsoup.connect("http://reviews.opentable.com/0938/9/reviews.htm").get(); Element part = doc.body(); Elements parts = part.getElementsByTag("span"); String attValue; String html; for(Element ent : parts) { if(ent.hasAttr("class")) { attValue = ent.attr("c...
stackexchange/codereview
I am interested in use or created an script to get error rounding reports in algorithms. I hope the script or something similar is already done... I think this would be usefull for digital electronic system design because sometimes it´s neccesary to study how would be the accuracy error depending of the number of decim...
stackexchange/codereview
I have implemented the algorithm, but now I want to find the edit distance for the string which has the shortest edit distance to the others strings. Here is the algorithm: def lev(s1, s2): return min(lev(a[1:], b[1:])+(a[0] != b[0]), lev(a[1:], b)+1, lev(a, b[1:])+1)
stackexchange/codereview
I've been at this for awhile and have tried different examples (including a few that I found here), and tried to adapt them to what I need. I am trying to use a DB query in a servlet to populate a combo box in the resulting html form that is created. While it all compiles and the page pops up with a combobox, there is...
stackexchange/codereview
I want to create a style which I can apply to different control types. Something like this: <ToolBar> <ToolBar.Resources> <Style TargetType="Control"> <Setter Property="Margin" Value="1"/> <Setter Property="Padding" Value="0"/> </Style> </ToolBar.Resources> <ComboBox...
stackexchange/codereview
I have raw data in byte form and I want to play it when my application starts. The byte stream will be streamed in every few seconds and I need to play it so it should also have very low latency. Please provide sample code, if possible. Thank you.
stackexchange/codereview
Are IDEs always a Good Thing(tm)? I used to use only jEdit, but a while back switched to NetBeans, mostly because of the GUI Builder and the NetBeans Platform (I'm mostly a Java programmer). While I am a lot more productive with it, it feels less flexible and I often find myself hacking some things in jEdit again (Scal...
stackexchange/codereview
i want to do sorting in the mvc contrib grid....so far i have i used this coding in homecontroller.cs public ActionResult Sort(GridSortOptions Sort) { using (ProductsDataContext db = new ProductsDataContext()) { var categories = db.Products.ToList(); if (Sort.Column != null)...
stackexchange/codereview
I am new to iPhone Apps. Do we get the know the email address of all the users who bought our iPhone App through App Store? Also, when we submit our app for review, do we have to submit the App Description, price and other details? OR we do this after our app is approved by them? Please let me know.
stackexchange/codereview
I've passed a 2D array from a C++ class to a CUDA function; however, once in the CUDA function the data in the matrix is gone. I'm still in the host, not the device so I don't understand what I've done wrong as this should be very straight forward. Here is the C++ int main() { const int row=8; const int column=8;...
stackexchange/codereview
I have a button named yes and another named no. <input type="button" name="yes" onclick="button()"> <input type="button" name="no"> I want to create a cookie when yes is clicked that would store the info "YES" and needs to expire after 7 days. How do i do that? The only information that the cookie needs to store is "Y...
stackexchange/codereview
I have a struct in my Ruby code that looks somewhat like this Parameter = Struct.new(:name, :id, :default_value, :minimum, :maximum) later, I create an instance of this struct using freq = Parameter.new('frequency', 15, 1000.0, 20.0, 20000.0) At some point, I need an exact duplicate of this struct, so I call newFreq ...
stackexchange/codereview
I’m looking to use the GAE Datastore directly, without using JDO/JPA. I have a quick question: Suppose I have this code: Key key = getMyKey (); Entity entity1 = dataStore.get (key); Entity entity2 = dataStore.get (key); Are entity1 and entity2 guaranteed to be the same object (i.e. entity1 == entity2), or can calls t...
stackexchange/codereview
What should I write in php if I would like to use "post" in Android programming? For example, if I want to upload my name and age form my android phone to the server, what should I write in the server's php? There are many examples about the use "post" of android on the internet, but less about how to write the php.
stackexchange/codereview
the problem is bigger, but I try reducing it to a simpler style: Lets assume, that I am simply programming a Client/Server Model. I manage to connect to the Service and can use its function and am able to communicate. The connection is build up through a configuration file on server site and the client just connects to...
stackexchange/codereview
So, Gmail's IMAP is a bit 'weird'. They use IMAP folders to represent Labels. I believe typically that an email in IMAP can only belong to one 'Folder', however with Gmail, an email message can belong to many 'folders' which gives us very close functionality to labels. My question is, I'm writing a gmail client (so t...
stackexchange/codereview
how to use not like in django queries Model.objects.filter(keywords not like "null" or "undefined") select * from model where keywords not like "%undefined%" or keywords not like "%null%";
stackexchange/codereview
I've implemented a TryParse function for a class MinMax like this: public static bool TryParse(string s, out MinMax result) { var parts = s.Split(' '); if (parts.Length != 2) { return false; } float min; float max; if (!float.TryParse(parts[0]....
stackexchange/codereview
How can I create a count down timer in JSF? I don't want the timer reset when refresh the page.
stackexchange/codereview
Instead of repeating myself with my form: <form name="addBlockList" action="" method="post"> Välj blockeringsgrad: <select name="blockeringsgrad" style="font-size: 12px;"> <option value="1">1 - Bilder</option> <option value="2">2 - Bilder, Vän, Vägginlägg, PM</option> <option value="3">3 - Ingen tillgång till profil</...
stackexchange/codereview
I've installed django on my windows machine, added the pydev and django plugins for eclipse, create a django project, and ran manage.py createapp to create one app. Now when I run manage.py runserver (via eclipse's "custom command" option") It says Validating models... but when I go to http://localhost:8000 I get no re...
stackexchange/codereview
I have a Ruby script which is constantly updating a MySQL database. I want to show the "mysql_num_rows()" in realtime. So as an entry is entered into the database by the Ruby script I want the PHP script to update its mysql_num_row() count in realtime. I tried using <meta http-equiv="refresh" content="5">, but I don't ...
stackexchange/codereview
I think the question is self-explanatory. I know exec runs on another process, so if I wanted to ls a directory I would do something like that. int pid; if((pid = fork()) != -1) { if(!pid) { execl("/bin/ls", "-a", "-l", (char *) 0); } else { wait(&status); } } else //error That's fine...
stackexchange/codereview
I want to initialize string in C to empty string. I tried: string[0] = ""; but it wrote "warning: assignment makes integer from pointer without a cast" How should I do it then?
stackexchange/codereview
i will create a program check stock with barcode and database what do i need to learn What language should I use to development. And Should I use a database where. c/c++, java, Visual C# not experience but pretty spec check in, check out and check amount in stock Thank sorry for grammar
stackexchange/codereview
i want to generate an array of random numbers for example if the range is [0,10] then the desired output to be 2 3 5 6 4 7 8 9 0 1 ( non repeatitive ) the problem i am facing with rand() function is sometimes i get some repeated nos , i was discrete values in that range , and different order everytime i invoke. Ps: ...
stackexchange/codereview
I have a grid of values in a DataGrid. In each cell I have one of 4 values, I want each value to have an associated colour. In the past all my data triggers have been of the format; <DataTrigger Binding="{Binding Status}" Value="R"> <Setter Property="xcdg:DataRow.Background" Value="Pink" /> </DataTrigger> But I n...
stackexchange/codereview
Im wondering if theres a way to have the catch statement clear the text box that caused the error. Here's my validation code so far: private bool ValidateForm() { int val1, direction = 0; double speed = 0.0; bool validated = false; if (txtName.Text != "") { try { // att...
stackexchange/codereview
Hay Everyone, i have a MySQL query SELECT * FROM `product` WHERE `price` BETWEEN '60' AND '999' ORDER BY `product` DESC LIMIT 12 OFFSET 0 This obviously select 12 products where the price is between 60 and 999. This shows the rows correctly. However if i increase the limit like this query SELECT * FROM `product` WHER...
stackexchange/codereview
I want to do this simple internal write : http://localhost/icore4/t1/js/GeneralJs.js to http://localhost/icore4/js/GeneralJs.js htaccess location icore4/.htaccess htaccess code RewriteEngine on RewriteRule ^(.*)/(.*)$ /$2 [NC,L] bottomline, I want to get rid of t1 and put it in the query string. As of now, I am bo...
stackexchange/codereview
I'm trying to schedule my alarm manager to fire up an intent every hour in a day. this is what I do , and it doesnt work properly. code: new code after edit: Calendar cal = Calendar.getInstance(); cal.set(Calendar.HOUR_OF_DAY , 22); //22:00 of every evening cal.set(Calendar.MINUTE , 0); //initiat...
stackexchange/codereview
I am trying to test the output of a view helper that resides within a namespace. The original helper is located under app/helpers/admin/events_helper.rb. The test is at spec/helpers/admin/events_helper_spec.rb and looks like this (simplified): require File.dirname(__FILE__) + '/../../spec_helper' describe Admin::Event...
stackexchange/codereview
I'm trying to find something like Java Embedding Plugin (JEP) that can evaluate a mathematical formula (string) and give back the answer. But it should also calculate a variable, for example: (25+36+x)*2 = 25 should give: x = -11 A little like http://www.wolframalpha.com/, but it shouldn't be that versatile, and it sho...
stackexchange/codereview
I'm developing a web site that (like many other sites) use a bunch of different tools such as php, xml, xsl, json, jquery, css etc. I'm looking for resources/books that can provide tips on how to use these tools more efficiently. Best practices, tips and tricks and that sort of stuff. For example how to structure files...
stackexchange/codereview
Is there a way to group several keys which points to the same value in a dictionary?
stackexchange/codereview