Search Results

Search found 1008 results on 41 pages for 'kevin cupp'.

Page 27/41 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Getting method arguments with Roslyn

    - by Kevin Burton
    I can get a list from the solution of all calls to a particuliar method using the following code: var createCommandList = new List<MethodSymbol>(); INamedTypeSymbol interfaceSymbol = (from p in solution.Projects select p.GetCompilation().GetTypeByMetadataName("BuySeasons.BsiServices.DataResource.IBsiDataConnection")).FirstOrDefault(); foreach (ISymbol symbol in interfaceSymbol.GetMembers("CreateCommand")) { if (symbol.Kind == CommonSymbolKind.Method && symbol is MethodSymbol) { createCommandList.Add(symbol as MethodSymbol); } } foreach (MethodSymbol methodSymbol in createCommandList) { foreach (ReferencedSymbol referenceSymbol in methodSymbol.FindReferences(solution)) { foreach (ReferenceLocation referenceLocation in from l in referenceSymbol.Locations orderby l.Document.FilePath select l) { if (referenceLocation.Location.GetLineSpan(false).StartLinePosition.Line == referenceLocation.Location.GetLineSpan(false).EndLinePosition.Line) { Debug.WriteLine(string.Format("{0} {1} at {2} {3}/{4} - {5}", methodSymbol.Name, "(" + string.Join(",", (from p in methodSymbol.Parameters select p.Type.Name + " " + p.Name).ToArray()) + ")", Path.GetFileName(referenceLocation.Location.GetLineSpan(false).Path), referenceLocation.Location.GetLineSpan(false).StartLinePosition.Line, referenceLocation.Location.GetLineSpan(false).StartLinePosition.Character, referenceLocation.Location.GetLineSpan(false).EndLinePosition.Character)); } else { throw new ApplicationException("Call spans multiple lines"); } } } } But this gives me a list of ReferencedSymbol's. Although this gives me the file and line number that the method is called from I would also like to get the specific arguments that the method is called with. How can I either convert what I have or get the same information with Roslyn? (notice the I first load the solution with the Solution.Load method and then loop through to find out where the method is defined/declared (createCommandList)). Thank you.

    Read the article

  • nginx improperly forwards to https, adds two trailing slashes when rewriting

    - by Kevin
    I'm using nginx as a proxy for a django project on mod_wsgi and to serve the static content. I have two domain names for it: asdf-example.com and asdfexample.com. I want to use rewrites to redirect everything to www.asdf-example.com They're not quite working the way they should: asdf-example.com forwards to https:// www.asdf-example.com, which fails because I'm not using SSL. Though asdf-example.com/search forwards to http://.... asdfexample.com and www.asdfexample.com both forward to www.asdf-example.com//, which looks weird. My config file: server { listen 80; server_name asdf-example.com asdfexample.com; if ($host ~* ^asdf-example\.com){ rewrite ^(.*)$ http://www.asdf-example.com/$1 permanent; } if ($host ~* ^asdfexample\.com){ rewrite ^(.*)$ http://www.asdf-example.com/$1 permanent; } if ($host ~* ^www\.asdfexample\.com){ rewrite ^(.*)$ http://www.asdf-example.com/$1 permanent; } ... Thanks

    Read the article

  • CI PHP if statement w/ sql syntax

    - by Kevin Brown
    This is a quick syntax question... I need to block out an HTML element if two SQL statements are true w/ php. If the status = 'closed', and if the current user is logged in. I can figure out the calls, I just need to see an example of the syntax. :) So, If SQL status=closed, and if current_user=is_logged_in()...something like that.

    Read the article

  • How to wire a verifier to a 2.0m5 Restlet using the spring extension and an xml config?

    - by Kevin Pauli
    I can't seem to find any example of how to do this. Imperatively in java it would be a piece of cake of course, but I can't seem to figure out how to inject my JaasVerifier into my SpringComponent declaratively from within the xml. It appears from the method signatures that Verifier is designed to be attached to Context, but the instance of Context itself is created as a side effect of the SpringComponent creation so I can't get a hold of it in Spring. There must be something I am missing.

    Read the article

  • Use a single freemarker template to display tables of arbitrary pojos

    - by Kevin Pauli
    Attention advanced Freemarker gurus: I want to use a single freemarker template to be able to output tables of arbitrary pojos, with the columns to display defined separately than the data. The problem is that I can't figure out how to get a handle to a function on a pojo at runtime, and then have freemarker invoke that function (lambda style). From skimming the docs it seems that Freemarker supports functional programming, but I can't seem to forumulate the proper incantation. I whipped up a simplistic concrete example. Let's say I have two lists: a list of people with a firstName and lastName, and a list of cars with a make and model. would like to output these two tables: <table> <tr> <th>firstName</th> <th>lastName</th> </tr> <tr> <td>Joe</td> <td>Blow</d> </tr> <tr> <td>Mary</td> <td>Jane</d> </tr> </table> and <table> <tr> <th>make</th> <th>model</th> </tr> <tr> <td>Toyota</td> <td>Tundra</d> </tr> <tr> <td>Honda</td> <td>Odyssey</d> </tr> </table> But I want to use the same template, since this is part of a framework that has to deal with dozens of different pojo types. Given the following code: public class FreemarkerTest { public static class Table { private final List<Column> columns = new ArrayList<Column>(); public Table(Column[] columns) { this.columns.addAll(Arrays.asList(columns)); } public List<Column> getColumns() { return columns; } } public static class Column { private final String name; public Column(String name) { this.name = name; } public String getName() { return name; } } public static class Person { private final String firstName; private final String lastName; public Person(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } } public static class Car { String make; String model; public Car(String make, String model) { this.make = make; this.model = model; } public String getMake() { return make; } public String getModel() { return model; } } public static void main(String[] args) throws Exception { final Table personTableDefinition = new Table(new Column[] { new Column("firstName"), new Column("lastName") }); final List<Person> people = Arrays.asList(new Person[] { new Person("Joe", "Blow"), new Person("Mary", "Jane") }); final Table carTable = new Table(new Column[] { new Column("make"), new Column("model") }); final List<Car> cars = Arrays.asList(new Car[] { new Car("Toyota", "Tundra"), new Car("Honda", "Odyssey") }); final Configuration cfg = new Configuration(); cfg.setClassForTemplateLoading(FreemarkerTest.class, ""); cfg.setObjectWrapper(new DefaultObjectWrapper()); final Template template = cfg.getTemplate("test.ftl"); process(template, personTableDefinition, people); process(template, carTable, cars); } private static void process(Template template, Table tableDefinition, List<? extends Object> data) throws Exception { final Map<String, Object> dataMap = new HashMap<String, Object>(); dataMap.put("tableDefinition", tableDefinition); dataMap.put("data", data); final Writer out = new OutputStreamWriter(System.out); template.process(dataMap, out); out.flush(); } } All the above is a given for this problem. So here is the template I have been hacking on. Note the comment where I am having trouble. <table> <tr> <#list tableDefinition.columns as col> <th>${col.name}</th> </#list> </tr> <#list data as pojo> <tr> <#list tableDefinition.columns as col> <td><#-- what goes here? --></td> </#list> </tr> </#list> </table> So col.name has the name of the property I want to access from the pojo. I have tried a few things, such as pojo.col.name and <#assign property = col.name/> ${pojo.property} but of course these don't work, I just included them to help convey my intent. I am looking for a way to get a handle to a function and have freemarker invoke it, or perhaps some kind of "evaluate" feature that can take an arbitrary expression as a string and evaluate it at runtime.

    Read the article

  • Filemaker XSL Select Column By Name

    - by Kevin Sylvestre
    I am looking to export from Filemaker using column names (instead of positions). Currently I export the following XSL stylesheet that exports by position with: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" > <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <people> <xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW"> <person> <name> <xsl:value-of select="fm:COL[01]/fm:DATA"/> </name> <location> <xsl:value-of select="fm:COL[02]/fm:DATA"/> </location> </person> </xsl:for-each> </people> </xsl:template> </xsl:stylesheet> Any ideas? Thanks.

    Read the article

  • Simulate Offline Mode for HTML5 Cache Testing

    - by Kevin Sylvestre
    I have an HTML5 application that requires offline support. I am using a local Apache server for the application, and am trying to figure out what the best way is to simulate offline mode (currently, in Firefox I disable my Air-Port to simulate offline mode, but this is a pain). Any suggestions? I am open to using other browsers if a method exists that doesn't require turning off my Internet.

    Read the article

  • JXTreeTable and BorderHighlighter Drawing Border on All Rows

    - by Kevin Rubin
    I'm using a BorderHighlighter on my JXTreeTable to put a border above each of the table cells on non-leaf rows to give a more clear visual separator for users. The problem is that when I expand the hierarchical column, all cells in the hierarchical column, for all rows, include the Border from the Highlighter. The other columns are displaying just fine. My BorderHighlighter is defined like this: Highlighter topHighlighter = new BorderHighlighter(new HighlightPredicate() { @Override public boolean isHighlighted(Component component, ComponentAdapter adapter) { TreePath path = treeTable.getPathForRow(adapter.row); TreeTableModel model = treeTable.getTreeTableModel(); Boolean isParent = !model.isLeaf(path.getLastPathComponent()); return isParent; } }, BorderFactory.createMatteBorder(2, 0, 0, 0, Color.RED)); I'm using SwingX 1.6.5.

    Read the article

  • I've created a database table using Visual Studio for my C# program. Now what?

    - by Kevin
    Hi! I'm very new to C#, so please forgive me if I've overlooked something here. I've created a database using Visual Studio (add new item service-based database) called LoadForecast.mdf. I then created a table called ForecastsDB and added some fields. My main question is this: I've created a console application with the intention of writing some data to the newly created database. I've added LoadForecast.mdf as a data source for my program, but is there anything else I should do? I saw an example where the next step was adding a "data diagram", but this was for a visual application, not a console application. Do I still need to diagram the database for my console app? I just want to be able to write new records out to my database table and wasn't sure if there were any other things I needed to do for the VS environment to be "aware" of my database. Thanks for any advise!

    Read the article

  • Can only access asp.net app on localhost

    - by Kevin Donn
    I'm trying to get an asp.net application up on IIS on a Windows Server 2008 machine. I can hit the app from localhost, no problem. But I can't access the app using the server's domain name either locally or from another machine on the network. But here's the odd part. I can access a normal file on IIS using the domain name, both from a browser running on the server and from a browser running on another machine on the network. Here's a synopsis ("http" converted to "htp" below because I don't have enough points to have all these links in my message): From IE on the server itself: works htp://localhost/foo.htm works htp://localhost/App works htp://test.foo.com/foo.htm dead htp://test.foo.com/App From IE on another machine: works htp://test.foo.com/foo.htm dead htp://test.foo.com/App And when I say "dead" I mean the request times out. Any ideas?

    Read the article

  • Android OS 2.2 Permissions: I have absolutely no idea why this simple piece of code doesn't work. Wh

    - by Kevin
    I'm just playing around with some code. I create an Activity and simply do something like this: long lo = currentTimeMillis(); System.out.println(lo); lo *= 3; System.out.println(lo); SystemClock.setCurrentTimeMillis(lo); System.out.println( currentTimeMillis() ); Yes, in my AndroidManifest.xml, I've added: <uses-permission android:name="android.permission.SET_TIME"></uses-permission> <uses-permission android:name="android.permission.SET_TIME_ZONE"></uses-permission> Nothing changes. The SystemClock is never reset...it just keeps on ticking. The error that I'm getting just says that the permission "SET_TIME" was not granted to the program. Protection level 3. The permissions are there...and in the API for 2.2 it says that this feature is supported now. I have no idea what I'm doing wrong. If android.content.Intent; comes into play, please explain. I don't really understand what the idea behind intents! Thanks for any help!

    Read the article

  • Best way to solve programming problem without a computer?

    - by Kevin
    What is the best way to solve programming questions when you are givien a question to write a program, in an exam for example where you have no computer to test it. Is there a certain technique that people use to help them solve these type of written problems? Or is it all down to knowlegde of the language?

    Read the article

  • Performance of DirectX and Recent Windows Mobile Version

    - by Kevin
    I'm seeing very poor performance while using the managed DirectDraw wrappers for WindowsMobile. Microsoft.WindowsMobile.DirectX.Direct3D I would appear the biggest bottle neck is calling Device.Present() after building up the scene. When using the System.Diagnostics.Stopwatch and running this very trivial exmaple Using Sprites on MSDN I'm seeing it's taking approximately 150ms to call the Device.Present() method. I'm seeing this on my AT&T Tilt and on the emulator. In larger applications such as the UltimateGMan sample it's taking over a second to call this method. Does anyone have any experience with using DirectX on mobile devices? What am I missing? I would prefer to stay in the managed world but if I drop back into C++ would I see better performance?

    Read the article

  • Read Text File in Document Folder - Iphone SDK

    - by Kevin
    Hello everyone I have this code below: NSString *fileName = [[NSUserDefaults standardUserDefaults] objectForKey:@"recentDownload"]; NSString *fullPath = [NSBundle pathForResource:fileName ofType:@"txt" inDirectory:[NSHomeDirectory() stringByAppendingString:@"/Documents/"]]; NSError *error = nil; [textViewerDownload setText:[NSString stringWithContentsOfFile:fullPath encoding: NSUTF8StringEncoding error:&error]]; textviewerdownload is the textview displaying the text from the file. The actual file name is stored in an NSUserDefault called recentDownload. When I build this, I click the button which this is under, and my application crashes. Is there anything wrong with the syntax or just simple error?

    Read the article

  • jquery function

    - by kevin
    Hello id like to get the current element firing this event inside the event, Ideally I need the id, selected value and class, Thanks in advance $(document).ready(function () { $("#positions select").live("change", function () { var id = $("#category_id").val(); //var id = this.val(); alert(id); $.getJSON("/Category/GetSubCategories/" + id, function (data) { if (data.length > 0) { alert(data.length); var position = document.getElementById('positions'); var tr = position.insertRow(7); var td1 = tr.insertCell(-1); var td = tr.insertCell(-1); var sel = document.createElement("select"); sel.name = 'sel'; sel.id = 'sel'; sel.setAttribute('class', 'category'); // $("positions select").live("change", function () { //}); td.appendChild(sel); $.each(data, function (GetSubCatergories, category) { $('#sel').append($("<option></option>"). attr("value", category.category_id). text(category.name)); }); } }); }); });

    Read the article

  • C# - Advantages/Disadvantages of different implementations for Comparing Objects

    - by Kevin Crowell
    This questions involves 2 different implementations of essentially the same code. First, using delegate to create a Comparison method that can be used as a parameter when sorting a collection of objects: class Foo { public static Comparison<Foo> BarComparison = delegate(Foo foo1, Foo foo2) { return foo1.Bar.CompareTo(foo2.Bar); }; } I use the above when I want to have a way of sorting a collection of Foo objects in a different way than my CompareTo function offers. For example: List<Foo> fooList = new List<Foo>(); fooList.Sort(BarComparison); Second, using IComparer: public class BarComparer : IComparer<Foo> { public int Compare(Foo foo1, Foo foo2) { return foo1.Bar.CompareTo(foo2.Bar); } } I use the above when I want to do a binary search for a Foo object in a collection of Foo objects. For example: BarComparer comparer = new BarComparer(); List<Foo> fooList = new List<Foo>(); Foo foo = new Foo(); int index = fooList.BinarySearch(foo, comparer); My questions are: What are the advantages and disadvantages of each of these implementations? What are some more ways to take advantage of each of these implementations? Is there a way to combine these implementations in such a way that I do not need to duplicate the code? Can I achieve both a binary search and an alternative collection sort using only 1 of these methods?

    Read the article

  • gluLookAt vectors and FPS-style camera

    - by Kevin Pamplona
    I am attempting to implemented an FPS-style camera by updating three vectors: EYE, DIR, UP. These vectors are the same that are used by gluLookAt (since gluLookAt is specified by the position of the camera, the direction it is looking at, and an up vector). I have already implemented the left-right and up-down strafing movements, but I'm having a lot of trouble understanding the math behind making the camera look-around while remaining stationary. In this case, the EYE vector remains the same, while I must update DIR and UP. Below is the code I tried, but it doesn't seem to work properly. Any suggestions? Thanks. void Transform::left(float degrees, vec3& dir, vec3& up) { vec3 axis; axis = glm::normalize(up); mat3 R = rotate(-degrees, axis); dir = R*dir; dir = R*up; }; void Transform::up(float degrees, vec3& dir, vec3& up) { vec3 axis; axis=glm::normalize(glm::cross(dir,up)); mat3 R = rotate(-degrees, axis); dir = R*dir-; up = R*up; };

    Read the article

  • Combining a web application with another (larger).

    - by Kevin Brown
    I'm writing a web app, initially meant to be stand-alone--it's essentially a survey with user-management/authentication built on Codeigniter. The company I'm doing this for wants to merge it with their main system so that it acts like a feature, or a sub-app of their website. What is the best thing for me to do? I think I could do one of two things: Finish my application, as I had planned to initially, and let them handle the merging.It would probably save me a headache. Stop where I am in development, and migrate my authentication system to theirs, migrate the payment system to use theirs, and then finish the app. In your opinion, or experience, what is the best thing to do?

    Read the article

  • Boost link error when using "--layout=system" on VS2005

    - by Kevin
    I'm new to boost, and thought I'd try it out with some realistic deployment scenarios for the .dlls, so I used the following command to compile/install the libraries: .\bjam install --layout=system variant=debug runtime-link=shared link=shared --with-date_time --with-thread --with-regex --with-filesystem --includedir=<my include directory> --libdir=<my bin directory> > installlog.txt That seemed to work, but my simple program (taken right from the "Getting Started" page) fails: #include <boost/regex.hpp> #include <iostream> #include <string> // Place your functions after this line int main() { std::string line; boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" ); while (std::cin) { std::getline(std::cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) std::cout << matches[2] << std::endl; } } This fails with the following linker error: fatal error LNK1104: cannot open file 'libboost_regex-vc80-mt-1_42.lib' I'm sure that both the .lib and the .dlls are in that directory, and named how I want them to be (ie: boost_regex.lib, etc, all unversioned, as the --layout=system says). So why is it looking for the versioned type of it? And how do I get it to look for the unversioned type of the library? I've tried this with more "normal" options, such as below: .\bjam stage --build-type=complete --with-date_time --with-thread --with-filesystem --with-regex > mybuildlog.txt And that works fine. I made sure my compiler saw the "stage\lib" directory, and it compiled and ran fine with nothing beyond having the environment looking into the right lib directory. But when I took those "testing" directories away, and wanted to use these others (unversioned), then it failed. I'm under VS2005 here on XP. Any ideas?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >