I already know C++ console programming. So shall i learn Qt for c++ or c# first?? I eventually plan to learn both anyways. Also, how long will each one take. The only programming language i know is c++.
i try to write this code to process Arabic language by python
import codecs
file = codecs.open("C:\Python27\CCA_raw_utf8.txt","r","utf-8")
text= file.read()
####################################
print "\n "," --------------------------------------------"
text=text[1:]
words=text.split()
for w in words:
if w == unicode ("?????","utf-8"):
print w
but it doesn't and take error " if w == unicode ("?????","utf-8"):
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc7 in position 0: invalid continuation byte "
why program gives this result and how we can correct that??
I have set new division on postgress pg_operator table because i want tath when is division by zero return 0.
i have write this:
create operator / ( procedure = zero_division, leftarg = double precision, rightarg = double precision);
where zero_division is:
CREATE OR REPLACE FUNCTION zero_division(double precision, double precision)
RETURNS double precision AS
'select case when $2 = 0 then 0 else $1 / $2::real end;'
LANGUAGE sql IMMUTABLE
COST 100;
when i run value/ 0 i get error of division.
I was just reading a bit about the HQ9+ programming language ( http://esolangs.org/wiki/HQ9 , http://en.wikipedia.org/wiki/HQ9%2B and http://www.cliff.biffle.org/esoterica/hq9plus.html ), and it tells me something about a so called 'accumulator' which can be incremented, but not be accessed. Also, using the + doesn't manipulate the result:
code
H+H
result
Hello World
Hello World
Can anyone explain me how this works, what this does and if it even makes any sense? Thanks
I'm wondering specifically what experienced programmers thought when they started developing in Python. I'm sure the answer depends on your background, but my own personal answer is the conversion of basically anything in the language to a True/False value in boolean contexts.
Resulting in "oddities" like:
if x:
not meaning the same thing as:
if x == True:
I understand why, but it bugs me, and I certainly had to think about it a bit when I first ran into it.
Hi,
I am developing an iPhone application which needs to show some font in language other than English like Malayalam or Arabic. Is it possible to do that? Please give me appropriate direction to do this.
Thanks in advance.
I have the following questions concerning the differences between the four options:
What is the main difference between the four options?
Which of the above support int64_t or long long without suffix LL. I want a data type of the range 2^63 - 1
If your answer to my second question is not C(gcc 4.3.2) , whether the code I write in C(gcc 4.3.2) for C language will be valid in rest of the three options or do I have to modify something, then what will be those modifications.
I want to copy a large a ram-based file (located at /dev/shm direcotry) to local disk, is there some way for an efficient copy instead of read char one by one or create another piece memory? I can use only C language here. Is there anyway that I can put the memory file directly to disk? Thanks!
Programming language : VB6
I have a problem to copy region within a picture deteremined by 4 points(p1,p2,p3,p4), and reskew it to a another picture with fixed rectangle (P1,P2,P3,P4), as shown :
thank you so much in advance for your help
I have a list L of objects (for what it's worth this is in scons). I would like to create two lists L1 and L2 where L1 is L with an item I1 appended, and L2 is L with an item I2 appended.
I would use append but that modifies the original list.
How can I do this in Python? (sorry for the beginner question, I don't use the language much, just for scons)
When I wrote best I meant:
Speed,
Have an IDE, a debugger,
Compiling to machine code or some other language,
Quality of implemenation and,
Completeness.
I have a list of items sorted alphabetically:
list = [a,b,c,d,e,f,g,h,i,j]
I'm able to output the list in an html table horizonally like so:
| a , b , c , d |
| e , f , g , h |
| i , j , , |
What's the algorithm to create the table vertically like this:
| a , d , g , j |
| b , e , h , |
| c , f , i , |
I'm using python, but your answer can be in any language or even pseudocode.
Thanks
Which is the best programming language to use for creating a screensaver?
I am thinking of creating a screensaver to showcase projects i have done before for self satisfaction.
How should i go about it?
Thanks
Hi,
I am using C language and Linux as my programming platform.
I am learning how to create a daemon, and I want to create a log file so that I write a debug message in my daemon. My question is where should I put the log file in my system. Should I put it in the var folder?
Please advice.
Many thanks.
hi guys , i want to design a small website like stackoverflow (but in deferent language) and i want to use an opensource secure scalable cms to do that , so what cms to use ? ( i prefer using java )
thanks .
After a break from coding in general, my way of thinking logically faded (as if it was there to begin with...). I'm no master programmer. Intermediate at best. I decided to see if i can write an algorithm to print out the fibonacci sequence in Java. I got really frustrated because it was something so simple, and used the debugger to see what was going on with my variables. solved it in less than a minute with the help of the debugger.
Is this cheating?
When I read code either from a book or someone else's, I now find that it takes me a little more time to understand. If the alghorithm is complex (to me) i end up writing notes as to whats going on in the loop. A primitive debugger if you will.
When you other programmers read code, do you also need to write things down as to whats the code doing? Or are you a genius and and just retain it?
I am a c# developer which finds himself having to relearn c++. The last time I programmed in c++ was in school and am looking for good books as a refresher. I want something that assumes previous programming exposure and gets straight to the point. Is there a book similar to K&R for c++? I know the language is bloated so a book that covers a subset of c++ would be ideal.
Is it possible to run Lua interpreter on the iphone?
If yes, are there any libraries that have bindings to Iphone's SDK?
If its not possible with Lua, what are the other language options?
Hi,
I often cross this kind of code transformation (or even mathematical transformation)
(python example, but applies to any language)
I've go a function
def f(x):
return x
I use it into another one.
def g(x):
return f(x)*f(x)
print g(2)
leads to 4
But I want to remove the functional dependency, and I change the function g into
def g(f):
return f*f
print g( f(2) )
leads to 4 too
How do you call this kind of transformation, locally turning a function into a scalar ?
I'm interested in programming languages well suited for embedded programming.
In particular:
Is it possible to program embedded systems in C++?
Or is it better to use pure C?
Or is C++ OK only if some features of the language (e.g. RTTI, exceptions and templates) are excluded?
What about Java in this domain?
Thanks.
Hi
There are several PHP or js code formatting libs out there -- does anyone know if similar libs exist in Java?
Ie., Given a string of code, return a formatted string with syntax colouring etc.
It'd be ideal if it auto detected the language, but I might be pushing my luck there...