Search Results

Search found 1894 results on 76 pages for 'phil factor'.

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

  • Function keys on Dell laptop work double as OEM keys

    - by Factor Mystic
    I'm working with a new Dell Studio 1555, and the F1-F12 keys at the top of the keyboard are dual function with OEM keys such as volume and screen brightness. The problem is, is that the OEM keys are the default, and you have to press the Fn key to get the F- key to work. For example, this means you have to hit Alt+Fn+F4 to close a window, instead of the regular Alt+F4. This is really annoying. Is there a way to reverse the default functions of the F- keys in Windows? Ideally this is possible without some kind of third party hotkey manager.

    Read the article

  • Screenshot utilities for Windows

    - by Factor Mystic
    What are some good screenshot programs for Windows, preferably free? Obviously I know I can hit the Print Screen key and paste that into Paint and save it, but I'm looking for something that makes it simple. Bonus points if it can automatically upload to an image host.

    Read the article

  • Flex/bison, error: undeclared

    - by Imran
    hallo, i have a problem, the followed program gives back an error, error:: Undeclared(first use in function), why this error appears all tokens are declared, but this error comes, can anyone help me, here are the lex and yac files.thanks lex: %{ int yylinenu= 1; int yycolno= 1; %} %x STR DIGIT [0-9] ALPHA [a-zA-Z] ID {ALPHA}(_?({ALPHA}|{DIGIT}))*_? GROUPED_NUMBER ({DIGIT}{1,3})(\.{DIGIT}{3})* SIMPLE_NUMBER {DIGIT}+ NUMMER {GROUPED_NUMBER}|{SIMPLE_NUMBER} %% <INITIAL>{ [\n] {++yylinenu ; yycolno=1;} [ ]+ {yycolno=yycolno+yyleng;} [\t]+ {yycolno=yycolno+(yyleng*8);} "*" {return MAL;} "+" {return PLUS;} "-" {return MINUS;} "/" {return SLASH;} "(" {return LINKEKLAMMER;} ")" {return RECHTEKLAMMER;} "{" {return LINKEGESCHWEIFTEKLAMMER;} "}" {return RECHTEGESCHEIFTEKLAMMER;} "=" {return GLEICH;} "==" {return GLEICHVERGLEICH;} "!=" {return UNGLEICH;} "<" {return KLEINER;} ">" {return GROSSER;} "<=" {return KLEINERGLEICH;} ">=" {return GROSSERGLEICH;} "while" {return WHILE;} "if" {return IF;} "else" {return ELSE;} "printf" {return PRINTF;} ";" {return SEMIKOLON;} \/\/[^\n]* { ;} {NUMMER} {return NUMBER;} {ID} {return IDENTIFIER;} \" {BEGIN(STR);} . {;} } <STR>{ \n {++yylinenu ;yycolno=1;} ([^\"\\]|"\\t"|"\\n"|"\\r"|"\\b"|"\\\"")+ {return STRING;} \" {BEGIN(INITIAL);} } %% yywrap() { } YACC: %{ #include stdio.h> #include string.h> #include "lex.yy.c" void yyerror(char *err); int error=0,linecnt=1; %} %token IDENTIFIER NUMBER STRING COMMENT PLUS MINUS MAL SLASH LINKEKLAMMER RECHTEKLAMMER LINKEGESCHWEIFTEKLAMMER RECHTEGESCHEIFTEKLAMMER GLEICH GLEICHVERGLEICH UNGLEICH GROSSER KLEINER GROSSERGLEICH KLEINERGLEICH IF ELSE WHILE PRINTF SEMIKOLON %start Stmts %% Stmts : Stmt {puts("\t\tStmts : Stmt");} |Stmt Stmts {puts("\t\tStmts : Stmt Stmts");} ; //NEUE REGEL---------------------------------------------- Stmt : LINKEGESCHWEIFTEKLAMMER Stmts RECHTEGESCHEIFTEKLAMMER {puts("\t\tStmt : '{' Stmts '}'");} |IF LINKEKLAMMER Cond RECHTEKLAMMER Stmt {puts("\t\tStmt : '(' Cond ')' Stmt");} |IF LINKEKLAMMER Cond RECHTEKLAMMER Stmt ELSE Stmt {puts("\t\tStmt : '(' Cond ')' Stmt 'ELSE' Stmt");} |WHILE LINKEKLAMMER Cond RECHTEKLAMMER Stmt {puts("\t\tStmt : 'PRINTF' Expr ';'");} |PRINTF Expr SEMIKOLON {puts("\t\tStmt : 'PRINTF' Expr ';'");} |IDENTIFIER GLEICH Expr SEMIKOLON {puts("\t\tStmt : 'IDENTIFIER' '=' Expr ';'");} |SEMIKOLON {puts("\t\tStmt : ';'");} ;//NEUE REGEL --------------------------------------------- Cond: Expr GLEICHVERGLEICH Expr {puts("\t\tCond : '==' Expr");} |Expr UNGLEICH Expr {puts("\t\tCond : '!=' Expr");} |Expr KLEINER Expr {puts("\t\tCond : '<' Expr");} |Expr KLEINERGLEICH Expr {puts("\t\tCond : '<=' Expr");} |Expr GROSSER Expr {puts("\t\tCond : '>' Expr");} |Expr GROSSERGLEICH Expr {puts("\t\tCond : '>=' Expr");} ;//NEUE REGEL -------------------------------------------- Expr:Term {puts("\t\tExpr : Term");} |Term PLUS Expr {puts("\t\tExpr : Term '+' Expr");} |Term MINUS Expr {puts("\t\tExpr : Term '-' Expr");} ;//NEUE REGEL -------------------------------------------- Term:Factor {puts("\t\tTerm : Factor");} |Factor MAL Term {puts("\t\tTerm : Factor '*' Term");} |Factor SLASH Term {puts("\t\tTerm : Factor '/' Term");} ;//NEUE REGEL -------------------------------------------- Factor:SimpleExpr {puts("\t\tFactor : SimpleExpr");} |MINUS SimpleExpr {puts("\t\tFactor : '-' SimpleExpr");} ;//NEUE REGEL -------------------------------------------- SimpleExpr:LINKEKLAMMER Expr RECHTEKLAMMER {puts("\t\tSimpleExpr : '(' Expr ')'");} |IDENTIFIER {puts("\t\tSimpleExpr : 'IDENTIFIER'");} |NUMBER {puts("\t\tSimpleExpr : 'NUMBER'");} |STRING {puts("\t\tSimpleExpr : 'String'");} ;//ENDE ------------------------------------------------- %% void yyerror(char *msg) { error=1; printf("Line: %d , Column: %d : %s \n", yylinenu, yycolno,yytext, msg); } int main(int argc, char *argv[]) { int val; while(yylex()) { printf("\n",yytext); } return yyparse(); }

    Read the article

  • Silverlight Cream for April 02, 2010 -- #828

    - by Dave Campbell
    In this Issue: Phil Middlemiss, Robert Kozak, Kathleen Dollard, Avi Pilosof, Nokola, Jeff Wilcox, David Anson, Timmy Kokke, Tim Greenfield, and Josh Smith. Shoutout: SmartyP has additional info up on his WP7 Pivot app: Preview of My Current Windows Phone 7 Pivot Work From SilverlightCream.com: A Chrome and Glass Theme - Part I Phil Middlemiss is starting a tutorial series on building a new theme for Silverlight, in this first one we define some gradients and color resources... good stuff Phil Intercepting INotifyPropertyChanged This is Robert Kozak's first post on this blog, but it's a good one about INotifyPropertyChanged and MVVM and has a solution in the post with lots of code and discussion. How do I Display Data of Complex Bound Criteria in Horizontal Lists in Silverlight? Kathleen Dollard's latest article in Visual Studio magazine is in answer to a question about displaying a list of complex bound criteria including data, child data, and photos, and displaying them horizontally one at a time. Very nice-looking result, and all the code. Windows Phone: Frame/Page navigation and transitions using the TransitioningContentControl Avi Pilosof discusses the built-in (boring) navigation on WP7, and then shows using the TransitionContentControl from the Toolkit to apply transitions to the navigation. EasyPainter: Cloud Turbulence and Particle Buzz Nokola returns with a couple more effects for EasyPainter: Cloud Turbulence and Particle Buzz ... check out the example screenshots, then go grab the code. Property change notifications for multithreaded Silverlight applications Jeff Wilcox is discussing the need for getting change notifications to always happen on the UI thread in multi-threaded apps... great diagrams to see what's going on. Tip: The default value of a DependencyProperty is shared by all instances of the class that registers it David Anson has a tip up about setting the default value of a DependencyProperty, and the consequence that may have depending upon the type. Building a “real” extension for Expression Blend Timmy Kokke's code is WPF, but the subject is near and dear to us all, Timmy has a real-world Expression Blend extension up... a search for controls in the Objects and Timelines pane ... and even if that doesn't interest you... it's the source to a Blend extension! XPath support in Silverlight 4 + XPathPad Tim Greenfield not only talks about XPath in SL4RC, but he has produced a tool, XPathPad, and provided the source... if you've used XPath, you either are a higher thinker than me(not a big stretch), or you need this :) Using a Service Locator to Work with MessageBoxes in an MVVM Application Josh Smith posted about a question that comes up a lot: showing a messagebox from a ViewModel object. This might not work for custom message boxes or unit testing. This post covers the Unit Testing aspect. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Silverlight Cream for June 15, 2010 -- #882

    - by Dave Campbell
    In this Issue: Colin Eberhardt Zoltan Arvai, Marcel du Preez, Mark Tucker, John Papa, Phil Middlemiss, Andy Beaulieu, and Chad Campbell. From SilverlightCream.com: Throttling Silverlight Mouse Events to Keep the UI Responsive Colin Eberhardt sent me this link to his latest at Scott Logic... about how to throttle Silverlight -- no not that, you'd have to go to one of the *other* blogs for that :) ... this is throttling the mouse, particularly the mouse wheel to keep the UI from freezing up ... check out the demos, you'll want to read the code Data Driven Applications with MVVM Part I: The Basics Zoltan Arvai started a series of tutorials on Data-Driven Applications with MVVM at SilverlightShow... this is number 1, and it looks like it's going to be a good series to read. Red-To-Green scale using an IValueConverter Marcel du Preez has an interesting post up at SilverlightShow using an IValueConverter to do a red/yellow/green progress bar ... this is pretty cool. Infragistics XamWebOutlookBar & Caliburn With assistance from Rob Eisenburg, Mark Tucker was able to build a Caliburn sample including the Infragistics XamWebOutlookBar, and he's sharing his experience (and code) with all of us. Printing Tip – Handling User Initiated Dialogs Exceptions John Papa responded to a common printing problem by writing it up in his blog. Note this problem quite often appears during debug, so check it out... John also has a quick tip on an update to the PrintAPI in Silverlight 4. Automatic Rectangle Radius X and Y Phil Middlemiss has another great Blend post up -- this one on rounding off buttons... they look great to me, but he's looking for advice -- how about that Phil? They look great to me :) WP7 Back Button in Games Planning on selling 'stuff' in the Windows Phone Marketplace? Are you familiar with the required use of the Back Button? How about in a game? ... Andy Beaulieu discusses all this and has some code you'll want to use. Windows Phone 7 – Call Phone Number from HyperlinkButton Chad Campbell [no relation :) ] is discussing dialing a number from a hyperlink in WP7 - oh yeah, it's a phone as well :) -- I think I've only seen a number attempt to be called -- hmm... and we're not yet either because we all have emulators, but this is a good intro to the functionality for when we may actually have devices! Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • ASP.NET ReportViewer Google Chrome CPU usage

    - by Phil
    Hello, We have found an interesting issue between ASP.NET 3.5 and ReportViewer with Google Chrome. Our set of pages work fine until a ReportViewer control displays a report. Google Chrome then eats up 50% of the CPU doing nothing it seems. I've extracted the ReportViewer control to a blank Web Forms project to confirm its that control and not a rogue bit of my code. I'm using ReportViewer in local mode (RDLC file) so I presume its the 2005 version? Anyone seen this before and have a solution? Phil Edit: Google Chrome 3.0.195.33 on Vista Business x64 Edit 2: Added bounty for help fixing this

    Read the article

  • Visual C# 2008 Express connection to SQL Server 2008 Express problem

    - by Phil
    Hi guys, I have a problem with Visual C# 2008 express (SP1) connecting to SQL Server 2008 express. The "Add Connection" window (wherever initiated) doesn't list existing sql server and no option for sql server except a compact edition. Note that, I've got the VWD 2008 express (SP1) on the same machine which shows the window regularly (with SQL server listed) and SQL Server Management studio works fine with the server as well. I've seen other similar posts, did take some advices: reinstalled the VC#, services run ok, etc... but with no success with VC# so far. Again, on the same machine the VWD shows the dialog with sql server option regularly, but VC# shows only 3 options in "Change data source" dialog (1. Microsoft Access Database File (OLE DB) 2. Microsoft SQL Server Compact 3.5, 3. Microsoft SQL Server Database File) Any idea? Thanks in advice, Phil

    Read the article

  • git push problem -argh!

    - by phil swenson
    Dunno what's going on, no response from github on this prob so I'm asking here. Tried a git push for the first time in a month or so and got this. Turned on export GIT_CURL_VERBOSE=1 and did a push and get this: localhost:send2mobile_rails phil$ git push Password: * Couldn't find host github.com in the .netrc file; using defaults * About to connect() to github.com port 443 (#0) * Trying 207.97.227.239... * Connected to github.com (207.97.227.239) port 443 (#0) * SSL connection using DHE-RSA-AES256-SHA * Server certificate: * subject: O=*.github.com; OU=Domain Control Validated; CN=*.github.com * start date: 2009-12-11 05:02:36 GMT * expire date: 2014-12-11 05:02:36 GMT * subjectAltName: github.com matched * issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certificates.godaddy.com/repository; CN=Go Daddy Secure Certification Authority; serialNumber=07969287 * SSL certificate verify ok. > GET /303devworks/send2mobile_rails.git/info/refs?service=git-receive-pack HTTP/1.1 User-Agent: git/1.7.1 Host: github.com Accept: */* Pragma: no-cache < HTTP/1.1 401 Authorization Required < Server: nginx/0.7.61 < Date: Tue, 01 Jun 2010 10:53:13 GMT < Content-Type: text/html; charset=iso-8859-1 < Connection: keep-alive < Content-Length: 0 < WWW-Authenticate: Basic realm="Repository" < * Connection #0 to host github.com left intact * Issue another request to this URL: 'https://[email protected]/MYUSERHERE/send2mobile_rails.git/info/refs?service=git-receive-pack' * Couldn't find host github.com in the .netrc file; using defaults * Re-using existing connection! (#0) with host github.com * Connected to github.com (207.97.227.239) port 443 (#0) * Server auth using Basic with user '303devworks' > GET /303devworks/send2mobile_rails.git/info/refs?service=git-receive-pack HTTP/1.1 Authorization: Basic MzAzZGVfd29sa3M6Y29nbmwzNzIw User-Agent: git/1.7.1 Host: github.com Accept: */* Pragma: no-cache < HTTP/1.1 200 OK < Server: nginx/0.7.61 < Date: Tue, 01 Jun 2010 10:53:13 GMT < Content-Type: application/x-git-receive-pack-advertisement < Connection: keep-alive < Status: 200 OK < Pragma: no-cache < Content-Length: 153 < Expires: Fri, 01 Jan 1980 00:00:00 GMT < Cache-Control: no-cache, max-age=0, must-revalidate < * Expire cleared * Connection #0 to host github.com left intact Counting objects: 166, done. Delta compression using up to 4 threads. Compressing objects: 100% (133/133), done. * Couldn't find host github.com in the .netrc file; using defaults * About to connect() to github.com port 443 (#0) * Trying 207.97.227.239... * connected * Connected to github.com (207.97.227.239) port 443 (#0) * SSL re-using session ID * SSL connection using DHE-RSA-AES256-SHA * old SSL session ID is stale, removing * Server certificate: * subject: O=*.github.com; OU=Domain Control Validated; CN=*.github.com * start date: 2009-12-11 05:02:36 GMT * expire date: 2014-12-11 05:02:36 GMT * subjectAltName: github.com matched * issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certificates.godaddy.com/repository; CN=Go Daddy Secure Certification Authority; serialNumber=07969287 * SSL certificate verify ok. * Server auth using Basic with user 'MYUSERHERE' > POST /303devworks/send2mobile_rails.git/git-receive-pack HTTP/1.1 Authorization: Basic JzAzZGV1d29ya3M6Y25nb29zNzIq User-Agent: git/1.7.1 Host: github.com Accept-Encoding: deflate, gzip Content-Type: application/x-git-receive-pack-request Accept: application/x-git-receive-pack-result Expect: 100-continue Transfer-Encoding: chunked * The requested URL returned error: 411 * Closing connection #0 error: RPC failed; result=22, HTTP code = 411 Writing objects: 100% (140/140), 2.28 MiB | 1.93 MiB/s, done. Total 140 (delta 24), reused 0 (delta 0) ^C localhost:send2mobile_rails phil$

    Read the article

  • How to find the filename of a script being run when it is executed from a symlink on linux

    - by Phil Boltt
    Hi, If I have a python script that is executed via a symlink, is there a way that I can find the path to the script rather than the symlink? I've tried using the methods suggested in this question, but they always return the path to the symlink, not the script. For example, when this is saved as my "/usr/home/philboltt/scripts/test.py" : #!/usr/bin/python import sys print sys.argv[0] print __file__ and I then create this symlink ln -s /usr/home/philboltt/scripts/test.py /usr/home/philboltt/test and execute the script using /usr/home/philboltt/test I get the following output: /usr/home/philboltt/test /usr/home/philboltt/test Thanks! Phil

    Read the article

  • Setting minimum number of decimal places for std::ostream precision

    - by Phil Boltt
    Hi, Is there a way to set the "minimum" number of decimal places that a std::ostream will output? For example, say I have two doubles that I want to print: double a = 0; double b = 0.123456789; I can set my maximum decimal precision so that I output b exactly std::cout << std::setprecision(9) << b << std::endl; Is there a way to set "minimum" precision so that std::cout << a << std::endl; yields "0.0", not just "0"? Thanks! Phil

    Read the article

  • FTP server deatails according to domain

    - by Phil Jackson
    Hello, What I am trying to accomplish is getting relative and absolute paths to files, images and folders that reside on a remote server. I have website address, and FTP details (these are required when signing up). What i need to know is whether the FTP details correspond correctly with the website. Firstly I used (this is all in PHP I forgot to add) : $conn_id = ftp_connect("ftp.".$WEBSITE); if($login_result = ftp_login ($conn_id, $ftpUser, $ftpPass)) which works. BUT what i dont know, and am not sure about at all, will ("ftp.".$WEBSITE) be sufficient for all "FTP servers"? Regards, Phil Jackson

    Read the article

  • Mac OS X 10.5+ and POSIX

    - by Phil
    Hello, I need to program an authentication module that has to work with Mac OS X 10.6 Snow Leopard and at the same time needs to be POSIX-compliant. I read here: developer.apple.com/leopard/overview/osfoundations.html that since Mac OS X 10.5 Leopard, Mac OS X is POSIX-compliant (to POSIX 1003.1), but working under MAC OS X 10.5 Leopard myself, I can't find any trace of my user name neither in /etc/passwd nor in its successor /etc/master.passwd, which is mentioned here: developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man5/passwd.5.html Instead it says in both files OpenDirectory Service is used, which should be OpenLDAP according to the OpenDirectoryService man-page. Is this still POSIX-compliant ? I guess not. I wonder how Mac OS X would handle my 100% POSIX-compliant code which depends on /etc/passwd ? I would be gratefull if someone could explain the way this works to me. Thank you for your time and trouble. Best regards Phil.

    Read the article

  • turning text into image - PHP/GD - save image

    - by Phil Jackson
    Hi, I'm using this script to simply create an image from text. What I would like to know is how to save the image instead of printing straight to browser; // an email address in a string $string = $post[$key]; // some variables to set $font = 4; $width = ImageFontWidth($font) * strlen($string); $height = ImageFontHeight($font); // lets begin by creating an image $im = @imagecreatetruecolor ($width,$height); //white background $background_color = imagecolorallocate ($im, 255, 255, 255); //black text $text_color = imagecolorallocate ($im, 0, 0, 0); // put it all together $image = imagestring ($im, $font, 0, 0, $string, $text_color); I know its probably just one line of code at the end but im not sure which GD function to use. Any help would be much appreciated, Regards, Phil.

    Read the article

  • PHP/mySQL - using result from 'CONCAT' and 'AS' in 'LIKE' clause

    - by Phil Jackson
    Hi I have the following code; if( ! empty( $post['search-bar'] ) ) { $search_data = preg_replace("#\s\s#is", '', preg_replace("#[^\w\d\s+]#is", '', $post['search-bar'] ) ); $data_array = explode( " ", $search_data ); $data_array = "'%" . implode( "%' OR '%", $data_array ) . "%'"; $query = "SELECT CONCAT( PROFILE_PROFFESION, FIRST_NAME, LAST_NAME, DISPLAY_NAME) AS 'STRING' FROM `" . ACCOUNT_TABLE . "` WHERE STRING LIKE ( " . $data_array . " ) AND BUSINESS_POST_CODE LIKE '" . substr(P_BUSINESS_POST_CODE, 0, 4) . "%'"; $q = mysql_query( $query, $CON ) or die( "_error_" . mysql_error() ); if( mysql_num_rows( $q ) != 0 ) { die(); } } Problem is I want to use the temp col 'STRING' in the where clause but is returning 'unknown coloumn STRING Can any one point me in the right direction, regards Phil

    Read the article

  • stumped on jquery call inside chrome extension

    - by phil swenson
    In my chrome extension I call this: jsonPost = { email:"[email protected]", password:"demo", content: $('#selected_text').val(), notification_type: $('#notification_type').val(), name:$('#notification_name').val() } $.post('http://localhost:3000/api/create.json', jsonPost, function (data) { console.log("type of data = " + typeof(data)); console.log("data in function = " + data); } The data makes it to the server. But the response is lost, in the console ---type of data = String ---data in function = So for some reason I am not getting the response back. Works from the browser. I even tried doing a get against cnn.com and got no response. any ideas? thanks

    Read the article

  • PHP/MySQL - updateing 2 tables in one request

    - by Phil Jackson
    Morning, I want to learn more about sql and I'm wanting to update to tables; $query3 = "INSERT INTO `$table1`, `$table2` ($table1.DISPLAY_NAME, $table1.EMAIL_ACCOUNT, $table2.DISPLAY_NAME, $table2.EMAIL_ACCOUNT) values ('" . DISPLAY_NAME . "', '" . EMAIL_ADDRESS . "', '" . $get['rn'] . "', '" . $email . "')"; could some one point me in the right direction on how I would go about this? current error is You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' contacts_ACT_Web_Designs (contacts_E_Jackson.DISPLAY_NAME, contacts_E_Jackson' at line 1 regards, phil

    Read the article

  • sshd: How to enable PAM authentication for specific users under

    - by Brad
    I am using sshd, and allow logins with public key authentication. I want to allow select users to log in with a PAM two-factor authentication module. Is there any way I can allow PAM two-factor authentication for a specifc user? I don't want users - By the same token - I only want to enable password authentication for specific accounts. I want my SSH daemon to reject the password authentication attempts to thwart would-be hackers into thinking that I will not accept password authentication - except for the case in which someone knows my heavily guarded secret account, which is password enabled. I want to do this for cases in which my SSH clients will not let me do either secret key, or two-factor authentication.

    Read the article

  • Which type of motherboard i should buy and why?

    - by metal gear solid
    If budged is not a problem. I just need best performance with less power consumption. I can purchase any cabinet , power supply and Motherboard. Is Power supply has any relation with Form factor? Is the size of motherboard and number of Slots only difference between all form factors? Is there any differences among form factors, related to performance of motherboard? Is bigger in Size (ATX) motherboard always better? Is it so smaller in Size motherboard will consume less power? What are pros and cons of each Form factor? What there are so many Form factor were created?

    Read the article

  • processing an audio wav file with C

    - by sa125
    Hi - I'm working on processing the amplitude of a wav file and scaling it by some decimal factor. I'm trying to wrap my head around how to read and re-write the file in a memory-efficient way while also trying to tackle the nuances of the language (I'm new to C). The file can be in either an 8- or 16-bit format. The way I thought of doing this is by first reading the header data into some pre-defined struct, and then processing the actual data in a loop where I'll read a chunk of data into a buffer, do whatever is needed to it, and then write it to the output. #include <stdio.h> #include <stdlib.h> typedef struct header { char chunk_id[4]; int chunk_size; char format[4]; char subchunk1_id[4]; int subchunk1_size; short int audio_format; short int num_channels; int sample_rate; int byte_rate; short int block_align; short int bits_per_sample; short int extra_param_size; char subchunk2_id[4]; int subchunk2_size; } header; typedef struct header* header_p; void scale_wav_file(char * input, float factor, int is_8bit) { FILE * infile = fopen(input, "rb"); FILE * outfile = fopen("outfile.wav", "wb"); int BUFSIZE = 4000, i, MAX_8BIT_AMP = 255, MAX_16BIT_AMP = 32678; // used for processing 8-bit file unsigned char inbuff8[BUFSIZE], outbuff8[BUFSIZE]; // used for processing 16-bit file short int inbuff16[BUFSIZE], outbuff16[BUFSIZE]; // header_p points to a header struct that contains the file's metadata fields header_p meta = (header_p)malloc(sizeof(header)); if (infile) { // read and write header data fread(meta, 1, sizeof(header), infile); fwrite(meta, 1, sizeof(meta), outfile); while (!feof(infile)) { if (is_8bit) { fread(inbuff8, 1, BUFSIZE, infile); } else { fread(inbuff16, 1, BUFSIZE, infile); } // scale amplitude for 8/16 bits for (i=0; i < BUFSIZE; ++i) { if (is_8bit) { outbuff8[i] = factor * inbuff8[i]; if ((int)outbuff8[i] > MAX_8BIT_AMP) { outbuff8[i] = MAX_8BIT_AMP; } } else { outbuff16[i] = factor * inbuff16[i]; if ((int)outbuff16[i] > MAX_16BIT_AMP) { outbuff16[i] = MAX_16BIT_AMP; } else if ((int)outbuff16[i] < -MAX_16BIT_AMP) { outbuff16[i] = -MAX_16BIT_AMP; } } } // write to output file for 8/16 bit if (is_8bit) { fwrite(outbuff8, 1, BUFSIZE, outfile); } else { fwrite(outbuff16, 1, BUFSIZE, outfile); } } } // cleanup if (infile) { fclose(infile); } if (outfile) { fclose(outfile); } if (meta) { free(meta); } } int main (int argc, char const *argv[]) { char infile[] = "file.wav"; float factor = 0.5; scale_wav_file(infile, factor, 0); return 0; } I'm getting differing file sizes at the end (by 1k or so, for a 40Mb file), and I suspect this is due to the fact that I'm writing an entire buffer to the output, even though the file may have terminated before filling the entire buffer size. Also, the output file is messed up - won't play or open - so I'm probably doing the whole thing wrong. Any tips on where I'm messing up will be great. Thanks!

    Read the article

  • Box 2d basic questions

    - by philipp
    I am a bit new to box2d and I am developing an game with type and letters. I am using an svg font and generate the box2d bodies direct from the glyphs path definition, using the convex hull of them. I also have an decomposition routine the decomposes this hull if necessary. All this it is more or less working, except that I got some strange errors which definitely are caused by the scale factors. The problem is caused by two factors: first: the world scale of box2d, second: the the precision of curve-approximation of the glyph vectors. So through scaling down the input vertices for box2d, it happens that they become equal caused by numerical precision, what causes errors in box2d. Through scaling the my glyphs a bit up, this goes away. I also goes away if I chose a different world scale factor, but this slows down the whole animation quite much! So if my view port is about 990px * 600px and i want to animate Glyphs in box2d which should have a size from about 50px * 50px up to 300px * 300px, which scale factor of the b2world should i choose? How small should the smallest distance from on vertex to another be, while approximating the glyph vectors? Thanks for help greetings philipp EDIT:: I continued reading the docs of box2d and after rethinking of the units system, which is designed to handle object from 0.1 up to 10 meters, I calculated a scale factor of 75. So Objects 600px width will are 8 meters wide in box2d and even small objects of about 20px width will become 0.26 meters width in box2d. I will go on trying with this values, but if there is somebody out there who could give me a clever advice i would be happy!

    Read the article

  • C# vector class - Interpolation design decision

    - by Benjamin
    Currently I'm working on a vector class in C# and now I'm coming to the point, where I've to figure out, how i want to implement the functions for interpolation between two vectors. At first I came up with implementing the functions directly into the vector class... public class Vector3D { public static Vector3D LinearInterpolate(Vector3D vector1, Vector3D vector2, double factor) { ... } public Vector3D LinearInterpolate(Vector3D other, double factor { ... } } (I always offer both: a static method with two vectors as parameters and one non-static, with only one vector as parameter) ...but then I got the idea to use extension methods (defined in a seperate class called "Interpolation" for example), since interpolation isn't really a thing only available for vectors. So this could be another solution: public class Vector3D { ... } public static class Interpolation { public static Vector3D LinearInterpolate(this Vector3D vector, Vector3D other, double factor) { ... } } So here an example how you'd use the different possibilities: { var vec1 = new Vector3D(5, 3, 1); var vec2 = new Vector3D(4, 2, 0); Vector3D vec3; vec3 = vec1.LinearInterpolate(vec2, 0.5); //1 vec3 = Vector3D.LinearInterpolate(vec1, vec2, 0.5); //2 //or with extension-methods vec3 = vec1.LinearInterpolate(vec2, 0.5); //3 (same as 1) vec3 = Interpolation.LinearInterpolation(vec1, vec2, 0.5); //4 } So I really don't know which design is better. Also I don't know if there's an ultimate rule for things like this or if it's just about what someone personally prefers. But I really would like to hear your opinions, what's better (and if possible why ).

    Read the article

  • Multiplayer Network Game - Interpolation and Frame Rate

    - by J.C.
    Consider the following scenario: Let's say, for sake of example and simplicity, that you have an authoritative game server that sends state to its clients every 45ms. The clients are interpolating state with an interpolation delay of 100 ms. Finally, the clients are rendering a new frame every 15ms. When state is updated on the client, the client time is set from the incoming state update. Each time a frame renders, we take the render time (client time - interpolation delay) and identify a previous and target state to interpolate from. To calculate the interpolation amount/factor, we take the difference of the render time and previous state time and divide by the difference of the target state and previous state times: var factor = ((renderTime - previousStateTime) / (targetStateTime - previousStateTime)) Problem: In the example above, we are effectively displaying the same interpolated state for 3 frames before we collected the next server update and a new client (render) time is set. The rendering is mostly smooth, but there is a dash of jaggedness to it. Question: Given the example above, I'd like to think that the interpolation amount/factor should increase with each frame render to smooth out the movement. Should this be considered and, if so, what is the best way to achieve this given the information from above?

    Read the article

  • Looking for algorithms regarding scaling and moving

    - by user1806687
    I've been bashing my head for the past couple of weeks trying to find algorithms that would help me accomplish, on first look very easy task. So, I got this one object currently made out of 5 cuboids (2 sides, 1 top, 1 bottom, 1 back), this is just for an example, later on there will be whole range of different set ups. I have included three pictures of this object(as said this is just for an example). Now, the thing is when the user scales the whole object this is what should happen: X scale: top and bottom cuboids should get scaled by a scale factor, sides should get moved so they are positioned just like they were before(in this case at both ends of top and bottom cuboids), back should get scaled so it fits like before(if I simply scale it by a scale factor it will leave gaps on each side). Y scale: sides should get scaled by a scale factor, top and bottom cuboid should get moved, and back should also get scaled. Z scale: sides, top and bottom cuboids should get scaled, back should get moved. Here is an image of the example object (a thick walled box, with one face missing, where each wall is made by a cuboid): Front of the object: Hope you can help,

    Read the article

  • How to move the rigidbody at the position of the mouse on release

    - by Edvin
    I'm making a "Can Knockdown" game and I need the rigidbody to move where the player released the mouse(OnMouseUp). Momentarily the Ball moves OnMouseUp because of rigidbody.AddForce(force * factor); and It moves toward the mousePosition but doesn't end up where the mousePosition is. Here's what I have so far in the script. var factor = 20.0; var minSwipeDistY : float; private var startTime : float; private var startPos : Vector3; function OnMouseDown(){ startTime = Time.time; startPos = Input.mousePosition; startPos.z = transform.position.z - Camera.main.transform.position.z; startPos = Camera.main.ScreenToWorldPoint(startPos); } function OnMouseUp(){ var endPos = Input.mousePosition; endPos.z = transform.position.z - Camera.main.transform.position.z; endPos = Camera.main.ScreenToWorldPoint(endPos); var force = endPos - startPos; force.z = force.magnitude; force /= (Time.time - startTime); rigidbody.AddForce(force * factor); }

    Read the article

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