Search Results

Search found 1165 results on 47 pages for 'pause'.

Page 38/47 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • c++ tables of unions and structures

    - by newbDeveloper
    I was told to write a program, that creates a union and structure, then creates two-element arrays of unions and structures and fills their fields. I have created a union and a structure, but how to fill their fields in arrays ? #include <iostream> #include <stdlib.h> #include <stdio.h> using namespace std; union complex; union complex{ int i1; long double ld1; } u; struct Person { char* name; int age; bool sex; void show(){ printf("name %s, age %2.0d, sex %1d\n", name , age, sex); }; } person; int main(void) { Person *o = new Person[2]; complex *un = new complex[2]; un[0]->i1=i; system("pause"); return 0; } I've tried un[0]-i1=i; but it's not the proper way to do this.

    Read the article

  • How can I find out if the MainActivity is being paused from my Java class?

    - by quinestor
    I am using motion sensor detection in my application. My design is this: a class gets the sensor services references from the main activity and then it implements SensorEventListener. That is, the MainActivity does not listen for sensor event changes: public void onCreate(Bundle savedInstanceState) { // ... code mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); // The following is my java class, it does not extends any android fragment/activty mShakeUtil = new ShakeUtil(mSensorManager,mAccelerometer,this); // ..more code.. } I can't redesign ShakeUtil so it is a fragment nor activity, unfortunately. Now to illustrate the problem consider: MainActivity is on its way to be destroyed/paused. I.e screen rotation ShakeUtil's onSensorChanged(SensorEvent event) gets called in the process.. One of the things that happen inside onSensorChanged is a dialog interaction, which gives the error: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState When the previous happens between MainActivity's onSaveInstanceState and onPause. I know this can be prevented if I successfully detect that MainActivity is being pause in ShakeUtil. How can I detect that MainActivity is being paused or onSaveInstanceState was called from ShakeUtil? Alternatively, how can I avoid this issue without making Shakeutil extend activity? So far I have tried with flag variables but that isn't good enough, I guess these are not atomic operations. I tried using Activity's isChangingConfigurations(), but I get an undocummented "NoSuchMethodFound" error.. I am unregistering the sensors by calling ShakeUtil when onPause in main ACtivity

    Read the article

  • C programing fopen

    - by Pedro
    #include <stdio.h> #include <stdlib.h> typedef struct aluno{ char cabecalho[60]; char info[100]; int n_alunos; char dados[100]; char curso[100]; int numero; char nome[100]; char e_mail[100]; int n_disciplinas; int nota; }ALUNO; void cabclh(ALUNO alunos[],int a){ FILE *fp; int i; for(i=0;i<100;i++){ fp=fopen("trabalho.txt","r"); } if(fp==NULL){ printf("Erro ao abrir o ficheiro\n"); } while(!feof(fp)){ fgets(alunos[i].cabecalho,100,fp); printf("%s\n",alunos[i].cabecalho); } } fclose(fp); } what is wrong here? main: int main(int argc, char *argv[]){ ALUNO alunos[100]; int aluno; int b; cabclh(aluno,b); system("PAUSE"); return 0

    Read the article

  • C++ program crashes at runtime

    - by qwerty
    Hello, I have this simple c++ program #include <cstdlib> #include <iostream> #include <math.h> #include <stdlib.h> #include <time.h> #include <vector> using namespace std; int aleator(int n) { return (rand()%n)+1; } int main() { int r; int indexes[100]={0}; // const int size=100; //int a[size]; std::vector<int>v; srand(time(0)); for (int i=0;i<25;i++) { int index = aleator(100); if (indexes[index] != 0) { // try again i--; continue; } indexes[index] = 1; cout << v[index] ; } cout<<" "<<endl; system("pause"); return 0; } But at runtime it crashes, so i got that error with 'Send error report' and 'Don't send'. What i'm doing wrong? Thanks!

    Read the article

  • Zend, slow load, "waiting for response" for 20-80 seconds on local site

    - by Tony C.
    So I have several sites running under the same zend setup. All of the sites run pretty normally except one. Upon loading or reloading this one site, reguardless of which page your on (excluding the 404 page explanation later...) you get a serious pause before any content begins to download. Using firebugs net panel you can see that the first request which is www.(siteaddress).com.local you see a "waiting for response" bar (purple) that is going for anywhere from 20 to sometimes 80+ seconds and this isn't on a dev site, this is on a local site under localhost. What I've managed to figure out so far is that all the pages do this except my 404 page. The reason the 404 page doesn't succumb to this is because it uses a seperate controller (the error controller) and therefore bypasses much of the controller and functions the other parts of the site use. Using exit statements I've manged to figure out that the problem happens somewhere between my post dispatch and my main (top most) controllers Init function. If i exit in the main controllers init the page loads (then exits instantly, no wait). If i do the same in the pre or post dispatch the page waits the 20-80 seconds then exits. Is there a diagram or explanation somewhere or a way for me to find out what events fire inbetween the post dispatch and the main controllers init function? Or does anyone have any clue what might cause this? Any help would be greatly appreciated...

    Read the article

  • Help me plan larger Qt project

    - by Pirate for Profit
    I'm trying to create an automated task management system for our company, because they pay me to waste my time. New users will create a "profile", which will store all the working data (I guess serialize everything into xml rite?). A "profile" will contain many different tasks. Tasks are basically just standard computer janitor crap such as moving around files, reading/writing to databases, pinging servers, etc.). So as you can see, a task has many different jobs they do, and also that tasks should run indefinitely as long as the user somehow generates "jobs" for them. There should also be a way to enable/disable (start/pause) tasks. They say create the UI first so... I figure the best way to represent this is with a list-view widget, that lists all the tasks in the profile. Enabled tasks will be bold, disabled will be then when you double-click a task, a tab in the main view opens with all the settings, output, errors,. You can right click a task in the list-view to enable/disable/etc. So each task will be a closable tab, but when you close it just hides. My question is: should I extend from QAction and QTabWidget so I can easily drop tasks in and out of my list-view and tab bar? I'm thinking some way to make this plugin-based, since a lot of the plugins may share similar settings (like some of the same options, but different infos are input). Also, what's the best way to set up threading for this application?

    Read the article

  • Resumable Upload in Ruby on Rails

    - by user253011
    Hi, I have been searching for a way for resumable file upload in RoR. In conclusion, I found out other than Java Applet no client-side-and-cross-platform agent can access the file system in such a way that to request the file from the position where the upload got terminated (due to any reason) with some exceptions like http://github.com/taf2/resume-up/tree/master (built in native Ruby, but requires google gears which is not "reliable" yet when it comes to cross platform almost same story as of ActiveX!) Since the only reliable option left is java applet, is there any good tutorial/forum/documentation for those paid java applets, such as "thin slice upload" etc. to make it work with rails application. I have found one http : // github . com / dassi / mediaclue , its a non-multi-ligual-German-Application in which they used jumploader. But in that application, I am unable to see resumable functionality. Scratching my head against their documentation, i found out http : // jumploader.com / doc_resume.html It tells that jumploader has resume functionality in Cross session resume, the one i am looking for (if the user close the browser the new session gets hold on uncompleted uploaded files from the old session against the user id). But I cant find any example on their demos page which actually pause/RESUME functionality in a continuous manner! Is it even possible to achieve that kind of resumable functionality. Please tell me about any options/example/demos preferable deployed in rails. I shall be very much obliged. ~ Thanks

    Read the article

  • What library to choose to build a user interface for a C++ software that uses SDL

    - by Barth
    Dear all, I have a simulation software (C++) that runs on the command line. It is platform independent (currently compiling and running on Windows, MacOS X and Linux). When the simulation ends, I visualize the result with SDL; it is a very basic 2d view, mainly color squares next to each other. I would like to have a user interface on top of the simulation so that I can start and pause the simulation, and change the parameters on the fly. Something pretty simple I guess. Well, ideally I will also add a grapher somewhere to see the evolution over time of some parameters. Now, I am wondering what direction I should go. Should I try to use one of the UI libraries for SDL ? Or maybe wxwidget in conjunction with SDL ? Or simply wxwidget and get rid of SDL ? Do you have any experience with this ? Thanks in advance Barth PS: I tried to use AGAR, a SDL UI library. It seemed very promising but I couldn't get it working. Not even the helloworld.

    Read the article

  • Accessing Instance Variables from NSTimer selector

    - by Timbo
    Firstly newbie question: What's the difference between a selector and a method? Secondly newbie question (who would have thought): I need to loop some code based on instance variables and pause between loops until some condition (of course based on instance variables) is met. I've looked at sleep, I've looked at NSThread. In both discussions working through those options many asked why don't I use NSTimer, so here I am. Ok so it's simple enough to get a method (selector? ) to fire on a schedule. Problem I have is that I don't know how to see instance variables I've set up outside the timer from within the code NSTimer fires. I need to see those variables from the NSTimer selector code as I 1) will be updating their values and 2) will set labels based on those values. Here's some code that shows the concept… eventually I'd invalidate the timers based on myVariable too, however I've excluded that for code clarity. MyClass *aMyClassInstance = [MyClass new]; [aMyClassInstance setMyVariable:0]; [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(doStuff) userInfo:nil repeats:YES]; [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(doSomeOtherStuff) userInfo:nil repeats:YES]; - (void) doStuff { [aMyClassInstance setMyVariable:11]; // don't actually have access to set aMyClassInstance.myVariable [self updateSomeUILabel:[NSNumber numberWithInt:aMyClassInstance.myVariable]]; // don't actually have access to aMyClassInstance.myVariable } - (void) doSomeOtherStuff { [aMyClassInstance setMyVariable:22]; // don't actually have access to set aMyClassInstance.myVariable [self updateSomeUILabel:[NSNumber numberWithInt:aMyClassInstance.myVariable]]; // don't actually have access to aMyClassInstance.myVariable } - (void) updateSomeUILabel:(NSNumber *)arg{ int value = [arg intValue]; someUILabel.text = [NSString stringWithFormat:@"myVariable = %d", value]; // Updates the UI with new instance variable values }

    Read the article

  • HashMap Memory Leak because of Dynamic Array

    - by Jake M
    I am attempting to create my own HashMap to understand how they work. I am using an array of Linked Lists to store the values(strings) in my hashmap. I am creating the array like this: Node** list; Instead of this: Node* list[nSize]; This is so the array can be any size at runtime. But I think I am getting a memory leak because of how I am doing this. I dont know where the error is but when I run the following simple code the .exe crashes. Why is my application crashing and how can I fix it? Note: I am aware that using a vector would be much better than an array but this is just for learning and I want to challenge myself to create the hashmap using a 'Dynamic' Array. PS: is that the correct term(Dynamic Array) for the kind of array I am using? struct Node { // to implement }; class HashMap { public: HashMap(int dynSize) { *list = new Node[dynSize]; size = dynSize; for (int i=0; i<size; i++) list[i] = NULL; cout << "END\n"; } ~HashMap() { for (int i=0; i<size; i++) delete list[i]; } private: Node** list; // I could use a vector here but I am experimenting with a pointer to an array(pointer), also its more elegant int size; }; int main() { // When I run this application it crashes. Where is my memory leak? HashMap h(5); system("PAUSE"); return 0; }

    Read the article

  • Is it safe to use a boolean flag to stop a thread from running in C#

    - by Lirik
    My main concern is with the boolean flag... is it safe to use it without any synchronization? I've read in several places that it's atomic. class MyTask { private ManualResetEvent startSignal; private CountDownLatch latch; private bool running; MyTask(CountDownLatch latch) { running = false; this.latch = latch; startSignal = new ManualResetEvent(false); } // A method which runs in a thread public void Run() { startSignal.WaitOne(); while(running) { startSignal.WaitOne(); //... some code } latch.Signal(); } public void Stop() { running = false; startSignal.Set(); } public void Start() { running = true; startSignal.Set(); } public void Pause() { startSignal.Reset(); } public void Resume() { startSignal.Set(); } } Is this a safe way to design a task? Any suggestions, improvements, comments? Note: I wrote my custom CountDownLatch class in case you're wondering where I'm getting it from.

    Read the article

  • Avoid slowdowns while using off-site database

    - by Anders Holmström
    The basic layout of my problem is this: Website (ASP.NET/C#) hosted at a dedicated hosting company (location 1) Company database (SQL Server) with records of relevant data (location 2). Location 1 & 2 connected through VPN. Customer visiting the website and wanting to pull data from the company database. No possibility of changing the server locations or layout (i.e. moving the website to an in-office server isn't possible). What I want to do is figure out the best way to handle the data acces in this case, minimizing the need for time-expensive database calls over the VPN. The first idea I'm getting is this: When a user enters the section of the website needing the DB data, you pull all the needed tables from the database into a in-memory dataset. All subsequent views/updates to the data is done on this dataset. When the user leaves (logout, session timeout, browser closed etc) the dataset gets sent to the SQL server. I'm not sure if this is a realistic solution, and it obviously has some problems. If two web visitors are performing updates on the same data, the one finishing up last will have their changes overwriting the first ones. There's also no way of knowing you have the latest data (i.e. if a customer pulls som info on their projects and we update this info while they are viewing them, they won't see these changes PLUS the above overwriting issue will arise). The other solution would be to somehow aggregate database calls and make sure they only happen when you need them, e.g. during data updates but not during data views. But then again the longer a pause between these refreshing DB calls, the bigger a chance that the data view is out of date as per the problem described above. Any input on the above or some fresh ideas would be most welcome.

    Read the article

  • what is the relation between SIGTSTP and SIGCHLD

    - by Rawhi
    I have tow handlers for each one of them (SIGTSTP, SIGCHLD), the thing is that when I pause a process using SIGTSTP the handler function of SIGCHLD run too. what should I do to prevent this . void ExeExternal(char *args[MAX_ARG], char* cmdString, LIST_ELEMENT** pList, int *Susp_Bg_Pid, int *susp) { int pID, status, w; switch (pID = fork()) { case -1: perror("smash error: >"); break; case 0: // Child Process setpgrp(); execv(args[0], args); execvp(args[0], args); perror("error"); exit(EXIT_FAILURE); break; default: if (cmdString[strlen(cmdString) - 1] != '&') { *Susp_Bg_Pid = pID; *susp = 1; while(*susp); } else { InsertElem(pList, args[0], getpid(), pID, 0); } break; } } signal handlers : void signalHandler(int signal) { int pid, cstatus; if (signal == SIGCHLD) { susp = 0; pid = waitpid(-1, &cstatus, WNOHANG); printf("[[child %d terminated]]\n", pid); DelPID(&JobsList, pid); } } void ctrlZsignal(int signal){ kill(Susp_Bg_Pid, SIGTSTP); susp = 0; printf("\nchild %d suspended\n", Susp_Bg_Pid); } Susp_Bg_Pid used to save the paused process id. susp indicates the state of the "smash" the parent process if it is suspended or not .

    Read the article

  • CMD For Loop does not hold set /a value

    - by Bob Hope
    Didn't know how to explain this well, so here is the code @echo off set test=0 for /f %%a in (textfile.txt) do ( rem loops five times(5 lines in textfile.txt) set /a test=test+1 rem Adds 1 to Test echo %%a rem Echo's correct line in file echo %test% rem Echo's whatever X was before the loop ) echo %test% rem Displays the correct value of X pause this is just an example of where I am finding the problem, txtfile.txt has 5 lines, so the for loop goes 5 times, each time, test gets +1 to it, and the /a displays the correct value of X, but the last echo on the for loop displays 0, which is what test is set to before the loop. The value of test is not changing until the loop is finished... is there any way to fix this? Here is what I want to accomplish, as there may be an easier way: I want to run a for loop that findstr's all rtf's in a series of sub folders, and copies them all to a all directory with a new name, 1.rtf,2.rtf,3.rtf, etc. The reason I need to rename them on the transfer is they all have the same name.

    Read the article

  • Pointing class property to another class with vectors

    - by jmclem
    I've got a simple class, and another class that has a property that points to the first class: #include <iostream> #include <vector> using namespace std; class first{ public: int var1; }; class second{ public: first* classvar; }; Then, i've got a void that's supposed to point "classvar" to the intended iteration of the class "first". void fill(vector<second>& sec, vector<first>& fir){ sec[0].classvar = &fir[0]; } Finally the main(). Create and fill a vector of class "first", create "second" vector, and run the fill function. int main(){ vector<first> a(1); a[0].var1 = 1000; vector<second> b(1); fill(b, a); cout << b[0].classvar.var1 << '\n'; system("PAUSE"); return 0; } This gives me the following error: 1>c:\...\main.cpp(29) : error C2228: left of '.var1' must have class/struct/union 1> type is 'first *' And I can't figure out why it reads the "classvar" as the whole vector instead of just the single instance. Should I do this cout << b[0].classvar[0].var1 << '\n'; it reads perfectly. Can anyone figure out the problem? Thanks in advance

    Read the article

  • Overlapping audio in IE when I show/hide videos

    - by user1062448
    I have a thumbnail list with links to individual videos. Everything works fine in all browsers but IE. In IE, if I start a video and (without slicking pause or stop) click on the thumbnail for the next video, the audio continues playing. In other words, the audio for both videos plays at once. Any suggestions? HTML: <ul class="videoButtons"> <li><a class="vidButton" href="javascript:void(0)" id="1" ><img src="images/videoPics/vid1Thumb.jpg" /><br />video title</a></li> <li><a class="vidButton" href="javascript:void(0)" id="2" ><img src="images/videoPics/vid2Thumb.jpg" /><br />video title</a></li> <li><a class="vidButton" href="javascript:void(0)" id="3" ><img src="images/videoPics/vid3Thumb.jpg" /><br />video title</a></li> </ul> <div class="box" id="video1"> <!--flv embedded object - FLVPlayer--> </div> <div class="box" id="video2"> <!--flv embedded object - FLVPlayer1--> </div> <div class="box" id="video3"> <!--flv embedded object - FLVPlayer2--> </div> Show/Hide code: $(".vidButton").click(function() { var buttonID = $(this).attr('id'); // get ID of the button clicked var video = $('#'+'video'+buttonID); // add ID number to video $('.box').hide(); // hide all other divs video.fadeTo("slow", 1); // show video }); }); // video objects swfobject.registerObject("FLVPlayer"); swfobject.registerObject("FLVPlayer1"); swfobject.registerObject("FLVPlayer2");

    Read the article

  • Timing issues with playback of the HTML5 Audio API

    - by pat
    I'm using the following code to try to play a sound clip with the HTML5 Audio API: HTMLAudioElement.prototype.playClip = function(startTime, stopTime) { this.stopTime = stopTime; this.currentTime = startTime; this.play(); $(this).bind('timeupdate', function(){ if (this.ended || this.currentTime >= stopTime) { this.pause(); $(this).unbind('timeupdate'); } }); } I utilize this new playClip method as follows. First I have a link with some data attributes: <a href=# data-stop=1.051 data-start=0.000>And then I was thinking,</a> And finally this bit of jQuery which runs on $(document).ready to hook up a click on the link with the playback: $('a').click(function(ev){ $('a').click(function(ev){ var start = $(this).data('start'), stop = $(this).data('stop'), audio = $('audio').get(0), $audio = $(audio); ev.preventDefault(); audio.playClip(start,stop); }) This approach seems to work, but there's a frustrating bug: sometimes, the playback of a given clip plays beyond the correct data-stop time. I suspect it could have something to do with the timing of the timeupdate event, but I'm no JS guru and I don't know how to begin debugging the problem. Here are a few clues I've gathered: The same behavior appears to come up in both FF and Chrome. The playback of a given clip actually seems to vary a bit -- if I play the same clip a couple times in a row, it may over-play a different amount of time on each playing. Is the problem here the inherent accuracy of the Audio API? My app needs milliseconds. Is there a problem with the way I'm using jQuery to bind and unbind the timeupdate event? I tried using the jQuery-less approach with addEventListener but I couldn't get it to work. Thanks in advance, I would really love to know what's going wrong.

    Read the article

  • Mathmatic errors in basic C++ program

    - by Heather
    I am working with a basic C++ program to determine the area and perimeter of a rectangle. My program works fine for whole numbers but falls apart when I use any number with a decimal. I get the impression that I am leaving something out, but since I'm a complete beginner, I have no idea what. Below is the source: #include <iostream> using namespace std; int main() { // Declared variables int length; // declares variable for length int width; // declares variable for width int area; // declares variable for area int perimeter; // declares variable for perimeter // Statements cout << "Enter the length and the width of the rectangle: "; // states what information to enter cin >> length >> width; // user input of length and width cout << endl; // closes the input area = length * width; // calculates area of rectangle perimeter = 2 * (length + width); //calculates perimeter of rectangle cout << "The area of the rectangle = " << area << " square units." <<endl; // displays the calculation of the area cout << "The perimeter of the rectangle = " << perimeter << " units." << endl; // displays the calculation of the perimeter system ("pause"); // REMOVE BEFORE RELEASE - testing purposes only return 0; }

    Read the article

  • jQuery - making sure content is loaded before it's faded in?

    - by Kenny Bones
    Hi, Nick Craver really helped me out alot with this code in this thread http://stackoverflow.com/questions/2743443/jquery-can-someone-help-stitching-jquery-code-with-ajaxcomplete/2743791#2743791 And it is working. But I notice that there's a small delay after I've clicked a link and before the content is actually loaded. It's not very intense content that's loaded either so I think it's got something to do with the order which things happen in the script. The original code looks like this: $('.dynload').live('click', function(){ var toLoad = $(this).attr('href')+' #content'; $('#content').fadeOut('fast',loadContent); $('#ajaxloader').fadeIn('normal'); function loadContent() { $('#content').load(toLoad,'',showNewContent()) } function showNewContent() { $('#content').fadeIn('fast',hideLoader()); //Cufon.replace('h1, h2, h3, h4, .menuwrapper', { fontFamily: 'advent'}); } function hideLoader() { $('#ajaxloader').fadeOut('normal'); } return false; }); The new code looks like this: $(function() { $('.dynload').live('click', function(){ $('#ajaxloader').fadeIn('fast'); $('#ajaxloaderfridge').fadeIn('fast'); var href = this.href + ' #content'; $('#content').fadeOut('fast',function() { $(this).load(href,'', function(data) { createMenus(); $('#ajaxloader').fadeOut('fast'); $('#ajaxloaderfridge').fadeOut('fast'); $('#content').fadeIn('fast'); Cufon.replace('h1, h2, h3, h4, .menuwrapper', { fontFamily: 'advent'}); }); }); return false; }); }); $(createMenus); function createMenus() { $('#kontrollpanel .slidepanels').kwicks({ min : 42, spacing : 3, isVertical : true, sticky : true, event : 'click' }); } In the original code, #content is faded out, then the function "loadContent" is started. Which is basically what is happening in the new script as well isn't it? And when I was using the old code, the content just faded out and faded in really fast and smooth and with no small pause delay before the content arrived.

    Read the article

  • Mathematics errors in basic C++ program

    - by H Bomb1013
    I am working with a basic C++ program to determine the area and perimeter of a rectangle. My program works fine for whole numbers but falls apart when I use any number with a decimal. I get the impression that I am leaving something out, but since I'm a complete beginner, I have no idea what. Below is the source: #include <iostream> using namespace std; int main() { // Declared variables int length; // declares variable for length int width; // declares variable for width int area; // declares variable for area int perimeter; // declares variable for perimeter // Statements cout << "Enter the length and the width of the rectangle: "; // states what information to enter cin >> length >> width; // user input of length and width cout << endl; // closes the input area = length * width; // calculates area of rectangle perimeter = 2 * (length + width); //calculates perimeter of rectangle cout << "The area of the rectangle = " << area << " square units." <<endl; // displays the calculation of the area cout << "The perimeter of the rectangle = " << perimeter << " units." << endl; // displays the calculation of the perimeter system ("pause"); // REMOVE BEFORE RELEASE - testing purposes only return 0; }

    Read the article

  • MSBuild - How to build a .NET solution file (in an XML task script) from pre-written command line commands

    - by Devtron
    Hello. I have been studying MSBuild as I have the need to automate my development shop's builds. I was able to easily write a .BAT file that invokes the VS command prompt and passes my MSBuild commands to it. This works rather well and is kinda nifty. Here is the contents of my .BAT build file: call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat" cd C:\Sandbox\Solution msbuild MyTopSecretApplication.sln /p:OutputPath=c:\TESTMSBUILDOUTPUT /p:Configuration=Release,Platform=x86 pause ^ This works well but I now have the need to use the MSBuild task for TeamCity CI. I have tried to write a few MSBuild scripts but I cannot get them to work the same. What is the equivalent build script to the command I am using in my .BAT file? Any ideas? I have tried using something like this, but no success (I know this is wrong): <?xml version="1.0"?> <project name="Hello Build World" default="run" basedir="."> <target name="build"> <mkdir dir="mybin" /> <echo>Made mybin directory!</echo> <csc target="exe" output="c:\TESTMSBUILDOUTPUT"> <sources> <include name="MyTopSecretApplication.sln"/> </sources> </csc> <echo>MyTopSecretApplication.exe was built!</echo> </target> <target name="clean"> <delete dir="mybin" failonerror="false"/> </target> <target name="run" depends="build"> <exec program="mybin\MyTopSecretApplication.exe"/> </target> What I simply need is an MSBuild XML build script that compiles a single solution for Release mode to a specified output directory. Any help?

    Read the article

  • segmentation fault when using pointer to pointer

    - by user3697730
    I had been trying to use a pointer to pointer in a function,but is seems that I am not doing the memory allocation correctly... My code is: #include<stdio.h> #include<math.h> #include<ctype.h> #include<stdlib.h> #include<string.h> struct list{ int data; struct list *next; }; void abc (struct list **l,struct list **l2) { *l2=NULL; l2=(struct list**)malloc( sizeof(struct list*)); (*l)->data=12; printf("%d",(*l)->data); (*l2)->next=*l2; } int main() { struct list *l,*l2; abc(&l,&l2); system("pause"); return(0); } This code compiles,but I cannot run thw program..I get a segmentation fault..What should I do?Any help would be appreciated!

    Read the article

  • int array doesnt get char values

    - by user1780004
    I am absolutely brand new at programming and im not sure how to explain what im doing here. The whole purpose of this piece is to enter values and then print them out in the same order. Now I wanna quit from entering values when pressing 'q' and so I have to scanf for chars but when I assign them back to the int array the values are not the same. Hope that makes any sense to you but in any case heres my code: #include <stdio.h> #include <stdlib.h> #define SIZE 5000 define flush fflush(stdin) main() { int input[SIZE] = {0},i = 0; int counter = 0; char inputs, quit; do { system("cls"); printf("Input number ('q' to quit and display numbers entered): "); flush; scanf("%c",&inputs); flush; if (inputs == 'q') quit = 'q'; else { input[i] = inputs; counter++; i++; } } while (i < SIZE && quit != 'q'); for(i = 0; i < counter; i++){ printf("%i.%i\n", i + 1, input[i]); } system("pause"); } Ive been trying to do this on my own btw and also researched some information online regarding chars but couldnt find anything that would help me. Thanks a lot in advance.

    Read the article

  • Passing a string to a function in C++

    - by Chef Flambe
    I want to pass a string like "Celcius" into a function that I have but I keep getting errors tossed back at me from the Function. System::Console::WriteLine' : none of the 19 overloads could convert all the argument types I figure I just have something simple wrong. Can someone point out my mistake please? Using MS Visual C++ 2010 I've posted the offending code. The other functions (not posted) work fine. void PrintResult( double result, std::string sType ); // Print result and string // to the console //============================================================================================= // start of main //============================================================================================= void main( void ) { ConsoleKeyInfo CFM; // Program Title and Description ProgramDescription(); // Menu Selection and calls to data retrieval/calculation/result Print CFM=ChooseFromMenu(); switch(CFM.KeyChar) // ************************************************************ { //* case '1' : PrintResult(F2C(GetTemperature()),"Celsius"); //* break; //* //* case '2' : PrintResult(C2F(GetTemperature()),"Fahrenheit"); //* break; //* //* default : Console::Write("\n\nSwitch : Case !!!FAILURE!!!"); //* } //************************************************************ system("pause"); return; } //Function void PrintResult( double result, std::string sType ) { Console::WriteLine("\n\nThe converted temperature is {0:F2} degrees {1}\n\n",result,sType); return; }

    Read the article

  • JSON to display text -- Freezes UI

    - by Adam Storr
    Hi everyone, I currently have a very simple view which displays info from a JSON feed. The problem I'm facing is the few second pause I encounter once I press this tab. How can I make this view load instantly and then have the label.text areas load after? Preferable with an activity indicator? Should I use threads? Thanks in advance! Code: - (NSString *)stringWithUrl:(NSURL *)url { NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:30]; NSData *urlData; NSURLResponse *response; NSError *error; urlData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error]; return [[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding]; } - (id)objectWithUrl:(NSURL *)url { SBJsonParser *jsonParser = [SBJsonParser new]; NSString *jsonString = [self stringWithUrl:url]; return [jsonParser objectWithString:jsonString error:NULL]; } - (NSDictionary *)downloadStats { id response = [self objectWithUrl:[NSURL URLWithString:@"http://www.example.com/JSON"]]; NSDictionary *feed = (NSDictionary *)response; return feed; [feed release]; } - (void)viewDidLoad { [super viewDidLoad]; [GlobalStatsScrollView setScrollEnabled:YES]; [GlobalStatsScrollView setContentSize:CGSizeMake(320, 360)]; } - (void)viewWillAppear:(BOOL)animated { NSLog(@"View appears"); // Download JSON Feed NSDictionary *feed = [self downloadStats]; totalproduced.text = [feed valueForKey:@"Produced"]; totalno.text = [feed valueForKey:@"Total"]; mostcommon.text = [feed valueForKey:@"Most Common"]; }

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >