Search Results

Search found 9082 results on 364 pages for 'c functions'.

Page 161/364 | < Previous Page | 157 158 159 160 161 162 163 164 165 166 167 168  | Next Page >

  • Variable timeouts in GLib

    - by Matachana
    I need to modify a GLib's time-out interval while it is in execution. Is that possible? I took a look to the source code and it seems possible to me, but is required use some non-public functions from GLib internals. Should I reimplement GTimeoutSource or there are a way to do it?

    Read the article

  • "Directly accessing" return values without referencing

    - by undocumented feature
    Look at this ruby example: puts ["Dog","Cat","Gates"].1 This will output Cat as ruby allows me to directly access the "anonymous" array created. If I try this in PHP, however: echo array("Dog","Cat,"Gates")[1] This won't work. What is this called, not only concerning arrays but all functions? Where else is it possible? Feel free to change the question title when you know how this "feature" is called.

    Read the article

  • Linux C++: how to profile time wasted due to cache misses?

    - by anon
    I know that I can use gprof to benchmark my code. However, I have this problem -- I have a smart pointer that has an extra level of indirection (think of it as a proxy object). As a result, I have this extra layer that effects pretty much all functions, and screws with caching. Is there a way to measure the time my CPU wastes due to cache misses? Thanks!

    Read the article

  • Click a button on an MS Access form from C# using Access Interop

    - by Az
    Hi, I can connect to the access database and run functions etc from c#, I can even get a hold of the button I need to click, but I can't make it think it's been clicked. nonManagedDb.DoCmd.OpenForm("frmMaintenance", Access.AcFormView.acNormal, MissingVal, Access.AcFormOpenDataMode.acFormReadOnly, Access.AcWindowMode.acWindowNormal, MissingVal); var RunRep = (CommandButton)nonManagedDb.Forms["frmMaintenance"].Controls["btnDailySheetsReport"]; That's as afar as I've gotten with this, I've tried reflection to grab it's event and invoke it but it's classed as a COM object only so that's out.

    Read the article

  • QGraphicsView ensureVisible() and centerOn()

    - by onurozcelik
    Hi, I am going to do pan/scale stuff on QGraphicsView. So I read the documentation of QGraphicsView and see some utility functions like ensureVisible() and centerOn(). I think I understand what the documentation says but I can' t manage to write a working example. Could you please write/suggest me an example code to understand the issue.

    Read the article

  • In Android OS or Java, what's the difference between a character sequence and a string????

    - by K-RAN
    For the API (Android SDK API version 8) functions whose definitions list character sequence parameters, I can feed the function String instead. Best part is that they work the same way, no hassle, no warnings. Is there a difference between the two types? And more importantly, is there an inherent danger if I send the function a String instead of a character sequence??? Thanks for any clarifications!!! :D

    Read the article

  • The Best Way to shred XML data into SQL Server database columns

    - by eddiegroves
    What is the best way to shred XML data into various database columns? So far I have mainly been using the nodes and value functions like so: INSERT INTO some_table (column1, column2, column3) SELECT Rows.n.value('(@column1)[1]', 'varchar(20)'), Rows.n.value('(@column2)[1]', 'nvarchar(100)'), Rows.n.value('(@column3)[1]', 'int'), FROM @xml.nodes('//Rows') Rows(n) However I find that this is getting very slow for even moderate size xml data.

    Read the article

  • deep or shallow copying?

    - by Dervin Thunk
    Dear all. I was wondering if there are examples of situations where you would purposefully pass an argument by value (deep copy) in C. For instance, passing a char to a function is usually cheaper in space than passing a char* (if there's no need to share the value), since char is 1 byte and pointers are, well, whatever they are in the architecture (4 in my 32 bit machine). ?(When) do you want to pass (big) deep copies to functions? if so, why?

    Read the article

  • Flex DataGrid not Displaying Data

    - by asawilliams
    I have a custom dataGrid that acts more like a 2D list (if that makes sense at all). I am dynamically creating the columns and recreating the dataProvider to suit my needs. While debugging I can see that I am creating the columns and setting them to the dataGrid and creating and setting the dataProvider, but for some reason I am able to see the dataGrid and the columns but not the data. [Bindable] private var mockData:ArrayCollection = new ArrayCollection([ {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}]); ... <TwoDimensionalList width="100%" height="100%" numColumns="7" numRows="7" dataField="value" dataProvider="{mockData}"/> The snippet of code from the object only contains the important functions, everything else is not important (getters, setters, etc ...). While debugging I checked all the variables in the functions to make sure they were assigned and a value that I was expecting. [Snippet] public class TwoDimensionalList extends DataGrid { ... /** * Creates and sets properties of columns */ private function createColumns():void { var column:DataGridColumn; var cols:Array = this.columns; for(var i:uint=0; i < numColumns; i++) { column = new DataGridColumn("column"+i.toString()); column.dataField = "column"+i.toString(); cols[i]=column; } this.columns = cols; // go to the current gotoPage(this._currentPageNum); } /** * Sets the data for the dataprovider based on the * number of columns, rows, and page number. * * @param pageNum the page number of the data to be viewed in the DataGrids. */ private function gotoPage(pageNum:uint):void { _currentPageNum = pageNum; var startIndex:uint = (pageNum-1)*numColumns*numRows; var data:ArrayCollection = new ArrayCollection(); for(var i:uint=0; i < numRows; i++) { var obj:Object = new Object(); for(var j:uint=0; j < numColumns; j++) { if((i+(j*numRows)+startIndex) < _dataProvider.length) obj["column"+j.toString()] = String(_dataProvider.getItemAt(i+(j*numRows)+startIndex)["value"]); } data.addItem(obj); } this.dataProvider = data; } }

    Read the article

  • making multiple c# file for one asp.net page

    - by Nikhil K
    For my project(in asp.net) i wrote near 1000 lines of c# code for one asp.net page.It includes so many functions.The problem is,it is going complicated while i am writing more codes on one page.How can i make multiple c# files for one asp.net page?? I tried by adding new class in VS2008.But calling a function from one file to other is making error(item is not present in current file).How can i do that??

    Read the article

  • overloading new/delete problem

    - by hidayat
    This is my scenario, Im trying to overload new and delete globally. I have written my allocator class in a file called allocator.h. And what I am trying to achieve is that if a file is including this header file, my version of new and delete should be used. So in a header file "allocator.h" i have declared the two functions extern void* operator new(std::size_t size); extern void operator delete(void *p, std::size_t size); I the same header file I have a class that does all the allocator stuff, class SmallObjAllocator { ... }; I want to call this class from the new and delete functions and I would like the class to be static, so I have done this: template<unsigned dummy> struct My_SmallObjectAllocatorImpl { static SmallObjAllocator myAlloc; }; template<unsigned dummy> SmallObjAllocator My_SmallObjectAllocatorImpl<dummy>::myAlloc(DEFAULT_CHUNK_SIZE, MAX_OBJ_SIZE); typedef My_SmallObjectAllocatorImpl<0> My_SmallObjectAllocator; and in the cpp file it looks like this: allocator.cc void* operator new(std::size_t size) { std::cout << "using my new" << std::endl; if(size > MAX_OBJ_SIZE) return malloc(size); else return My_SmallObjectAllocator::myAlloc.allocate(size); } void operator delete(void *p, std::size_t size) { if(size > MAX_OBJ_SIZE) free(p); else My_SmallObjectAllocator::myAlloc.deallocate(p, size); } The problem is when I try to call the constructor for the class SmallObjAllocator which is a static object. For some reason the compiler are calling my overloaded function new when initializing it. So it then tries to use My_SmallObjectAllocator::myAlloc.deallocate(p, size); which is not defined so the program crashes. So why are the compiler calling new when I define a static object? and how can I solve it?

    Read the article

  • Performance Cost of a Memcopy in C/C++

    - by Cenoc
    So whenever I write code I always think about the performance implications. I've often wondered, what is the "cost" of using a memcopy relative to other functions in terms of performance? For example, I may be writing a sequence of numbers to a static buffer and concentrate on a frame within the buffer, in order to keep the frame once I get to the end of the buffer, I might memcopy all of it to the beginning OR I can implement an algorithm to amortize the computation.

    Read the article

  • Does EOF actually exist?

    - by terrani
    Hi, When I use file functions in PHP, I check for EOF. I wonder if EOF actually exist in a file. When I create an empty text file, it displays 0KB. How does EOF exist in a file with 0KB?

    Read the article

  • Kohana 3 - Get URLs

    - by booze2go
    Hi Guys, could you help me with following questions. How do i get the: absolute/relative current url http://www.example.com/subdir/controller/action /subdir/controller/action absolute/relative application url http://www.example.com/subdir/ /subdir/ I could of course use native php to get it but i think i should rather use ko3 functions. Any idea how that works? Thanks in advance!

    Read the article

  • Outputing UTF-8 string on Mac OS's Terminal

    - by SuperBloup
    I got a programm in haskell outputting utf-8 using the package utf8-string and using only the output functions of this package. I set the encoding of each file I write to this way : hSetEncoding myFile utf8 {- myFile may be stdout -} but when I try to output : alpha = [fromEnum 0x03B1] {- a -} instead of the nice alpha letter I got on Linux (or in a file on windows), I got the following : α The weird thing is even if I try to write the output on a file, I can't read it back with mvim as an utf-8 file. Is there any way to get the correct behaviour

    Read the article

  • How do i call a method by a string name using python?

    - by gath
    I have the following class; class myStringMethod(): def __init__(self): self.func_list= [('func1','print_func1()'),('func2','print_func2()')] def print_func1(self, name): print name def print_func2(self, name): print name def call_func_by_name(self): for func in self.func_list: getattr(self, func[1])('Func Name') if __name__=='__main__': strM = myStringMethod() strM.call_func_by_name() #Nothing prints out! No functions get called out, what am i missing? gath

    Read the article

  • Qt - serialize/deserialaize text plus picture

    - by Narek
    I want to use a field (kind of QTextEdit), which is capabale of storing picture and text (like MS Word is doing) and it serializes and deserialaizes picture+text data. Is there any Qt Widget that allows us to manipulate with picture and text simultaniously and it has set/get functions which operate with serializable type? In othger words, I want to know if there exsists any Qt widget that can store picture+text and has "get" types of function that returns the content of that widgets editable area, which is a Type that could be serialized with QDataStream.

    Read the article

  • How do I prevent use of beta classes from google guava library?

    - by mjlee
    We have been using Google collections in the production for several months. We would like to start using guava for additional functions. However, I'm afraid to bring guava into our product stack b/c some developers may start to use 'beta' classes. We have various unit-tests in our code but at this point, I prefer not to include 'beta' class b/c it is subject to change in the future. Is there any easy way to do detect if the project includes any 'beta' guava classes?

    Read the article

  • What is the difference between a private and public funtion?

    - by Kyle
    I am a new programmer, and I started in C and am now starting to enjoy JavaScript and a tiny bit of PHP more. Lately I've heard the terms 'private' and 'public' functions a lot. Could anybody give an explanation of the both and how they are of use to a programmer? And I'm probably totally wrong here... but is a (function(){}) in javascript a private function?

    Read the article

  • VB.NET Function Return

    - by waves
    In order to return a value from a VB.NET function one can assign a value to the "Functions Name" or use "return value." I sometimes see these inter-mixed in the same function. Personally, I prefer the return. My question is, what is the internal difference, if any, between the two?

    Read the article

  • String Compression using Lempel-Ziv

    - by roybot
    Im looking for a way of compressing a given string using the Lempel-Ziv Algorithm. Preferably there would only be a set of two functions, encoder and decoder. The encoder takes the string and returns an integer. The decoder takes the integer and returns the original string. Time complexity is not important. How would you implement this?

    Read the article

  • How to relink existing shared library with extra object file

    - by awy
    I have existing Linux shared object file (shared library) which has been stripped. I want to produce a new version of the library with some additional functions included. I had hoped that something like the following would work, but does not: ld -o newlib.so newfuncs.o --whole-archive existinglib.so I do not have the source to the existing library. I could get it but getting a full build environment with the necessary dependencies in place would be a lot of effort for what seems like a simple problem.

    Read the article

< Previous Page | 157 158 159 160 161 162 163 164 165 166 167 168  | Next Page >