Daily Archives

Articles indexed Thursday October 31 2013

Page 8/18 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Alloy MVC Framework Titanium Network (Model)

    - by flyingDuck
    I'm trying to authenticate using the Model in Alloy. I have been trying to figure this problem out since yesterday. If anybody could help me, I'd really appreciate it. So, I have a view login.xml, then a controller login.js. The login.js contains the following function: var user = Alloy.Models.user; //my user.js model function login(e) { if($.username.value !== '' && $.password.value !== ''){ if(user.login($.username.value, $.password.value)){ Alloy.createController('home').getView().open(); $.login.close(); } }else{ alert('Username and/or Password required!'); } } Then in my user.js model, it's like this: extendModel : function(Model) { _.extend(Model.prototype, { login: function(username, password) { var first_name, last_name, email; var _this = this; var url = 'http://myurl.com/test.php'; var auth = Ti.Network.createHTTPClient({ onerror: function(e){ alert(e.error); }, onload: function(){ var json = this.responseText; var response = JSON.parse(json); if(response.logged == true){ first_name = response.f_name; last_name = response.l_name; email = response.email; _this.set({ loggedIn: 1, username: email, realname: first_name + ' ' + last_name, email: email, }); _this.save(); }else{ alert(response.message); } }, }); auth.open('POST', url); var params = { usernames: username, passwords: password, }; auth.send(params); alert(_this.get('email')); //alert email }, }); When I click on login in login.xml it calls the function login in index.js. So, now my problem is that, when I click the button for the first time, I get an empty alert from alert(_this.get('email')), but then when I click the button the second time, everything works fine, it alerts the email. I have no idea what's going on. Thank you for the help.

    Read the article

  • Adding active class in menu only works on first page

    - by rileychuggins
    I have nav links that become active once they come into the window. I need to implement this on three separate pages on my website but the following scripts only work for the first page. var services_refresh = function () { // do stuff console.log('Stopped Scrolling'); if($('#ct_scans.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#ct_scans"]').addClass('active'); } else if($('#xray.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#xray"]').addClass('active'); } else if($('#fluoroscopy.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#fluoroscopy"]').addClass('active'); } else if($('#mri.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#mri"]').addClass('active'); } else if($('#neuroimaging.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#neuroimaging"]').addClass('active'); } else if($('#nuclear_medicine.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#nuclear_medicine"]').addClass('active'); } else if($('#ultrasound.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#ultrasound"]').addClass('active'); } else if($('#mammography.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#mammography"]').addClass('active'); } else if($('#breast_ultrasound.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#breast_ultrasound"]').addClass('active'); } else if($('#breast_biopsy.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#breast_biopsy"]').addClass('active'); } else if($('#breast_mri.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#breast_mri"]').addClass('active'); } else if($('#osteoporosis.anchor').visible()) { $('#our_services_sub_sections li a').removeClass('active'); $('#our_services_sub_sections li a[href="#osteoporosis"]').addClass('active'); } }; Here is my HTML for the first page that works: <ul id="our_services_sub_sections" class="diagnostic_images"> <li><a class="scroll active" href="#ct_scans">CT Scans</a></li> <li><a class="scroll" href="#xray">X-Ray</a></li> <li><a class="scroll" href="#fluoroscopy">Fluoroscopy</a></li> <li><a class="scroll" href="#mri">MRI</a></li> <li><a class="scroll" href="#neuroimaging">Neuroimaging</a></li> <li><a class="scroll" href="#nuclear_medicine">Nuclear Medicine</a></li> <li><a class="scroll" href="#ultrasound">Ultrasound</a></li> </ul> Here is my HTML for the second page which does not work: <ul id="our_services_sub_sections" class="womens_imaging"> <li><a class="scroll active" href="#mammography">Mammography</a></li> <li><a class="scroll" href="#breast_ultrasound">Breast Ultrasound</a></li> <li><a class="scroll" href="#breast_biopsy">Breast Biopsy</a></li> <li><a class="scroll" href="#breast_mri">Breast MRI</a></li> <li><a class="scroll osteo" href="#osteoporosis">Osteoporosis<br />Evaluation (DEXA)</a></li> </ul> Why is this not working?

    Read the article

  • how to create following Java applicatin? [on hold]

    - by Tushar Bichwe
    Write a JAVA program which performs the following listed operations: A. Create a package named MyEmpPackage which consists of following classes A class named Employee which stores information like the Emp number, first name, middle name, last name, address, designation and salary. The class should also contain appropriate get and set methods. 05 A class named AddEmployeeFrame which displays a frame consisting of appropriate controls to enter the details of a Employee and store these details in the Employee class object. The frame should also have three buttons with the caption as “Add Record” and “Delete Record” and “Exit”. 10 A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points. 05 B When the “Add Record” button is clicked, the dialog box should be appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file. 10 When the “Exit” button is clicked, the frame should be closed. 10 [Note: Use the MyCustomListener class only to handle the appropriate events] C The “Delete Record” button should open a new frame which should take input of delete criteria using a radio button. The radio button should provide facility to delete on basis of first name, middle name or last name. 10 The new frame should also have a text box to input the delete criteria value. 10 The record should be deleted from the file and a message dialog should appear with the message that “Record is successfully Deleted”. 10 [Note: Use the MyCustomListener class only to handle the appropriate events] D Provide proper error messages and perform appropriate exceptions where ever required in all the classes 10

    Read the article

  • Creating spotlight in OpenGL scene

    - by Victor Oliveira
    Im studying OpenGL and trying to create a spot light at my application. The code that Im using for my #vertex-shader is below: #:vertex-shader #{ #version 150 core in vec3 in_pos; in vec2 in_tc; out vec2 tc; glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 20.0f); GLfloat spot_direction[] = { -1.0, -1.0, 0.0 }; glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, spot_direction); glEnable(GL_LIGHT0); void main() { vec4 pos= vec4(vec3(1.0)*in_pos - vec3(1.0), 1.0); pos.z=0.0; gl_Position = pos; tc = in_tc; } } The thing is, everytime Im trying to run the code an Error that says: Type: other, Source: api, ID: 131169, Severity: low Message: Framebuffer detailed info: The driver allocated storage for renderbuffer 1. len = 157, written = 0 failed to compile vertex shader of deferred: directional info log for shader deferred: directional vertex info log for shader deferred: directional: ERROR: Unbound variable: when Specifications: Renderer: GeForce GTX 580/PCIe/SSE2 Version: 3.3.0 NVIDIA 319.17 GLSL: 3.30 NVIDIA via Cg compiler Status: Using GLEW 1.9.0 1024 x 768 OS: Linux debian I guess to create this spotlight is pretty much simple, but since Im really new to OpenGL I dont have a clue how to do it until now, even reading sources like: http://www.glprogramming.com/red/chapter05.html#name3 Read also in some place that light spots can get really hard to understand, but I cant avoid this step right now since Im following my lecture schedule. Could anybody help me?

    Read the article

  • Java MapReduce read data

    - by Tatiana
    Hi I am having following map-reduce code by which I am trying to read records from my database. There's code: import java.io.*; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; import org.apache.hadoop.mapred.*; import org.apache.hadoop.mapred.lib.db.DBConfiguration; import org.apache.hadoop.mapred.lib.db.DBInputFormat; import org.apache.hadoop.mapred.lib.db.DBWritable; import org.apache.hadoop.util.*; import org.apache.hadoop.conf.*; public class Connection extends Configured implements Tool { public int run(String[] args) throws IOException { JobConf conf = new JobConf(getConf(), Connection.class); conf.setInputFormat(DBInputFormat.class); DBConfiguration.configureDB(conf, "com.sun.java.util.jar.pack.Driver", "jdbc:postgresql://localhost:5432/polyclinic", "postgres", "12345"); String[] fields = { "name" }; DBInputFormat.setInput(conf, MyRecord.class, "doctors", null, null, fields); conf.setMapOutputKeyClass(LongWritable.class); conf.setMapOutputValueClass(MyRecord.class); conf.setOutputKeyClass(LongWritable.class); conf.setOutputValueClass(TextOutputFormat.class); TextOutputFormat.setOutputPath(conf, new Path(args[0])); JobClient.runJob(conf); return 0; } public static void main(String[] args) throws Exception { int exitCode = ToolRunner.run(new Connection(), args); System.exit(exitCode); } } Class Mapper: import java.io.IOException; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.MapReduceBase; import org.apache.hadoop.mapred.Mapper; import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reporter; public class MyMapper extends MapReduceBase implements Mapper<LongWritable, MyRecord, Text, IntWritable> { public void map(LongWritable key, MyRecord val, OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException { output.collect(new Text(val.name), new IntWritable(1)); } } Class Record: import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.apache.hadoop.mapred.lib.db.DBWritable; class MyRecord implements Writable, DBWritable { String name; public void readFields(DataInput in) throws IOException { this.name = Text.readString(in); } public void readFields(ResultSet resultSet) throws SQLException { this.name = resultSet.getString(1); } public void write(DataOutput out) throws IOException { } public void write(PreparedStatement stmt) throws SQLException { } } After this I got error: WARN mapred.JobClient: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String). Can you give me any suggestion how to solve this problem?

    Read the article

  • Sqlite3 prompting `...>` instead of `sqlite>`

    - by Imray
    I'm following a beginners tutorial to sqlite3. The first step is creating a new database. So I enter a name (movies.db). I'm expecting to get another sqlite> prompt on the next line, and continue with the tutorial, but instead I get a lame ...> after which I can type any gibbersish I want. Clearly, this is not good. What my command prompt looks like: SQLite version 3.8.1 2013-10-17 12:57:35 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> $ sqlite3 movies.db ...> gibberish ...> dsds ...> sdada ...> gfgys ...> a ...> Aaaaarrrgh! ...> How do I get sqlite3 to work normally for me? Pardon my newbie-ness. I hope I've phrased this question in a way that might help other newbs too.

    Read the article

  • REST web service keeps first POST parametrs

    - by Diego
    I have a web service in REST, designed with Java and deployed on Tomcat. This is the web service structure: @Path("Personas") public class Personas { @Context private UriInfo context; /** * Creates a new instance of ServiceResource */ public Personas() { } @GET @Produces("text/html") public String consultarEdad (@QueryParam("nombre") String nombre) { ConectorCliente c = new ConectorCliente("root", "cafe.sql", "test"); int edad = c.consultarEdad(nombre); if (edad == Integer.MIN_VALUE) return "-1"; return String.valueOf(edad); } @POST @Produces("text/html") public String insertarPersona(@QueryParam("nombre") String msg, @QueryParam("edad") int edad) { ConectorCliente c = new ConectorCliente("usr", "passwd", "dbname"); c.agregar(msg, edad); return "listo"; } } Where ConectorCliente class is MySQL connector and querying class. So, I had tested this with the @GET actually doing POST work, any user inputed data and information from ma Java FX app and it went direct to webservice's database. However, I changed so the CREATE operation was performed through a webservice responding to an actual POST HTTP request. However, when I run the client and add some info, parameters go OK, but in next time I input different parameters it'll input the same. I run this several times and I can't get the reason of it. This is the clients code: public class WebServicePersonasConsumer { private WebTarget webTarget; private Client client; private static final String BASE_URI = "http://localhost:8080/GetSomeRest/serviciosweb/"; public WebServicePersonasConsumer() { client = javax.ws.rs.client.ClientBuilder.newClient(); webTarget = client.target(BASE_URI).path("Personas"); } public <T> T insertarPersona(Class<T> responseType, String nombre, String edad) throws ClientErrorException { String[] queryParamNames = new String[]{"nombre", "edad"}; String[] queryParamValues = new String[]{nombre, edad}; ; javax.ws.rs.core.Form form = getQueryOrFormParams(queryParamNames, queryParamValues); javax.ws.rs.core.MultivaluedMap<String, String> map = form.asMap(); for (java.util.Map.Entry<String, java.util.List<String>> entry : map.entrySet()) { java.util.List<String> list = entry.getValue(); String[] values = list.toArray(new String[list.size()]); webTarget = webTarget.queryParam(entry.getKey(), (Object[]) values); } return webTarget.request().post(null, responseType); } public <T> T consultarEdad(Class<T> responseType, String nombre) throws ClientErrorException { String[] queryParamNames = new String[]{"nombre"}; String[] queryParamValues = new String[]{nombre}; ; javax.ws.rs.core.Form form = getQueryOrFormParams(queryParamNames, queryParamValues); javax.ws.rs.core.MultivaluedMap<String, String> map = form.asMap(); for (java.util.Map.Entry<String, java.util.List<String>> entry : map.entrySet()) { java.util.List<String> list = entry.getValue(); String[] values = list.toArray(new String[list.size()]); webTarget = webTarget.queryParam(entry.getKey(), (Object[]) values); } return webTarget.request(javax.ws.rs.core.MediaType.TEXT_HTML).get(responseType); } private Form getQueryOrFormParams(String[] paramNames, String[] paramValues) { Form form = new javax.ws.rs.core.Form(); for (int i = 0; i < paramNames.length; i++) { if (paramValues[i] != null) { form = form.param(paramNames[i], paramValues[i]); } } return form; } public void close() { client.close(); } } And this this the code when I perform the operations in a Java FX app: String nombre = nombreTextField.getText(); String edad = edadTextField.getText(); String insertToDatabase = consumidor.insertarPersona(String.class, nombre, edad); So, as parameters are taken from TextFields, is quite odd why second, third, fourth and so on POSTS post the SAME.

    Read the article

  • check sequence in matlab

    - by gabboshow
    I have a vector that should contain n sequences from 00 to 11 A = [00;01;02;03;04;05;06;07;08;09;10;11;00;01;02;03;04;05;06;07;08;09;10;11] and I would like to check that the sequence "00 - 11 " is always respected (no missing values). for example if A =[00;01;02; 04;05;06;07;08;09;10;11;00;01;02;03;04;05;06;07;08;09;10;11] (missing 03 in the 3rd position) For each missing value I would like to have back this information in another vector missing= [value_1,position_1; value_2, position_2; etc, etc] Can you help me?

    Read the article

  • how can user_DEPENDENCIES read from the procedure

    - by Moudiz
    If I run this query : SELECT DISTINCT U.REFERENCED_NAME, U.REFERENCED_TYPE FROM USER_DEPENDENCIES U where U.name IN('P_CREATE_T') It will give me : U.REFERENCED_NAME | U.REFERENCED_TYPE random_name_table | table If I drop this table random_name_table : drop table random_name_table and I run the dependecie query It will give me this: U.REFERENCED_NAME | U.REFERENCED_TYPE BIN$6WfJh8MWWGngQ3ATqMDOpQ==$0 | table I know the result is related to recycle bin, But what I am asking is there a way that shows the table even if its droped ? I mean shouldnt the depency query read from the procedure and not from the database ? If not is there a query that reads from the procedure and not from database ? Edit ok I will make it clear : my question USER_DEPENDENCIES read from the procedure or the database ? My second question does the recycle bin always shows ? I mean is there times where the result of the recylebin disapear ?

    Read the article

  • Can operator<< in derived class call another operator<< in base class in c++?

    - by ivory
    In my code, Manager is derived from Employee and each of them have an operator<< override. class Employee{ protected: int salary; int rank; public: int getSalary()const{return salary;} int getRank()const{return rank;} Employee(int s, int r):salary(s), rank(r){}; }; ostream& operator<< (ostream& out, Employee& e){ out << "Salary: " << e.getSalary() << " Rank: " << e.getRank() << endl; return out; } class Manager: public Employee{ public: Manager(int s, int r): Employee(s, r){}; }; ostream& operator<< (ostream& out, Manager& m){ out << "Manager: "; cout << (Employee)m << endl; //can not compile, how to call function of Employee? return out; } I hoped cout << (Employee)m << endl; would call ostream& operator<< (ostream& out, Employee& e), but it failed.

    Read the article

  • Remove a special character and Insert that to a line

    - by Kraj
    How to remove a special character(#) from a big file and insert that character to a particular line for example input.tsv $22 23 24 25 26 33 33 34 35 36 44 45 46 47 48 ID ID1 ID2 ID3 ID4 Output.tsv 22 23 24 25 26 33 33 34 35 36 44 45 46 47 48 $ID ID1 ID2 ID3 ID4 I've used the sed -e 's/#//g' input.tsv file to remove the '$' then how can I include '$' to the line starting with ID

    Read the article

  • Mule Performing a string manipulation

    - by user2910309
    What is the best way to perform a string manipulation. I wish to perform a substring on a email address to extract the domain detail and populate this to a variable. a java transformer is a possibilty, but i was hoping if i could use a message enricher with a expression to perform this operation. pardon me but i am still a greenhorn on Mule. here is the excerpt from my mule flow which is failing with error cannot resolve method string length. <enricher target="#[flowVars['FromAddressDomain']]" doc:name="Message Enricher"> <expression-transformer expression="#[ payload.fromAddr.substring(payload.fromAddr.lastIndexOf('@')+ 1,payload.fromAddr.lenth())]" doc:name="Expression"></expression-transformer> </enricher>

    Read the article

  • Python virtualenv conflicting

    - by Fernando
    I'm trying to learn Django, so I started by reading about virtualenv. After installing it with pip (, I end up with: ... sudo pip install virtualenv) ... virtualenv paths virtualenv at /usr/local/bin/virtualenv and virtualenv-2.7 at /usr/local/bin/virtualenv-2.7 If I use virtualenv-2.7 it seems to work fine, but if I use virtualenv, new modules get added to /usr/local/bin, instead of being inside the environment. Example cd ~ virtualenv v1 source v1/bin/activate easy_install yolk which yolk # /usr/local/bin If I use virtualenv-2-7, yolk gets installed correctly inside v1. Did I mess up the installation? How can I fix this? (maybe uninstall virtualenv and start over). Thanks for any help! Edit: I figured i have two easy_install bins /usr/bin/easy_install-2.7 and /usr/bin/easy_install easy_install --version distribute 0.6.24dev-r0 easy_install-2.7 --version distribute 0.6.24dev-r0 so this may be the cause of problems. More info: python version: 2.7.3 virtualenv version: 1.10.1

    Read the article

  • How to send native texture ptr from Unity web player to a browser plug-in?

    - by user2928039
    I have written an NPAPI browser plug-in (using Firebreath) that Unity uses to access Kinect camera. I can retrieve skeleton data from Unity through JavaScript easily since it isn't too big but the problem is in retrieving color image data. Is it possible to send a native texture pointer (GetNativeTexturePtr) from Unity through JavaScript into the C++ plug-in so that it can write the texture data directly? (tested in standalone version and it works) Any other suggestions on how to transfer image data from browser plug-ins to Unity web player are very welcome. Thanks.

    Read the article

  • NSOperationQueue bug with dependencies

    - by Daniel
    I am using NSOperation and NSOperationQueue for performing a sequence of operations, all dependent on each other (2 on 1, 3 on 2, etc...). I set the dependency after I create the operations. I am encountering problems when the queue completes: the program crashes in the _release part of the code, apparently when the NSOperations are getting released. Note that they all get released at the end by the queue, because it is only after the very last one which depends on the second last one, which depends on etc... that they can be released. If I remove any dependency, the code runs fine. If I change waitUntilFinished: to NO, it crashes, if it is YES, it does not. I have isolated the problem to the following code which does not use any of my custom classes. NSOperation by default is a class that does absolutely nothing. Yet, this still crashes when all operations have completed. Therefore, it appears I am not using NSOperationQueue properly but can't see what is wrong. I am running on 10.9 and I have noticed that in general Maverick 10.9 is much more sensitive to these issues than 10.8. I call this method from the main Thread with a Menu item: - (void) testOperations:(id)object { NSOperationQueue* queue = [ [ NSOperationQueue alloc ] init ]; NSMutableArray* array = [ NSMutableArray array ]; for ( int i = 0; i < 10000; i++) [ array addObject: [[[ NSOperation alloc ] init ] autorelease ] ]; for ( int i = 1; i < [ array count ]; i++) [[ array objectAtIndex:i ] addDependency:[array objectAtIndex:i-1]]; // remove this and no crash [ queue addOperations: array waitUntilFinished:NO ]; // Change to YES, no crash [ queue autorelease ]; // or release, it does not make a difference, in fact leaking the memory makes no difference: the code crashes when the queue is removing the NSOperations } This will crash every single time with: bool objc::DenseMapBase , objc_object*, unsigned long, objc::DenseMapInfo, true: (EXC_BAD_ACCESS) The full stack is: #0 0x9104d81b in objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::find(objc_object* const&) () #1 0x910384e3 in _objc_rootReleaseWasZero () #2 0x9104d5d9 in -[NSObject release] () #3 0x99e41224 in CFRelease () #4 0x99e56277 in -[__NSArrayM dealloc] () #5 0x9104d5ef in -[NSObject release] () #6 0x97f62b22 in -[__NSOperationInternal dealloc] () #7 0x9104d5ef in -[NSObject release] () #8 0x97f62ac8 in -[NSOperation dealloc] () #9 0x9104d5ef in -[NSObject release] () #10 0x99e41224 in CFRelease () #11 0x99e56277 in -[__NSArrayM dealloc] () #12 0x9104d5ef in -[NSObject release] () #13 0x97f62b22 in -[__NSOperationInternal dealloc] () #14 0x9104d5ef in -[NSObject release] () #15 0x97f62ac8 in -[NSOperation dealloc] () #16 0x9104d5ef in -[NSObject release] () #17 0x99e41224 in CFRelease () #18 0x99e56277 in -[__NSArrayM dealloc] () #19 0x9104d5ef in -[NSObject release] () #20 0x97f62b22 in -[__NSOperationInternal dealloc] () #21 0x9104d5ef in -[NSObject release] () #22 0x97f62ac8 in -[NSOperation dealloc] () #23 0x9104d5ef in -[NSObject release] () #24 0x99e41224 in CFRelease () #25 0x99e56277 in -[__NSArrayM dealloc] () #26 0x9104d5ef in -[NSObject release] () #27 0x97f62b22 in -[__NSOperationInternal dealloc] () #28 0x9104d5ef in -[NSObject release] () #29 0x97f62ac8 in -[NSOperation dealloc] () #30 0x9104d5ef in -[NSObject release] () #31 0x99e41224 in CFRelease () #32 0x99e56277 in -[__NSArrayM dealloc] () #33 0x9104d5ef in -[NSObject release] () #34 0x97f62b22 in -[__NSOperationInternal dealloc] () #35 0x9104d5ef in -[NSObject release] () #36 0x97f62ac8 in -[NSOperation dealloc] () #37 0x9104d5ef in -[NSObject release] () #38 0x99e41224 in CFRelease () #39 0x99e56277 in -[__NSArrayM dealloc] () #40 0x9104d5ef in -[NSObject release] () #41 0x97f62b22 in -[__NSOperationInternal dealloc] () #42 0x9104d5ef in -[NSObject release] () #43 0x97f62ac8 in -[NSOperation dealloc] () #44 0x9104d5ef in -[NSObject release] () #45 0x99e41224 in CFRelease () #46 0x99e56277 in -[__NSArrayM dealloc] () #47 0x9104d5ef in -[NSObject release] () #48 0x97f62b22 in -[__NSOperationInternal dealloc] () #49 0x9104d5ef in -[NSObject release] () #50 0x97f62ac8 in -[NSOperation dealloc] () #10722 0x9104d5ef in -[NSObject release] () #10723 0x97f62b22 in -[__NSOperationInternal dealloc] () #10724 0x9104d5ef in -[NSObject release] () #10725 0x97f62ac8 in -[NSOperation dealloc] () #10726 0x9104d5ef in -[NSObject release] () #10727 0x99e41224 in CFRelease () #10728 0x99e56277 in -[__NSArrayM dealloc] () #10729 0x9104d5ef in -[NSObject release] () #10730 0x97f62b22 in -[__NSOperationInternal dealloc] () #10731 0x9104d5ef in -[NSObject release] () #10732 0x97f62ac8 in -[NSOperation dealloc] () #10733 0x9104d5ef in -[NSObject release] () #10734 0x99e41224 in CFRelease () #10735 0x99e56277 in -[__NSArrayM dealloc] () #10736 0x9104d5ef in -[NSObject release] () #10737 0x97f62b22 in -[__NSOperationInternal dealloc] () #10738 0x9104d5ef in -[NSObject release] () #10739 0x97f62ac8 in -[NSOperation dealloc] () #10740 0x9104d5ef in -[NSObject release] () #10741 0x99e41224 in CFRelease () #10742 0x99e56277 in -[__NSArrayM dealloc] () #10743 0x9104d5ef in -[NSObject release] () #10744 0x97f62b22 in -[__NSOperationInternal dealloc] () #10745 0x9104d5ef in -[NSObject release] () #10746 0x97f62ac8 in -[NSOperation dealloc] () #10747 0x9104d5ef in -[NSObject release] () #10748 0x99e41224 in CFRelease () #10749 0x99e56277 in -[__NSArrayM dealloc] () #10750 0x9104d5ef in -[NSObject release] () #10751 0x97f62b22 in -[__NSOperationInternal dealloc] () #10752 0x9104d5ef in -[NSObject release] () #10753 0x97f62ac8 in -[NSOperation dealloc] () #10754 0x9104d5ef in -[NSObject release] () #10755 0x99e41224 in CFRelease () #10756 0x99e56277 in -[__NSArrayM dealloc] () #10757 0x9104d5ef in -[NSObject release] () #10758 0x97f62b22 in -[__NSOperationInternal dealloc] () #10759 0x9104d5ef in -[NSObject release] () #10760 0x97f62ac8 in -[NSOperation dealloc] () #10761 0x9104d5ef in -[NSObject release] () #10762 0x99e41224 in CFRelease () #10763 0x99e56277 in -[__NSArrayM dealloc] () #10764 0x9104d5ef in -[NSObject release] () #10765 0x97f62b22 in -[__NSOperationInternal dealloc] () #10766 0x9104d5ef in -[NSObject release] () #10767 0x97f62ac8 in -[NSOperation dealloc] () #10768 0x9104d5ef in -[NSObject release] () #10769 0x99e41224 in CFRelease () #10770 0x99e56277 in -[__NSArrayM dealloc] () #10771 0x9104d5ef in -[NSObject release] () #10772 0x97f62b22 in -[__NSOperationInternal dealloc] () #10773 0x9104d5ef in -[NSObject release] () #10774 0x97f62ac8 in -[NSOperation dealloc] () #10775 0x9104d5ef in -[NSObject release] () #10776 0x99e41224 in CFRelease () #10777 0x99e56277 in -[__NSArrayM dealloc] () #10778 0x9104d5ef in -[NSObject release] () #10779 0x97f62b22 in -[__NSOperationInternal dealloc] () #10780 0x9104d5ef in -[NSObject release] () #10781 0x97f62ac8 in -[NSOperation dealloc] () #10782 0x9104d5ef in -[NSObject release] () #10783 0x99e41224 in CFRelease () #10784 0x99e56277 in -[__NSArrayM dealloc] () #10785 0x9104d5ef in -[NSObject release] () #10786 0x97f62b22 in -[__NSOperationInternal dealloc] () #10787 0x9104d5ef in -[NSObject release] () #10788 0x97f62ac8 in -[NSOperation dealloc] () #10789 0x9104d5ef in -[NSObject release] () #10790 0x99e41224 in CFRelease () #10791 0x99e56277 in -[__NSArrayM dealloc] () #10792 0x9104d5ef in -[NSObject release] () #10793 0x97f62b22 in -[__NSOperationInternal dealloc] () #10794 0x9104d5ef in -[NSObject release] () #10795 0x97f62ac8 in -[NSOperation dealloc] () #10796 0x9104d5ef in -[NSObject release] () #10797 0x99e41224 in CFRelease () #10798 0x99e56277 in -[__NSArrayM dealloc] () #10799 0x9104d5ef in -[NSObject release] () #10800 0x97f62b22 in -[__NSOperationInternal dealloc] () #10801 0x9104d5ef in -[NSObject release] () #10802 0x97f62ac8 in -[NSOperation dealloc] () #10803 0x9104d5ef in -[NSObject release] () #10804 0x99e41224 in CFRelease () #10805 0x99e56277 in -[__NSArrayM dealloc] () #10806 0x9104d5ef in -[NSObject release] () #10807 0x97f62b22 in -[__NSOperationInternal dealloc] () #10808 0x9104d5ef in -[NSObject release] () #10809 0x97f62ac8 in -[NSOperation dealloc] () #10810 0x9104d5ef in -[NSObject release] () #10811 0x99e41224 in CFRelease () #10812 0x99e56277 in -[__NSArrayM dealloc] () #10813 0x9104d5ef in -[NSObject release] () #10814 0x97f62b22 in -[__NSOperationInternal dealloc] () #10815 0x9104d5ef in -[NSObject release] () #10816 0x97f62ac8 in -[NSOperation dealloc] () #10817 0x9104d5ef in -[NSObject release] () #10818 0x99e41224 in CFRelease () #10819 0x99e56277 in -[__NSArrayM dealloc] () #10820 0x9104d5ef in -[NSObject release] () #10821 0x97f62b22 in -[__NSOperationInternal dealloc] () #10822 0x9104d5ef in -[NSObject release] () #10823 0x97f62ac8 in -[NSOperation dealloc] () #10824 0x9104d5ef in -[NSObject release] () #10825 0x99e41224 in CFRelease () #10826 0x99e56277 in -[__NSArrayM dealloc] () #10827 0x9104d5ef in -[NSObject release] () #10828 0x97f62b22 in -[__NSOperationInternal dealloc] () #10829 0x9104d5ef in -[NSObject release] () #10830 0x97f62ac8 in -[NSOperation dealloc] () #10831 0x9104d5ef in -[NSObject release] () #10832 0x99e41224 in CFRelease () #10833 0x99e56277 in -[__NSArrayM dealloc] () #10834 0x9104d5ef in -[NSObject release] () #10835 0x97f62b22 in -[__NSOperationInternal dealloc] () #10836 0x9104d5ef in -[NSObject release] () #10837 0x97f62ac8 in -[NSOperation dealloc] () #10838 0x9104d5ef in -[NSObject release] () #10839 0x99e41224 in CFRelease () #10840 0x99e56277 in -[__NSArrayM dealloc] () #10841 0x9104d5ef in -[NSObject release] () #10842 0x97f62b22 in -[__NSOperationInternal dealloc] () #10843 0x9104d5ef in -[NSObject release] () #10844 0x97f62ac8 in -[NSOperation dealloc] () #10845 0x9104d5ef in -[NSObject release] () #10846 0x99e41224 in CFRelease () #10847 0x99e56277 in -[__NSArrayM dealloc] () #10848 0x9104d5ef in -[NSObject release] () #10849 0x97f62b22 in -[__NSOperationInternal dealloc] () #10850 0x9104d5ef in -[NSObject release] () #10851 0x97f62ac8 in -[NSOperation dealloc] () #10852 0x9104d5ef in -[NSObject release] () #10853 0x99e41224 in CFRelease () #10854 0x99e56277 in -[__NSArrayM dealloc] () #10855 0x9104d5ef in -[NSObject release] () #10856 0x97f62b22 in -[__NSOperationInternal dealloc] () #10857 0x9104d5ef in -[NSObject release] () #10858 0x97f62ac8 in -[NSOperation dealloc] () #10859 0x9104d5ef in -[NSObject release] () #10860 0x99e41224 in CFRelease () #10861 0x99e56277 in -[__NSArrayM dealloc] () #10862 0x9104d5ef in -[NSObject release] () #10863 0x97f62b22 in -[__NSOperationInternal dealloc] () #10864 0x9104d5ef in -[NSObject release] () #10865 0x97f62ac8 in -[NSOperation dealloc] () #10866 0x9104d5ef in -[NSObject release] () #10867 0x99e41224 in CFRelease () #10868 0x99e56277 in -[__NSArrayM dealloc] () #10869 0x9104d5ef in -[NSObject release] () #10870 0x97f62b22 in -[__NSOperationInternal dealloc] () #10871 0x9104d5ef in -[NSObject release] () #10872 0x97f62ac8 in -[NSOperation dealloc] () #10873 0x9104d5ef in -[NSObject release] () #10874 0x99e41224 in CFRelease () #10875 0x99e56277 in -[__NSArrayM dealloc] () #10876 0x9104d5ef in -[NSObject release] () #10877 0x97f62b22 in -[__NSOperationInternal dealloc] () #10878 0x9104d5ef in -[NSObject release] () #10879 0x97f62ac8 in -[NSOperation dealloc] () #10880 0x9104d5ef in -[NSObject release] () #10881 0x99e41224 in CFRelease () #10882 0x99e56277 in -[__NSArrayM dealloc] () #10883 0x9104d5ef in -[NSObject release] () #10884 0x97f62b22 in -[__NSOperationInternal dealloc] () #10885 0x9104d5ef in -[NSObject release] () #10886 0x97f62ac8 in -[NSOperation dealloc] () #10887 0x9104d5ef in -[NSObject release] () #10888 0x99e41224 in CFRelease () #10889 0x99e56277 in -[__NSArrayM dealloc] () #10890 0x9104d5ef in -[NSObject release] () #10891 0x97f62b22 in -[__NSOperationInternal dealloc] () #10892 0x9104d5ef in -[NSObject release] () #10893 0x97f62ac8 in -[NSOperation dealloc] () #10894 0x9104d5ef in -[NSObject release] () #10895 0x99e41224 in CFRelease () #10896 0x99e56277 in -[__NSArrayM dealloc] () #10897 0x9104d5ef in -[NSObject release] () #10898 0x97f62b22 in -[__NSOperationInternal dealloc] () #10899 0x9104d5ef in -[NSObject release] () #10900 0x97f62ac8 in -[NSOperation dealloc] () #10901 0x9104d5ef in -[NSObject release] () #10902 0x99e41224 in CFRelease () #10903 0x99e56277 in -[__NSArrayM dealloc] () #10904 0x9104d5ef in -[NSObject release] () #10905 0x97f62b22 in -[__NSOperationInternal dealloc] () #10906 0x9104d5ef in -[NSObject release] () #10907 0x97f62ac8 in -[NSOperation dealloc] () #10908 0x9104d5ef in -[NSObject release] () #10909 0x99e41224 in CFRelease () #10910 0x99e56277 in -[__NSArrayM dealloc] () #10911 0x9104d5ef in -[NSObject release] () #10912 0x97f62b22 in -[__NSOperationInternal dealloc] () #10913 0x9104d5ef in -[NSObject release] () #10914 0x97f62ac8 in -[NSOperation dealloc] () #10915 0x9104d5ef in -[NSObject release] () #10916 0x97f49cca in __NSOQSchedule_f () #10917 0x9c1c9e21 in _dispatch_async_redirect_invoke () #10918 0x9c1c53a6 in _dispatch_client_callout () #10919 0x9c1c7467 in _dispatch_root_queue_drain () #10920 0x9c1c8732 in _dispatch_worker_thread2 () #10921 0x960c2dab in _pthread_wqthread () The full crash context is (bold for crash line): libobjc.A.dylib`objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::find(objc_object* const&): 0x9104d800: pushl %ebp 0x9104d801: movl %esp, %ebp 0x9104d803: pushl %esi 0x9104d804: subl $20, %esp 0x9104d807: leal -8(%ebp), %eax 0x9104d80a: movl %eax, 8(%esp) 0x9104d80e: movl 16(%ebp), %eax 0x9104d811: movl %eax, 4(%esp) 0x9104d815: movl 12(%ebp), %esi 0x9104d818: movl %esi, (%esp) **0x9104d81b: calll 0x9104d9b6 ; bool objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::LookupBucketFor<objc_object*>(objc_object* const&, std::__1::pair<objc_object*, unsigned long> const*&) const** 0x9104d820: movl 12(%esi), %ecx 0x9104d823: shll $3, %ecx 0x9104d826: addl (%esi), %ecx 0x9104d828: movl 8(%ebp), %edx 0x9104d82b: testb %al, %al 0x9104d82d: je 0x9104d836 ; objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::find(objc_object* const&) + 54 0x9104d82f: movl -8(%ebp), %eax 0x9104d832: movl %eax, (%edx) 0x9104d834: jmp 0x9104d838 ; objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::find(objc_object* const&) + 56 0x9104d836: movl %ecx, (%edx) 0x9104d838: movl %ecx, 4(%edx) 0x9104d83b: addl $20, %esp 0x9104d83e: popl %esi 0x9104d83f: popl %ebp 0x9104d840: ret $4 0x9104d843: nop I tried using a pre-created queue, this makes no difference. Apparently, with dependencies, this code is a problem with XCode 5.0, 32-bit. Edit: In fact, I can isolate the problem much further. An empty Cocoa Application project in XCOde 5.0 on 10.9 with ARC on and a single method will crash. If it does not on your computer, increase 4269 to anything bigger: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSOperationQueue* aQueue = [[ NSOperationQueue alloc ] init ]; NSMutableArray* array = [ NSMutableArray array ]; for ( int i = 0; i < 4269; i++) [ array addObject: [ [NSOperation alloc ] init ]]; for ( int i = 1; i < [ array count ]; i++) [[ array objectAtIndex:i ] addDependency:[array objectAtIndex:i-1]]; [ aQueue addOperations: array waitUntilFinished:NO ]; }

    Read the article

  • Faye private pub web sockets Errno::ECONNREFUSED: Connection refused - connect(2)

    - by Rubytastic
    Faye private pub has issues connecting. It works from rails console and from inside application. It fails when called from background process like delayed_job or sidekiq. I have been unable to resolve this issue for some time now, does anyone know why this happens? Errno::ECONNREFUSED: Connection refused - connect(2) /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/resolv-replace.rb:23:in initialize' /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/resolv-replace.rb:23:in initialize' /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in open' /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in block in connect' /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in timeout' /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:877:in connect' /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in do_start' /Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in start' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/private_pub-1.0.3/lib/private_pub.rb:42:in publish_message' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/private_pub-1.0.3/lib/private_pub.rb:29:in publish_to' /srv/books/app/workers/session_reload.rb:16:in perform' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/processor.rb:48:in block (3 levels) in process' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:119:in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:119:inblock in invoke' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/newrelic_rpm-3.6.8.168/lib/new_relic/agent/instrumentation/sidekiq.rb:25:in block in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/newrelic_rpm-3.6.8.168/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:324:in perform_action_with_newrelic_trace' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/newrelic_rpm-3.6.8.168/lib/new_relic/agent/instrumentation/sidekiq.rb:21:in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:121:inblock in invoke' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-failures-0.2.2/lib/sidekiq/failures/middleware.rb:10:in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:121:inblock in invoke' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/server/active_record.rb:6:in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:121:inblock in invoke' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/server/retry_jobs.rb:62:in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:121:inblock in invoke' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/server/logging.rb:11:in block in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/logging.rb:22:in with_context' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/server/logging.rb:7:in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:121:inblock in invoke' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:124:in call' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/middleware/chain.rb:124:ininvoke' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/processor.rb:47:in block (2 levels) in process' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/processor.rb:102:in stats' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/processor.rb:46:in block in process' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/processor.rb:83:in do_defer' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/sidekiq-2.16.0/lib/sidekiq/processor.rb:37:in process' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in public_send' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in dispatch' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/celluloid-0.15.2/lib/celluloid/calls.rb:122:in dispatch' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in block in handle_message' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in block in task' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in block in initialize' /Users/jordan/.rvm/gems/ruby-2.0.0-p247@books/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in block in create' Processor: dev-air.local:db67c04914cdef80c501043115298f6d-70211452597260

    Read the article

  • Where can I find the list of all SQL-standard-mandated aggregate functions? [on hold]

    - by einpoklum
    I know that different DBMSes support different aggregate functions; for example: MySQL's aggregates Oracle's aggregates I want to get the list of aggregates mandated by the SQL standard. Or, to be more precise, the lists of mandatory aggregates for SQL 1992, 1998, 2003, 2008 and 2011 - with 2011 being the most important to me. Edit: Of course if I buy a copy of the standards I could compile these lists myself. My question is whether they're accessible somewhere online.

    Read the article

  • Force reload/refresh when pressing the back button

    - by FlyingCat
    I will try my best to explain this. I have an application that show the 50+ projects in my view page. The user can click the individual project and go to the update page to update the project information. Everything works fine except that after user finish updating the individual project information and hit 'back' button on the browser to the previous view page. The old project information (before update) is still there. The user has to hit refresh to see the updated information. It not that bad, but I wish to provide better user experience. Any idea to fix this? Thanks a lot.

    Read the article

  • How to create a splash activity , call a second activity via a button, simple data form 5 fields and 2 buttons

    - by Mike
    New to Android need help with one solid build that I can refer to and study for future projects. The first activity is a background image with a button,when clicked the it takes you to the second activity which is a form with 5 data fields and 2 buttons. One button calls an intent to take a picture within the app and one button that submits the data from the form along with the picture to URL. lastly a third activity that says complete thank you. I can make some of this but don't know how to link button or open and merge camera with the app to be sent as a package of data. I suppose I could also hook into GPS acquire location as well as the camera call?

    Read the article

  • How do I switch out Views in a Cocoa application?

    - by David Garcia
    So I'm beginning to learn how to use Cocoa. I think I've pretty much got it but I'm hung up on creating and switching views. I'm rewriting a game I made a little bit ago for practice. All I want is one window (preferably not resizable) and I want to be able to switch out views for different screens in the game. First, I have the main menu (Start Game, High Scores, Exit). Then I need a window for each screen (Gameplay screen, Highscore screen). What I'm getting confused with is how to design this. I looked up NSViewController thinking it manages views but it doesn't. It only manages one view by loading it really. I don't understand why I'd need to use NSViewController then. Couldn't I just have a window class that contains multiple subclasses of NSView and load them like that? I'm not sure I understand the purpose of the ViewController. Does my Window Class really need to subclass NSWindowController? I was trying to follow the example of Apple's ViewController example and it has a window controller class that's a subclass of NSWindowController. I don't see what the purpose was of subclassing that. All NSWindowController seems to add is - initWithPath:(NSString *)newPath but I fail to see the use in that either when I can just edit the plist file to open the window on start up. Apple's example also has an NSView variable and an NSViewController variable. Don't you only need one variable to store the current view? Thanks in advance guys, I'm really confused as to how this works.

    Read the article

  • Set focus on textbox in WPF from view model (C#) & wPF

    - by priyanka.sarkar
    I have a TextBox and a Button in my view. Now I am checking a condition upon button click and if the condition turns out to be false, displaying the message to the user, and then I have to set the cursor to the text box control. if (companyref == null) { Lipper.Nelson.AdminClient.Main.Views.ContactPanels.CompanyAssociation cs = new Lipper.Nelson.AdminClient.Main.Views.ContactPanels.CompanyAssociation(); MessageBox.Show("Company does not exist.", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); cs.txtCompanyID.Focusable = true; System.Windows.Input.Keyboard.Focus(cs.txtCompanyID); } The above code is in the view model. The CompanyAssociation is the view name. But the cursor is not getting set in the TextBox. The xaml is as under <igEditors:XamTextEditor KeyDown="xamTextEditorAllowOnlyNumeric_KeyDown" Name="txtCompanyID" ValueChanged="txtCompanyID_ValueChanged" Text="{Binding Company.CompanyId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=border}" Grid.Column="1" Grid.Row="0" VerticalAlignment="Top" Margin="0,5,0,0" HorizontalAlignment="Stretch" IsEnabled="{Binding Path=IsEditable}" /> <Button Template="{StaticResource buttonTemp1}" Command="{Binding ContactCommand}" CommandParameter="searchCompany" Content="Search" Width="80" Grid.Column="2" Grid.Row="0" VerticalAlignment="Top" Margin="0" HorizontalAlignment="Left" IsEnabled="{Binding Path=IsEditable}" /> Please help

    Read the article

  • jQuery 2.0 drops support for legacy IE (IE6, IE7, IE8)

    - by Renso
    Originally posted on: http://geekswithblogs.net/renso/archive/2013/10/31/jquery-2.0-drops-support-for-legacy-ie-ie6-ie7-ie8.aspxjQuery upgrades may not be as reverse compatible as you may think. Starting from version 2 of jQuery, IE6, IE7 and yes also IE8 will no longer be supported. These are now considered legacy browsers. You will need to stop any upgrades to jQuery until your SLA states that IE8 is no longer supported and remain in jQuery 1.9.Some of the reasons for not supporting IE8 and before:- Remove all the code clutter in the jQuery library with code that has to deal with IE browser compatibility issues between IE6, 7 and 8 and the newer IE versions, the latter being more compliant.- IE6 and 7 may have fallen to below 2% generally, that does not mean that that is true for your client base. In the oil and gas industry some clients are years behind and you may have 50% or more of clients remain on IE8 or older for the foreseeable future.- The difference between browser engines has become almost negligible, as it should be. So one of the greatest goals of jQuery to abstract that out for developers is no longer needed, for most part anyway. - CSS3 features like animations basically replace the need for jQuery’s 2.0 animations and effects.If the need is still there to support IE8 or before, but you also want to upgrade, then use conditional comments:<!--[if lt IE 9]>    <script src="jQuery-1.9.0.js"></script><![endif]--><!--[if gte IE 9]><!-->    <script src="jQuery-2.0.0.js"><</script><!--<![endif]-->

    Read the article

  • Using proxy server to redirect MySQL traffic to multiple servers using standard port?

    - by FrenchFry
    Is it possible to redirect MySQL (tcp) traffic to multiple servers based on domain name alone? Our DNS is setup to point several sub-domain aliases to one proxy machine. (running haproxy and iptables). We would like to redirect all database traffic through this proxy server and route it to the appropriate db server, WITHOUT deviating from the standard MySQL port. dev.domain1.com:3306 -- dbDevServer.domain1.com:3306 test.domain1.com:3306 -- dbTestServer.domain1.com:3306 prod.domain1.com:3306 -- dbProdServer.domain1.com:3306 Thanks!

    Read the article

  • Server 2003 IAS RADIUS -> Server 2012 AD DS

    - by Jordan
    I have googled this extensively but have not been able to find a good answer. Does anyone know if ' Windows Server 2003 IAS RADIUS' will query a 'Windows Server 2012 AD DS' and be able to return the attributes correctly? This is just standard AD stuff (Remote dial-in for VPN authentication). I am hypothesizing that it will work OK, but I wanted to see if anyone had any first hand knowledge. Thanks.

    Read the article

  • Warning messages while build Apache server

    - by GoinOff
    I am building Apache server 2.4.6 from source and am not sure about a few warning messages I received during the rpm build process. The build completes OK and everything seems fine..BTW, this is on CentOS 5.5... During the make process: /home/johnm/dev/project1/install/linux/BUILD/httpd-2.4.6/srclib/apr/libtool --silent --mode=install install mod_authn_file.la /home/johnm/dev/project1/install/linux/tmp/usr/local/apache2/modules/ libtool: install: warning: remember to run `libtool --finish /usr/local/apache2/modules' What is this warning message about?? remember to run libtool --finish ?? Also, I see this: libtool: install: warning: `/home/johnm/dev/project1/install/linux/BUILD/httpd-2.4.6/srclib/apr-util/libaprutil-1.la' has not been installed in `/usr/local/apache2/lib' I am building Apache in a temp directory but libtools seems to be looking in the wrong place (/usr/local/apache2/lib instead of /home/johnm/dev/project1/install/linux/tmp/usr/local/apache2/lib). This seems like something I can blow off?? In my specfile I set DESTDIR to /home/johnm/dev/project1/install/linux/tmp where the install files are placed: %install export DESTDIR=%{buildroot} make install Both messages appear numerous times during the make process. When I install the rpm on the system, everything appears to work without problems..Thinking I can ignore these messages??? or am I missing something important??

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >