Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 205/332 | < Previous Page | 201 202 203 204 205 206 207 208 209 210 211 212  | Next Page >

  • MediaWiki : is it possible to add an edit link in a template?

    - by leo
    I have a template on my wiki, kind of a box template. Then, there is this page where I use it several times. Can I add an edit link to each of the boxes so I don't have to edit the whole page in order to modify one of the boxes? The boxes contain only text, not other templates. Thanks! Edit: Actually there's an easier way to ask my question: Let's say I have a page without sections defined (namely without == titles ==): content A content B content C Is there a way to open an edit form only for content B?

    Read the article

  • What is the best place to store globals in Rails app?

    - by Nick Gorbikoff
    Hello. I was wondering if there is the best practice on where to store global settings in a rails app. What I mean by that is i.e: I have a few globals defined that may change, but not likely and it seems inappropriate to store them in DB since they are used so much. For instance I have SYSTEM_EMAIL & SYSTEM_EMAIL_SIGNATURE & SYSTEM_STORAGE_ROOT. Right now I keep them in environment.rb, but I'm not sure if this is the right palce to store them. Thank you

    Read the article

  • iOS Development: How can I encapsulate a string in an NSData object?

    - by BeachRunnerJoe
    Hello. I'm building a multiplayer game on the iPhone and I need to send string data to the other players in the game. To do that, I need to encapsulate my NSString* string data in an NSData object somehow. Here's an example of how my code is structured... typedef struct { PACKETTYPE packetType; ??? stringToSend; //<---not sure how to store this } StringPacket; StringPacket msg; msg.packetType = STRING_PACKET; msg.stringToSend = ... // <---not sure what to do here NSData *packet = [NSData dataWithBytes:&msg length:sizeof(StringPacket)]; So my question is, if StringPacket is a struct defined in my header, what type should the stringToSend property be so that I can easily call the dataWithBytes method of NSData to encapsulate the packet data in an NSData object? Thanks for your wisdom!

    Read the article

  • How does the stream manipulators work?

    - by Narek
    It is well known that the user can define stream manipulators like this: ostream& tab(ostream & output) { return output<< '\t'; } And this can be used in main() like this: cout<<'a'<<tab<<'b'<<'c'<<endl; Please explain me how does this all work? If operator<< assumes as a second parameter a pointer to the function that takes and returns ostream &, then please explain my why it is necessary? What would be wrong if the function does not take and return ostream & but it was void instead of ostream &? Also it is interesting why “dec”, “hex” manipulators take effect until I don’t change between them, but user defined manipulators should be always used in order to take effect for each streaming?

    Read the article

  • In SQL Server 2000, how to delete the specified rows in a table that does not have a primary key?

    - by Yousui
    Hi, Let's say we have a table with some data in it. IF OBJECT_ID('dbo.table1') IS NOT NULL BEGIN DROP TABLE dbo.table1; END CREATE TABLE table1 ( DATA INT ); --------------------------------------------------------------------- -- Generating testing data --------------------------------------------------------------------- INSERT INTO dbo.table1(data) SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT NULL UNION ALL SELECT 400 UNION ALL SELECT 400 UNION ALL SELECT 500 UNION ALL SELECT NULL; How to delete the 2nd, 5th, 6th records in the table? The order id defined by the following query. SELECT data FROM dbo.table1 ORDER BY data DESC; Note, this is in SQL Server 2000 environment. Thanks.

    Read the article

  • apply function using expand.grid in R

    - by kolonel
    I have two vectors x and y. I create a grid using the following function: v = expand.grid(x, y) I have a function defined as follows N <- function(a, b , dat){ m = ncol(Filter(function(z) a*max(z)*min(z) < b , dat[1:ncol(dat)])) return(m) } and then I need to maximize N over a grid of x,y: Maximize <- function(x , y ,dat){ v = as.matrix(expand.grid(x,y)) # Here is where I want to map the values of v and get the maximum element and # get the tuple in v that maximized N temp1 <- max(apply(v , 1 , N(v[[1]] , v[[2]] , dat))) } Thanks

    Read the article

  • LocationListener is being called multiple times

    - by sujitjitu
    Hi, I am working on an Location Based Application. In this application i am using LocationListener class to update the location when the Location is changed.In each Activity i have different LocationListener to update location and do some specific work on updated location. But my problem is that when i am changing my location through DDMS , the LocationListener is being called of that current Activity as well as all the activities of the whole application where LocationListener has been defined. I don't know whether there should be one LocationListener for the whole application or for each Activity we should have different LocationListener. Please help me......Its urgent..........Thanks in Advance.....

    Read the article

  • Setting an empty default value for a char-column in MySQL?

    - by user281434
    Hi In phpMyAdmin I have a char(32) column that has no default value(ie. Default: None). When I try to insert data through a SQL query, it throws out an error saying that the column "doesn't have a default value". I need it to be empty, so instead I've just set it's default value as "As defined: " and then nothing in the value field. Is this a bad idea? And is it any better than simply throwing in an empty value for the column in the SQL query? Thanks for your time.

    Read the article

  • How to import .class file in a .java file?

    - by Namratha
    Hi, What i need to do is as follows: I have a bigloo scheme program (*.scm), then using the bigloo frameworks jvm a class file is generated. I want to use this .class file from a .java file. That is, i need to import this(.class) file as i want to use some functions defined in the scheme file which is now a .class file. How do i do it in Eclipse? i have created two packages one for java and one for the .class file. Then i import the package containing the .class file. But i am not able to use the function in the .class file in the .java file. Are there any settings to be done? Please let me know how this can be done.

    Read the article

  • Data manipulation without server side

    - by monczek
    Hi, I have to create a very simple webpage to show, filter and add data from not-yet-defined source (probably txt/xml/cvs). Records should be visible as a table, filtered using 3 criteria fields. There should be also possibility to add new records. My first thought was: XHTML + jQuery + csv2table + PicNet Table Filter. It does exactly what I want except adding rows - that is saving changes in source file (probably due to security risk). My question is - is there any possibility to do it without involving server side like asp.net, jee, php, sql? Source file is located on the server. Thanks for your ideas :-)

    Read the article

  • Dismissing the keyboard in a UIScrollView

    - by Nicholas1024
    Alright, I have a couple of UITextFields and UITextViews inside a UIScrollView, and I'd like to set the keyboard to disappear whenever the scrollview is touched or scrolled (except when you touch down inside the text field/view, of course). My current attempt at doing this is replacing the UIScrollView with a subclass, and setting it to call a removeKeyboard function (defined inside the main view controller) inside the touchesBegan method. However, this only removes the keyboard for a normal touch, not when the view is simply scrolled. So, what's the best way to remove the keyboard inside a UIScrollView? Thanks in advance for your help.

    Read the article

  • Placing text on UIView in custom location

    - by JAM
    I am trying to calculate a position to place label on the screen. The goal is to place "word" label in lower right corner of the first square block If yellowish square is defined as myView = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 70, 70)]; [self.view addSubview:myView]; [myView setBackgroundColor:[UIColor colorWithHexString:@"FFFFEC"]]; Using it, i'd like to place a label in it's lower right corner l1 = [[UILabel alloc] init]; [l1 setText:@"word"]; [l1 setFrame:CGRectMake(myView.frame.origin.x + myView.frame.size.width, myView.frame.origin.y + myView.frame.size.height, 700, 700)]; [l1 setFont:[UIFont fontWithName:@"Arial" size:10.0]]; [l1 setBackgroundColor:[UIColor colorWithHexString:@"CCFFFEC"]]; [l1 setTextAlignment:UITextAlignmentRight]; [l1 sizeToFit]; This is what happens: The matter here obviously, is in a correct offset. Knowing the font and size of text, how can one correctly calculate it?

    Read the article

  • a macro question for c language (#define)

    - by Daniel
    I am reading source code of hoard memory allocator, and in the file of gnuwrapper.cpp, there are the following code #define CUSTOM_MALLOC(x) CUSTOM_PREFIX(malloc)(x) What's the meaning of CUSTOM_PREFIX(malloc)(x)? is CUSTOM_PREFIX a function? But as a function it didn't defined anywhere. If it's variable, then how can we use variable like var(malloc)(x)? more code: #ifndef __GNUC__ #error "This file requires the GNU compiler." #endif #include <string.h> #include <stdlib.h> #include <stdio.h> #include <malloc.h> #ifndef CUSTOM_PREFIX ==> here looks like it's a variable, so if it doesn't define, then define here. #define CUSTOM_PREFIX #endif #define CUSTOM_MALLOC(x) CUSTOM_PREFIX(malloc)(x) ===> what's the meaning of this? #define CUSTOM_FREE(x) CUSTOM_PREFIX(free)(x) #define CUSTOM_REALLOC(x,y) CUSTOM_PREFIX(realloc)(x,y) #define CUSTOM_MEMALIGN(x,y) CUSTOM_PREFIX(memalign)(x,y)

    Read the article

  • C++ Static Array Initialization - Memory Issue

    - by donalmg
    Hi, I have a header file which contains a member variable declaration of a static char array: class ABC { public: static char newArray[4]; // other variables / functions private: void setArray(int i, char * ptr); } In the CPP file, I have the array initialized to NULL: char ABC::newArray[4] = {0}; In the ABC constructor, I need to overwrite this value with a value constructed at runtime, such as the encoding of an integer: ABC::ABC() { int i; //some int value defined at runtime memset(newArray, 0, 4); // not sure if this is necessary setArray(i,newArray); } ... void setArray(int i, char * value) { // encoding i to set value[0] ... value [3] } When I return from this function, and print the modified newArray value, it prints out many more characters than the 4 specified in the array declaration. Any ideas why this is the case. I just want to set the char array to 4 characters and nothing further. Thanks...

    Read the article

  • Iterate over the lines of a string

    - by Space_C0wb0y
    I have a multi-line string defined like this: foo = """ this is a multi-line string. """ I need an iterator that iterates over the individual lines of that string. I could of course do it like this: lineiterator = iter(foo.splitlines()) Is there a more direct way of doing this? In this scenario the string has to traversed once for the splitting, and then again by the parser. It doesn't matter in my test-case, since the string is very short there, I am just asking out of curiosity. Python has so many useful and efficient built-ins for such stuff, but I could find nothing that suits this need.

    Read the article

  • How should I use try...except while defining a function?

    - by SpawnCxy
    Hi all, I find I've been confused by the problem that when I needn't to use try..except.For last few days it was used in almost every function I defined which I think maybe a bad practice.For example: class mongodb(object): def getRecords(self,tname,conditions=''): try: col = eval("self.db.%s" %tname) recs = col.find(condition) return recs except Exception,e: #here make some error log with e.message What I thought is ,exceptions may be raised everywhere and I have to use try to get them. And my question is,is it a good practice to use it everywhere when defining functions?If not are there any principles for it?Help would be appreciated! Regards

    Read the article

  • C++ Vector of vectors

    - by xbonez
    I have a class header file called Grid.h that contains the following 2 private data object: vector<int> column; vector<vector<int>> row; And a public method whose prototype in Grid.h is such: int getElement (unsigned int& col, unsigned int& row); The definition of above mentioned function is defined as such in Grid.cpp: int getElement (unsigned int& col, unsigned int& row) { return row[row][col] ; } When I run the program, I get this error: error C2109: subscript requires array or pointer type Whats going wrong?

    Read the article

  • How do I pass object values with render :action => 'new'

    - by PlanetMaster
    Hi, In an app I have the following: def new @property = Property.new(:country_id => 1, :user_id => current_user.id, :status_id => 'draft') end def create @property = Property.new(params[:property]) if @property.save flash[:success] = t('The_property_is_successfully_created') redirect_to myimmonatie_url else flash.now[:error]=t("The_property_could_not_be_created") render :action => 'new' end end When an error accors, the line render :action = 'new' gets executed, but the my form gives an error: user blank country blank These cannot be blank (defined in model), meaning this code: @property = Property.new(:country_id => 1, :user_id => current_user.id, :status_id => 'draft') is not executed anymore. What is the reason and solution? Thanks!

    Read the article

  • Lua not producing table of functions (IO API)

    - by ArtOfCode
    I'm working on a basic project in Lua. I've been trying to get data from files using the IO API (as defined here), but when I open a file and give it a handle, it doesn't seem to return a table of functions. The (erroneous bit of) code: local unread = fs.list("email/"..from.."/") local send = "" for _,file in ipairs(unread) do local handle = io.open(file,"r") local text = handle:read("*a") send = send .. text .. "\n" handle.close() fs.delete(file) end The fs you see on the first line is a professional filesystem wrapper round the IO API, not my work and perfectly error-free, so that's not the problem. However, when I try to read the file (handle:read()), it throws "attempt to index nil". Tracing it, it turns out that handle itself is nil. Any ideas?

    Read the article

  • comlen function in Java

    - by davit-datuashvili
    in c or c++ the function comlen is defined such int comlen(char *p,char *q){ int i=0; while *p && (*p++==*q++) i++; return i; } Is this code equivalent of this function? int comlen(String s,String m){ int i=0; while (i<s.length() && s.charAt(i)==m.charAt(i)){ i++; } return i; }

    Read the article

  • PHP __call vs method_exists

    - by neo
    The Project I'm working on contains something like a wrapper for call_user_func(_array) which does some checks before execution. One of those checks is method_exists (In Case the supplied first argument is an instance of a class and the second is a method name) The other is_callable. The function will throw an exception if one of those checks fails. My Code contains an array with function names (setFoo, setBar, etc.) and the php magic function for overloading (__call) which handles setting, replacing and deletion of certain variables (better certain array elements). The Problem: method_exists will return false if the function is not defined. Do I have any chance to get a true if the __call function does proper handling of the request?

    Read the article

  • Jquery, ajax() and each(), how to wait untill all info is really loaded?

    - by Moustard
    Hello, I have a function using $.ajax() to get values from an XML file, when the info is loaded and success event is fired, I use $(xml).find('').each(function(){}); to populate some vars... function getData() { $.ajax({ type: 'GET', url : 'info.xml', dataType: 'xml', success: function(xml) { $(xml).find('DATAS').each(function() { date = new Date($(this).attr('DATE')); alert(date); }) //Here I have a bigger find/each that should take more time }, error: function() { return false; } }); } In this case, when I trigger the function from the document ready function, the alert shows the right data, but If I remove the alert from the function and try this instead, date wont be defined yet: $(document).ready(function() { if(getData() != false) { alert(date); } }); I guess in this case the data is not ready yet? Is there a way to keep control on when the whole each() traversing is finished and ready?

    Read the article

  • What's in-memory database technology that do realtime materialized view?

    - by KA100
    What I'm looking for is something like materialized views in front-end that shows my data in diffident ways without full recalculation. let's say I have stock watcher with many front-end views and dashborads some based on aggregation, order by or just filter with different criteria defined realtime by user. Now, I receive online record updates from some webservice and it's not like "data warehouse" every single record can be updated any time and it actually happens every second. Is there any technology can help me in such I create something like materialized view and it's update it without doing full recalculation every time data changed. Thank you.

    Read the article

  • C++ standard: dereferencing NULL pointer to get a reference?

    - by shoosh
    I'm wondering about what the C++ standard says about code like this: int* ptr = NULL; int& ref = *ptr; int* ptr2 = &ref; In practice the result is that ptr2 is NULL but I'm wondering, is this just an implementation detail or is this well defined in the standard? Under different circumstances a dereferencing of a NULL pointer should result in a crash but here I'm dereferencing it to get a reference which is implemented by the compiler as a pointer so there's really no actual dereferencing of NULL.

    Read the article

  • How to change the font size in table cells according to cells content ?

    - by misha-moroshko
    I have an HTML table which has incrementing numbers starting from 0 in its cells (left to right, up to bottom). I fixed in CSS the width and the height of the cells (40px width, 25px height, in my case). When the table becomes larger, the numbers inside it becomes large also (for example, the last number is 1266356). This causes the cells to be wider than I defined in the CSS, which expands the whole table accordingly. Instead, I would like the font of the numbers to be smaller to keep the width of the cell 40px. How can I accomplish this using CSS / Javascript / jQuery ?

    Read the article

< Previous Page | 201 202 203 204 205 206 207 208 209 210 211 212  | Next Page >