Daily Archives

Articles indexed Sunday April 8 2012

Page 10/14 | < Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >

  • How can I generate signed distance fields in real time, fast?

    - by heishe
    In a previous question, it was suggested that signed distance fields can be precomputed, loaded at runtime and then used from there. For reasons I will explain at the end of this question (for people interested), I need to create the distance fields in real time. There are some papers out there for different methods which are supposed to be viable in real-time environments, such as methods for Chamfer distance transforms and Voronoi diagram-approximation based transforms (as suggested in this presentation by the Pixeljunk Shooter dev guy), but I (and thus can be assumed a lot of other people) have a very hard time actually putting them to use, since they're usually long, largely bloated with math and not very algorithmic in their explanation. What algorithm would you suggest for creating the distance fields in real-time (favourably on the GPU) especially considering the resulting quality of the distance fields? Since I'm looking for an actual explanation/tutorial as opposed to a link to just another paper or slide, this question will receive a bounty once it's eligible for one :-). Here's why I need to do it in real time:

    Read the article

  • Locomotion-system with irregular IK

    - by htaunay
    Im having some trouble with locomtions (Unity3D asset) IK feet placement. I wouldn't call it "very bad", but it definitely isn't as smooth as the Locomotion System Examples. The strangest behavior (that is probably linked to the problem) are the rendered foot markers that "guess" where the characters next step will be. In the demo, they are smooth and stable. However, in my project, they keep flickering, as if Locomotion changed its "guess" every frame, and sometimes, the automatic defined step is too close to the previous step, or sometimes, too distant, creating a very irregular pattern. The configuration is (apparently)Identical to the human example in the demo, so I guessing the problem is my model and/or animation. Problem is, I can't figure out was it is =S Has anyone experienced the same problem? I uploaded a video of the bug to help interpreting the issue (excuse the HORRIBLE quality, I was in a hurry).

    Read the article

  • Automatically decorating every instance method in a class

    - by max
    I want to apply the same decorator to every method in a given class, other than those that start and end with __. It seems to me it should be doable using a class decorator. Are there any pitfalls to be aware of? Ideally, I'd also like to be able to: disable this mechanism for some methods by marking them with a special decorator enable this mechanism for subclasses as well enable this mechanism even for methods that are added to this class in runtime [Note: I'm using Python 3.2, so I'm fine if this relies on features added recently.] Here's my attempt: _methods_to_skip = {} def apply(decorator): def apply_decorator(cls): for method_name, method in get_all_instance_methods(cls): if (cls, method) in _methods_to_skip: continue if method_name[:2] == `__` and method_name[-2:] == `__`: continue cls.method_name = decorator(method) return apply_decorator def dont_decorate(method): _methods_to_skip.add((get_class_from_method(method), method)) return method Here are things I have problems with: how to implement get_all_instance_methods function not sure if my cls.method_name = decorator(method) line is correct how to do the same to any methods added to a class in runtime how to apply this to subclasses how to implement get_class_from_method

    Read the article

  • Passing.getText() String to another class

    - by DanMc
    I'm currently working on a first year university project and I have a problem, although I doubt it's a very complicated one, but I've been searching and I just can't find a suitable answer to it. The problem concerns two classes. A gui class (class1) and another class (class2). I have a JTextField in class1 and am trying to pass through the .getText() value to class2 and store it in a String type variable. The current code I'm trying to achieve this with is the following: (Class1) private JTextField textField = new JTextField("Something"); ... public String getTextFieldString() { return textField.getText(); } (Class2) private c1 Class1 = new Class1(); private String s = new String(); ... s = c1.getTextFieldString(); I'm pretty new to coding, I've read that maybe I need to pass through an argument somewhere and I assume that's because textField is not static in itself, it changes when somebody enters a new value. (sorry for stating the obvious there.) Anyway, help is appreciated. Thanks a lot!

    Read the article

  • Using macro to check null values

    - by poliron
    My C code contains many functions with pointers to different structs as parameters which shouldn't be NULL pointers. To make my code more readable, I decided to replace this code: if(arg1==NULL || arg2==NULL || arg3==NULL...) { return SOME_ERROR; } With that macro: NULL_CHECK(arg1,arg2,...) How should I write it, if the number of args is unknown and they can point to different structs?(I work in C99)

    Read the article

  • Multimedia content in REST responce(XML/JSON)

    - by Koushik
    In my thesis I need to test different architectures. A request to a REST web service developed using Apache CXF and Spring MVC with MySQL as back end serving references(a field in database) to images,audio and video files stored in file system. In the response message, what is the best method to send the content to the client(another application using the service which I developed). URI: http://www.filmservices.com/film/{id} A client here is not the end user. Send the encoded hyperlink's(where the content is stored in the file system) to the client, so that the client renders the response and displays it to the browser. Use Base64 to encode the message(image,audio,video) and send it to the client. Main concern is performance.

    Read the article

  • Android: how to make two TextViews placed in different lines if there is no enough space in one line

    - by bluebyte
    I'am trying to organize two TextViews to behave like that: So, if there is enough space for both TextViews in line, android should place them in line. If there is no enough space, the second TextView must be placed on a next line with right alignment. <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:id="@+id/takeoffCity" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/flightItem" /> <TextView android:id="@+id/landingCity" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/flightItem" /> </LinearLayout> <style name="flightItem" parent="@android:style/TextAppearance"> <item name="android:textSize">14dip</item> <item name="android:textColor">@color/flightItemFont</item> <item name="android:scrollHorizontally">true</item> <item name="android:textStyle">bold</item> </style>

    Read the article

  • Which is faster: creating a detailed mesh before execution or tessellating?

    - by Nick Udell
    For simplicity of the problem let's consider spheres. Let's say I have a sphere, and before execution I know the radius, the position and the triangle count. Let's also say the triangle count is sufficiently large (e.g. ~50k triangles). Would it be faster generally to create this sphere mesh before hand and stream all 50k triangles to the graphics card, or would it be faster to send a single point (representing the centre of the sphere) and use tessellation and geometry shaders to build the sphere on the GPU? Would it still be faster if I had 100 of these spheres in different positions? Can I use hull/geometry shaders to create something which I can then combine with instancing?

    Read the article

  • Powershell: error handling with try and catch

    - by resolver101
    I'm writing a script and want to control the errors. However im having trouble finding information on error handling using the try, catch. I want to catch the specific error (shown below) and then perform some actions and resume the code. What code is needed for this? This is the code i am running and im entering in a invalid username when prompted. Get-WMIObject Win32_Service -ComputerName localhost -Credential (Get-Credential) Get-WmiObject : User credentials cannot be used for local connections At C:\Users\alex.kelly\AppData\Local\Temp\a3f819b4-4321-4743-acb5-0183dff88462.ps1:2 char:16 + Get-WMIObject <<<< Win32_Service -ComputerName localhost -Credential (Get-Credential) + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

    Read the article

  • Random walk- Brownian Motion

    - by Sam
    I've been assigned the project of creating a simple console app. that models brownian motion in a 2D plane. I wasn't given much information on how to do so (and I'm hoping that it's a pretty popular assignment so that I could get some insight) just that it relies on random number generation. I researched brownian motion for a little bit and saw some formulas that looked complicated, but by the description is just seems to have to move randomly within a certain number interval. Can anyone clarify? Am I to create a program that continually creates a random number in an interval and then modify the particles "x" and "y" coordinate or is there more to it? Thanks for any help.

    Read the article

  • input file cannot be found

    - by Eric Smith
    I am just messing around with reading input files with java until I got stumped at the most basic of steps... finding the input file! The input.txt file is in the same directory as my class file that is calling it yet eclipse still gives me an error that it cant be found: "Exception in thread "main" java.lang.Error: Unresolved compilation problem: Unhandled exception type FileNotFoundException" My code: package pa; import java.util.Scanner; public class Project { public static void main(String[] args) { java.io.File file = new java.io.File("input.txt"); System.out.println(file.getAbsolutePath()); Scanner input = new Scanner(file); } } input.txt is in the same package, same folder and everything. I'm confused :(

    Read the article

  • Java reflection for generics

    - by Vijay Bhore
    I am using Java Reflection to expose methods in custom eclipse tool. I am writing method getReturnType which accepts java.lang.reflect.Method as input and returns object of Class private static Class<?> getReturnType(Method method) { Type type = ((ParameterizedType)method.getGenericReturnType()).getRawType(); return getClass(type); } This code compiles well but at runtime i get the below exception while casting Type to ParameterizedType. java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType Please suggest. Thanks!

    Read the article

  • what's the "best" approach to creating the UI of an audio plugin that will be both audio unit and VST for OS X and Windows?

    - by SaldaVonSchwartz
    I'm working on a couple audio plugins. Right now, they are audio units. And while the "DSP" code won't change for the most part between implementations / ports, I'm not sure how to go about the GUI. For instance, I was looking at the Apple-supplied AUs in Lion. Does anyone know how did they go about the UI? Like, are the knobs and controls just subclasses of Cocoa controls? are they using some separate framework or coding these knobs and such from scratch? And then, the plugs I'm working on are going to be available too as VSTs for Windows. I already have them up and running with generic interfaces. But I'm wondering if I should just get over it and recreate all my interfaces with the vstgui code provided by Steinberg or if there's a more practical approach to making the interfaces cross-platform.

    Read the article

  • Pass through touches to portion of UIWebView

    - by cannyboy
    I have a UIWebView. Using something like this: http://blog.evandavey.com/2009/02/how-to-make-uiwebview-transparent.html .. I have made the UIWebView transparent. I now need to be able to pass though touches on the webview to the view below, but only on a rectangular portion of the web view. So, imagine the webview is a square, and it has a square area in the centre which must pass-thru touches to the view below. Is there a way to do this?

    Read the article

  • Getting started with JUCE for Android

    - by steveha
    I need to start building an Android app that uses the JUCE libraries. I'm reading the web site and trying to figure stuff out. I tried installing JUCE on an Ubuntu 11.04 system, and when I built the IntroJucer app, the menus don't work right (they flash open when I click with the mouse but then disappear). Can a JUCE app for Android be built on Mac OS X, or even Windows? If you are using JUCE to build Android apps, please give me any advice you can.

    Read the article

  • How do I make my MySQL query with joins more concise?

    - by John Hoffman
    I have a huge MySQL query that depends on JOINs. SELECT m.id, l.name as location, CONCAT(u.firstName, " ", u.lastName) AS matchee, u.email AS mEmail, u.description AS description, m.time AS meetingTime FROM matches AS m LEFT JOIN locations AS l ON locationID=l.id LEFT JOIN users AS u ON (u.id=m.user1ID) WHERE m.user2ID=2 UNION SELECT m.id, l.name as location, CONCAT(u.firstName, " ", u.lastName) AS matchee, u.email AS mEmail, u.description AS description, m.time AS meetingTime FROM matches AS m LEFT JOIN locations AS l ON locationID=l.id LEFT JOIN users AS u ON (u.id=m.user2ID) WHERE m.user1ID=2 The first 3 lines of each sub-statement divided by UNION are identical. How can I abide by the DRY principle, not repeat those three lines, and make this query more concise?

    Read the article

  • d3: Coloring Multiple Lines from Nested Data

    - by diet_coke
    I'm currently assembling some line graphs with circles at the datapoints from arrays of JSON objects formatted like so: var data = [{ "name": "metric1", "datapoints": [ [10.0, 1333519140], [48.0, 1333519200] ] }, { "name": "metric2", "datapoints": [ [48.0, 1333519200], [12.0, 1333519260] ] }] I want to have a color for each metric, so I'm trying to color them based on the index of the object within the array data. The code I have currently for just placing the circles looks like: // We bind an svg group to each metric. var metric_groups = this.vis.selectAll("g.metric_group") .data(data).enter() .append("g") .attr("class", "metric_group"); // Then bind a circle for each datapoint. var circles = metric_groups.selectAll("circle") .data(function(d) { return d.datapoints; }); circles.enter().append("circle") .attr("r", 3.5); Now if I change that last bit to something like: circles.enter().append("circle") .attr("r", 3.5); .style("fill", function(d,i) { return i%2 ? "red" : "blue"; } I get alternating red and blue circles, as could be expected. Taking some advice from Nested Selections : 'Nesting and Index', I tried: circles.enter().append("circle") .attr("r", 3.5); .style("fill", function(d,i,j) { return j%2 ? "red" : "blue"; } Which doesn't work (j is undefined), presumably because we are in the named property datapoints, rather than an array element. How might I go about doing the coloring that I want without changing my data structure? Thanks!

    Read the article

  • Java output file doesnt recognise \n as linebreak

    - by oderebek
    for a Java project for a University Class I have a method that saves ASCII images as a uniline string and another method called toString rebuilds this ASCII image and returns as a string. When I run my program on the Eclipse my output looks on console alright and multiline, and there are line breaks where they should be. But when I run it with the command line with a redirected outputfile java myprogram < input output the text in the output is uniline without line breaks Here is the code of the method public String toString(){ String output = ""; for(int i=0; i<height; i++){ output=output+image.substring(i*width, i*width+width)+"\n"; } return output; } What should I do so I can get a multiline output text file

    Read the article

  • Heroku "We're sorry, but something went wrong." due to javascript_include_tag

    - by Newton
    Uploading my ruby on rails app to heroku causes the following error: We're sorry, but something went wrong. This does not occur on my local machine. After some debugging, I think I may have spotted the error, but do not know how to fix it. In my file application.html.erb, removing the following line solves the problem, but then my app loses its jquery mobile theme. Any ideas what I could do to fix the problem? Line causing the problem: <%= javascript_include_tag "application" %> application.html.erb file: <!DOCTYPE html> <html> <head> <title>Washapp</title> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /> <%= javascript_include_tag "application" %> <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script> <%= csrf_meta_tags %> <script> if (window.location.hash == "#_=_") window.location.hash = ""; </script> </head> <body> <div data-role="page"> <%= yield %> </div> </body> </html>

    Read the article

  • PHP output results on to one page

    - by linda
    i have a system where a user searches for a film and reviews appear on a page with a button next to each review. The button can be selected to look at the individual review but i basically want a button that when selected it will look at all reviews on one page, the code i am using for the individual review is this <?php ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); $searchfilm=$_POST['searchfilm']; //Connect to database //Filter search $searchfilm = strtoupper($searchfilm); $searchfilm = strip_tags($searchfilm); $searchfilm = trim ($searchfilm); $query = mysql_fetch_assoc(mysql_query("SELECT filmreview FROM review WHERE id = '$id'")); $data = mysql_query("SELECT film.filmname, review.filmreview, review.reviewtitle, review.id FROM film, review WHERE film.filmid = review.filmid AND filmname = '$searchfilm'"); while($row = mysql_fetch_assoc($data)) { // echo $row['filmname']; // echo "<b>Film Name:</b> " .$searchfilm; echo "<table border=\"2\" align=\"left\">"; echo "<tr><td>"; echo "<b>Review Title:</b> " .$row['reviewtitle']; echo "<tr><td>"; echo $row['filmreview']; echo "<p>"; echo "<form method='post' action='analyse1.php'>"; echo "<input type='hidden' name='reviewid' value='".$row['id']."'>"; echo "<input type='submit' name='submit' value='Analyse'>"; echo "</form>"; echo "</table>"; } ?>

    Read the article

  • what are the most essential bundles in symfony2?

    - by user
    this question but i hope it does not, i'll try my best to make clarify it I'm new to symfony2 but not to php, as far as i know, everything in symfony2 is bundles. Being a django guy, i know that the essential apps are: south Django-Debug-Toolbar Haystack Search Django Admin Tools (maybe) fabric the registration and user profile app (unless you decide to use django-userena) Piston I'm not going to make a longer list, you get the point. I know 2 essential apps for symfony2 so far the admin generator and FOSUserBundle. So what are other must have bundles?

    Read the article

  • Which method of adding items to the ASP.NET Dictionary class is more efficient?

    - by ahmd0
    I'm converting a comma separated list of strings into a dictionary using C# in ASP.NET (by omitting any duplicates): string str = "1,2, 4, 2, 4, item 3,item2, item 3"; //Just a random string for the sake of this example and I was wondering which method is more efficient? 1 - Using try/catch block: Dictionary<string, string> dic = new Dictionary<string, string>(); string[] strs = str.Split(','); foreach (string s in strs) { if (!string.IsNullOrWhiteSpace(s)) { try { string s2 = s.Trim(); dic.Add(s2, s2); } catch { } } } 2 - Or using ContainsKey() method: string[] strs = str.Split(','); foreach (string s in strs) { if (!string.IsNullOrWhiteSpace(s)) { string s2 = s.Trim(); if (!dic.ContainsKey(s2)) dic.Add(s2, s2); } }

    Read the article

  • undefined reference to function, despite giving reference in c

    - by Jamie Edwards
    I'm following a tutorial, but when it comes to compiling and linking the code I get the following error: /tmp/cc8gRrVZ.o: In function `main': main.c:(.text+0xa): undefined reference to `monitor_clear' main.c:(.text+0x16): undefined reference to `monitor_write' collect2: ld returned 1 exit status make: *** [obj/main.o] Error 1 What that is telling me is that I haven't defined both 'monitor_clear' and 'monitor_write'. But I have, in both the header and source files. They are as follows: monitor.c: // monitor.c -- Defines functions for writing to the monitor. // heavily based on Bran's kernel development tutorials, // but rewritten for JamesM's kernel tutorials. #include "monitor.h" // The VGA framebuffer starts at 0xB8000. u16int *video_memory = (u16int *)0xB8000; // Stores the cursor position. u8int cursor_x = 0; u8int cursor_y = 0; // Updates the hardware cursor. static void move_cursor() { // The screen is 80 characters wide... u16int cursorLocation = cursor_y * 80 + cursor_x; outb(0x3D4, 14); // Tell the VGA board we are setting the high cursor byte. outb(0x3D5, cursorLocation >> 8); // Send the high cursor byte. outb(0x3D4, 15); // Tell the VGA board we are setting the low cursor byte. outb(0x3D5, cursorLocation); // Send the low cursor byte. } // Scrolls the text on the screen up by one line. static void scroll() { // Get a space character with the default colour attributes. u8int attributeByte = (0 /*black*/ << 4) | (15 /*white*/ & 0x0F); u16int blank = 0x20 /* space */ | (attributeByte << 8); // Row 25 is the end, this means we need to scroll up if(cursor_y >= 25) { // Move the current text chunk that makes up the screen // back in the buffer by a line int i; for (i = 0*80; i < 24*80; i++) { video_memory[i] = video_memory[i+80]; } // The last line should now be blank. Do this by writing // 80 spaces to it. for (i = 24*80; i < 25*80; i++) { video_memory[i] = blank; } // The cursor should now be on the last line. cursor_y = 24; } } // Writes a single character out to the screen. void monitor_put(char c) { // The background colour is black (0), the foreground is white (15). u8int backColour = 0; u8int foreColour = 15; // The attribute byte is made up of two nibbles - the lower being the // foreground colour, and the upper the background colour. u8int attributeByte = (backColour << 4) | (foreColour & 0x0F); // The attribute byte is the top 8 bits of the word we have to send to the // VGA board. u16int attribute = attributeByte << 8; u16int *location; // Handle a backspace, by moving the cursor back one space if (c == 0x08 && cursor_x) { cursor_x--; } // Handle a tab by increasing the cursor's X, but only to a point // where it is divisible by 8. else if (c == 0x09) { cursor_x = (cursor_x+8) & ~(8-1); } // Handle carriage return else if (c == '\r') { cursor_x = 0; } // Handle newline by moving cursor back to left and increasing the row else if (c == '\n') { cursor_x = 0; cursor_y++; } // Handle any other printable character. else if(c >= ' ') { location = video_memory + (cursor_y*80 + cursor_x); *location = c | attribute; cursor_x++; } // Check if we need to insert a new line because we have reached the end // of the screen. if (cursor_x >= 80) { cursor_x = 0; cursor_y ++; } // Scroll the screen if needed. scroll(); // Move the hardware cursor. move_cursor(); } // Clears the screen, by copying lots of spaces to the framebuffer. void monitor_clear() { // Make an attribute byte for the default colours u8int attributeByte = (0 /*black*/ << 4) | (15 /*white*/ & 0x0F); u16int blank = 0x20 /* space */ | (attributeByte << 8); int i; for (i = 0; i < 80*25; i++) { video_memory[i] = blank; } // Move the hardware cursor back to the start. cursor_x = 0; cursor_y = 0; move_cursor(); } // Outputs a null-terminated ASCII string to the monitor. void monitor_write(char *c) { int i = 0; while (c[i]) { monitor_put(c[i++]); } } void monitor_write_hex(u32int n) { s32int tmp; monitor_write("0x"); char noZeroes = 1; int i; for (i = 28; i > 0; i -= 4) { tmp = (n >> i) & 0xF; if (tmp == 0 && noZeroes != 0) { continue; } if (tmp >= 0xA) { noZeroes = 0; monitor_put (tmp-0xA+'a' ); } else { noZeroes = 0; monitor_put( tmp+'0' ); } } tmp = n & 0xF; if (tmp >= 0xA) { monitor_put (tmp-0xA+'a'); } else { monitor_put (tmp+'0'); } } void monitor_write_dec(u32int n) { if (n == 0) { monitor_put('0'); return; } s32int acc = n; char c[32]; int i = 0; while (acc > 0) { c[i] = '0' + acc%10; acc /= 10; i++; } c[i] = 0; char c2[32]; c2[i--] = 0; int j = 0; while(i >= 0) { c2[i--] = c[j++]; } monitor_write(c2); } monitor.h: // monitor.h -- Defines the interface for monitor.h // From JamesM's kernel development tutorials. #ifndef MONITOR_H #define MONITOR_H #include "common.h" // Write a single character out to the screen. void monitor_put(char c); // Clear the screen to all black. void monitor_clear(); // Output a null-terminated ASCII string to the monitor. void monitor_write(char *c); #endif // MONITOR_H common.c: // common.c -- Defines some global functions. // From JamesM's kernel development tutorials. #include "common.h" // Write a byte out to the specified port. void outb ( u16int port, u8int value ) { asm volatile ( "outb %1, %0" : : "dN" ( port ), "a" ( value ) ); } u8int inb ( u16int port ) { u8int ret; asm volatile ( "inb %1, %0" : "=a" ( ret ) : "dN" ( port ) ); return ret; } u16int inw ( u16int port ) { u16int ret; asm volatile ( "inw %1, %0" : "=a" ( ret ) : "dN" ( port ) ); return ret; } // Copy len bytes from src to dest. void memcpy(u8int *dest, const u8int *src, u32int len) { const u8int *sp = ( const u8int * ) src; u8int *dp = ( u8int * ) dest; for ( ; len != 0; len-- ) *dp++ =*sp++; } // Write len copies of val into dest. void memset(u8int *dest, u8int val, u32int len) { u8int *temp = ( u8int * ) dest; for ( ; len != 0; len-- ) *temp++ = val; } // Compare two strings. Should return -1 if // str1 < str2, 0 if they are equal or 1 otherwise. int strcmp(char *str1, char *str2) { int i = 0; int failed = 0; while ( str1[i] != '\0' && str2[i] != '\0' ) { if ( str1[i] != str2[i] ) { failed = 1; break; } i++; } // Why did the loop exit? if ( ( str1[i] == '\0' && str2[i] != '\0' || (str1[i] != '\0' && str2[i] =='\0' ) ) failed =1; return failed; } // Copy the NULL-terminated string src into dest, and // return dest. char *strcpy(char *dest, const char *src) { do { *dest++ = *src++; } while ( *src != 0 ); } // Concatenate the NULL-terminated string src onto // the end of dest, and return dest. char *strcat(char *dest, const char *src) { while ( *dest != 0 ) { *dest = *dest++; } do { *dest++ = *src++; } while ( *src != 0 ); return dest; } common.h: // common.h -- Defines typedefs and some global functions. // From JamesM's kernel development tutorials. #ifndef COMMON_H #define COMMON_H // Some nice typedefs, to standardise sizes across platforms. // These typedefs are written for 32-bit x86. typedef unsigned int u32int; typedef int s32int; typedef unsigned short u16int; typedef short s16int; typedef unsigned char u8int; typedef char s8int; void outb ( u16int port, u8int value ); u8int inb ( u16int port ); u16int inw ( u16int port ); #endif //COMMON_H main.c: // main.c -- Defines the C-code kernel entry point, calls initialisation routines. // Made for JamesM's tutorials <www.jamesmolloy.co.uk> #include "monitor.h" int main(struct multiboot *mboot_ptr) { monitor_clear(); monitor_write ( "hello, world!" ); return 0; } here is my makefile: C_SOURCES= main.c monitor.c common.c S_SOURCES= boot.s C_OBJECTS=$(patsubst %.c, obj/%.o, $(C_SOURCES)) S_OBJECTS=$(patsubst %.s, obj/%.o, $(S_SOURCES)) CFLAGS=-nostdlib -nostdinc -fno-builtin -fno-stack-protector -m32 -Iheaders LDFLAGS=-Tlink.ld -melf_i386 --oformat=elf32-i386 ASFLAGS=-felf all: kern/kernel .PHONY: clean clean: -rm -f kern/kernel kern/kernel: $(S_OBJECTS) $(C_OBJECTS) ld $(LDFLAGS) -o $@ $^ $(C_OBJECTS): obj/%.o : %.c gcc $(CFLAGS) $< -o $@ vpath %.c source $(S_OBJECTS): obj/%.o : %.s nasm $(ASFLAGS) $< -o $@ vpath %.s asem Hopefully this will help you understand what is going wrong and how to fix it :L Thanks in advance. Jamie.

    Read the article

  • Creating dynamic breadcrumb in asp.net mvc with mvcsitemap provider

    - by Jalpesh P. Vadgama
    I have done lots breadcrumb kind of things in normal asp.net web forms I was looking for same for asp.net mvc. After searching on internet I have found one great nuget package for mvpsite map provider which can be easily implemented via site map provider. So let’s check how its works. I have create a new MVC 3 web application called breadcrumb and now I am adding a reference of site map provider via nuget package like following. You can find more information about MVC sitemap provider on following URL. https://github.com/maartenba/MvcSiteMapProvid So once you add site map provider. You will find a Mvc.SiteMap file like following. And following is content of that file. <?xml version="1.0" encoding="utf-8" ?> <mvcSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0" xsi:schemaLocation="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0 MvcSiteMapSchema.xsd" enableLocalization="true"> <mvcSiteMapNode title="Home" controller="Home" action="Index"> <mvcSiteMapNode title="About" controller="Home" action="About"/> </mvcSiteMapNode> </mvcSiteMap> So now we have added site map so now its time to make breadcrumb dynamic. So as we all know that with in the standard asp.net mvc template we have action link by default for Home and About like following. <div id="menucontainer"> <ul id="menu"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> </ul> </div> Now I want to replace that with our sitemap provider and make it dynamic so I have added the following code. <div id="menucontainer"> @Html.MvcSiteMap().Menu(true) </div> That’s it. This is the magic code @Html.MvcSiteMap will dynamically create breadcrumb for you. Now let’s run this in browser. You can see that it has created breadcrumb dynamically without writing any action link code. So here you can see with MvcSiteMap provider we don’t have to write any code we just need to add menu syntax and rest it will do automatically. That’s it. Hope you liked it. Stay tuned for more till then happy programming.

    Read the article

  • Visual Studio Ultimate RoadMap

    - by TATWORTH
    At http://blogs.msdn.com/b/jasonz/archive/2012/03/27/visual-studio-ultimate-roadmap.aspx, Jason Zander has discussed the roadmap for Visual Studio 11 Ultimate. There are great advantages to Ultimate, if it is available to you, use it.At http://msdn.microsoft.com/en-us/library/ff636699.aspx, there is a list of feature packs for Visual Studio 10. Well worth a look if you have Visual Studio 10 Professional or Ultimate.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >