Sponsored Content
Top Forums Programming C Beginner Looking For Suggestions Post 302302651 by c_d on Tuesday 31st of March 2009 02:27:39 PM
Old 03-31-2009
seeing jim mcnamara's code gave me an idea

Code:
#include<stdio.h>
#define SP 32
#define BRK_LOP 16

int main()
{
    char ch;
    int flag=0;
    puts("Press ctrl+p to stop");
    while((ch=fgetc(stdin))!=BRK_LOP)
       ch!=SP ? flag=fputc(ch,stdout)-ch : ( flag==0 ? flag=fputc(ch,stdout) : 0 );
    return 0;
}

now, hows this?

Last edited by c_d; 03-31-2009 at 03:33 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Suggestions on where to begin?

I have been a student at Hendrix Institute for about a year now. My term is comming to an end by the end of december. I have learned varios computer programs for web development that include Flash 5 and Dreamweaver. Actionscripting, Javascript and Database development with Access was all... (4 Replies)
Discussion started by: andrew25008
4 Replies

2. UNIX for Dummies Questions & Answers

Suggestions wanted ...

All, Have an AMD-K6/2 PC, 20G.Hd along with RH7.2. Wanting to know what I should do in terms of setup (workstation/server) and then what I can do with it? I'd like to learn a DBMS and SQL - can I do this using RedHat? Any suggestions with how I can use/ what I can do with this appreciated. (3 Replies)
Discussion started by: Cameron
3 Replies

3. UNIX for Dummies Questions & Answers

Backup suggestions

The current backup procedure we using a tar command in linux. The files are stored in one partition in different folders. The docs stores in day wise folders like ex: /usr/data/xyz/20050129, /usr/data/xyz/20050130 .............etc We using tar & gzip command to take backup everyday. The backup... (3 Replies)
Discussion started by: bache_gowda
3 Replies

4. UNIX for Advanced & Expert Users

Looking for Suggestions...

We run WebSphere and by default it wants to install everything under /usr. While I can understand the default (everyone has a /usr) I would like to move this over to a dedicated volume group called apps and then setup my lv's and fs's here. Our WebSphere Admin doesn't like this because apparently... (1 Reply)
Discussion started by: scottsl
1 Replies

5. Solaris

Suggestions Req

Hi all, I have worked on HP UNIX and now i have moved to SunSolaris which i never used to work. I am more on programming side like shell and perl scripting. So i want to know from you experts that i need to take care or changes which i code in sun solaris in compared to HP unix. Suggestions... (1 Reply)
Discussion started by: ravi.sadani19
1 Replies

6. Shell Programming and Scripting

Suggestions on input

Hi, I have written a script which calls a process which ends up in a reboot of the system. At the end of the reboot it prompts for login & i need to provide the login details. am not able to figure out hw to do this. Doubt: will echoing login details after calling the process work? for ex:... (1 Reply)
Discussion started by: meera
1 Replies

7. UNIX for Advanced & Expert Users

Need suggestions.......

Hello there....i am a final year comp science student.......i am thinking of doing my project on unix platform......which one do u suggest?thanx in advance... (3 Replies)
Discussion started by: theprasad1990
3 Replies

8. Solaris

Suggestions for new T5140

I've been busy and fell behind on Sun/Oracle. Forgive me if too basic. I welcome brief, cryptic, or advanced replies. I also welcome noobie information since I may have no clue what's up at the moment. Problem statement: I inherited a computer to set up. I would rather not figure out 8 months... (1 Reply)
Discussion started by: Nevyn
1 Replies

9. UNIX for Dummies Questions & Answers

Suggestions for the interview

Hi guys, i'm undergoing a traning in solaris administration and i request if any one have an idea on the interview questions on solaris. thank you. (3 Replies)
Discussion started by: 038karthik
3 Replies

10. Shell Programming and Scripting

Suggestions on this script please

i=1 out="" j=`expr 2 * $1` while do out="$out"#"" echo $out ((i=i+1)) done while do print ${out%?} ((i=i+1)) done This script is throwing an error: gurnish:/home/fnb/gurnish/saurabh/scripts> while1 3 expr: 0402-050 Syntax error. # (6 Replies)
Discussion started by: targetshell
6 Replies
MYSQLND_MEMCACHE_SET(3) 						 1						   MYSQLND_MEMCACHE_SET(3)

mysqlnd_memcache_set - Associate a MySQL connection with a Memcache connection

SYNOPSIS
bool mysqlnd_memcache_set (mixed $mysql_connection, [Memcached $memcache_connection], [string $pattern], [callback $callback]) DESCRIPTION
Associate $mysql_connection with $memcache_connection using $pattern as a PCRE regular expression, and $callback as a notification call- back or to unset the association of $mysql_connection. While associating a MySQL connection with a Memcache connection, this function will query the MySQL Server for its configuration. It will automatically detect whether the server is configured to use the InnoDB Memcache Daemon Plugin or MySQL Cluster NDB Memcache support. It will also query the server to automatically identify exported tables and other configuration options. The results of this automatic config- uration can be retrieved using mysqlnd_memcache_get_config(3). PARAMETERS
o $mysql_connection - A handle to a MySQL Server using one of the MySQL API extensions for PHP, which are PDO_MYSQL, mysqli or ext/mysql. o $memcache_connection - A Memcached instance with a connection to the MySQL Memcache Daemon plugin. If this parameter is omitted, then $mysql_connection will be unassociated from any memcache connection. And if a previous association exists, then it will be replaced. o $pattern - A regular expression in Perl Compatible Regular Expression syntax used to identify potential Memcache-queries. The query should have three sub patterns. The first subpattern contains the requested field list, the second the name of the ID column from the query and the third the requested value. If this parameter is omitted or os set to NULL, then a default pattern will be used. o $callback - A callback which will be used whenever a query is being sent to MySQL. The callback will receive a single boolean parameter telling if a query was sent via Memcache. RETURN VALUES
TRUE if the association or disassociation is successful, otherwise FALSE if there is an error. EXAMPLES
Example #1 mysqlnd_memcache_set(3) example with var_dump(3) as a simple debugging callback. <?php $mysqli = new mysqli("host", "user", "passwd", "database"); $memc = new Memcached(); $memc->addServer("host", 11211); mysqlnd_memcache_set($mysqli, $memc, NULL, 'var_dump'); /* This query will be intercepted and executed via Memcache protocol */ echo "Sending query for id via Memcache: "; $mysqli->query("SELECT f1, f2, f3 FROM test WHERE id = 1"); /* f1 is not configured as valid key field, this won't be sent via Memcache */ echo "Sending query for f1 via Memcache: "; $mysqli->query("SELECT id FROM test WHERE f1 = 1"); mysqlnd_memcache_set($mysqli); /* Now the regular MySQL protocol will be used */ echo "var_dump won't be invoked: "; $mysqli->query("SELECT f1, f2, f3 WHERE id = 1"); ?> The above example will output: Sending query for id via Memcache: bool(true) Sending query for f1 via Memcache: bool(false) var_dump won't be invoked: SEE ALSO
mysqlnd_memcache_get_config(3). PHP Documentation Group MYSQLND_MEMCACHE_SET(3)
All times are GMT -4. The time now is 02:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy