Any help?
You'll have to be more patient, please wait more than simply 4 hours before bumping like that. Give it at least 24 hours, as some people aren't in the same timezone as you.
Any help?
You'll have to be more patient, please wait more than simply 4 hours before bumping like that. Give it at least 24 hours, as some people aren't in the same timezone as you.
Happy New Year! (in advance or belated, depending on where you are!)
Belated, seeing as we're UTC+13. Here in New Zealand we're 175°E-ish so 5° of longitude away from being the first in the word to enter the new year.
The cut_str() isn't included in the standard PHP installation, it's probably been written by you or someone else, in a PHP source file. Nobody else has a copy of this function's code because it only exists in your code. Please post the cut_str
function's code.
how can I hide this error!?
You really should use mysqli_* or else one day in the future when you upgrade PHP, your code will just stop working, and you'll have PHP complaining that mysql_connect() doesn't exist. When functions are deprecated, it is a sign that you must begin migrating to the alternatives. I highly recommend using mysqli_* as the syntax is pretty much the same as mysql_*.
If you still insist to use mysql_*, then you can tell PHP not to report the use of deprecated functions. Look through /etc/php/php.ini
and search for error_reporting
. Append & ~E_DEPRECATED
to it. For example, my PHP config has:
error_reporting = E_ALL
so I'd end up with
error_reporting = E_ALL & ~E_DEPRECATED
Hope this helps
You can sort-of dynamically create tuples, for example:
name = "Jim"
last_name = "Beam"
mytuple = (name, last_name)
However, you'd not be able to dynamically change the size of a tuple. That sort of thing's hard-coded.
A whole hour? That's nothing ;) But seriously, good on you for soliving the problem yourself and posting the solution for others.
We don't do your homework for you. Show some effort of your own toward solving the problem before simply demanding code.
Go to a decent store selling musical instruments
I second this. I had a cousin who picked up a $60 electric guitar + amp package from what was basically a supermarket bargain bin simply because it was cheap. He thrashed the whammy bar while playing some band like Burzum and snapped it right off.
Can anyone help me?
You can help us help you by asking your question more clearly and first showing some effort towards solving the problem.
You agreed to these rules when you signed up. I'll quote from that very page:
Do provide evidence of having done some work yourself if posting questions from school or work assignments
Ohh crap, here we go with a potential flame/argument/back-and-forward/opinion thread. Oh well, it's been civilised so far, let's keep it that way.
I've used both vi
and nano
and prefer nano simply because I find it more user friendly. Then again, I never do serious editing in a terminal.
I think you can use any compiler which has the ability modify the linker, GNU's compiler has linker scripts which controls this important aspect.
No, no, no, no, don't make that assumption. Unfortunately, it's more complicated than that. A toolchain is compiled to handle the quirks and twists of the target platform. Sure, there are a few flags you feed to GCC, but even then, the general trend is a failing compile.
The guys over at OSDev.org have long known this and long tried to teach it. If you've ever been on the forums, you'll know you should compile a GCC Cross Compiler, which has been set up from the start to compile for striaght i586 ELF without a libc or whatever your target is. Read through Building a GCC Cross Compiler. I'm sure Schol-R-Lea and a few others can vouch for this method. I tried to make do with my system's toolchain, but was eventually talked around to compiling a cross compiler, and haven't looked back. It is the way to go if you're serious about it at all.
On the other hand, if you're using straight ASM, you might be okay, but this is the C forum.
they can increase the tax on it.
Thus penalising everyone for a minority's mistakes?
In case you don't get it, what deceptikon is talking about is the homework policy.
how should i do and what should I do ?
What others have said: get some grammar books, read through them. As with any language, you basically have to eat and breathe it for a significant amount of time to become proficient. Practice makes perfect, so get reading and writing :)
I'm pretty sure there are some English learner's forums where you can post something and get feedback and corrections on your writing, so these may be of use.
Nice tutorial deceptikon, I very much like the style. I used to have teachers who would try and teach the class something new without first setting a scene of what happens without the new tool. They'd be talking to class full of 'Hello, World!'-ers, saying about what arrays are, but not creating that contrast, so many people would come away from the lesson thinking "Why not just use multiple variables instead?". This tutorial is the opposite, which is awesome.
TL;DR: Nice work on both content and style :)
Actually, I just noticed one of your other threads, where someone links to the example code snippet on this page for getting a file's size.
Basically, you're incrementing a variable while inFile is true:
while (inFile)
length++;
Inside your loop, there's nothing which could possibly change the value of inFile to false, thus the loop will go on forever. Here's some pidgin C, ie it's not correct syntax but should give you the idea:
while(fgetc(file_handle) != EOF)
length++;
Basically, fgetc will fetch a character from the file. We'll compare it with EOF so that when fgetc reaches the end of the file, our loop will end. Basically, with each iteration of the loop, some action needs to happen which will cause a change, resulting in the condition being broken. I'm not so good at explaining these things very clearly, but I'm sure mike_2000_17 will write a clear answer to this sometime later...
What do you think is going to change inFile's boolean state to quit the loop?
I ain't an expert in grammar either, although I fancy myself a connaisseur.
That is quite possibly the most hilarious way I have heard the words fancy, myself and connaisseur being used. I simply don't see grammar as being a sibling of fine cheeses and wines...
Also, just to add (apologies, I would've edited and tacked this onto my post above, but 30 minutes has passed) I've found the following to be fairly reliable at ensuring integrety of a program as long as you run a tight ship:
[asmguy@asmguybox ~]$ gpg -o test -d test.gpg && chmod +x test
You need a passphrase to unlock the secret key for
user: "Assembly Guy <asmguy@example.com>"
4096-bit RSA key, ID ########, created ####-##-## (main key ID ########)
gpg: encrypted with 4096-bit RSA key, ID ########, created ####-##-##
"Assembly Guy <asmguy@example.com>"
gpg: Signature made Sat 30 Nov 2013 15:25:49 NZDT using RSA key ID ########
gpg: Good signature from "Assembly Guy <asmguy@example.com>"
[asmguy@asmguybox ~]$ ./test
Hooray!
[asmguy@asmguybox ~]$
Let's take AD's point to the extreme:
someone can always replace the intended program with his/her own malicious one
Okay, what if someone replaces libc with their own malicious one, with all of the original code in there, such that programs will still run, but there will be malicious code sprinkled through it? Of course, I'm intentionally taking things to extremes here.
Also, deceptikon's example doesn't work in Linux (well, not my installation...) To execute something in the working directory, it needs to be prefixed with a ./
. I did a system("ls")
successfully even when I wrote a program named ls
and put it in the current directory. Sure, a hacker could replace /usr/bin/ls
with a bad one, but they'd need to have root access. But if they had root access, they'd might as well do something worse to the system.
I'm not promoting the use of system()
, just playing devil's advocate.
Hai can any one modify this code to produce the combination that will be able to pronounce? I mean if the input is abc then it should produce cab and bac only. not all of it.
To do this, you'd have to sit down and write out pairs (maybe even triplets) of letters which are pronouncable. You'd then have to create an array of these in your program and go from there... Unfortunately, it's not an overly easy or quick task.
Also, if you're not explicitly required to write a string length function, you can use strlen()
.
And if you're into optimising your function, you could do something like the following, but if you're only just starting C++, then don't listen to the next bit :)
unsigned int Count_characters(const char *string)
{
unsigned int count = 0;
while(string[count++]);
return (count-1);
}
I don't use MASM, but from what deceptikon said, you'll need a linker as well as MASM.
i want the coding for this question....????
Then write it?
We don't do your homework for you, you must first show us your code/progress so far.
Ohh right, makes sense.
The scores the preview/test mode gives are crap, I was being told I would get a 0.4-something, but upon submission, I got an 8.
I that a while after I wrote. It's performing the !
operation on i
, then the modulo. It'd need brackets for example !(i%3)
. This puts it to the same length as i%3==0
.
Odd. Maybe D doesn't like it. What error's it throwing at you?
In that case, just go for other things I mentioned, such as if(!i%3)
instead of if(i%3==0)
, as well as i<101
instead of i<=100
. While its only a byte here or there, it'll soon add up...
Also, instead of repeating w(
, could you alias w
to equal write(
? The same applies for );
- alias it for a letter you're not using, like q
.
Would it simply not compile at all, or would there be a warning? While it's strictly 'illegal', a C compiler will sit there and frown at you for a bit, but end up compiling fine.
Does D allow the use of int main()
. That'd save one byte...
Instead of repeating sequences like );
and i%
, see if making an alias for those could help. Also use <101
instead of <=100
. Also, you've started to apply my thinking on the boolean logic, but you've not fully applied it, I can still see some comparisons with 0 in your code.
EDIT: Deleted because of buggy untested code
For a start, some compilers allow a declaration of a variable inside a for loop, eg for(int i=0;...
. Also, you can cut out comparisons with 0 like if(i%3==0&&i%5!=0)
. If i%3
is 0, then it is effectively a boolean with value FALSE, otherwise it's a boolean TRUE. Also, you don't need three conditions, just two:
This way you can cut the size down a wee bit
set /p
is a set
command with a 'prompt' flag fed to it, meaning that it will prompt the user for a value to set the variable to. Example (untested):
set /p "myvar=Enter a value: "
echo You said %myvar%
To answer your second question, check out DosTips.
As long as a new HDD can connect to the motherboard, you should be fine on that issue. AFAIK, all new HDDs now have a SATA interface, so your mobo would need a SATA connector. That's the main thing to check just off the top of my head.
Do you mean that Ubuntu set up a tiny partition and is only using that? Maybe post a summary of sudo cfdisk /dev/your-hdd-or-disk-or-whatever
. You can extend and shrink partitions fairly safely using gParted, remembering to run it from a disk which isn't the one you're changing.
If you had a pointer to StudentID and you wished to reference StudentName, you'd just have to add the size of StudentID to your pointer, then your pointer would be pointing at StudentName
While we're on the topic of the buttons, I find them a bit standy-outy. I find them to draw attention away from the post. Maybe if they were more pale? Maybe it's just me.
Pass a pointer to the struct
Which specific problems are you having?
And how did u checked the word .. if its palindrome or not ?
He's leaving that up to you. It's simple if you break it down into small steps. A palindrome is where a word is the same forwards as it is backwards. For example the word redder
is 6 letters long and it is a palindrome. We can check this systematically by looking at the first and last letters. Are they the same? Yes. Continue. Look at the 2nd and 2nd to last letters. Are they the same? Yes. We'll check the last pair of letters, the 3rd and the 3rd to last. They are the same too. This renders the word a palindrome.
You could do this another way by simply creating a char[6]
buffer and load it with the word the user entered, but backwards. For example, if the user entered Pooled
, then your new buffer would end up containing delooP
. Then you can simply call strcmp
on the original and the reversed. If they are the same, then the word is a palindrome - because, well, palindromes are the same forwards as backwards.
Also stop by at the W3 Markup Validator and the W3 CSS Validator from time to time to check you're doing everything by the book.
I wanna a Convincing answer ..
You must first show an effort towards solving the problem. What code do you have so far? What problems does your code so far have?
@JeffGrigg the downvoter, this is a code snippet, not a thread. You might like to look a little more carefully before asking what the OP's question is :)
In this specific case, is there any advantage of using
app = MyApp()
app.mainloop()
over simply using
MyApp().mainloop()
We don't do your homework for you. Show some effort or an attempt and come back with a specific question.
We don't do your homework for you.