Search Results

Search found 6605 results on 265 pages for 'complex networks'.

Page 182/265 | < Previous Page | 178 179 180 181 182 183 184 185 186 187 188 189  | Next Page >

  • Rails 2.3.5: How does one add an error when it doesn't make sense to put it in a validation?

    - by randombits
    I recently was trying to add errors.add_to_base code in the middle of some model logic and was wondering why it wasn't showing up in my view that was iterating over all errors. I then ran across this e-mail which explains why: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/e045ec1dead1ff06?pli=1 The question is then, how does one add errors with add_to_base if it doesn't make sense to put them into a validate method? I have some complex logic. The model needs to talk to a has_many relationship which has its own relationships that go through a myriad of conditionals to figure out if a request makes sense. It's nothing that can be tied to a validate method easily. How does one add errors then accordingly?

    Read the article

  • Mysterious c debugging problem when trying to utilize printfs

    - by O_O
    Ok, folks. I've never encountered this before and it boggles the mind and is illogical. I have a somewhat complex loop and I want to try and see if everything is working by putting some printf statements. I look the intermediate products using printf and verify that the answer is ok. Then, when I comment out the printf to the intermediate products, the answer is WRONG. Has anyone ever encountered this? This is driving me insane and I don't see how the printfs could change an answer.... X_x If it helps, I am using a c/c++ compiler for a DSP. Thanks for any advice.. Here is a snippet... printf("splitBackground = %d, numWindowPoints = %d\n", splitBackground, numWindowPoints); splitBackground = splitBackground/numWindowPoints; printf("%d ", splitBackground); This is good but when I comment out the first line of code, it turns out to be hugely incorrect. :(

    Read the article

  • PHP and C# communication with Encrypt/Decrypt

    - by SilentWarrior
    Hello, I have been searching and cant find a consistent solution to my problem : I want to encrypt something in C# and decrypt it in PHP but also be able to encrypt in PHP and decrypt in C#, using the same key on both ends. All the solutions I found dont seem to work both ways, most of them only work on one language and then fail on the other, either by decrypting wrong or by blowing up the offsets. I would like to use TripleDES but it isnt a requirement, just want something relatively strong for plain text communication (will either use JSON or just plain key-value pairs for complex stuff). Thanks in advance PS: http://pastie.org/643106 this is what I have been testing with.

    Read the article

  • Possible to exclude or reorder a column from `*` ?

    - by Earlz
    Is it possible to exclude a column from a select * from table statement with SQL Server? I have a need for this and this is my only option other than parsing a raw SQL string to get out the required field names (I really don't want to do that). Just to be bold. When the query is made I do not have access to the list of fields needed from the table but I do know which field I do not need. This is part of a complex multi-part query. Surely there must be some way even if it's "hackish" such as using table variables or views My other option is to reorder the columns. My problem is with ExecuteScalar SQL functions which get the first row and first column.

    Read the article

  • C++ Access variable value using string representing variable's name

    - by Paul Ridgway
    Hello everyone, If the title was not clear, I will try to clarify what I am asking: Imagine I have a variable called counter, I know I can see its current value by doing something like: std::cout << counter << std::endl; However, assume I have lots of variables and I don't know which I'm going to want to look at until runtime. Does anyone know a way I can fetch the value of a variable by using its name, for example: std::cout << valueOf("counter") << std::endl; I feel being able to do this might make debugging large complex projects easier. Thanks in advance for your time. PS: Please do not respond with 'Google it', I have, though maybe not with the best query to get the answer I'm looking for...

    Read the article

  • How to use ccache selectively?

    - by Anonymous
    I have to compile multiple versions of an app written in C++ and I think to use ccache for speeding up the process. ccache howtos have examples which suggest to create symlinks named gcc, g++ etc and make sure they appear in PATH before the original gcc binaries, so ccache is used instead. So far so good, but I'd like to use ccache only when compiling this particular app, not always. Of course, I can write a shell script that will try to create these symlinks every time I want to compile the app and will delete them when the app is compiled. But this looks like filesystem abuse to me. Are there better ways to use ccache selectively, not always? For compilation of a single source code file, I could just manually call ccache instead of gcc and be done, but I have to deal with a complex app that uses an automated build system for multiple source code files.

    Read the article

  • Listing C/C++ functions (Code analysis in Unix)

    - by Jond
    Whether we're maintaining unfamiliar code or checking out the implementation details of an Apache module it can help if we can quickly traverse the code and build up an overview of what we're looking at. Grep serves most of my daily needs but there are some cases where it just wont do. Here's a common example of how it can help. To find the definition of a PHP function I'm interested in I can type this at the command line: grep -r "function myfunc" . This could be adapted very quickly to C or C++ if we know the return type, but things become more complicated if, say, I want to list every method that my class provides: grep "function " ./src/mine.class.php Since there's no single keyword that denotes a function or method in C++ and because it's generally more complex syntax, I think I'd need some kind of static code analysis tool, smart use of the C Preprocessor or blind faith the coder followed strict code guidelines (# of whitespace, position of curlies etc) to get these sorts of results. What would you recommend? p.s. be nice, this is my first post ;-) :p

    Read the article

  • Javascript object encapsulation that tracks changes

    - by Raynos
    Is it possible to create an object container where changes can be tracked Said object is a complex nested object of data. (compliant with JSON). The wrapper allows you to get the object, and save changes, without specifically stating what the changes are Does there exist a design pattern for this kind of encapsulation Deep cloning is not an option since I'm trying to write a wrapper like this to avoid doing just that. The solution of serialization should only be considered if there are no other solutions. An example of use would be var foo = state.get(); // change state state.update(); // or state.save(); client.tell(state.recentChange()); A jsfiddle snippet might help : http://jsfiddle.net/Raynos/kzKEp/ It seems like implementing an internal hash to keep track of changes is the best option. [Edit] To clarify this is actaully done on node.js on the server. The only thing that changes is that the solution can be specific to the V8 implementation.

    Read the article

  • HTML/Javascript disabled and then reenabled checkbox is being POSTED

    - by NeverStopLearning
    I have a page with a checkbox that is disabled/reenabled with javascript on button click. If I never disable the checkbox then its value is correctly POSTed, however if I disable the checkbox even once it gets posted without value (posts as "name=" even when checked). I have inspected the POST value through firebug. Why does it behaves like this? Am I missing something? I ve read somewhere that disabled controls are not posted, thats OK, but this control is not disabled when the submit is clicked. I am using ASP.NET with more complex setup to test this, but essentially this is the core of the problem. The brower is FF latest. I found very similar question, however without an answer: disabled control being reenabled but still not posting back contents to server

    Read the article

  • How to track conversion rate (clicks to sales) from an internal advertising system?

    - by Ed Woodcock
    I am currently writing an interal advertising system for a company client's website, where the adverts will only be seen by internal users, and all transactions take place internally to the site (i.e. the adverts are for member-only content available on the site). Does anyone have any recommendations as to the best way to track the conversion rate of these adverts (i.e. views:clicks:sales)? EDIT I'm not looking for a 'Why don't you use google analystics'-type answer, I'm looking into possible architecture outlines, i.e. a 'why don't use store a guid in a cache temporarily and see if it ties to the advert' kind of answer. /EDIT In a previous job I did something based on an internal cache, which simply did view:click tracking, however the addition of the sales rate makes this task more complex, especially if we take into account the idea that someone may click through to an advert and not purchase immediately. Cheers, Ed (N.B. I'm leaving this purposely vague in order to (hopefully) get some answers that provide ideas I've yet to have thought of by coming at the problem from a different angle)

    Read the article

  • What if Web page's background matters

    - by hgulyan
    Hi, I have a complex background image and images, that should be on exact positions of the background image. How can I organize web page? I can't use absolute positions, because I need to organize background to view it nice on any monitor, any resolution and any browser. It can be aligned to center or smth else. Web page can be written just with HTML, Javascript or with a library like JQuery. Here's an example of what kind of web page I'd like to have. http://desandro.com/portfolio/ (background picture and points on it) Thanks in advance.

    Read the article

  • Access attribute values of empty element tag in xml

    - by meenakshik
    Hello, I have a xml where I got some empty complex elements and I need to access the attribute values of this element. <test> <a> <abc-metadata name="testData" value="This is a test"/> </a> </test> I want to get hold of the 'testData' and 'This is a test' values. I do read the document and I tried accessing it document.getElementsByTagName . I am sure there is some way to access attributes of element tags but somehow it throws me nullpointer exception. Thanks in advance

    Read the article

  • Gridview SortExpression with 2 fields

    - by aron
    Hello, I have a GridView that get's its datasource from a complex object. So I'm doing the Sorting & Paging in the code behind. <asp:GridView ID="SystemsDetailList" runat="server" AllowSorting="true" AllowPaging="true" AutoGenerateColumns="False" ShowFooter="True" OnPageIndexChanging="gridView_PageIndexChanging" OnSorting="gridView_Sorting"> For an important title column I have a SortExpression with 2 fields: SortExpression="FunctionalAreaDisplayCode, EswbsDisplayCode" This in the code behind: protected void gridView_Sorting(object sender, GridViewSortEventArgs e) { BindSystemList(e.SortExpression, sortOrder); } public string sortOrder { get { if (ViewState["sortOrder"].ToString() == "desc") { ViewState["sortOrder"] = "asc"; } else { ViewState["sortOrder"] = "desc"; } return ViewState["sortOrder"].ToString(); } set { ViewState["sortOrder"] = value; } } For some reason it will keep "FunctionalAreaDisplayCode" always sorted ASC but the EswbsDisplayCode works fine as it flips between ASC and DESC correctly. and tips here? thanks!

    Read the article

  • node.js storing gamestate, how?

    - by expressnoob
    I'm writing a game in javascript, and to prevent cheating, i'm having the game be played on the server (it's a board game like a more complicated checkers). Since the game is fairly complex, I need to store the gamestate in order to validate client actions. Is it possible to store the gamestate in memory? Is that smart? Should I do that? If so, how? I don't know how that would work. I can also store in redis. And that sort of thing is pretty familiar to me and requires no explanation. But if I do store in redis, the problem is that on every single move, the game would need to get the data from redis and interpret and parse that data in order to recreate the gamestate from scratch. But since moves happen very frequently this seems very stupid to me. What should I do?

    Read the article

  • How to mimic an excel spreadsheet on a website in vb.net?

    - by user1439659
    I am building a website to capture data. I have many spreadsheets that are used for data entry or capture. Now I want to mimic these complex spreadsheets on the web forms but I am unsure of the correct control to use. Data entry must be allowed and live calculations also need to be made similar to formulas on normal excel spreadsheets. Later on the data must be captured into an SQL table. What would be the best control to use or method to mimic that functionality, albeit that the spreadsheet component is no longer available in visual studio 2010. Is it a data grid? Thanks

    Read the article

  • What does this recursive function do?

    - by null
    What does this function do? And how do you evaluate it? How to trace it? How to understand recursive method? I just can't understand the recursion, and the exam date is coming soon, and I know in order to understand recursion, I must first understand recursion. But I just can't write a slightly complex recursive method, can anyone help me out using the simplest English words. public class BalancedStrings { public static void printBalanced(String prefix, int a, int b) { if (a > 0) printBalanced(prefix + "a", a - 1, b); if (b > 0) printBalanced(prefix + "b", a, b - 1); if (a == 0 && b == 0) System.out.println(prefix); } public static void printBalanced(int n) { if (n % 2 == 0) { printBalanced("", n / 2, n / 2); } } public static void main(String[] args) { printBalanced(4); } }

    Read the article

  • Separating Spring and Dojo single page app codebases

    - by Pie21
    I'm working on a web application with a Spring Roo REST API backend and a Dojo single-page client app. Spring Roo provides a handy admin interface (with Web MVC) out of the box, so I'd like to keep that accessible for administrative duties. However I'd like the Dojo app to be decoupled from the server application as possible. The server is a platform for which we expect new client applications to be developed, so I'd like to develop the 'official' client web app in isolation. What is the best (or even just one good) way to structure the application code? It's easy to leave the server alone as an API and admin interface, but where does all the Dojo JS live? It works okay when it's in the Spring webapp directory, but gets complicated quickly as soon as the structure gets more complex or is moved anywhere else (Spring URL mappings are still awfully opaque to me). Ideally it could be hosted locally on a development machine, which introduces all the cross-domain JS issues as well.

    Read the article

  • What is the REGEX of a CSS selector

    - by user421563
    I'd like to parce a CSS file and add before every CSS selector another selector. From: p{margin:0 0 10px;} .lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px;} I'd like: .mySelector p{margin:0 0 10px;} .mySelector .lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px;} But my CSS file is really complex (in fact it is the bootstrap css file) so the regex should match all CSS selectors. For now I have this regex: ([^\r\n,{};]+)(,|{) and you can see the result here http://regexr.com?328ps but as you can see there are a lot of matches that shouldn't match for example: text-shadow:0 -1px 0 rgba(0, matchs positive but it shouldn't Does someone have a solution ? THX

    Read the article

  • Advice regarding Java frameworks [closed]

    - by Mixiul
    I am in the process of creating a website/phone application using JQuery Mobile and PhoneGap. I am hoping to add openID support so users can login in with pre-existing accounts. It will be necessary for me to have a database with a few tables to enable me to implement all the core functionality I desire. I haven't really had much experience with frameworks before, the closest thing I have done to this is create a basic website using php that connected to a MySql database stored on the machine that hosted the apache webserver. The interaction with the database won't be complex. I am required to use a java framework for the backend of my application. My question is which java framework is most suitable (flexible and straight forward to learn)? Any advice you guys can provide is greatly appreciated. Thanks

    Read the article

  • CMD Execption Handling C/C++

    - by ciyo
    I will use some CMD commands in my program and these commands might throw some exceptions. And as you know, when an exception accours, CMD writes its own error message the screen. But, I want to write my own error message. My question is this: Is there a way to block CMD messages and write only my own error messages? P.S. This is not a complex program. It executes CMD commands using System(). Example: Let's say, the user can rename and copy any files in the program. As you know, if the user does not enter file's path properly, an error message is showed on the screen. And I want that this error message never appears on the screen. Only my own error message is showed. Thank you!

    Read the article

  • Why SQL functions are faster than UDF

    - by Zerotoinfinite
    Though it's a quite subjective question but I feel it necessary to share on this forum. I have personally experienced that when I create a UDF (even if that is not complex) and use it into my SQL it drastically decrease the performance. But when I use SQL inbuild function they happen to work pretty faster. Conversion , logical & string functions are clear example of that. So, my question is "Why SQL in build functions are faster than UDF"? and it would be an advantage if someone can guide me how can I judge/manipulate function cost either mathematically or logically.

    Read the article

  • Question about software that tracks divs better than notepad++

    - by Jeff
    I recently got hired as a web developer, and the project that I am overseeing has a formatting issue on one of the pages because one of the divs is out of whack. It is a fairly complex page with quite a bit of php, and from what I can gather, I am missing a </div> tag somewhere, and accordingly everything is messed up. I am currently using notepad++, which is decent at lining up divs, meaning that if you click on the opening div tag, it will highlight purple and also highlight the closing one. But it seems as though if you have div tags that span several lines (hundreds) it won't work. Has anyone else run into a similar situation? Is there a better editor I could be using that would do a better job of helping me with my div issue? Or do I have to go through and line up the divs 1 by 1? (there are like over 100). Please let me know!! Thanks

    Read the article

  • "modal" in apple documentation

    - by Crystal
    Apple uses "modal" often in their documentation. Like dismissModalViewController in their titles of methods, or documentation like: "The UIViewController class provides the fundamental view-management model for iPhone applications. The basic view controller class supports the presentation of an associated view in addition to basic support for managing modal views and rotating views in response to device orientation changes. Subclasses such as UINavigationController and UITabBarController provide additional behavior for managing complex hierarchies of view controllers and views." I'm not sure as to what context I should think of when I see modal in the names and documentation. Any thoughts? Thanks.

    Read the article

  • int i vs int index etc. Which one is better?

    - by Earlz
    Coming from a C background I've always used int i for generic loop variables. Of course in big nested loops or other complex things I may use a descriptive name but which one had you rather see? int i; for(i=0;i<Controls.Count;i++){ DoStuff(Controls[i]); } or int index; for(index=0;index<Controls.Count;index++){ DoStuff(Controls[index]); } In the current project I am working on there are both of these styles and index being replaced by ndx. Which one is better? Is the i variable too generic? Also what about the other C style names? i, j, k Should all of these be replaced by actual descriptive variables?

    Read the article

  • Updating counters through Hibernate

    - by at
    This is an extremely common situation, so I'm expecting a good solution. Basically we need to update counters in our tables. As an example a web page visit: Web_Page -------- Id Url Visit_Count So in hibernate, we might have this code: webPage.setVisitCount(webPage.getVisitCount()+1); The problem there is reads in mysql by default don't pay attention to transactions. So a highly trafficked webpage will have inaccurate counts. The way I'm used to doing this type of thing is simply call: update Web_Page set Visit_Count=Visit_Count+1 where Id=12345; I guess my question is, how do I do that in Hibernate? And secondly, how can I do an update like this in Hibernate which is a bit more complex? update Web_Page wp set wp.Visit_Count=(select stats.Visits from Statistics stats where stats.Web_Page_Id=wp.Id) + 1 where Id=12345;

    Read the article

< Previous Page | 178 179 180 181 182 183 184 185 186 187 188 189  | Next Page >