Search Results

Search found 7418 results on 297 pages for 'argument passing'.

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

  • Objective-C: Initializing char with char at index of string.

    - by Mr. McPepperNuts
    unichar myChar = [myString characterAtIndex:0]; [myNSMutableArray addObject:myChar]; I am trying to insert the first char of a string into an array, to create an array of chars. the first line does not give me an error. The second line however, provides the following error: warning: passing argument 1 of 'addObject:' makes pointer from integer without a cast This also crashes the application with a "bad address" error. I thought this error was due to a problem with memory allocation. Can someone shed some light on this.

    Read the article

  • Embedded C++, any tips to avoid a local thats only used to return a value on the stack?

    - by lisarc
    I have a local that's only used for the purposes of checking the result from another function and passing it on if it meets certain criteria. Most of the time, that criteria will never be met. Is there any way I can avoid this "extra" local? I only have about 1MB of storage for my binary, and I have several thousand function calls that follow this pattern. I know it's a minor thing, but if there's a better pattern I'd love to know! SomeDataType myclass::myFunction() { SomeDataType result; // do I really need this local??? // i need to check the result and pass it on if it meets a certain condition result = doSomething(); if ( ! result ) { return result; } // do other things here ... // normal result of processing return SomeDataType(whatever); }

    Read the article

  • Client / Server security from mobile to website

    - by Amir Latif
    Hey. Am new to the world of web programming and learning a bunch of fairly simple new pieces of tech, trying to piece them all together. So, we have a simple client (currently iPhone, to move to J2ME soon) that's pulling down lists of data via PHP, which is talking to a MySQL db. I have a rudimentary user/login system so that data is only served to someone who matches a known user etc, either on the website or on the client. All the php scripts on the website that query the DB check to make sure an active session is in place, otherwise dumping the user back to the login screen. I've read a little about SSL and want to know if that is sufficient to protect the website AND the data passing between the server and the client?

    Read the article

  • Powershell Foreach-Object with if statement not working - help!

    - by Dmart
    I have a batch file that takes a computer name as its argument and will install Java JRE on it remotely. Now, Im trying to run this Powershell script to repeatedly call the batch file and install Java on any system that it finds without the latest version. It seems to run error-free, but the statements inside the if code block never seem to run - even when the if conditional test evaluates to true. Can anyone look at this script and point out what I'm possibly missing? I'm using the Quest AD cmdlets, and BSOnPosh module. Thank you. get-qadcomputer -sizelimit 0 -name mypc* -searchroot 'OU=MyComputers,DC=MyDomain,DC=lcl'| test-host -property name |ForEach-Object -process { $targnm = $_.name $tststr=reg query "\\$targnm\HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" /v Java6FamilyVersion if(-not ($tststr | select-string -SimpleMatch '1.6.0_20')) { $mssg="Updating to JRE 6u20 on $targnm" Out-Host $mssg Out-File -filepath c:\install_jre_log.txt -inputobject $mssg -Append cmd /c \\server\apps\java\installjreremote.cmd $targnm } else { $mssg ="JRE 6u20 found on $targnm" Out-Host $mssg Out-File -filepath c:\install_jre_log.txt -inputobject $mssg -Append } }

    Read the article

  • searching map by value

    - by Mariusz Chw
    I have 2 elements (for now) map: #define IDI_OBJECT_5001 5001 #define IDI_OBJECT_5002 5002 /.../ ResourcesMap[IDI_OBJECT_5001] = "path_to_png_file1"; ResourcesMap[IDI_OBJECT_5002] = "path_to_png_file2"; I'm trying to implement method for searching this map. I'm passing string argument (file path) and method return int (key value of map) int ResFiles::findResForBrew(string filePath) { string value = filePath; int key = -1; for (it = ResourcesMap.begin(); it != ResourcesMap.end(); ++it) { if (/*checking if it->second == value */) { key = it->first; break; } } return key; } How I could check when it-second- == value, and then return that key? I would be grateful for some help. Thanks in advance.

    Read the article

  • rails migration. modify starting point for auto_increment

    - by railsnew
    I have a table already created. I am looking for a rails migration where I can modify the starting point of the auto_increment number for id column of my table. Let's say I want it to start from 1000. I googled a bit and came across this: it says: :options "string" pass raw options to your underlying database, e.g. auto_increment = 10000. Note that passing options will cause you to lose the default ENGINE=InnoDB statement Can this be used for something I want? and how will the migration look since i am changing the column and not creating new one...

    Read the article

  • Javascript handling textarea

    - by bbenton
    Hi all, I'm a bit new to Javascript and am trying to create a delimited string from a textare. The problem is when passing in the textarea, it adds newlines for each row on the textarea. I need to have the entire textarea parsed into a string with a delimiter for each line (replacing the newline char). So for example, if you passed in a textarea with the following lines (which is also how it looks when using the alert function): abcd efgh ijkl It would look like: abcd-efgh-ijkl after parsing. function submitToForm(form) { var param_textarea = form.listofplugins.value; var test = param_textarea.replace(/\\r?\\n/, /:/) alert(test); } Thanks a lot!

    Read the article

  • How to pass json via a form element

    - by becomingGuru
    I have this swf (flash) file that provides the json that needs to be sent to the server. I wrote a very simple jQuery: function submitForm(swf_json) { $('#swfjson').val(swf_json); #swfjson is an input of type hidden $('#titleForm').submit(); } and the swf will call the submitForm above and I receive the request.POST in django as usual. But, django is interpreting the swf_json as a string "Object object" >>>type(request.POST['swfjson']) <type 'unicode'> Of course I can pass the json as a string to the view function. Doesn't seem good to me. Any other way of passing the json object to the django view?

    Read the article

  • Is it possible to transfer data between html pages driven by spring web flow?

    - by Easwaramoorthy Kanagaraj
    I am aware of passing data between jsp in spring web flow. Is it possible to transfer data between html pages driven by spring web flow. I don't want to use the HTML5 local storage capabilities. Example: Page 1: Search box for an employee id. Page 2: Search result for the employee details. Two ways that I could think: Get the employee details in page 1 by ajax and pass the result to the page two. Pass the employee id to page 2 and get the result by ajax in onload. In both case I need to pass any variable/data. I am confused in doing this. Is there anything in the Spring webflow using which I could do this? Thanks in advance, Easwar

    Read the article

  • Zend_Table_Db and Zend_Paginator num rows

    - by Uffo
    I have the following query: $this->select() ->where("`name` LIKE ?",'%'.mysql_escape_string($name).'%') Now I have the Zend_Paginator code: $paginator = new Zend_Paginator( // $d is an instance of Zend_Db_Select new Zend_Paginator_Adapter_DbSelect($d) ); $paginator->getAdapter()->setRowCount(200); $paginator->setItemCountPerPage(15) ->setPageRange(10) ->setCurrentPageNumber($pag); $this->view->data = $paginator; As you see I'm passing the data to the view using $this->view->data = $paginator Before I didn't had $paginator->getAdapter()->setRowCount(200);I could determinate If I have any data or not, what I mean with data, if the query has some results, so If the query has some results I show the to the user, if not, I need to show them a message(No results!) But in this moment I don't know how can I determinate this, since count($paginator) doesn't work anymore because of $paginator->getAdapter()->setRowCount(200);and I'm using this because it taks about 7 sec for Zend_Paginator to count the page numbers. So how can I find If my query has any results?

    Read the article

  • ASP.NET MVC Programming

    - by AlbertRosa
    So here's the deal I'm working on a project that I had originally focused on Zend Framework, But now I want to get into ASP.NET MVC and boy lets just say it's good and a great start though i'm still at the beginning stage of it. But I am having issues with passing Data From My Controller to the Master / Layout Page. Now in Zend I am able to determine which controller and which action I am in through a helper I created. Now I want to implement the same functionality in this ASP.NET MVC application. So my Master Layout Page knows which Controller I am in and hence highilighting the navigation for it. I am using a straight custom html li a structure navigation. Any help on this specific topic would be greatly appreciated.

    Read the article

  • How to access Session values from layers beneath the web application layer.

    - by Matthew Vines
    We have many instances in our application where we would like to be able to access things like the currently logged in user id in our business domain and data access layer. On log we push this information to the session, so all of our front end code has access to it fairly easily of course. However, we are having huge issues getting at the data in lower layers of our application. We just can't seem to find a way to store a value in the business domain that has global scope just for the user (static classes and properties are of course shared by the application domain, which means all users in the session share just one copy of the object). We have considered passing in the session to our business classes, but then our domain is very tightly coupled to our web application. We want to keep the prospect of a winforms version of the application possible going forward. I find it hard to believe we are the first people to have this sort of issue. How are you handling this problem in your applications?

    Read the article

  • GEvent.addListener(...) return?

    - by user354436
    Hello, my Question is as follows: What does GEvent.addListener(map, "click" function(){...}) return into the callback function? I don't find any information in the GMaps reference at all, can you show me some? The only thing I found out was that there are two parameters, "overlay" and "latLng" that are passed. The name of these parameters should not be of interest right? I could also name them "foo" and "bar" as far as I know. But the parameter "overlay" seems to be empty anyway? Also I have problems passing these two parameters directly into a callback function I created myself which looks like that... GEvent.addListener(gmap, "click", generateMarker(overlay, latLng)); ... instead of writing the following, which actually works fine. GEvent.addListener(gmap, "click", function(overlay, latLng) { generateMarker(overlay, latLng); });

    Read the article

  • XML XHR Request resultin in 0 stauts and empty response text.

    - by deepak
    I had another post for the same problem... I think I put the question in a wrong way.. Let me give more details: i have test.html in my c:\ drive and I have a local webserver runnin in qt, and i have some plugin written to that webserver which will get the request and send some response text "hello". in test.html i m making a xml xhr request which will make a GET request like localhost:8080/test which will return the text "hello" by that plugin. Now if I directly open test.html from C:\ it doesnt work, i mean i get response 4 and status 0, and response text nothing.. but the request is passing through webserver and plugin It works fine, when the test.html is put in the webserver pages directory.

    Read the article

  • Ruby/RoR: calling original method via super()?

    - by fearless_fool
    In a RoR app, I want to specialize ActiveRecord's update_attributes() method in one of my models, extracting some of the attributes for special handling and passing the rest of them to the original update_attributes() method. The details: class Premise < ActiveRecord::Base ... def update_attributes(attrs) attrs.each_pair do |key, val| unless has_attribute?(key) do_special_processing(key, val) attrs.delete(key) end end # use original update_attributes() to process non-special pairs super.update_attributes(attrs) end ... end The call to super.update_attributes(attr) raises an error: undefined method `update_attributes' for true:TrueClass ... which makes me suspect I really don't understand the super keyword in Ruby. What am I missing? Specifically, how do I call the original update_attributes() method?

    Read the article

  • Enable 8th bit as Meta in zsh without a warning

    - by Bostonvaulter
    In my quest to configure my shell to work exactly how I want it with respect to the alt/meta key I am having some trouble. Recently I added "bindkey -m" to my .zshrc and now whenever I start a zsh shell (ie open a terminal window) I get this error "warning: `bindkey -m' disables multibyte support". Now since I don't care much about multibyte support atm, is there a way I can disable just this warning? Even better would be a way to use 8th-bit meta as well as multibyte. Also note that this happens on a clean zsh install on 4.3.9 and 4.3.10 My reasoning for wanting bindkey -m vim: alt mappings (my own personal commands/mappings) zsh: alt mappings (such as Alt-. to recall the last argument of the previous command) emacs: alt mappings (lots of built-ins) So, is there any way to disable this warning or otherwise accomplish what I'm trying to do?

    Read the article

  • Pass Types as arguments to a function in Haskell?

    - by Charles Peng
    The following two functions are extremely similar. They read from a [String] n elements, either [Int] or [Float]. How can I factor the common code out? I don't know of any mechanism in Haskell that supports passing types as arguments. readInts n stream = foldl next ([], stream) [1..n] where next (lst, x:xs) _ = (lst ++ [v], xs) where v = read x :: Int readFloats n stream = foldl next ([], stream) [1..n] where next (lst, x:xs) _ = (lst ++ [v], xs) where v = read x :: Float I am at a beginner level of Haskell, so any comments on my code are welcome.

    Read the article

  • Make file Linking issue Undefined symbols for architecture x86_64

    - by user1035839
    I am working on getting a few files to link together using my make file and c++ and am getting the following error when running make. g++ -bind_at_load `pkg-config --cflags opencv` -c -o compute_gist.o compute_gist.cpp g++ -bind_at_load `pkg-config --cflags opencv` -c -o gist.o gist.cpp g++ -bind_at_load `pkg-config --cflags opencv` -c -o standalone_image.o standalone_image.cpp g++ -bind_at_load `pkg-config --cflags opencv` -c -o IplImageConverter.o IplImageConverter.cpp g++ -bind_at_load `pkg-config --cflags opencv` -c -o GistCalculator.o GistCalculator.cpp g++ -bind_at_load `pkg-config --cflags opencv` `pkg-config --libs opencv` compute_gist.o gist.o standalone_image.o IplImageConverter.o GistCalculator.o -o rungist Undefined symbols for architecture x86_64: "color_gist_scaletab(color_image_t*, int, int, int const*)", referenced from: _main in compute_gist.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make: *** [rungist] Error 1 My makefile is as follows (Note, I don't need opencv bindings yet, but will be coding in opencv later. CXX = g++ CXXFLAGS = -bind_at_load `pkg-config --cflags opencv` LFLAGS = `pkg-config --libs opencv` SRC = \ compute_gist.cpp \ gist.cpp \ standalone_image.cpp \ IplImageConverter.cpp \ GistCalculator.cpp OBJS = $(SRC:.cpp=.o) rungist: $(OBJS) $(CXX) $(CXXFLAGS) $(LFLAGS) $(OBJS) -o $@ all: rungist clean: rm -rf $(OBJS) rungist The method header is located in gist.h float *color_gist_scaletab(color_image_t *src, int nblocks, int n_scale, const int *n_orientations); And the method is defined in gist.cpp float *color_gist_scaletab(color_image_t *src, int w, int n_scale, const int *n_orientation) { And finally the compute_gist.cpp (main file) #include <stdio.h> #include <stdlib.h> #include <string.h> #include "gist.h" static color_image_t *load_ppm(const char *fname) { FILE *f=fopen(fname,"r"); if(!f) { perror("could not open infile"); exit(1); } int width,height,maxval; if(fscanf(f,"P6 %d %d %d",&width,&height,&maxval)!=3 || maxval!=255) { fprintf(stderr,"Error: input not a raw PPM with maxval 255\n"); exit(1); } fgetc(f); /* eat the newline */ color_image_t *im=color_image_new(width,height); int i; for(i=0;i<width*height;i++) { im->c1[i]=fgetc(f); im->c2[i]=fgetc(f); im->c3[i]=fgetc(f); } fclose(f); return im; } static void usage(void) { fprintf(stderr,"compute_gist options... [infilename]\n" "infile is a PPM raw file\n" "options:\n" "[-nblocks nb] use a grid of nb*nb cells (default 4)\n" "[-orientationsPerScale o_1,..,o_n] use n scales and compute o_i orientations for scale i\n" ); exit(1); } int main(int argc,char **args) { const char *infilename="/dev/stdin"; int nblocks=4; int n_scale=3; int orientations_per_scale[50]={8,8,4}; while(*++args) { const char *a=*args; if(!strcmp(a,"-h")) usage(); else if(!strcmp(a,"-nblocks")) { if(!sscanf(*++args,"%d",&nblocks)) { fprintf(stderr,"could not parse %s argument",a); usage(); } } else if(!strcmp(a,"-orientationsPerScale")) { char *c; n_scale=0; for(c=strtok(*++args,",");c;c=strtok(NULL,",")) { if(!sscanf(c,"%d",&orientations_per_scale[n_scale++])) { fprintf(stderr,"could not parse %s argument",a); usage(); } } } else { infilename=a; } } color_image_t *im=load_ppm(infilename); //Here's the method call -> :( float *desc=color_gist_scaletab(im,nblocks,n_scale,orientations_per_scale); int i; int descsize=0; //compute descriptor size for(i=0;i<n_scale;i++) descsize+=nblocks*nblocks*orientations_per_scale[i]; descsize*=3; // color //print descriptor for(i=0;i<descsize;i++) printf("%.4f ",desc[i]); printf("\n"); free(desc); color_image_delete(im); return 0; } Any help would be greatly appreciated. I hope this is enough info. Let me know if I need to add more.

    Read the article

  • C++: Cannot convert from foo& to foo*

    - by Rosarch
    I have a method: odp(foo& bar); I'm trying to call it: foo baz; odp(&baz); I get a compiler error: error C2664: "odp" cannot convert parameter 1 from 'foo *' to 'foo &' What am I doing wrong? Aren't I passing in a reference to baz? UPDATE: Perhaps I have a misconception about the relationship between pointers and references. I thought that they were the same, except references couldn't be null. Is that incorrect?

    Read the article

  • List<Object> as a JRBeanCollectionDataSource to a Subreport

    - by Kiran
    am passing a List as a JRBeanCollectionDataSource to a Subreport. here Object is of Type A and B. A is having properties 'name' and 'address' and B is having property 'location'. if Object is of type A then i have display 'name' and 'address' in subreport. and if is of type B then i have to diaplay 'location' in subreport. i have to access a type of Object in a subreport, means is of which type (A or B)?. i have tried a lot but not found any solution. can anyone help me please. thanks in advance.

    Read the article

  • HTTPS vs. VPN for communication between business partners?

    - by Andrew H
    A business partner has asked to set up a site-to-site VPN just so that a few servers can communicate with each other over HTTPS. I'm convinced this isn't necessary, or even desirable. To be fair it must be part of a wider policy, potentially even a legal requirement. However I'd like to convince them to simply offer an IP to us (and us only) and a port of their choosing for HTTPS. Has anyone had a similar experience, or had to come up with a cast-iron argument against a VPN? Allow me to expand a little - we have a web service that initiates a connection to the partner's corresponding service using an encrypted HTTP connection. The connection uses a client certificate to authenticate. The connection is firewalled so only our IPs can contact the service. So why is a VPN necessary?

    Read the article

  • Django - Empty session data in ajax requests

    - by ninja123
    Hi guys, I have an ajax view where I want to set a session variable like such: def upload(request, *args, **kwargs): request.session['test'] = 'test' request.session.modified = True print request.session.items() I have another normal view something like this: def advertise(request): print request.session.items() I get these two strings printed to shell: [('test', 'test')] [('_auth_user_backend', 'django.contrib.auth.backends.ModelBackend'), ('_auth_user_id', 26L)] Why is the session data that I set in the ajax view not passing to my regular views? If I set session data in regular view, everything works as fine, but it seems that ajax requests contain empty session data? Anybody dealt with something like this before? Any suggestions are greatly appreciated. Thanks.

    Read the article

  • Different ways to specify libraries to gcc/g++

    - by abigagli
    I'd be curious to understand if there's any substantial difference in specifying libraries (both shared and static) to gcc/g++ in the two following ways (CC can be g++ or gcc) CC -o output_executable /path/to/my/libstatic.a /path/to/my/libshared.so source1.cpp source2.cpp ... sourceN.cpp vs CC -o output_executable -L/path/to/my/libs -lstatic -lshared source1.cpp source2.cpp ... sourceN.cpp I can only see a major difference being that passing directly the fully-specified library name would make for a greater control in choosing static or dynamic versions, but I suspect there's something else going on that can have side effects on how the executable is built or will behave at runtime, am I right? Andrea.

    Read the article

  • Extracting public key from private key in OpenSSL

    - by ereOn
    Hello, I need to extract the RSA public key from a RSA private key using OpenSSL. I'm currently using RSAPublicKey_dup() passing the RSA* private key to get the public key. However, while the call seems to work, I cannot load (or use) this public key using the openssl command-line tool. If I generate the public key using the command-line tool ("$ openssl rsa -in private.pem -pubout > public.pem"), I can use it and it works like a charm. Do you guys know how I can get this work ? Maybe another function ? The OpenSSL documentation is quite hard to browse... Thank you.

    Read the article

  • Can't get Angular Dart Router to work

    - by JesterXL
    I've tried this syntax in AngularDart 0.11.0: Angular Dart passing data from route service into a controller module.value(RouteInitializerFn, configureRoutes); void configureRoutes(Router router, RouteViewFactory views) { print("configureRoutes"); views.configure({ 'login': ngRoute( path: '/login', view: 'login/login.tpl.html'), 'today': ngRoute( path: '/today', view: '/today/today.tpl.html') }); However, my routing function never seems to get called. I've used both a print statement and breakpoint to no avail. When I attempt to call it like so: WorkoutLoggerApplication(this.rootScope, this.router) { print("WorkoutLoggerApplication::constructor"); new Future.delayed(new Duration(seconds: 2), () { router.go("login", {}); }); } I get: Bad state: Invalid route name: login I've tried 0.10.0, but no dice. I've also tried 3 varieties of the new bind function format, both also don't seem to ever fire the routing function.

    Read the article

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