Hello there, I have written some general functions to convert between decimal and any other base-n number system(n<=36 for now) and vice-versa. Don't want to make things messy here so i have posted the code here.
Could anybody suggest any better way for this? May be more effective and Rubyish?
Thanks
When I do:
less /usr/include/stdio.h (which is only a C library - nothing to do with C++)
I see __THROW after quite a few function declarations.
Also, comments above a few functions say that 'This function is a possible cancellation point and therefore not marked with __THROW'
What is all this for?
THROW is meant to be for exception handling.. but as far as I know, C doesn't provide any support for it...
Plz explain.
Hi,
Iwant to know the sites that can give me information on the list of javascript functions that are supported by IE/Firefox/Opera/Safari.
Can you help me with the sites .
Thank you in advance.
Hi,
I'm currently doing an application with 5 View Controllers and a tabBar on the bottom.
For this application, I need to set up a button in viewController(1) which can send me to an other viewController(3), but without touching the tabBar (it will be hidden for the viewController(1)).
I basically know how to use a tabBar, but I don't know wich functions I can use to do that.
Thanks in advance!
Séraphin
Hey All,
I am a little stuck and need some advice/help.
I have a progress bar:
<mx:ProgressBar id="appProgress" mode="manual" width="300" label="{appProgressMsg}" minimum="0" maximum="100"/>
I have two listener functions, one sets the progress, and one sets the appProgressMsg:
public function incProgress(e:TEvent):void {
var p:uint = Math.floor(e.data.number / e.data.total * 100);
trace("Setting Perc." + p);
appProgress.setProgress(p, 100);
}
public function setApplicationProgressStep(e:TEvent):void {
trace("Setting step:" + e.data);
appProgressMsg = e.data;
}
I want to reuse this progress bar alot. And not necessarily for ProgressEvents, but when going through steps.
For instance, I loop over a bunch of database inserts, and want to undate the progress etc.
Here is a sample:
public function updateDatabase(result:Object):void {
var total:int = 0;
var i:int = 0;
var r:SQLResult;
trace("updateDatabase called.");
for each (var table:XML in this.queries.elements("table")) {
var key:String = table.attribute("name");
if (result[key]) {
send(TEvent.UpdateApplicationProgressStep, "Updating " + key);
i = 1;
total = result[key].length;
for each (var row:Object in result[key]) {
//now, we need to see if we already have this record.
send(TEvent.UpdateApplicationProgress, { number:i, total: total } );
r = this.query("select * from " + key + " where server_id = '" + row.id + "'");
if (r.data == null) {
//there is no entry with this id, make one.
this.query(table.insert, row);
} else {
//it exists, so let's update.
this.update(key, row);
}
i++;
}
}
}
}
Everything works fine.
That is, the listener functions are called and I get trace output like:
updateDatabase called.
Setting step:Updating project
Setting Perc 25
Setting Perc 50
Setting Perc 75
Setting Perc 100
The issue is, only the very last percent and step is shown. that is, when it's all done, the progress bar jumps to 100% and shows the last step label.
Does anyone know why this is?
Thanks in advance for any help,
Jason
Hi all,
I need wake up PC from sleep to perform some actions - from C#. I've used CreateWaitableTimer functions, everything goes fine, at given time PC wakes up - but monitor stays in power save mode (turned off). So i want to know - how possible to turn on monitor after wake up?
PS I've tried "Complete Guide on How To Turn A Monitor On/Off/Standby" - with SendMessage (Codeproject) and SetThreadExecutionState(ES_DISPLAY_REQUIRED) - it doesn't work
Any ideas?
I have WAMP 2.0 installed and am working on a content management system using PHP and MySQL. Is it possible to use the PHP FTP functions on my local machine, so I can test them?
Thanks!
Mike
Hi,
I'm a .NET programmer who've just started to learn more about client side scripting, and I was wondering sometimes you use $get('value') and $find('value') and I've discovered that these are just shortcuts for
$get = GetElementByID
$find = FindComponent
however, I still don't understand, what is the difference between these two functions in JavaScript?
Thanks in advance.
I have a Word document which is several hundred pages long.
I would like to use a macro to automatically create about a dozen or so sub-documents based on certain rules (mainly, occurrence of certain strings in each Section).
Is this possible? What VBA functions should I read-up on? Does anybody know of any code examples which are even remotely similar and which I may be able to customize for my purposes?
Thanks
In my list, addition, the operation + appears as #. How can I make this appear exactly as +? When I eval it, it should also work exactly the same as +.
I guess this would also apply in all kinds of functions in Clojure...
Thanks guys.
I would like to know how to create a php function that can be installed in php
just like the already built in functions like :
rename
copy
The main point I would like to achieve is a simple php function that can be called from ANY php page on the whole host without needing to have a php function within the php page / needing an include.
so simply I would like to create a function that will work like this :
location();
That without a given input string will output the current location of the file via echo etc
Hey guys, after using graphical IDE's like Visual Studio, I'm used to pressing CTRL+Space to auto-complete a variable or function name. Now, I know such a thing isn't completely possible in VI, but I heard there was a list of commands that could be mapped that allowed automatic completion of variables and functions in the current file opened. Does anyone know what this sequence is?
Thanks in advance.
Ok, so I'm the author of a CMS and I'm interested in building a CalDAV-server that enables the user to interface with my CMS through CalDAV instead of only through the web, so they can see their calendars, add todos and things like that.
I've looked at http://www.davical.org/ which is a CalDAV service built in PHP, but it has its own database and I already have the DB stuff done and just want a middle-layer services that translates, both ways, to and from my databases using my functions.
Any ideas?
Hi,
is there anyway to fetch only the rows of a table which has a concrete
value in a concrete field.
For example:
$24_people = $table->getFieldAndValue('age', 24);
I now i can do it with a query, but wouldn't you find useful this kind
of functions? or maybe is no possible or is not convenient because some
reason ?
Regards
Javi
The p calls inspect, and puts/print calls to_s for representing its object.
If I run
class Graph
def initialize
@nodeArray = Array.new
@wireArray = Array.new
end
def to_s # called with print / puts
"Graph : #{@nodeArray.size}"
end
def inspect # called with p
"G"
end
end
if __FILE__ == $0
gr = Graph.new
p gr
print gr
puts gr
end
I get
G
Graph : 0Graph : 0
Then, why does ruby has two functions do the same thing? What makes the difference between to_s and inspect?
If I comment out the to_s or inspect function, I get as follows.
##
i want to design an interface has the function to do mapping from Entity object to Form object
public interface IFormToEntityMapper
{
TEntity Map(TForm tForm);
}
and vise versa.
public interface IEntityToFormMapper
{
TForm Map(TEntity tEntity);
}
i have the question if i should define these two functions in one interface and seperate them to different interface. if i put them into one interface, does that violate the SRP?
How do you render the cursor and create highlighting for selected text in Pango?
Also, can I use PangoCairo to render parts of a layout at a time, so I can draw it in different ways (such as with an outline)?
Finally, how did you get your understanding of Pango, there doesn't seem to be very many tutorials and the technical documentation only describes the functions.
Thanks!
I have a repository using Rational ClearCase Explorer 2003.06.10+ which I want to migrate into Serena ChangeMan Version Manager 8.1.4.2.
Is this possible? The ClearCase repository was not used for all it's functions, just as a place to hold copies of documents, so the only thing I need to keep is the files and their version histories.
Example:
SELECT id, name FROM user WHERE id IN (1,2,3,4,5)
ORDER BY FIELD(id, 2, 3, 4, 1, 5)
I've seen some examples using FIND_IN_SET() or FIELD() functions. Which one is better? Are there any more efficient approaches?
Order is supposed to change rarely.
These two functions are both infinite loops,
and the programe hangs once called in the same thread.
gtk_main();
...
pcap_loop(adhandle, 0, packet_handler, NULL);
How do I create a child thread and run pcap_loop(adhandle, 0, packet_handler, NULL); instead?
I'm trying t build a somekind a clone to wordpress and have some problems understanding the functions that are used there. But that's not the problem..
The thing I'm looking for is good book that detailed explains what aspects to be aware of during the creation of the cms and some code snippets or something in that direction..
With best regards
How to create a .BAT file to download file or folder from FTP server? (and replace with it existing file) (we have links like ftp://me:[email protected]/file.file and absolute file link like C:\Users\UserName\Some mixed ??????? English Adress\file.file) (using only native windows (xp vista win7 etc) BAT functions and files)
Hello
I'm creating a website with structure like this:
class main { }
class mysql extends main { }
class user extends main { }
class etc extends main { }
The idea is for these classes to use functions from each other. This doesn't work. How can I call a function from mysql in user?
Martti Laine