Hi, folks !
Is there any serial port facilities in Qt ?
If not, which crossplatform (desirable) libraries (for working with serial port and, maybe, with other I/O ports), do you recommend ?
One song per answer please!
We have discussed music you listen to while coding, but I looking for music related to coding and coders. It can be eclectic or mainstream, and even a bit of a stretch (just explain the connection).
Vote for your favorite song or add it if it isn't already here.
Link to lyrics, band, music, video, etc., when possible.
Hello,
I'm working on a simple C prorgam, and i'ms tuck with an if test:
int line_number = 0;
if ((line_number >= argv[2]) && (line_number <= argv[4]) )
gcc says:
cp.c:25: warning: comparison between pointer and integer
cp.c:25: warning: comparison between pointer and integer
What can I do to properly write the range of line I want to deal with ?
Thank you!
When you code a distributed algorithm, do you use any library to model abstract things like processor, register, message, link, etc.? Is there any library that does that?
I'm thinking about e.g. self-stabilizing algorithms, like self-stabilizing minimum spanning-tree algorithms.
Hi everyone,
I'm wondering what's good out there for AOP / crosscutting in .Net, along the lines of AspectJ. I see Microsoft has a policy injection application block; any other good stuff out there I should take a look at?
A lot of what I am working on is changing the mindset of a community of developers. Moving them from one tool to another, or to picking up a new tool.
What are some of the suggested or recommended ways to get a community to pick up a new meme?
While we can mandate tool usage, this is a last resort. I would rather have the developers move to any new tools of their own accord.
I'm not a programmer, I need to understand why a programmer will move from one tool to another.
Edited the title thanks to a fabulous comment! My world runs on Meme's, tipping points, and general pressures. This is why I needed to ask.
And clarifying yet more- I am the middle manager needing to plan and manage an implementation and not a sales person.
For the most part, when I want to display some HTML code to be actually rendered I would use a 'close PHP' tag, write the HTML, then open the PHP again. eg
<?php
// some php code
?>
<p>HTML that I want displayed</p>
<?php
// more php code
?>
But I have seen lots of people who would just use echo instead, so they would have done the above something like
<?php
// some php code
echo("<p>HTML that I want displayed</p>");
// more php code
?>
Is their any performance hit for dropping out and back in like that? I would assume not as the PHP engine would have to process the entire file either way.
What about when you use the echo function in the way that dose not look like a function, eg
echo "<p>HTML that I want displayed</p>"
I would hope that this is purely a matter of taste, but I would like to know if I was missing out on something. I personally find the first way preferable (dropping out of PHP then back in) as it helps draw a clear distinction between PHP and HTML and also lets you make use of code highlighting and hinting for your HTML, which is always handy.
This is a problem I hit when trying to implement a game using the LÖVE engine, which covers box2d with Lua scripting.
The objective is simple: A turret-like object (seen from the top, on a 2D environment) needs to orientate itself so it points to a target.
The turret is on the x,y coordinates, and the target is on tx, ty. We can consider that x,y are fixed, but tx, ty tend to vary from one instant to the other (i.e. they would be the mouse cursor).
The turret has a rotor that can apply a rotational force (torque) on any given moment, clockwise or counter-clockwise. The magnitude of that force has an upper limit called maxTorque.
The turret also has certain rotational inertia, which acts for angular movement the same way mass acts for linear movement. There's no friction of any kind, so the turret will keep spinning if it has an angular velocity.
The turret has a small AI function that re-evaluates its orientation to verify that it points to the right direction, and activates the rotator. This happens every dt (~60 times per second). It looks like this right now:
function Turret:update(dt)
local x,y = self:getPositon()
local tx,ty = self:getTarget()
local maxTorque = self:getMaxTorque() -- max force of the turret rotor
local inertia = self:getInertia() -- the rotational inertia
local w = self:getAngularVelocity() -- current angular velocity of the turret
local angle = self:getAngle() -- the angle the turret is facing currently
-- the angle of the like that links the turret center with the target
local targetAngle = math.atan2(oy-y,ox-x)
local differenceAngle = _normalizeAngle(targetAngle - angle)
if(differenceAngle <= math.pi) then -- counter-clockwise is the shortest path
self:applyTorque(maxTorque)
else -- clockwise is the shortest path
self:applyTorque(-maxTorque)
end
end
... it fails. Let me explain with two illustrative situations:
The turret "oscillates" around the targetAngle.
If the target is "right behind the turret, just a little clock-wise", the turret will start applying clockwise torques, and keep applying them until the instant in which it surpasses the target angle. At that moment it will start applying torques on the opposite direction. But it will have gained a significant angular velocity, so it will keep going clockwise for some time... until the target will be "just behind, but a bit counter-clockwise". And it will start again. So the turret will oscillate or even go in round circles.
I think that my turret should start applying torques in the "opposite direction of the shortest path" before it reaches the target angle (like a car braking before stopping).
Intuitively, I think the turret should "start applying torques on the opposite direction of the shortest path when it is about half-way to the target objective". My intuition tells me that it has something to do with the angular velocity. And then there's the fact that the target is mobile - I don't know if I should take that into account somehow or just ignore it.
How do I calculate when the turret must "start braking"?
How can I update a table (MyTable) from a aprticular database (DB1) by equating the said MyTable from a different database (DB2) but it has the same tablename with the one I need to update. I tried putting alias to my program but it doesn't work. Need Help
how can I determine the number of CoE students per school per city?
the coe students belongs to a different table from the school table from the city table. I really need some help now. thanks
On Ubuntu linux, when you watch a flash video, it gets saved temporarily in the /tmp as flv files while the video buffers. I use vlc to directly play these files.
Currently, I have scripted a shortcut that directly scans and opens the latest file in /tmp with vlc, when clicked.
But, I want to program a Java application that will continually monitor this /tmp directory for any new flv files, and open it in vlc automatically. I know I can use Runtime.exec() to open the VLC application with the flv files. But, I DO NOT want to run a while(true) loop (with sleep) to scan for files.
How can I make use of Event Handling (Java or any other language) on Linux to complete this task?
I'm looking for very specific text editor:
Closes on ESC, no project management or tabs
Syntax highlighting - preferably with color themes (e.g. can apply different color themes without changing C# coloring definition) or, at least, can load/save themes; support for C/C#/XML/HTML/JavaScript/etc - common MS/.NET world - out of box
Configurable keys, or: Shift-Tab shifts blocks
XML/HTML auto-completion support - well, optional
I use synplus plugin for Total Commander currently, but it has few drawbacks (e.g. crashes sometimes ;-), no auto-completion, etc).
Basically I want fast Visual-Studio-like editor that I open, do edits, and then close using ESC. I remember I tried Notepad++, etc - most of them open files in tabs, don't close on ESC... - that is, behave like IDE.
At least I've just downloaded Notepad++, it doesn't close on ESC even if I setup keybindings to do so.
Autocompletion is optional (though it is to be simple as just tags completion), what I really look for is closing on ESC, not getting in the way with all the tabs and IDE-like, and good coloring. Plus shift-tab is must have for blocks manipulation.
Update: any open-source one that I can easily tweak to close on ESC? ;-) Seems like ESC (and reasonable color highlighting) is the core requirement. I've just tried many editors - Programmer's Notepad, E, Crimson, etc - I can't set any of them to close on ESC. Any external tool to close selected program on ESC? ;-)
UPDATE: Hm, found an awesome utility for my latest thought: http://www.autohotkey.com. Easy to setup to close any window on ESC (as well as many other tricks). Seems like the most tough requirements is gone - I can use ANY text editor ;-)
I have followed the tutorial at Scala and Android with Scala 2.7.3 final. The resulting Android App works but even the most basic application takes several minutes (!) to compile and needs 900 kb compressed, which is a show stopper for mobile applications. Additionally, the IDE runs out of memory every now and then. I assume dex is not made for big libraries like the scala-library.
So my question is: Has anyone actually done this and is there any cure for this?
I know of a couple, but I would like to build a list up for some nice holiday reading.
(If there is a book on here you read for free, and really liked, make sure to support the author and buy a hard copy!)
i would like to delete a string or a line inside a ".txt" file ( i.e. filen.txt
). For example, i have these lines in the file:
1JUAN DELACRUZ
2jUan dela Cruz
3Juan Dela Cruz
then delete the 2nd line (2jUan dela Cruz), so the ".txt" file will look like:
1JUAN DELACRUZ
3Juan Dela Cruz
Please help.Thank you
I have started prgramming a windows service. I have added a notify icon from the toolbox.
It has the small notify icon that appears in the systray as a member of those icons.
It works so far.
So far I have a blank form. I have used the DoubleClick for the notifyIcon to bring up
the form (I will use the form for something later).
Now I have a list of things I want to accomplish to make this work like a true windows
service.
First of all, if possible, I owuld like to remove the maximize and cancel button on the form.
Most windos service apps that I have seen offer the ability to close the app by right-mouse-button clicking on the notify icon which brings up a menu of options.
I see in the properties of the form under Misc there is an CancelButton. But I do not see how do deactivate it. In the Properties of the forum I see under Window Style there is a ControlBox option that, if I turn to false, all three buttons, (minimize, maximize and cancel) go away.
These are not what i am looking for. I would not like the option for them to resize,
maximize or close the form here. I suspect people will close the box intending to
make the box go away while still wanting the app to run.
Under the "Focus" caption in Properties, there id "Deactivate". I have created my own
event/method/function for this and in debug I noticed that when you click on the x-box in the upper right corner, this function is called. The problem is that after the function is
over, the app closes anyway. How do I over-ride this function?
Secondly, how do you catch the right button click event on the notify icon in the
systray?
I can see how to create events for "Click" and "MouseClick" etc. but how so I determine
which button was click?
Using the right buton click is how such programs know when to pull up a menu. So I would
like to know how to do this as well.
Stack overflow has become the first place i come to whenever i have dev problem. I also like to browse when i'm killing time.
Just curious to know what other general sites or resource people use regularly.
Hi
I am trying to code something in Netlogo..I am using an existing model Chemical Equilibrium and am trying to implement the following:
turtles-own [speed ]
ask turtles
[
;; set velocity ( ambient-temperature = 30 )
;; fd velocity
if temp > 40 [ "speed" increases of turtles ]
ifelse temperature < 30 [ speed of turtles decreases]
]
;; to temp
but it does not seem to work
(it temperature is more than 40 the speed of the turtles increases
if the temperature is less than 30 the speed of the turtles decreases)
temperature is a slider on the model
the same for pressure
ask turtles
[
;; if pressure > 50 then speed increases of turtles
;; if pressure < 50 then speed decreases of turtles
]
;; to pressure
thanks
Could UML be used to program a computer system on its own, without a supporting implementation language, e.g. diagrams straight to machine code (maybe via C or C++ etc), without human coding intervention.
Hi,
some short and probably stupid questions about PBS:
1- I submit jobs using
qsub job_file
is it possible to submit a (sub)job inside a job file?
2- I have the following script:
qsub job_a
qsub job_b
For launching job_b, it would be great to have before the results of job_a finished. Is it possible to put some kind of barrier or some otehr workaround so job_b is not launched until job_a finished?
Thanks
I was wondering if there was a way I could program and compile .net applications (c#, asp.net mvc) from a usb stick on any laptop I plugged in.
I am lookinjg for a solution that does not have me installing programs on the laptop, so I have to be able to run an ide or editor from an exe and compile presumably from command line.
Was also wondering if I can run MS test projects from command line to check tests passed etc.
Thanks
Hello, Do you imagine that I have the following txt:
/* Licenciaturas na ESTG-IPVC 2009 – v1.1*/
- Info,
3
dados, ;;
- disciplinas, ;;[;]
LEI;7671;Maria Albertina da silva;[email protected];
9;8;12;9;12;11;6;15;7;11;
LTCGM;6567;Artur Pereira Ribeiro;[email protected];
6;13;14;12;11;16;14;
LEI;7701;Ana Maria Carvalho;[email protected];
8;13;11;7;14;12;11;16;14;
How can I make a C program that convert txt to XML.
thanks
I will register as graduate student, and my friend has suggested I attend a speed reading class. (He is MBA student). I don't know whether it is good to attend this course or not, but at this moment almost of my textbook required time to think about its content.
Has anyone applied speed reading with technical books? Is it good to attend this course?