instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
Pass a integer 2 to this function and then return a integer which is 4 x = 2; x = rotateInt('L', x, 1); (left shift the bits by 1) Example: 00000010 -> rotate left by 1 -> 00000100 but if I pass this: x = rotateInt('R', x, 3); it will return 64, 01000000 Here is the code, can someone correct the error... thanks in...
stackexchange/codereview
I'm working recently on many TYPO3 Projects and I'd like to have a good tutorial/reference to work my way up. I'm looking for something like Agile Web Development with Rails but for TYPO3 if you like. The documentation of TYPO3 is good but not incredible so I was wondering if there was a better option out there.
stackexchange/codereview
I have PHP generated HTML. Firebug shows me this source: <div class="module-header"><div class="module-header2"><div class="module-header3"><h3 class="module-title" style="visibility: visible;"><span>Մարդկային</span> ռեսուրսներ</h3></div></div></div> Mozilla Source shows me another HTML for that part. <div class="mod...
stackexchange/codereview
I try to minimize my form to system tray but when I do, the form disappears and the notification icon doesnt work :( What am I doing wrong? Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize If Me.WindowState = FormWindowState.Minimized Then Me.Visible...
stackexchange/codereview
I got some issues to deploy my application. Environment: Ubuntu 10.04, Tomcat 7.02 (Install from archive from tomcat site, not from repositories), server is run and stoped manualy, not using any IDE. For the first I've created host in $CATALINA_HOME/conf/server.xml: <Host name="java.dev" appBase="/home/krasilic...
stackexchange/codereview
I have written a program with C#, that creates a logfile and fills this by using log4net. This program starts powershell-scripts. The scripts use log4net, too. It works: > C#: > ps.Runspace.SessionStateProxy.SetVariable("myMethod",(Action<Level,string>)myMethod); > ps.AddCommand(System.IO.Path.Combine(pathScripts, ...
stackexchange/codereview
I've got this this rule in my htaccess file to force linked files to download rather than open in the browser: <FilesMatch "\.(gif|jpe?g|png)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch> Is there a way to alter the RegExp so it only applies to files in a certain dir...
stackexchange/codereview
I have a strange error with a $_GET Value. I'm using this code for a query: array($_GET['cats']) If I insert the get parameter manually, like: array(3,328) everything works fine. But if I use: array($_GET['cats']) and submit the cats by URL like ?cats=3,328 it does not work. What could be the issue?
stackexchange/codereview
I have a program that will run on several machines. I cannot control exactly which machines this program will be running on, but all will link to the same database that is located on a server somewhere. The program might require to run a script that is recevied in the form of a .sql text file. Currently, the program is...
stackexchange/codereview
I'm trying to get a local variable from a decorator. An example: def needs_privilege(privilege, project=None): """Check whether the logged-in user is authorised based on the given privilege @type privilege: Privilege object, id, or str @param privilege: The requested privilege""" def validate(func...
stackexchange/codereview
Does PHP have built-in debugging logging like Ruby on Rails logger.info() to a development.log file? With PHP I'd like to look "under the hood" to see what's going on... pages served, query string values, etc. I've Googled a bunch but can't find anything. (I'm trying to port a web app from RoR to PHP because I need mor...
stackexchange/codereview
I use an editorgrid to edit elements from a JsonStore. The JsonStore uses a HttpProxy to update the backend database. My problem is that the backend API expects fromTs and toTs to be Unix timestamps, but when a record is updated, the resulting http post contains a date formatted like this: Wed Oct 20 00:00:00 UTC+0200...
stackexchange/codereview
I am trying to parse a string and get another string in the middle. ie. Hello world this is a string I need to find the string between "world" and "is" (this). I have looked around but haven't been able to figure it out yet, mainly because I am new to Objective C... Anyone have an idea of how to do this, with RegEx or...
stackexchange/codereview
I am using DataView in SharePoint. I want to bind a collection of objects to the DataView. But when I am trying to bind it is giving the error that the collection does not implement IDataSource interface. Can anybody tell me how to extend the collection class to implement IDataSource interface? Thanks Ashwani
stackexchange/codereview
Cliffnotes: I've gotten method chaining to work as I expected in one case, but in another case, there is something funny going on. I expect these two example to have the exact same output: As expected example Not as expected example I've done a lot of chaining using Javascript, so when I learned that you can chain cla...
stackexchange/codereview
Here is the problem. I wrote this function to return a reference to the i element of a member vector, so this element could be edited. Here is the code: Letter& Literal::get (int i) const { return lit_m.at (i); //Vector of Letter objects } But g++ won't let me assign that element to a non-const reference: g++ -o l...
stackexchange/codereview
I followed the steps in: http://lennybacon.com/2010/10/18/UltimateGuideToSpeedUpVisualStudio.aspx to make my Visual Studio 2010 faster, including the advice toward the bottom labeled "64 bit support" about running editbin /largeaddressaware deveenv.exe . Is there any way I can verify that this command "worked"?
stackexchange/codereview
I'm trying to filter my posts to only show the ones with that have a custom value for the field "Model" while sorting the posts by another custom field called "Price." Here's the function I'm using (not working): <?php global $query_string; query_posts( $query_string . "&meta_value=Model&orderby=meta_value&meta_key=P...
stackexchange/codereview
what is the difference between SPfolder.ContenttypeOrder and SPFolder.UniqueContentTypeOrder? Why sometimes UniqueContentTypeOrder is null? How do i get the contenttypes attached to a folder which are visible to this folder and in order? I thought by using UniqueContentTypeOrder, but sometimes it is set to null? Thank...
stackexchange/codereview
Basically what I am wanting to do is take the variable named FROM and swap it with the variable named TO and vice visa, the reason for this is to allow the user to press a button which swaps the variables over when pressed. Exactly how it does when you press the swap button on google translate. Below is the code for t...
stackexchange/codereview
I'm using Python 2.6.1 on Mac OS X. I have two simple Python files (below), but when I run python update_url.py I get on the terminal: Traceback (most recent call last): File "update_urls.py", line 7, in <module> main() File "update_urls.py", line 4, in main db = SqliteDBzz() NameError: global name 'Sqlite...
stackexchange/codereview
My machine is continuously making udp dns traffic request. What I need to know is the PID of the process generating this traffic. The normal way in TCP connection is to use netstat/lsof and get the process associated at the pid. Is UDP the connection is stateless, so, when I call netastat/lsof I can see it only if the ...
stackexchange/codereview
This code fragment: namespace ns { struct last; struct first { typedef last next; }; template <typename T> struct chain { chain<typename T::next> next; }; template <> struct chain<last> { }; } using namespace ns; template <typename T> void f(const T& ...
stackexchange/codereview
I have this excel worksheet A B c foo1 joo1 loo1 foo1 joo2 loo2 foo2 joo3 loo3 foo2 joo4 loo4 foo2 joo5 loo5 Now I want this A B c foo1 joo1, joo2 loo1, loo2 foo2 joo3, joo4, joo5 loo3, l...
stackexchange/codereview
We have a website developed in PHP with MySQL and sometimes facing problems when traffic increases. We have almost optimized the site in all ways to handle more requests but still facing problems at peak hours. One of my friends suggests to rebuild the site using HBase / MongoDB as back-end to improve the performance. ...
stackexchange/codereview
I am trying to run jetty web server in SSL mode using PKCS12 keystore. The code is as follows: import org.mortbay.jetty.Server; import org.mortbay.jetty.security.SslSelectChannelConnector; class MyClass { public static void main(String[] args) { Server server = new Server(); SslSelectChannelConnecto...
stackexchange/codereview
I’ve got a massive memory leak in my program. This is the first time I’ve used IronPython in a tight loop, so I’m wondering if this could be the cause. For Each column In m_Columns Dim rawValue As String rawValue = line.Substring(column.FileColumnIndex.Value - 1, column.FileColumnEndIndex.Value - column.File...
stackexchange/codereview
I want to rebuild (maybe I don't even have to) the nativ android progress indicator and show it as icon for a list item. I followed this example and endet up with a heavy performance eating animation, which also doesn't match the native spinner. The code has as "LinearInterpolator" which seems to cause those problems. ...
stackexchange/codereview
I am decomposing a single long into a long[] of single bit longs by public static int decompose(long[] buffer, long base) { int count = Long.bitCount(base); for (int i=0; i<count; i++) { base ^= (buffer[i] = Long.lowestOneBit(base)); } return count; } but I feel like there might be a faster way to do this,...
stackexchange/codereview
I have NSZombieEnabled to NO in my arguments. I am checking to see if it is enabled: if(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled")) { NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!"); } My debugger says it is still enabled. Why?
stackexchange/codereview
Few days ago I where searching for human interface for mobile devices. but all bluetooth devices are pretty messy and hard to implement. Question are: "Is there open source, or free library for making Oscilloscope on WinMobile platform. As my interface is not going to be human, I will try to make some kind of buzzer ...
stackexchange/codereview
I am trying to access a webservices over https, I have the ssl certificates in place. However when I send the webservice request I am getting: threw exceptionorg.apache.axis2.AxisFault: Transport error: 403 Error: Forbidden at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:296) at org.apach...
stackexchange/codereview
I know that my question has been asked before but I didn't found any answer suitable for my case or even works. My problem is: I need to embed a Flash movie inside WPF application, then I need to use Externalinterface - or whatever the way is - to integrate through this flash movie - I'm working on Visual Studio 2008! ...
stackexchange/codereview
Is there a desktop .NET-based equivalent of the <optgroup> functionality for comboboxes on html pages?
stackexchange/codereview
My blog posts live in a container that's 600px wide. When I have an image that's wider than 600px, I resize it via CSS (.post img {max-width: 600px}) I'd like users to be able to click on these resized images and see the full size version in a lightbox, but to do this I need to detect in Javascript which images have be...
stackexchange/codereview
I'm using this Fx.Slide script in my site: var togglers = $$('.toggler'), expanders = $$('.expandable'); togglers.each(function(toggler, index){ var fx = new Fx.Slide(expanders[index]).hide(); toggler.addEvents({ click: function(e){ e = new Event(e); ...
stackexchange/codereview
I have a piece of code that will return a flat sequence for every pixel in a image. import Image im = Image.open("test.png") print("Picture size is ", width, height) data = list(im.getdata()) for n in range(width*height): if data[n] == (0, 0, 0): print(data[n], n) This codes returns something like this ((0...
stackexchange/codereview
I have a model called "user" and a controller for "user" with an action "login". The controller is empty right now as I'm simply testing the page, however, going to www.mysite.com/user/login redirects me automatically to www.mysite.com/user*s*/login and then says that the users controller does not exist. I know it doe...
stackexchange/codereview
Does python 2.5 allow you to pass exception arguments? try: raise Exception("argument here") except Exception: print Exception.args I've had no luck with the above code - I know this is how you do it in Python 2.7 - is this not in Python 2.5?
stackexchange/codereview
I was wondering if there is a tool, bookmarklet or something out there that can help me find non-secure items on a page. When I view source and search for http:// on the https page in question I find the following items: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xht...
stackexchange/codereview
I don't want to open my site in fullscreen mode (as it's not possible without using Flash) or to open it in 'kiosk mode'. I want to ask the user to press F11 on his/her keyboard to turn the browser into fullscreen mode. And I want to know if he/she did it. Is there a way to determine if the current window is being brow...
stackexchange/codereview
Good afternoon, Does anyone know of an "out-of-the-box" implementation of Levenshtein DFA (deterministic finite automata) in .NET (or easily translatable to it)? I have a very big dictionary with more than 160000 different words, and I want to, given an inicial word w, find all known words at Levenshtein distance at mo...
stackexchange/codereview
I'm migrating a multi threaded application from HP-UX to Solaris and so far, everything is OK except for one thing! The application has a thread that is handling the signals and, when some of them are received, it runs some cleaning (logging, kill child processes and so on). I've reduced the code as much as it was poss...
stackexchange/codereview
Lets say I have the function void do_work (foo?); The ? represents a 0 or a 1 which will be the value of variable int bar = 0; There are also the variables int foo0 = 0; int foo1 = 0; I am trying to inject the value of one variable into the name of another variable so that the function gets the full name of ei...
stackexchange/codereview
Here's my problem: Consider the following html: <div id="item1" class="green_large"> <div id="item2" class="green_large"> <div id="item2" class="green_small"> <div id="item4" class="yellow_large"> <div id="item5" class="yellow_large"> How do I check if $(this) contain a class name with the substring "yellow" for examp...
stackexchange/codereview
What is the best non-ORM database to work with Scala? I find this link link text, but this does not answer my question fully. Could be considered desirable features performance, scalability and facility to write complex structures of relationships between data. Thanks
stackexchange/codereview
My code was working fine until I reloaded the program a few hours later. Now I get these this error: error C3867: 'player::getxPos': function call missing argument list; use '&player::getxPos' to create a pointer to member error C3867: 'player::getyPos': function call missing argument list; use '&player::getyPos' to c...
stackexchange/codereview
Monitoring the all network traffic from one port on the switch and captured the all traffic bu using wireshark. Here i found all packet captured in the summary result and it has dropped packet information also. This is some thing lost packets in the network or at the wireshark point? I was in ambiguous...i am testing ...
stackexchange/codereview
New to XSD here. Has anyone found or written a framework for validating XML with an XML schema in Cocoa/Obj-C? What I really need is the ability to define permitted types of modifications to an NSXMLDocument, as described in an XSD file. This includes defining sequences of child elements, list of attributes and their p...
stackexchange/codereview
I'm using the following code to restore a backup sql database with C# and SMO. void RestoreDatabaseWithSMO(string sConnect, string dbName, string backUpPath) { using (SqlConnection cnn = new SqlConnection(sConnect)) { cnn.Open(); cnn.ChangeDatabase("master"); ServerConnection sc = new S...
stackexchange/codereview
I am trying to load the tomcat log of combined pattern to MySQL db,now I push each record to db when it is parsed. First,read a line from the InputStream, then parse it to a LogItem which is used to wrap a log record, then Using the MySQLDbManager to insert the record to db, MySQLDbManager hold a reference of a databas...
stackexchange/codereview
I am using JSF along with RichFaces and Spring Webflow. I am trying to select rows from the data table using and perform some operation on the server side on the selected row. How ever I am facing problem retrieving the data from the checkbox. <rich:column id="compCheckBox" styleClass="center-aligned-text"> ...
stackexchange/codereview
I'm getting hundreds of these process_reaper threads that build up over time in my application. Anyone have any idea what these may be? They seem to be in my use of Runtime.exec() however I'm destroying my process in a finally statement but they still show up screen shot: http://www.dropmocks.com/mBxM5 Process proc = ...
stackexchange/codereview
One of my colleagues told me something like that over a year ago. I was wondering if there is something like this available now or will be in the future? I think it was gonna have a separate GC core, and some memory management thing but I am fuzzy about it. Any clues?
stackexchange/codereview
SQL Server 2005 supports CLR so it means we can use CLR in backend so how to do that, I have some function in c# which do some complex manipulation with date-time variable now I want to use those functions in SP. First of all IS IT POSSIBLE TO DO THIS.
stackexchange/codereview
Starting with a List of entities and needing all dependent entities through an association, is there a way to use the corresponding navigation-propertiy to load all child-entities with one db-round-trip? Ie. generate a single WHERE fkId IN (...) statement via navigation property? More details I've found these ways to l...
stackexchange/codereview
I have a multi-dimensional array generated in PHP: array( 'Requirements' => array( 'export_requirements' => array('value'=> 1, 'label'=> 'Export'), 'add_requirements' => array('value'=> 2, 'label'=> 'Add'), 'add_private_requirements' => array('value'=> 4, 'lab...
stackexchange/codereview
Im a little puzzled here, can someone just look over this query and tell me am i doing anything wrong? SELECT d.* FROM as_downloads d LEFT JOIN as_categories c ON (d.download_category_id = c.category_id) WHERE d.download_category_id != -1 LIMIT 30 Fetching the rows from the as_downloads table but not joining the categ...
stackexchange/codereview
I am using trigger to trace DDL changes but when I change column name from the SQL Server Management Studio the trigger is not working? create TRIGGER trgLogDDLEvent ON DATABASE FOR DDL_DATABASE_LEVEL_EVENTS FOR AS DECLARE @data XML SET @data = EVENTDATA() IF @data.value('(/EVENT_INSTANCE/EventType)[1]', 'nvarchar(10...
stackexchange/codereview
I have deleted my default db now I can not login using sql server authentication. How can I change default db back to Master db EDIT: I cannot login using sql server authentication. It gives me error Cannot open user default database. Login failed. Login failed for user 'xyz'. (Microsoft SQL Server, Error: 4064)...
stackexchange/codereview
I'm going slightly insane here. I've been trying to figure out what is the problem for the past 24 hours, but I simply can't figure out what is wrong. I have an article submission framework. First the user inputs some article text fields, then he uploads 2 pictures, then he crops them. The problem occurs when I try to...
stackexchange/codereview
I create a new iframe, append it to body, and then try to get its 'document' variable, like this: var $iframe = $( "<iframe name='my-frame'>" ); $iframe.appendTo( $("body") ); var doc = null; if($.browser.msie){ doc = window.frames["my-frame"].document; // 'access denied' in IE } else { doc = $iframe[0].conte...
stackexchange/codereview
I'll release my first app soon, and I'm afraid of getting dozens of bug mails from users every day. Tapbots for example have a great Ticket System in place. When you send them an support inquiry from their web form, you immediately get an email in return with an big ID in the subject, and some professional text like "p...
stackexchange/codereview
I have a web application (MainApplication) where many of the pages contain a custom Web Control that looks for some content in a cache. If it can't find any data within the cache, then it goes out to a database for the content. After retrieving the content, the Control displays the content on the page. There is a web a...
stackexchange/codereview
I googled and found the below helpful references. Currently I want to run all from the command-line (for easy of execution & quickness) in cases: A specific test (ie. a test written by a method marked [TestMethod()]) All tests in a class All impacted tests of the current TFS pending change of mine. All tests All tests...
stackexchange/codereview
What are some best practices for being able to deploy a Windows service that will have to be updated? I have a Windows service that I will be deploying but might require some debugging and new versions during the beta process. What is the best way to handle that? Ideally, I'd like to find a ClickOnce-style deployment ...
stackexchange/codereview
I have classes setup similar to this: <DataContract()> _ Public MustInherit Class SystemTaskProcessBase Public MustOverride ReadOnly Property Name() As String Public MustOverride ReadOnly Property Description() As String Public MustOverride Property Result() As SystemTaskResult <DataMember()> _ P...
stackexchange/codereview
I've checked and played a bit with Microsoft Pex. It's a very handy tool/library even though it's not as straight forward to write parametrized unit tests with it. But when used correctly it can provide much better test code coverage than writing manual unit tests. Not to mention time spent writing those tests either. ...
stackexchange/codereview
I'm trying to use one of the existing Widget.Button styles but I see two different styles that look the same, but I'm sure there's a reason why they are made distinct. Can anyone explain the difference between the Widget.Button style versus the Widget.Button.Inset style, or at least an application where I would use on...
stackexchange/codereview
I have a client and a server program, and I am currently using hashtables to store the clients Name and IP address when they connect. I now need to add another variable that the client will send to the server when it connects, but as far as I understand it, hashtables only have 2 columns (Key and value). Is there anoth...
stackexchange/codereview
Finally I found the effect I was looking for. Sadly it is written as a java applet. Do you know how can I get the same effect with JavaScript? You can see the effect in the link below... it switches between pictures as though they where book pages: http://javaboutique.internet.com/BookFlip/
stackexchange/codereview
I faced with next task: I have an host, for example host.com and web-application on it. Application written on Java (JSP/Servlets+Struts2). I need to implement such HTTP-request to servlet mapping: if user enters address in browser like http://host.com/admin.action, where admin.action - existing action, defined in stru...
stackexchange/codereview
We are currently investigating options for migrating a legacy application built using .NET 1.1 to .NET 4. Office 2003 was used in the application and we need to migrate away to Office 2010. The old application used CDO/MAPI to interact with Excel/Outlook... so what is the prescribed p&p for accessing Excel/Outlook 2010...
stackexchange/codereview
I've written a working grammar to replace dbunit in scala called ScalaDBTest. The whole program works - only took 2 days to write. I got a lot of polishing to do. Anyway, the grammar I'm using for the DSL to input data into the database is malleable and I'd like some feedback on it. The basic syntax looks like this. I...
stackexchange/codereview
I notice that XML::RSS::Parser hasn't been updated since 2005. Is this still the recommended library for parsing RSS or Atom? Is there a better one or a better way?
stackexchange/codereview
I've tried a bunch of examples here on SO and modifed them, but none are exactly what I need and as a result either fail with 500 server errors (meaning the rewrite rules are wrong) or redirect just the subdomain to the domain and not any of the full URLs of pages. I need to redirect all URLs under blog.mydomain.com to...
stackexchange/codereview
Hello i tried hard to make exactly like this: But it's difficult for me, and its not right at all. My boxes arent so perfect as in the image, and same with the text under it. <table border="0" align="center" cellspacing="2" cellpadding="2" > <tr > <td class="cell" style="color: #CCC; f...
stackexchange/codereview
I'm working on a program that will have several users connected to each other via p2p. I would like to test run my program by opening several instances on one computer and have these instances communicate as though they are on separate machines (i.e: as if it's the real thing). Any idea how to approach this? Thanks, P...
stackexchange/codereview
I'd like to automatically pad my shapes with some space so that connectors (e.g. arrows) do not touch the shape, but instead are a few pixels away. This can be achieved by moving the shape connector points away from the shape, but this is a manual, time consuming process which needs to be done per shape which I would l...
stackexchange/codereview
This is probably a simple question, which I can't seem to find a solid answer to. Why would one choose JSON2 over jquery-json plugin (http://code.google.com/p/jquery-json/)? Given that a web application is using jQuery to begin with. Everyone's writing about how great it is that JSON2 falls back on the native implemen...
stackexchange/codereview
Let's say I'm writing a eBook reader for Windows Phone 7. Now the first thing that the user will need to do is add some books to his device, and since I don't offer a online book store or similar service, the only option is file transfer from his PC to the phone. Is he able to do this, how? Then how do I access this fi...
stackexchange/codereview
I've been tasked with implementing a blacklist-based profanity filter for a Rails app. I know there are a ton of issues with blacklist-based filtering, but the decision was made above my head. Challenge: I'm looking for a good list of Spanish profanity to run into the filter. For English, we're building on a list wh...
stackexchange/codereview
I have a GUI that has behind it an interface that allows those dll's meeting it's contract to run through this GUI. All the work and calculation is done within each dll. I want to display an update as each record (within the dll) is processed, this update has to be on the GUI. Is there a simple way of passing this inf...
stackexchange/codereview
I have a domain let's call it newsite.com which is parked to maindomain.com. I use mod-rewrite to direct all requests for newsite.com to a subdirectory on maindomain.com. On newsite.com I have CodeIgniter installed. Which means the urls look like this: newsite.com/products/shoes/ The above works just fine. However, i...
stackexchange/codereview
I'm writing a program which is more or less like this : #include <list> list<MyClass> things; class MyClass { // some stuff void remove() { things.remove_if(THING_IS_ME); } }; What do I need to write instead of THING_IS_ME? In other words, I'm using a global STL list as a collection of things. At so...
stackexchange/codereview
I am making app where a list of countries to be shown. When the first time app runs the user selects the no. of countries. I stored that list in nsuser defaults. I want to checkmark those countries in the TableView when the app runs again for second time. One more problem is when I scroll through the TableView and aga...
stackexchange/codereview
I have following code class Test { public: int &ref; int a; Test(int &x) :ref(x) { cout<<"Address of reference "<<&ref<<endl; cout<<"&a : "<<&a<<endl; cout<<"this = "<<this<<endl; } }; int main() { Test *pObj = NULL; { int i = 10; cout<<"Addr...
stackexchange/codereview
Is there any tools like httpwatch/fiddler available to monitor the headers send by PHP API like file_get_contents
stackexchange/codereview
I am making a chat application for my homework which runs within a Linux Terminal. So, I need to take from the user some input and display the output from all the users as well in a well organized manner. So, I made two threads. One thread have a cin command and the other thread is having a display function which basic...
stackexchange/codereview
I'm parsing an XML file which is quite simple: <?xml version="1.0" encoding="utf-8"?> <catalog> <book id="bk101"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> <genre>Computer</genre><price>44.95</price><publish_date>2000-10-01</publish_date> <description>An in-de...
stackexchange/codereview
I am creating a mobile version of my website. It is nothing fancy, just a few pages. I would like to be able to share the content in both form, without having to update it in two places. Is the easiest way to do this with CSS? Or can I create some sort of XML or text file and read it in both sites? Here is what I ended...
stackexchange/codereview
It's my day 1 of learning python. so it's a noob question for many of you. See the following code: #!/usr/bin/env python import sys def hello(name): name = name + '!!!!' print 'hello', name def main(): print hello(sys.argv[1]) if __name__ == '__main__': main() when I run it $ ./Python-1.py alice h...
stackexchange/codereview
i want to set RegularExpressions for check string1. string1 can change to : string1:='D1413578;1038' string1:='D2;11' string1:='D16;01' ,.... in string1 only Character 'D' and semicolon is always exist. i set RegularExpressions1 := '\b(D#\;#)\b'; but RegularExpressions1 can't to check string1 correctly. in the vb6 th...
stackexchange/codereview
How can I urlencode a string with special chars æøå? ex. urllib.urlencode('http://www.test.com/q=testæøå') I get this error :(.. not a valid non-string sequence or mapping object
stackexchange/codereview
Here's what I'm trying to do: public class EmployeeService { public void GetEmployeesAsyc(Action<IEnumerable<Employees>> callback) { ThreadPool.QueueUserWorkItem(x => { var employees = //...fetch employees ...// callback(employees); }); } } public class ViewModel {...
stackexchange/codereview
On OS X. $ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065) Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode) Here's my whole project: $ ll total 1072 -rw-r--r-- 1 ethan ethan 1316 Oct 19 17:17 BlackberryDataExtractor.class -rw-r--r-- 1 ethan...
stackexchange/codereview
I have some JScrollPanes on my hex editor and they're not showing up. Any idea why? import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.util.Vector; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; public class H...
stackexchange/codereview
I create separate Window, design it with XAML and when I invoke ShowDialog from main form it seems like my dialog (Window) blinks once and then shows itself. Is it a common behavior? I didn't notice that in while working with Windows Forms. I also ran application on another computer, and get the same thing. It bothers ...
stackexchange/codereview
I have folder which path is .com/yp/uploads and i have another folder .com/uploads I want to do htaccess rule like this: If .com/yp/uploads/abc.jpg(or another file extension) doesn't exists then show .com/uploads/abc.jpg Thank you.
stackexchange/codereview
My function will be called thousands of times. If i want to make it faster, will changing the local function variables to static be of any use? My logic behind this is that, because static variables are persistent between function calls, they are allocated only the first time, and thus, every subsequent call will not a...
stackexchange/codereview