I'm currently reading the boot.s file in the source for the first ever Linux kernel (assuming that 0.01 is indeed the first public release). I know C and ASM, the latter considerably less than the former. Even so, I seem to be able to understand and essentially grasp the code in the source files. This file has me confused though. I now realise that's because it's in real mode, not protected mode. Needless to say, I've never seen ASM code written in real mode before. Protected mode was the defacto mode x86 OSes ran on before I was even born, so it's to be expected. Here's a routine I want to co
I need to get from Mumbai to Hospet/Hampi in mid (to late) March and will probably book a bus but if something goes wrong and I'm not able to book it from outside of India, I'd like to know what other options are there? I've seen that there are only two trains a week that go from Mumbai to Hospet directly. Do you know of any connecting rides that I could take and what are my chances of getting a reserved or RAC ticket 3 days before the departure. Are there any other means of transport? How much would a cab ride cost (I am aware that I'd have to pay for return to Mumbai as well)? EDIT: Is it po
How many representable floats are there between 0.0 and 0.5? And how many representable floats are there between 0.5 and 1.0? I'm more interested in the math behind it, and I need the answer for floats and doubles.
NINJA EDIT: For some reason, the same code works now, without any problem at all. I don't know what happened, or why, but I no longer have this problem Here's the original post: To put simply, I created a MovieClip, put it with addChild() to stage, and when I tried to call this piece of code: MovieClip(root).someFunction(); It throws Error #1034: Type Coercion failed: cannot convert flash.display::Stage@4034f71 to flash.display.MovieClip. I really can't figure out why this piece of code won't work. The object itself works perfectly, as I can call functions within it (that line of code is actua
I want to get a list of applications and their output ports for some given list of applications, from my C program. I'm thinking of using something like ss -natp | awk '/firefox/ { split($4,array,":"); printf "%d ", array[2]} END{print ""}'' which gives me a list like 41477 59505. What's an efficient way of calling ss once and then getting such this for all the applications? (Multiple output pipes? Is there an optimal way to use awk for many matches? Catting ss to a file and then awk-ing many it many times?) Thanks!
I am looking to implement the opposite behaviour to the following question: CSS Push Div to bottom of page. I.e., when content overflows to the scrollbars, I would like the footer to be at the bottom of the page, like Stack Overflow. I have a div with id="footer" and the following CSS: #footer { position: absolute; bottom: 30px; width: 100%; } This moves the div to the bottom of the viewport - but the element stays there even when you scroll the page down, so it is no longer at the bottom. How can I make sure the div stays at the bottom of the page's contents even when the content overflows? I
I am following the example on this page: Example of 10-fold SVM classification in MATLAB Basically, I am following the example to execute my classification. The problem I face is that pred is always positive. It is not able to detect negative data. clear all; clc; load('C:\Users\HP\Documents\MATLAB\TrainLabel'); load('C:\Users\HP\Documents\MATLAB\TrainVec'); cvFolds = crossvalind('Kfold', TrainLabel, 10); cp = classperf(TrainLabel); for i = 1:10 testIdx = (cvFolds == i); trainIdx = ~testIdx; %Model = svmtrain(TrainVec(trainIdx,:), TrainLabel(trainIdx), 'showplot', true); Model = svmtrain(Train
I am following the example on this page : Example of 10-fold SVM classification in MATLAB. Basically, i am following the example to execute my classification. The problem i face is that pred is always postive. It is not able to detect negative data. clear all; clc; load('C:\Users\HP\Documents\MATLAB\TrainLabel'); load('C:\Users\HP\Documents\MATLAB\TrainVec'); cvFolds = crossvalind('Kfold', TrainLabel, 10); cp = classperf(TrainLabel); for i = 1:10 testIdx = (cvFolds == i); trainIdx = ~testIdx; % Model = svmtrain(TrainVec(trainIdx,:), TrainLabel(trainIdx),'showplot',true); Model = svmtrain(Train
I have a Wordpress website automatically that gets some information from a RSS feed, posts it and then, with the help of a built-in Wordpress function, sets a custom field for that post with a name and a value. The problem is that this custom field only gets set when someone visits the published post. So, I have to visit every single new post for the custom field to be applied or to wait a visitor to do so. I was looking forward to create a bot, web-crawler or spider that just visits all my new webpages once in an hour or whatever so the custom field gets automatically applied when the post is
I was just trying to make an installer. What is the best way to handle storing files in the exe file and then extracting them to the installation directory? For example, I have my installer.exe file, I want it to contain the following: Main executable file 3 x *.db files Upon selecting the install directory and clicking install, I wish for the contained files to be extracted to the chosen installation directory, however I can not find out how to store the files that I need extracting within the installer.
I am already able to run the examples in the LibSVM package. Now i need to carry out the ten-fold cross validation(MATLAB) on a data set. How do i go about doing it?
I have done some searching for this, but the mailing list posts I have found are associated with the person not specifying a random effect in nlme whereas I have done this. I also own the book Mixed Effect Models in S and S-Plus by Pinheiro and Bates, but can't work out my problem from the book. I'm still working on my nutrient data analysis, and have now shifted onto real data. The data come from a population survey, and feature a repeated measures design as each respondent has two 24-hour intake recalls for the nutrient. I have successfully fit a lme4 model to my data, and now I am trying to
I have a SVG that I am trying to center in a div. The div has a width of 900px. The SVG has a width of 400px. The SVG has its margin-left and margin-right set to auto. Doesn't work, it just acts as if the left margin is 0 (default). Does Anyone know what's the error?
I want to implement Facebook log-in (connect) into my website locally. I have looked at the documentation and I could not implement it myself. I have already created an App ID in Facebook. What should I change when I upload my website? I have tried this example: <html> <head> <title>My Facebook Login Page</title> </head> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'YOUR_APP_ID', status : true, cookie : true, xfbml : true, oauth : true, }); }; (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('s
If I have an object that compares equal to an element of a Python set, but is not the same object, is there a reasonable way to get a reference to the object in the set? The use case would be using the set to identify and share duplicated data. Example (Python 2.7): >>> a = "This is a string" >>> b = "This is a string" >>> a is b False >>> a == b True >>> s = set((a,)) >>> b in s True How to get a reference to a using b and s? I can think of one way, but I'm not sure if it is not implementation-dependent whether you get a or b. EDIT: This does not work when s has more than one element; interse
java.lang.OutOfMemoryError: Java heap space Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space I am getting this error my system RAM is 3GB and I have given -Xmx1280M. Still, I am getting this error. In some other machine with 2GB RAM and -Xmx1280M option, this error is not coming (Same operation). What can be the problem? I am using java VisualVM to track which objects are taking memory but heap which is generating at OOME is very big. It is taking very much time to load the heap and "Computing Retained Size" seems to be never ending. What should I do t
I'm trying to create a simple page with like button inside in my facebook app when i test my page on the facebook debugger, i got this messages: Missing Required Property: The og:url property is required, but not present. Missing Required Property: The og:type property is required, but not present. Missing Required Property: The og:title property is required, but not present. but i declared all the meta tags in my page, what am i missing? this is my page html: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>The
I've created Axis2 1.6 Webservice Client, I can make wsdl2java. But, when i run my program.. It shows this error?.. [INFO] Unable to sendViaPost to url[http://10.53.1.187:7782//rest/UVSInterface_Extend] org.apache.axis2.AxisFault: Transport error: 404 Error: /error/error404.jsp at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:310) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194) at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(Com
I have read some texts about strong collision resistance and weak collision resistance, but I was unable to understand the difference. The only thing I can understand is that there is a low probability of collision in hash functions which have weak collision resistance, and a higher probability of collision in strong collision resistance hash functions. I could not understand what the real thing is and what the significance of these parameters is. Can anyone help me on this?
I have been reading a LOT of google posts and StackOverflow questions about how to restore a database in SQL Server from a .bak file. But none of them states how to just READ the tables in the database-backup. (None that I could find anyway?) I just want to check out some old information which now has been deleted, without actually restoring the full database. Is this possible? . EDIT: I just wanted to post my T-SQL solution to the problem, so others may use it and I can go back and look it up ;) First I created a new database called backup_lookup and took it offline. After this I could restor
For example, I have some class .article, and I want to view this class as grid view. So I applied this style: .article{ width:100px; height:100px; background:#333; float:left; margin:5px; } That style will make the .article look tiled/grid. It's work fine with fixed height. But if I want to set the height to auto (automatically stretch according to the data within it), the grid look nasty. And I want to make the view like this:
I could get this XML file from C# class with XmlSerializer. <?xml version="1.0" encoding="utf-8"?> <Component xmlns:spirit="b" xmlns:chrec="a" MovieName="0" BlocksNotCovered="0"> <ClassInfoList> <chrec:string>hello</chrec:string> <chrec:string>world</chrec:string> </ClassInfoList> <moduleName /> <world> <x>10</x> <y>20</y> </world> </Component> How can I add prefix namespaces for chrec and spriti? For example, how can I get this XML file? <?xml version="1.0" encoding="utf-8"?> <spirit:Component xmlns:spirit="b" xmlns:chrec="a" MovieName="0" BlocksNotCovered="0"> <spirit:ClassInfoList> <chrec:s
A fair number of our "automate a group of installers" .bat files end with something like: :success ECHO Success! (as far as I can tell) ECHO. ECHO. ECHO Press any key to reboot... ECHO. ECHO. PAUSE >NUL shutdown -r EXIT /b If the prior commands have taken a while, there's a good chance the user has accidentally hit a key well before we reach the :success label. Since STDIN seems to be buffered, this will cause the PAUSE to be dismissed instantly. What I'd rather have is something like: GOBBLE_STDIN_SOMEHOW PAUSE >NUL shutdown -r How would I "flush" STDIN, consuming anything that was there, but
Environment: Windows server 2003, Spring 3.0, Tomcat 6 How can I reference a JNDI property inside a PropertyPlaceholderConfigurer? Specifically, I'm using JNDI to look up a java.lang.String that represents a path to a property file needed by my webapp <jee:jndi-lookup id="mypropsfile1" jndi-name="myPropsFile1" resource-ref="true"/> <jee:jndi-lookup id="mypropsfile2" jndi-name="myPropsFile2" resource-ref="true"/> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders" value="true"/> <property n
I am trying to access SQL DB that is located on my computer from an application that is located on a server (has IIS7). I set the ConnectionString in the WebConfig with the IP of my computer and I always get this error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) I wanted to enable remote connections a
While working on a production issue, I stumbled on something, that I thought was, strange in a SELECT statement in PB. Essentially, I have a simple SQL that selects into a Variable. I guess, the original developer (I am only maintaining this code) expected only one row in this case. .... // Date ld_CutOff .... SELECT TO_DATE(PARM_VALUE, 'DD-MON') INTO :ld_CutOff FROM SYSPARM WHERE PARM_NAME = 'CUTOFF_DATE' ; .... Now the table has more than 1 that match the criteria. Thus, the SQL errored (Select Returned more than 1 row) as expected. (Based on prior experience in PB and PL/SQL,) I expected th
I am using Selenium 2 Webdriver. I want to click on a link but the link text can be "Linktext" or "LINKTEXT". Is ther a better way than that: List<WebElement> list = driver.findElements(By.linkText("Linktext")); if(list.size()>0){ driver.findElement(By.linkText("Linktext")).click(); } else { driver.findElement(By.linkText("LINKTEXT")).click(); } API and google didnt really help me. Any ideas how to ignore upper case?
Why do certain random strings produce colors when entered as background colors in HTML? For example, bgcolor="chucknorris" produces a red background: <body bgcolor="chucknorris"> test </body> Conversely, bgcolor="chucknorr" produces a yellow background: <body bgcolor="chucknorr"> test </body> This holds true across various browsers and platforms. What’s going on here?