Search Results

Search found 622 results on 25 pages for 'howto'.

Page 10/25 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • HOWTO: implement a jQuery version of ASP.Net MVC "Strongly Typed Partial Views"

    - by Sam Carleton
    I am working on a multi-page assessment form where the questions/responses are database driven. Currently I the basic system working with Html.BeginForm via standard ASP.Net MVC. At this point in time, the key to the whole system is the 'Strongly Typed Partial Views'. When the question/response is read from the database, the response type determines which derived model is created and added to the collection. The main view it iterates through the collection and uses the 'Strongly Typed Partial Views' system of ASP.Net MVC to determine which view to render the correct type of response (radio button, drop down, or text box). I would like to change this process from a Html.BeginForm to Ajax.BeginForm. The problem is I don't have a clue as to how to implement the dynamic creation of the question/response in the JavaScript/jQuery world. Any thoughts and/or suggestions? Here is the current code to generate the dynamic form: @using (Html.BeginForm(new { mdsId = @Model.MdsId, sectionId = @Model.SectionId })) { <div class="SectionTitle"> <span>Section @Model.SectionName - @Model.SectionDescription</span> <span style="float: right">@Html.CheckBoxFor(x => x.ShowUnansweredQuestions) Show only unaswered questions</span> </div> @Html.HiddenFor(x => x.PrevSectionId) @Html.HiddenFor(x => x.NextSectionId) for (var i = 0; i < Model.answers.Count(); i++) { @Html.EditorFor(m => m.answers[i]); } }

    Read the article

  • Howto see if form fields are identical in Zend framework

    - by atjepatatje
    Hi there, In Zend Framework (1.10) i want to check if two input fields are identical I have the following code in my form: $this->addElement('password', 'password', array( 'label' => 'Wachtwoord:', 'required' => true ) ); $this->addElement('password', 'verifypassword', array( 'label' => 'Bevestig wachtwoord:', 'required' => true, ) ); I already tryed the "identical" validator, but I did'nt got it to work.

    Read the article

  • css: howto remove pseudo elements (afer,before, ...)

    - by Thariama
    I would like to use a switch for the layout of paragraph tags on a webpage. I use the after pseudoelement p:after {content: url("../img/paragraph.gif");} Now i need to remove this css code from the page. How can this be done easily (jquery is already used on the page)? (i do not want to include or remove files containing css)

    Read the article

  • Howto use predicates in LINQ to Entities for Entity Framework objects

    - by user274947
    I'm using LINQ to Entities for Entity Framework objects in my Data Access Layer. My goal is to filter as much as I can from the database, without applying filtering logic on in-memory results. For that purpose Business Logic Layer passes a predicate to Data Access Layer. I mean Func<MyEntity, bool> So, if I use this predicate directly, like public IQueryable<MyEntity> GetAllMatchedEntities(Func<MyEntity, Boolean> isMatched) { return qry = _Context.MyEntities.Where(x => isMatched(x)); } I'm getting the exception [System.NotSupportedException] --- {"The LINQ expression node type 'Invoke' is not supported in LINQ to Entities."} Solution in that question suggests to use AsExpandable() method from LINQKit library. But again, using public IQueryable<MyEntity> GetAllMatchedEntities(Func<MyEntity, Boolean> isMatched) { return qry = _Context.MyEntities.AsExpandable().Where(x => isMatched(x)); } I'm getting the exception Unable to cast object of type 'System.Linq.Expressions.FieldExpression' to type 'System.Linq.Expressions.LambdaExpression' Is there way to use predicate in LINQ to Entities query for Entity Framework objects, so that it is correctly transformed it into a SQL statement. Thank you.

    Read the article

  • Howto: Access a second related model in a nested attribute builder block

    - by Joe Cairns
    I have a basic has_many through relationship: class Foo < ActiveRecord::Base has_many :bars, :dependent => :destroy has_many :wtfs :through => :bars accepts_nested_attributes_for :bars, :wtfs end On my crud forms I have a builder block for the wtf, but I need the label to come from the bar (an attribute called label for instance). What's the proper method to do this? Here's the most simple scaffold: <h1>New foo</h1> <% form_for(@foo) do |f| %> <%= f.error_messages %> <p> <%= f.label :name %><br /> <%= f.text_field :name %> </p> <h2>Bars</h2> <% f.fields_for :wtfs do |builder| %> <%= builder.hidden_field :bar_id %> <p> <%= builder.text_field :wtf_data_i_need_to_set %> </p> <% end %> <p> <%= f.submit 'Create' %> </p> <% end %> <%= link_to 'Back', foos_path %>

    Read the article

  • HowTo: Conditional Page Break in SSRS 2010 ?

    - by SwissCoder
    Hi there I just migrated a project from .NET 3.5 to 4.0, accordingly the reports now use SSRS included in .net 4.0/VS2010. Before conditionally setting a rectangles visibility did the trick for me. (inside the rectangle I put a rectangle with a pagebreak) But this stopped working now.. any help appreciated

    Read the article

  • Howto Plot "Reverse" Cumulative Frequency Graph With ECDF

    - by neversaint
    I have no problem plotting the following cumulative frequency graph plot like this. library(Hmisc) pre.test <- rnorm(100,50,10) post.test <- rnorm(100,55,10) x <- c(pre.test, post.test) g <- c(rep('Pre',length(pre.test)),rep('Post',length(post.test))) Ecdf(x, group=g, what="f", xlab='Test Results', label.curves=list(keys=1:2)) But I want to show the graph in forms of the "reverse" cumulative frequency of values x ? (i.e. something equivalent to what="1-f"). Is there a way to do it? Other suggestions in R other than using Hmisc are also very much welcomed.

    Read the article

  • rails howto compare datetime ?

    - by fenec
    hello, i have games in my sqLite DB with the attribute starting_date( t.date :starting_date). i would like to know all the games that have alreday started so i am using this lines of code: Game.find :all,:conditions=>"starting_date <= #{Date.today}" Game.find_by_sql("SELECT * FROM "games" WHERE (created_at < 2010-05-13)") the result is nill,even though i know that i have games that have already started like this one : #<Game id: 1, team_1_id: 2, team_2_id: 1, status: 2, team_1_points: nil, team_2_points: nil, starting_date: "2010-05-05", winner: 1, sport: "football", country: nil, league: "calcio", created_at: "2010-04-07 00:09:21", updated_at: "2010-05-13 00:57:19"> what am i doing wrong here?

    Read the article

  • Howto obtain Per-Interface statistics on windows

    - by Canacourse
    I am trying to find the most used Network card on windows 200 or XP. I planned to obtain the number of packets sent trough each NIC to determine the main NIC. I thought IP Helper might give me this information but also it looks like the functions in IP helper only give stats for all interfaces. I know this can be done. Any ideas? Many Thanks...

    Read the article

  • howto Debugging on PHP

    - by justjoe
    how we do basic debugging in PHP ? Can anybody share true horror story on debugging PHP application (or (even better) on PHP framework such Codeigniter and Wordpress) ? i love to hear real experience in case i have to encounter similar situation on my journey to learn PHP.

    Read the article

  • HowTo parse numbers from string with BOOST methods?

    - by mosg
    Problem: Visual C++ 10 project (using MFC and Boost libraries). In one of my methods I'm reading simple test.txt file. Here is what inside of the file (std::string): 12 asdf789, 54,19 1000 nsfewer:22!13 Then I'm reading it and I have to convert all digits to int only with boost methods. For example, I have a list of different characters which I have to parse: ( ’ ' ) ( [ ], ( ), { }, ? ? ) ( : ) ( , ) ( ! ) ( . ) ( - ) ( ? ) ( ‘ ’, “ ”, « » ) ( ; ) ( / ) And after conversation I must have some kind of a massive of int's values, like this one: 12,789,54,19,1000,22,13 Maybe some one already did this job? PS. I'm new for boost. Thanks!

    Read the article

  • Howto read only one line via c++ from a data

    - by Markus Hupfauer
    i tryed to read the first line of a .dat data, but when i tryed to give to text, wich was saved in the .dat data, it print out the whole data, not only one line. the tool is also not looking after breaks or spaces :( Im using the following code: //Vocabel.dat wird eingelesen ifstream f; // Datei-Handle string s; f.open("Vocabeln.dat", ios::in); // Öffne Datei aus Parameter while (!f.eof()) // Solange noch Daten vorliegen { getline(f, s); // Lese eine Zeile cout << s; } f.close(); // Datei wieder schließen getchar(); . So could u help me please ? . Thanks a lot Markus

    Read the article

  • howto: vimrc change part of file path and execute script

    - by posop
    I would like to set up a command to execute launch the php script i am editing. :echo expand('%:p:h') yields: C:\xampp\htdocs\my my localhost path is C:\xampp\htdocs i would like to cut the contents of local host off my current directory and append a file separator so i would have: g:var = \my\ so the end goal would be to have something like this in my .vimrc (need help with the concatenate) map <F5> :w<CR>:silent execute '!"c:\Program Files (x86)\Mozilla Firefox\firefox.exe"' "localhost . $var . %"<CR> is this possible? or is there another way to do this?

    Read the article

  • Howto check if a object is connected to another in hibernate

    - by codevourer
    Imagine two domain object classes, A and B. A has a bidirectional one-to-many relationship to B. A is related to thousands of B. The relations must be unique, it's not possible to have a duplicate. To check if an instance of B is already connected to a given instance of A, we could perform an easy INNER JOIN but this will only ensure the already persisted relations. What about the current transient relations? class A { @OneToMany private List<B> listOfB; } If we access the listOfB and perform a check of contains() this will fetch all the connected instances of B lazy from the datasource. I only want to validate them by their primary-key. Is there an easy solution where I can do things like "Does this instance of A is connected with this instance of B?" Without loading all these data into memory and perform a based on collections?

    Read the article

  • howto have condition in a nested SQL query?

    - by fenec
    here is my SQL statement , i would like to find all the games that have the status 0 and names of teams that are like key_word or the sport's name that are like the key word. The problem is that all the games that are displayed don't have status 0 . What am i doing wrong? sql="select * from games where games.status=0 and games.team_2_id IN (select id from teams where name like '"+key_word+"') or games.team_1_id IN (select id from teams where name like '"+key_word+"') or games.sport like '"+key_word+"' "

    Read the article

  • Howto take a glimpse into mscorlib?

    - by panny
    Hi all! I want to read data into RSAParameters structure ( RSAParameters ) and did check twice, that the data is correct. But still, I get an error "invalid data" exception for this: bei System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) bei System.Security.Cryptography.Utils._ImportKey(SafeProvHandle hCSP, Int32 keyNumber, CspProviderFlags flags, Object cspObject, SafeKeyHandle& hKey) bei System.Security.Cryptography.RSACryptoServiceProvider.ImportParameters(RSAParameters parameters) How can I take a look into the source code to check why _ImportKeys is throwing an exception? I have no experience with .dll 'decryption'..are there any symbols to reference somewhere for visual studio 8.0? Thank you.

    Read the article

  • Howto convert to string and read data from TCP packet

    - by salime
    I used sharppcap to capture TCP packets. Now i wanna reconstruct HTTP packet from TCP packets but i don't know how. I read somewhere i can find start of HTTP packet in TCP data... i tried to convert byte[] TCP data to string using this code: string s = System.Text.Encoding.UTF8.GetString(tcp_pack.Data); but the string isn't readable. like a binary file that is opened with notepad. is it because the data is encrypted or code is incorrect? how can i reconstruct HTTP packet from TCP packets?

    Read the article

  • Howto plot two cumulative frequency graph together

    - by neversaint
    I have data that looks like this: #val Freq1 Freq2 0.000 178 202 0.001 4611 5300 0.002 99 112 0.003 26 30 0.004 17 20 0.005 15 20 0.006 11 14 0.007 11 13 0.008 13 13 ...many more lines.. Full data can be found here: http://dpaste.com/173536/plain/ What I intend to do is to have a cumulative graph with "val" as x-axis with "Freq1" & "Freq2" as y-axis, plot together in 1 graph. I have this code. But it creates two plots instead of 1. dat <- read.table("stat.txt",header=F); val<-dat$V1 freq1<-dat$V2 freq2<-dat$V3 valf1<-rep(val,freq1) valf2<-rep(val,freq2) valfreq1table<- table(valf1) valfreq2table<- table(valf2) cumfreq1=c(0,cumsum(valfreq1table)) cumfreq2=c(0,cumsum(valfreq2table)) plot(cumfreq1, ylab="CumFreq",xlab="Loglik Ratio") lines(cumfreq1) plot(cumfreq2, ylab="CumFreq",xlab="Loglik Ratio") lines(cumfreq2) What's the right way to approach this?

    Read the article

  • Howto check if two hosts are the same

    - by Michael Stoll
    Hi, I just came across an issue, where I had to check if a path points into a windows share. Part of this problem is to check if host A is the same as host B. Where host A and host B can be one of the following {IPv4-Address, IPv6-Address, Hostname, FQDN}. As I do not need to be exact it's enough to resolve and compare the IP-Addresses in my case. But is there, theoretically, a method to check if the hosts are the same?

    Read the article

  • Howto disable the emacs site-start files permanently?

    - by elemakil
    When solving this problem I figured out that I need to disable the site-wise init files in order to get my emacs + CEDET running (everything works nicely when starting emacs using emacs --no-site-file but is broken without the additional argument). I'd like to disable the site-wise init files permanently but as I'm using several different approaches/methods when launching emacs (launcher/panel/terminal) I don't think aliasing it in my .zshrc won't work. I require a method to permanently disable all site-start files. Is there any easy way to achieve this? Thanks!

    Read the article

  • Failing faster when URL content is not found, howto

    - by Jam
    I have a thread pool that loops over a bunch of pages and checks to see if some string is there or not. If String is found, or not found response is near instant, however if server is offline or application is not running getting a rejection seems to take seconds How can I change my code to fail faster? for (Thread thread : pool) { thread.start(); } for (Thread thread : pool) { try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } Here is my run method @Override public void run() { for (Box b : boxes) { try { connection = new URL(b.getUrl()).openConnection(); scanner = new Scanner(connection.getInputStream()); scanner.useDelimiter("\\Z"); content = scanner.next(); if (content.equals("YES")) { } else { System.out.println("\tFAILED ON " + b.getName() + " BAD APPLICATION STATE"); } } catch (Exception ex) { System.out.println("\tFAILED ON " + b.getName() + " BAD APPLICATION STATE"); } } }

    Read the article

  • howto catch jQuery for multiple links but not all

    - by user247245
    I'm trying to dig into jQuery but would like some feedback on how to do things the best way, I have a list with items, which each contains a hidden div that should show upon click on it's parent, list div:ed item1 with link hidden div div:ed item2 with link hidden div .. My current solution is to trace the calling link by it's id and then reusing that ID for showing the correct hidden one: $(document).ready(function() { //jQ should only trigger on links with id="cmLinkINT" $("a").click(function() { //see if it's a comment request. var s = $(this).attr("id"); if (s.indexOf('cmLink') != -1) { //ok, it was a 'show'-link, get the id.. var j = s.substring(6); //ok, now I have the id i want to show (detailsINT) return false; } }); }); What's not clear to me is the best approach, Should I use id for requesting a or trace the id of the parent div. How to avoid that the code triggers on any link? Class? Thankful for any feedback, regards //t

    Read the article

  • ASP.net MVC3 howto edit sql database

    - by user1662380
    MovieStoreEntities MovieDb = new MovieStoreEntities(); public ActionResult Edit(int id) { //var EditMovie1 = MovieDb AddMovieModel EditMovie = (from M in MovieDb.Movies from C in MovieDb.Categories where M.CategoryId == C.Id where M.Id == id select new AddMovieModel { Name = M.Name, Director = M.Director, Country = M.Country, categorie = C.CategoryName, Category = M.CategoryId }).FirstOrDefault(); //AddMovieModel EditMovie1 = MovieDb.Movies.Where(m => m.Id == id).Select(m => new AddMovieModel {m.Id }).First(); List<CategoryModel> categories = MovieDb.Categories .Select(category => new CategoryModel { Category = category.CategoryName, id = category.Id }) .ToList(); ViewBag.Category = new SelectList(categories, "Id", "Category"); return View(EditMovie); } // // POST: /Default1/Edit/5 [HttpPost] public ActionResult Edit(AddMovieModel Model2) { List<CategoryModel> categories = MovieDb.Categories .Select(category => new CategoryModel { Category = category.CategoryName, id = category.Id }) .ToList(); ViewBag.Category = new SelectList(categories, "Id", "Category"); if (ModelState.IsValid) { //MovieStoreEntities model = new MovieStoreEntities(); MovieDb.SaveChanges(); return View("Thanks2", Model2); } else return View(); } This is the Code that I have wrote to edit Movie details and update database in the sql server. This dont have any compile errors, But It didnt update sql server database.

    Read the article

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