Search Results

Search found 2532 results on 102 pages for 'chad green'.

Page 17/102 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • MVC: Model View Controller -- does the View call the Model?

    - by Gary Green
    I've been reading about MVC design for a while now and it seems officially the View calls objects and methods in the Model, builds and outputs a view. I think this is mainly wrong. The Controller should act and retrieve/update objects inside the Model, select an appropriate View and pass the information to it so it may display. Only crude and rudiementary PHP variables/simple if statements should appear inside the View. If the View gets the information it needs to display from the Model, surely there will be a lot of PHP inside the View -- completely violating the point of seperating presentation logic.

    Read the article

  • Why do I get "undefined method `destroy'" when including 'svn/repos'?

    - by Chad Johnson
    I get the following when running script/server require 'svn/repos' script/console Loading development environment (Rails 2.3.5) require 'svn/repos' /Library/Ruby/Site/1.8/svn/core.rb:88: warning: already initialized constant Stream /Library/Ruby/Site/1.8/svn/core.rb:138: warning: already initialized constant AuthBaton NoMethodError: undefined method destroy' for #<Svn::Ext::Core::Apr_pool_wrapper_t:0x10150ae68> from /Library/Ruby/Site/1.8/svn/util.rb:60:insvn_fs_initialize' from /Library/Ruby/Site/1.8/svn/util.rb:60:in call' from /Library/Ruby/Site/1.8/svn/util.rb:60:ininitialize' from /Library/Ruby/Site/1.8/svn/fs.rb:14 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:innew_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' from /Library/Ruby/Site/1.8/svn/repos.rb:5 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire' from (irb):1 Any idea why?

    Read the article

  • Multiple file types in vim

    - by Chad
    When I am working on a PHP file for example the default filetype is php. This makes sense, however when that PHP file has HTML as well the filetype is still only php. For some plugins that means that I get the PHP functionality for that plugin, but miss out on the HTML functionality. A more specific situation where this happens is with my snippet plugin. I get php snippets and not html snippets when I am editing a php file. Possible solutions to this (which I obviously don't like, hence my posting this question) are: add a map to toggle between different filetypes when I am editing different sections of the file. update my php snippets file to include the html snippets as well (while this would work for the example above, it doesn't solve the fundamental problem). So, Is there a way to edit a file using multiple filetypes at the same time in vim?

    Read the article

  • Why collection literals ?

    - by Green Hyena
    Hi fellow Java programmers. From the various online articles on Java 7 I have come to know that Java 7 will be having collection literals like the following: List<String> fruits = [ "Apple", "Mango", "Guava" ]; Set<String> flowers = { "Rose", "Daisy", "Chrysanthemum" }; Map<Integer, String> hindiNums = { 1 : "Ek", 2 : "Do", 3 : "Teen" }; My questions are: 1] Wouldn't it have been possible to provide a static method of in all of the collection classes which could be used as follows: List<String> fruits = ArrayList.of("Apple", "Mango", "Guava"); IMO this looks as good as the literal version and is also reasonably concise. Why then did they have to invent a new syntax? 2] When I say List<String> fruits = [ "Apple", "Mango", "Guava" ]; what List would I actually get? Would it be ArrayList or LinkedList or something else? Thanks.

    Read the article

  • Can someone describe the nested set model from a C#/LINQ perspective?

    - by Chad
    I know the nested set model doesn't pertain to the C# language or LINQ directly... it's what I'm using to develop my web app. For hierarchical data (categories with sub-categories in my case), I'm currently using something similar to the Adjacency List model. At the moment, I've only got 2 levels of categories, but I'd like to take it further and allow for n levels of categories using the nested set model. I'm not quite clear on how to use it in a C# context. Here's the article I'm reading on the nested set model. Though this article cleared up my confusion some, I still have a big ?? in my head: - Is inserting, updating or deleting categories tedious? It looks like the left and right numbers would require re-numbering... what would the LINQ queries look like for the following scenarios? Delete a child node (re-number all node's left/right values) Delete a parent node (what do you do with the orphans?) Move a child node to a different parent node (renumber again) If my understanding is correct, at all times the child node's left/right values will always be between the parent node's left/right values, am I correct? Seems easy enough, if only the categories were static... most likely I need to spend more time to get my head around the concept. Any help is greatly appreciated!

    Read the article

  • Why Does Thread.CurrentThread.CurrentCulture Change between Page Rendering and HttpModule.PostReques

    - by Chad
    I'm creating an HttpModule that needs to know the value of Thread.CurrentThread.CurrentCulture as set in an MVC application. That value is currently being set by the BaseController, but when my HttpModule.PostRequestHandlerExecute() method fires, it reverts to what the Culture was prior to page rendering. I have duplicated this by creating a simple web app with these steps: Module.PreRequestHandlerExecute: Set culture to A Page_Load: Culture is currently A. Set culture to B Module.PostRequestHandlerExecute: Current thread culture is A. I expected it to be B but it was changed between page rendering and PostRequestHandlerExecute Any idea why .Net changes this value or how I could get around it? The thread is the same, so something in .Net must be explicitly reverting the culture.

    Read the article

  • Manipulating multi-track ogg files programatically

    - by Chad Birch
    I'm planning to create a program for manipulating multi-track OGG files, but I don't have any experience with the relevant libraries, so I'm looking for recommendations about which language/library to use for this. I don't really have any preference for the language, I'll happily code it in C, C#, Python, whatever makes things the easiest (or even possible). Perhaps it's even a possibility to automate Audacity somehow? In terms of requirements, I'm not looking for anything particularly fancy. It will probably be a command-line program, I don't need to be able to play the audio, draw image representations of the waveforms, etc. The program will basically be used as a converter, but I need to do some processing before outputting. That is, I need the ability to programatically remove some tracks, set panning per-track, change track volumes, etc. Nothing too complex, just some basic processing, and then output the result in either MP3 or a format easily converted to MP3, such as WAV. Any suggestions or general information would be appreciated, thanks.

    Read the article

  • Symlinking (ln) faster than moving (mv)?

    - by Chad Johnson
    When we build web software releases, we prepare the release in a temporary directory and then replace the release directory with the temporary one just prepared: # Move and replace existing release directory. mv /path/to/httpdocs /path/to/httpdocs.before mv /path/to/$newReleaseName /path/to/httpdocs Under this scheme, it happens that with about 1 in every 15 releases, a user was using a file in the original release directory exactly at the time the commands above are run, and a fatal error occurs for that user. I am wondering if using symlinking like follows would be significantly faster, in terms of processing time, thereby helping to lessen the likelihood of this problem: # Remove and replace existing release symlink. ln -sf /path/to/$newReleaseName path/to/httpdocs

    Read the article

  • Is this a good centralized DVCS workflow?

    - by Chad Johnson
    I'm leaning toward using Mercurial, coming from Subversion, and I'd like to maintain a centralized workflow like I had with Subversion. Here is what I am thinking: stable (clone on server) default (branch) development (clone on server) default (branch) bugs (branch) developer1 (clone on local machine) developer2 (clone on local machine) developer3 (clone on local machine) feature1 (branch) developer3 (clone on local machine) feature2 (branch) developer1 (clone on local machine) developer2 (clone on local machine) As far as branches vs. clones is concerned, does this workflow sense? Do I have things straight? Also, the 'stable' clone IS the release. Does it make sense for the 'default' branch to be the release and what all other branches are ultimately merged into?

    Read the article

  • IA-32: Pushing a byte onto a stack isn't possible on Pentium, why?

    - by Tim Green
    Hi, I've come to learn that you cannot push a byte directly onto the Intel Pentium's stack, can anyone explain this to me please? The reason that I've been given is because the esp register is word-addressable (or, that is the assumption in our model) and it must be an "even address". I would have assumed decrementing the value of some 32-bit binary number wouldn't mess with the alignment of the register, but apparently I don't understand enough. I have tried some NASM tests and come up that if I declare a variable (bite db 123) and push it on to the stack, esp is decremented by 4 (indicating that it pushed 32-bits?). But, "push byte bite" (sorry for my choice of variable names) will result in a kind error: test.asm:10: error: Unsupported non-32-bit ELF relocation Any words of wisdom would be greatly appreciated during this troubled time. I am first year undergraduate so sorry for my naivety in any of this. Tim

    Read the article

  • How does Facebook chat avoid continuous polling of the server?

    - by Chad Johnson
    I am trying to understand how Facebook's chat feature receives messages without continuously poling the server. Firebug shows me a single GET XmlHttpRequest continuously sitting there, waiting for a response from the server. After 5 minutes, this never timed out. How are they preventing timeout? An AJAX request can just sit there like that indefinitely, waiting for a response? Can I do this with JSONRequest? I see this at json.org: JSONRequest is designed to support duplex connections. This permits applications in which the server can asynchronously initiate transmissions. This is done by using two simultaneous requests: one to send and the other to receive. By using the timeout parameter, a POST request can be left pending until the server determines that it has timely data to send. Or is there another way to let an AJAX call just sit there, waiting, besides using JSONRequest?

    Read the article

  • Why would some POST data go missing when using Uploadify?

    - by Chad Johnson
    I have been using Uploadify in my PHP application for the last couple months, and I've been trying to track down an elusive bug. I receive emails when fatal errors occur, and they provide me a good amount of details. I've received dozens of them. I have not, however, been able to reproduce the problem myself. Some users (like myself) experience no problem, while others do. Before I give details of the problem, here is the flow. User visits edit screen for a page in the CMS I am using. Record id for the page is put into a form as a hidden value. User clicks the Uploadify browse button and selects a file (only single file selection is allowed). User clicks Submit button for my form. jQuery intercepts the form submit action, triggers Uploadify to start uploading, and returns false for the submit action (manually cancelling the form submit event so that Uploadify can take over). Uploadify uploads to a custom process script. Uploadify finishes uploading and triggers the Javascript completion callback. The Javascript callback calls $('#myForm').submit() to submit the form. Now that's what SHOULD happen. I've received reports of the upload freezing at 100% and also others where "I/O Error" is displayed. What's happening is, the form is submitting with the completion callback, but some post parameters present in the form are simply not in the post data. The id for the page, which earlier I said is added to the form as a hidden field, is simply not there in the post data ($_POST)--there is no item for 'id' in the $_POST array. The strange thing is, the post data DOES contain values for some fields. For instance, I have an input of type text called "name" which is for the record name, and it does show up in the post data. Here is what I've gathered: This has been happening on Mac OSX 10.5 and 10.6, Windows XP, and Windows 7. I can post exact user agent strings if that helps. Users must use Flash 10.0.12 or later. We've made it so the form reverts to using a normal "file" field if they have < 10.0.12. Does anyone have ANY ideas at all what the cause of this could be?

    Read the article

  • Algorithm for parsing a flat tree into a non-flat tree

    - by Chad Johnson
    I have the following flat tree: id name parent_id is_directory =========================================================== 50 app 0 1 31 controllers 50 1 11 application_controller.rb 31 0 46 models 50 1 12 test_controller.rb 31 0 31 test.rb 46 0 and I am trying to figure out an algorithm for getting this into the following tree structuree: [{ id: 50, name: app, is_directory: true children: [{ id: 31, name: controllers, is_directory: true, children: [{ id: 11, name: application_controller.rb is_directory: false },{ id: 12, name: test_controller.rb, is_directory: false }], },{ id: 46, name: models, is_directory: true, children: [{ id: 31, name: test.rb, is_directory: false }] }] }] Can someone point me in the right direction? I'm looking for steps (eg. build an associative array; loop through the array looking for x; etc.).

    Read the article

  • problem in leigeber's sorting

    - by developer
    iam using leigeber's sorting javascript to sort my data on my page......i took the js from here :- leigeber's sorting javascript Now this is shwoing highlighted sorted column and all and its all perfect.Now iam having some negative and some positive values in my data and i want to show those negative data in red color and positive in green.This whole sorting thing is using js and css to do the highlighting and sorting.Iam a bit confused now and cant make it out that how i can assign red color to the negative ones and green to the positive ones as js is returning the data as an object i.e. a complete row and i cant make 1 column's data red or green.Will it be done by js itself or with the help of stylesheet to find -ves and +ves.Im totally lost and dont know how to do it.Please help!!!! this is an example of hte data iam using this whole sorting thing on:- -Name- -Price- -loss- -Pts- abc 361.15 -5.68 -21.75 abc2 1072.35 -5.24 -59.25 abc3 512.35 5.24 28.35 abc4 335.2 -5.02 -17.7 abc5 318.6 5.01 -16.8 abc6 76.15 -4.15 3.3

    Read the article

  • Why would some $_POST variables go missing for a form with PHP?

    - by Chad Johnson
    Sometimes, multiple times a day in fact, users of my web application are submitting a certain form which has about a dozen form fields, half of which are hidden fields, and half of the $_POST data is simply not present in the processing script. Note that the fields that are not present are at the very bottom of the form. I know this because this raises a fatal error, and an email is dispatched to me which includes the post data. And of course, neither I nor any of the developers on my team can reproduce the problem. Flash is involved in the process, as I'm using a library called Uploadify to display a progress meter. Here is the flow...does anyone have ANY ideas at all why some of the post data would be getting wiped out? User visits edit screen for a page in the CMS I am using. Record id for the page is put into a form as a hidden value. User clicks the Uploadify browse button and selects a file (only single file selection is allowed). User clicks Submit button for my form. jQuery intercepts the form submit action, triggers Uploadify to start uploading, and returns false for the submit action (manually cancelling the form submit event so that Uploadify can take over). Uploadify uploads to a custom process script. Uploadify finishes uploading and triggers the Javascript completion callback. The Javascript callback calls $('#myForm').submit() to submit the form. This happens on multiple browsers (Firefox 3.5, 3.6, Safari, Internet Explorer 7, 8) and multiple platforms (Mac OS 10.5, 10.6 and Windows XP, 7).

    Read the article

  • Call by Reference Function in C

    - by Chad
    Hello everyone, I would just like a push in the right direction here with my homework assignment. Here is the question: (1) Write a C function called input which returns void, this function prompts the user for input of two integers followed by a double precision value. This function reads these values from the keyboard and finds the product of the two integers entered. The function uses call by reference to communicate the values of the three values read and the product calculated back to the main program. The main program then prints the three values read and the product calculated. Provide test results for the input: 3 5 23.5. Do not use arrays or global variables in your program. And here is my code: #include <stdio.h> #include <stdlib.h> void input(int *day, int *month, double *k, double *pro); int main(void){ int i,j; double k, pro; input(&i, &j, &k, &pro); printf("%f\n", pro); return 0; } void input(int *i, int *j, double *k, double *pro){ int x,y; double z; double product; scanf("%d", &x); scanf("%d", &y); scanf("%f", &z); *pro += (x * y * z); } I can't figure out how to reference the variables with pointers really, it is just not working out for me. Any help would be great!

    Read the article

  • Multi-level clones with Git?

    - by Chad Johnson
    So, I'm thinking of having the following centralized setup with Git (each of these are clones): stable development developer1 developer2 developer3 So, I created my stable repository git --bare init made the 'development' clone git clone ssh://host.name//path/to/stable/project.git development and made a 'developer' clone git clone ssh://host.name//path/to/development/project.git developer So, now, I make a change, commit, and then I push from my developer account git commit --all git push and the change goes to the development clone. But now, when I ssh to the server, go to the development clone directory, and run "git fetch" or "get pull", I don't see the changes. So what do I do? Am I totally misunderstanding things and doing things wrong? How can I see the changes in the 'development' clone that I pushed from my 'developer' clone? This worked fine in Mercurial.

    Read the article

  • macro returning length of arguments in C

    - by anon
    Is it possible to write a C macro that returns the length of its arguments? I want something that does: foo(1) -> 1 foo(cat, dog) -> 2 foo(red, green, blue) -> 3 Even better if this macro can be defined in such a way that it works with ## so that foo(1) -> bar1(1) foo(cat, dog) -> bar2(cat, dog) foo(red, green, blue) -> car3(red, green, blue) Thanks! EDIT: I really want a macro, not a function. Suggestions to use functions will be downvoted.

    Read the article

  • Careers in Computer Security? [closed]

    - by Joey Green
    I have the opportunity to go back for MSCS and the closest college's main research is in computer security and forensics. I've always been interested in computer networks and security but I have no interest whatsoever to run cables or add users to the network( which is what the network people do where I currently work ). I wanted to know how may I find out the types of day to day task a computer security expert does? I don't mean the jobs you find on dice or indeed. I'm talking about the type of careers that start out at the NSA or DIA. Also, I'm wondering what the pay is like for these types of fields? Thanks to all that reply.

    Read the article

  • Use the repository pattern when using PLINQO generated data?

    - by Chad
    I'm "upgrading" an MVC app. Previously, the DAL was a part of the Model, as a series of repositories (based on the entity name) using standard LINQ to SQL queries. Now, it's a separate project and is generated using PLINQO. Since PLINQO generates query extensions based on the properties of the entity, I started using them directly in my controller... and eliminated the repositories all together. It's working fine, this is more a question to draw upon your experience, should I continue down this path or should I rebuild the repositories (using PLINQO as the DAL within the repository files)? One benefit of just using the PLINQO generated data context is that when I need DB access, I just make one reference to the the data context. Under the repository pattern, I had to reference each repository when I needed data access, sometimes needing to reference multiple repositories on a single controller. The big benefit I saw on the repositories, were aptly named query methods (i.e. FindAllProductsByCategoryId(int id), etc...). With the PLINQO code, it's _db.Product.ByCatId(int id) - which isn't too bad either. I like both, but where it gets "harrier" is when the query uses predicates. I can roll that up into the repository query method. But on the PLINQO code, it would be something like _db.Product.Where(x = x.CatId == 1 && x.OrderId == 1); I'm not so sure I like having code like that in my controllers. Whats your take on this?

    Read the article

  • Serial port determinism

    - by Matt Green
    This seems like a simple question, but it is difficult to search for. I need to interface with a device over the serial port. In the event my program (or another) does not finish writing a command to the device, how do I ensure the next run of the program can successfully send a command? Example: The foo program runs and begins writing "A_VERY_LONG_COMMAND" The user terminates the program, but the program has only written, "A_VERY" The user runs the program again, and the command is resent. Except, the device sees "A_VERYA_VERY_LONG_COMMAND," which isn't what we want. Is there any way to make this more deterministic? Serial port programming feels very out-of-control due to issues like this.

    Read the article

  • Display Facebook Status Publicly

    - by Chad
    There a couple posts on this topic non of them really talk about posting your facebook status publicly. I'm looking to post a facebook status publicly just like you can with a twitter update. Does anyone have a fully working code example of this?

    Read the article

  • Why is there no music streaming API service?

    - by Chad Johnson
    Apple has decided to kill lala.com. I loved that site. Now, everyone has to go back to paying $0.89+ for songs from Amazon, iTunes, etc. Lame. Rhapsody would be great, except there are no clients for Mac or Linux. They do have a web interface, buy it is nothing compared to lala's web 2.0y interface. What I just don't understand is, why is there no music API streaming service out there? Basically, developers could hook the service into any desktop or web app, and then users of the app could pay $x a month (like with Rhapsody) and play any amount of music, so long as their subscription is active. Why not? Lala streamed music to web browsers, so surely it could be as secure as lala is (was), preventing music theft.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >