Search Results

Search found 976 results on 40 pages for 'josh p'.

Page 33/40 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • How do I map a macro across a list in Scheme?

    - by josh
    I have a Scheme macro and a long list, and I'd like to map the macro across the list, just as if it were a function. How can I do that using R5RS? The macro accepts several arguments: (mac a b c d) The list has (define my-list ((a1 b1 c1 d1) (a2 b2 c2 d2) ... (an bn cn dn))) And I'd like to have this: (begin (mac a1 b1 c1 d2) (mac a2 b2 c2 d2) ... (mac an bn cn dn)) (By the way, as you can see I'd like to splice the list of arguments too)

    Read the article

  • Global Import/using Aliasing in .NET

    - by Josh Stodola
    Using import aliasing in a single class, we can reference class library namespaces by assigning our own custom alias like this: ' VB Imports Db = Company.Lib.Data.Objects // C# using Db = Company.Lib.Data.Objects; And then we are able to reference the classes inside of Company.Lib.Data.Objects by using the Db alias that we assigned. Is it possible to do this at the global level so that the alias is applied to the entire solution instead of the given file? Currently, we are working with web applications, so I was hoping we could add something to web.config, but I am also interested in whether or not this is possible with windows forms, console apps, and/or class libraries.

    Read the article

  • In SQL, how can I count the number of values in a column and then pivot it so the column becomes the

    - by Josh Yeager
    I have a survey database with one column for each question and one row for each person who responds. Each question is answered with a value from 1 to 3. Id Quality? Speed? -- ------- ----- 1 3 1 2 2 1 3 2 3 4 3 2 Now, I need to display the results as one row per question, with a column for each response number, and the value in each column being the number of responses that used that answer. Finally, I need to calculate the total score, which is the number of 1's plus two times the number of 2's plus three times the number of threes. Question 1 2 3 Total -------- -- -- -- ----- Quality? 0 2 2 10 Speed? 2 1 1 7 Is there a way to do this in set-based SQL? I know how to do it using loops in C# or cursors in SQL, but I'm trying to make it work in a reporting tool that doesn't support cursors.

    Read the article

  • Processing data from an AJAX request

    - by Josh K
    I have a PHP API I'm working with that outputs everything as JSON. I need to call one of the API methods and parse it out using an AJAX request. I am using jQuery (though it shouldn't matter). When I make the request it errors out with a "parsererror" as the textStatus and a "Syntax Error: invalid label" when I make the request. Simplified code: $.ajax ({ type: "POST", url: "http://mydomain.com/api/get/userlist/"+mid, dataType: "json", dataFilter: function(data, type) { /* Here we assume and pray */ users = eval(data); alert(users[1].id); }, success: function(data, textStatus, XMLHttpRequest) { alert(data.length); // Should be an array, yet is undefined. }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); alert(errorThrown); }, complete: function(XMLHttpRequest, textStatus) { alert("Done"); } }); If I leave off the eval(data) then everything works fine. Well, except for data still being undefined in success. Note that I'm taking an array of objects in PHP and then passing them out through json_encode. Would that make any difference? There has been no progress made on this. I'm willing to throw more code up if someone believes they can help. Here is the PHP side of things private function _get_user_colors($id) { $u = new User(); $u->get_where(array('id' => $id)); $bar = array(); $bar['user'] = $u->stored; foreach($user->colors as $color) { $bar['colors'][] = $color; } echo(json_encode($bar)); } I have had zero issues using this with other PHP based scripts. I don't know why Javascript would take issue with it.

    Read the article

  • IndexedDB and Relationships

    - by Josh Johnson
    Can I create relationships between my object stores in IndexedDB? For example, I have two object stores: artist and album. An artist has a one-to-many relationship with an album. album.artistId relates the album to artist.id. I'm thinking along the lines of Hibernate here. I would like to do a query for artists and have the albums belonging to that artist returned as an array called artists on the album object. artist.albums = [];

    Read the article

  • Zend Framework - How do make a hierarchy without it being a module?

    - by Josh
    Here is my specific issue. I want to make an api level which then under that you can select which method you will use. For example: test.com/api/rest test.com/api/xmlprc Currently I have api mapping to a module directory. I then setup a route to make it a rest route. test.com/api is a rest route, but I would rather have it be test.com/api/rest. This would allow me later to add others. In Bootstrap.php: $front = Zend_Controller_Front::getInstance(); $router = $front->getRouter(); $route = new Zend_Controller_Router_Route( 'api/:module/:controller/:id/*', array('module' =>'default') ); $router-addRoute('api', $route); $restRoute = new Zend_Rest_Route($front, array(), array( 'rest' )); $router-addRoute('rest', $restRoute); return $router; In application.ini: resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" I know it will involve routes, but sometimes I find the Zend Framework documentation to be a little hard to follow. When I go to test.com/rest/controller/ it works how it should, but if I go to test.com/api/rest/ it tells me that my module is api and controller is rest.

    Read the article

  • Is there a way to rotate an html table?

    - by Josh
    Is there a way to rotate an html table? So, say I had a table like this: <table id="table-1" cellspacing="0" cellpadding="2"> <tr><td>1</td></tr> <tr><td>2</td></tr> <tr><td>3</td></tr> <tr><td>4</td></tr> <tr><td>5</td></tr> <tr><td>6</td></tr> </table> and wanted to some sort of button that had javascript behind it that could rotate the table any which direction. For example, clicking the right button, results in: <table id="table-1" cellspacing="0" cellpadding="2"> <tr><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td></tr> </table> I have a drag and drop plugin that uses a table, and I am trying to do a piece that allows for a user to add to a queue (that results in the table), and then they can also rotate it around as well. Thanks.

    Read the article

  • Int Showing as Long Odd Value

    - by Josh Kahane
    Hi I am trying to send an int in my iphone game for game center multiplayer. The integer is coming up and appearing as an odd long integer value rather than the expected one. I have this in my .h: typedef enum { kPacketTypeScore, } EPacketTypes; typedef struct { EPacketTypes type; size_t size; } SPacketInfo; typedef struct { SPacketInfo packetInfo; int score; } SScorePacket; Then .m: Sending data: scoreData *score = [scoreData sharedData]; SScorePacket packet; packet.packetInfo.type = kPacketTypeScore; packet.packetInfo.size = sizeof(SScorePacket); packet.score = score.score; NSData* dataToSend = [NSData dataWithBytes:&packet length:packet.packetInfo.size]; NSError *error; [self.myMatch sendDataToAllPlayers: dataToSend withDataMode: GKMatchSendDataUnreliable error:&error]; if (error != nil) { // handle the error } Receiving: SPacketInfo* packet = (SPacketInfo*)[data bytes]; switch (packet->type) { case kPacketTypeScore: { SScorePacket* scorePacket = (SScorePacket*)packet; scoreData *score = [scoreData sharedData]; [scoreLabel setString:[NSString stringWithFormat:@"You: %d Challenger: %d", score.score, scorePacket]]; break; } default: CCLOG(@"received unknown packet type %i (size: %u)", packet->type, packet->size); break; } Any ideas? Thanks.

    Read the article

  • Fluent Nhibernate mapping related items

    - by Josh
    I am trying to relate 2 items. I have a table that is simply an Id field, and then 2 columns for the Item Id's to relate. I want it to be a 2 way relationship - that is, if the items appear twice in the table, I only want one relationship connection back. So, here's my item: public class Item { public virtual Guid ItemId {get; set;} public virtual string Name {get; set;} public virtual IList<Item> RelatedItems {get; set;} } The table for relating the items looks like this: CREATE TABLE RelatedItems ( RelatedItemId uniqueidentifier NOT NULL, ItemId uniqueidentifier NOT NULL, RelatedId uniqueidentifier NOT NULL, CONSTRAINT PK_RelatedItems PRIMARY KEY CLUSTERED (RelatedItemId) ) What is the best way to map this connection?

    Read the article

  • Beginner Access VBA SQL INSERT Question

    - by Josh K
    Syntax question: I am using the code below to call a query in Access VBA strSQL = "INSERT INTO tblLoanDetails ([ServerName]) VALUES ('Test') WHERE [ID]=3" Call CurrentDb.Execute(strSQL) And i am getting a runtime error of "3067: Query must contain atleast one table or query." the insert statement string looks like this (Threw the var into a text box): INSERT INTO tblLoanDetails ([ServerName]) VALUES ('Test') WHERE [ID]=3 I also tried adding a semi-colon to the end but with no luck. I also double checked to make sure my table is called tblLoanDetails and my Column names are ServerName, and ID Appreciate any help.

    Read the article

  • broken UTF-8 String ruby

    - by josh
    While reading a file I get broken UTF-8 String error whenever I have the following in my file través if I change it to normal e then it works. Whats the way to fix this? error only happens if I do line.lstrp or any other function. Just printing the lines is ok. problem even happens when I try to match the string with regex.

    Read the article

  • PHP: Need a double check on an error in this small code

    - by Josh K
    I have this simple Select box that is suppose to store the selected value in a hidden input, which can then be used for POST (I am doing it this way to use data from disabled drop down menus) <body> <?php $Z = $_POST[hdn]; ?> <form id="form1" name="form1" method="post" action="test.php"> <select name="whatever" id="whatever" onchange="document.getElementById('hdn').value = this.value"> <option value="1">1Value</option> <option value="2">2Value</option> <option value="3">3Value</option> <option value="4">4Value</option> </select> <input type="hidden" name ='hdn' id="hdn" /> <input type="submit" id='submit' /> <?php echo "<p>".$Z."</p>"; ?> </form> </body> The echo call works for the last 3 options (2,3,4) but if I select the first one it doesnt output anything, and even if i change first one it still doesnt output anything. Can someone explain to me whats going on, I think it might be a syntax issue.

    Read the article

  • MVC and binding to List of Checkboxes

    - by Josh
    Here is my problem. I have a list of models that are displayed to the user. On the left is a checkbox for each model to indicate that the user wants to choose this model (in this case, we're building products a user can add to their shopping cart). The model has no concept of being chosen...it strictly has information about the product in question. I've talked with a few other developers after having gone through and the best I could come up with is getting the formcollection and string parsing the key values to determine whether the checkbox is checked or not. This doesn't seem ideal. I was thinking there would be something more strongly bound, but I can't figure out a way to do it. I tried creating another model that had a boolean property to represent being checked and a property of the model and passing a list of that model type to the view and creating a ActionResult on the controller that accepts a list of the new model / checked property, but it comes back null. Am I just thinking too much like web forms and should just continue on with parsing checkbox values? Here's what I've done for wrapping the models inside a collection: public class SelectableCollection[T] : IList[T] {} public class SelectableTrack{ public bool IsChecked{get;set;} public bool CurrentTrack{get;set;} } For the view, I inherit from ViewPage[SelectableCollection[SelectableTrack]] For the controller, I have this as the ActionResult: [HttpPost] public ActionResult SelectTracks(SelectableCollection sc) { return new EmptyResult(); } But when I break inside the ActionResult, the collection is null. Any reason why it isn't coming through?

    Read the article

  • How do I generate Entity Framework 4.0 classes from the command line that have different names than

    - by Josh Kodroff
    I want to generate Entity Framework 4.0 classes from a (legacy) database from a command line, but I have 2 transformations I want: Tables/columns are lowerCamelCase and I want my classes/members to be UpperCamelCase. I want to suffix my classes with "Dto". Any idea how this might be accomplished? I'm a total newbie to EF, but I have a decent understanding of Linq to Sql and was able to accomplish the same task by doing: sqlmetal - dbml - xml mapping file and .cs file.

    Read the article

  • Designing for varying mobile device resolutions, i.e. iPhone 4 & iPhone 3G

    - by Josh
    As the design community moves to design applications & interfaces for mobile devices, a new problem has arisen: Varying Screen DPI's. Here's the situation: Touch: * iPhone 3G/S ~ 160 dpi * iPhone 4 ~ 300 dpi * iPad ~ 126 dpi * Android device @ 480p ~ 200 dpi Point / click: * Laptop @ 720p ~ 96 dpi * Desktop @ 720p ~ 72 dpi There is certainly a clear distinction between desktop and mobile so having two separate front-ends to the same app is logical, especially when considering one is "touch"-based and the other is "point/click"-based. The challenge lies in designing static graphical elements that will scale between, say, 160 dpi and 300+ dpi, and get consistent and clean design across zoom levels. Any thoughts on how to approach this? Here are some scenarios, but each has drawbacks as well: * Design a single set of assets (high resolution), then adjust zoom levels based on detected resolution / device o Drawbacks: Performance caused by code layering, varying device support of Zoom * Develop & optimize multiple variations of image and CSS assets, then hide / show each based on device o Drawbacks: Extra work in design & QA. Anyone have thoughts or experience on how to deal with this? We should certainly be looking at methods that use / support HTML5 and CSS3.

    Read the article

  • Retrieve E-mail from server (pop3) by date for filtering on subject or body in C#

    - by Josh
    I have a piece of monitoring software I am writing which needs to retrieve e-mails sent to an address for a certain day so that I can filter them by a regex in the subject or body. I don't need to retrieve the entire message, only the subject and body for all messages on a given day so that I can evaluate them with a regular expression for a token. I looked at EAGetMail as a solution, but their implementation doesn't do what I need to to do. I can only get all information on mail, which only has the size and index. I would need it by subject, but even then I don't want to get everything in inbox. If I went with this solution I have to get all mail, and then retrieve each mail message individually to evaluate the subject and body. This is not ideal. I also looked at OpenPop.Net, but it too does not have a targeted retrieval for today's messages only. Can I even do what I want without looping through every single email on the server until I find a match? What is the best way to accomplish what I am trying to do? Am I going to have to build a custom web request to get the data I want? Also, I looked at Chilkat, but I am looking for a free solution, even if it means building the http request myself.

    Read the article

  • C# Method not returning a unique value when it should be.

    - by Josh King
    I have two methods, generateNounPhrase() and generateVerbPhrase(). VerbPhrase will call on NounPhrase half the time and it's output the output should be something to the effect of: the empty lot re-animates this pyramid (bold indicating where generateNounPhrase() is logically called). The true output however is in the form of: the empty lot re-animates the empty lot At first I thought my randomIndex method wasn't working as I had intended, but if I run the two methods again I do get different noun phrases but they are not unique at the beginning and end of the sentence as they should be. Any idea what I am doing wrong in order to get one method to show the same result? private string generateNounPhrase() { string nounPhraseString = ""; nounPhraseString = nounMarkersStringList[randomIndex(0,nounMarkersStringList.Count-1)]; if (included(1, 4, 2) == true) { nounPhraseString += " " + adjectivesStringList[randomIndex(0, adjectivesStringList.Count - 1)]; } nounPhraseString += " " + nounsStringList[randomIndex(0, nounsStringList.Count - 1)]; return nounPhraseString; } private string generateVerbPhrase() { string verbPhraseString = ""; if (included(1, 4, 2) == true) { verbPhraseString = intransitiveVerbsStringList[randomIndex(0, intransitiveVerbsStringList.Count - 1)]; } else { verbPhraseString = transitiveVerbsStringList[randomIndex(0, transitiveVerbsStringList.Count - 1)] + " " + generateNounPhrase(); } return verbPhraseString; }

    Read the article

  • Django: optimizing queries

    - by Josh
    I want to list the number of items for each list. How can I find this number in a single query, rather than a query for each list? Here is a simplified version of my current template code: {% for list in lists %} <li> {{ listname }}: {% with list.num_items as item_count %} {{ item_count }} item{{ item_count|pluralize }} {% endwith %} </li> {% endfor %} lists is passed as: List.objects.filter(user=user) and num_items is a property of the List model: def _get_num_items(self): return self.item_set.filter(archived=False).count() num_items = property(_get_num_items) This queries SELECT COUNT(*) FROM "my_app_item" WHERE... n times, where n is the number of lists. Is it possible to make a single query here?

    Read the article

  • heroku - how to see all the logs

    - by josh
    I have a small app on heroku. Whenever I want to see the logs I go to the command line and do heroku logs That only shows me about 100 lines. Is there not a way to see complete logs for our application on heroku?

    Read the article

  • How do I pass a javascript parameter to an asp.net MVCmodel from within a View?

    - by Josh
    Hi everyone! I am having an issue trying to access a list property on a model from within a javascript. My basic situation is this: I have an ArticleController and an ArticleViewModel. An Article has a number of properties, one of which is Text, which is just a string that contains the contents of the article. The ArticleViewModel contains a Pages property, which is just a List of Strings. When the ArticleViewModel constructor is called, I populate the Pages list by dividing up the article text based on some delimeters. I have a View which inherits the ArticleViewModel type. What I want to do is only display one page at a time, and then when the user clicks a page number (from a list at the bottom of the article), I want to use javascript to load that page into the #dynamicContent div. The problem: I can't seem to pass a parameter to the Model.Pages property from within javascript... Is this possible? I get an error stating, "Expression Expected" when I try what I have below. I don't want to have to worry about AJAX calls or anything like that since I already have the entire article... I just need a way to access each individual page from within the javascript function. Alternatively, if there is a better solution for "paginating" an article so that I can load each articlePage without having to refresh the entire html page, I would certainly be open to that as well. Any help would be much appreciated!! Thanks for your time! ArticleView Code: Script at the top of the view: function loadPage(pageNumber) { try { alert(pageNumber); $('#dynamicContent').html('<%=Model.Pages(' + pageNumber + ') %>'); } catch (e) { alert('in here'); alert(e.description); } } HTML for view: [...] <div id="articleBody"> <div id="dynamicContent"> <%=Model.Pages(0)%> </div> </div> [...] Page Links at bottom of page: [...] <div> <ul style="display:block"> <li style="display:inline"> <a href="#articleTitle" onclick="loadPage(0)"> 1 </a> </li> <li style="display:inline"> <a href="#articleTitle" onclick="loadPage(1)"> 2 </a> </li> </ul> </div>

    Read the article

  • The Cash or Credit problem

    - by Josh K
    If you go to a store and ask "Cash or Credit?" they might simply say "Yes." This doesn't tell you anything as you posed an OR statement. if(cash || credit) With humans it's possible that they might respond "Both" to that question, or "Only {cash | credit}." Is there a way (or operator) to force the a statement to return the TRUE portions of a statement? For example: boolean cash = true; boolean credit = true; boolean cheque = false; if(cash || credit || cheque ) { // In here you would have an array with cash and credit in it because both of those are true }

    Read the article

  • Writing a script with the cmd prompt.

    - by Josh
    I'm trying to make a script that will place a list (in a .csv file) of processes that are running that take up more than 10 mb of RAM and shows the time + date the script was run. My teacher did this during his lecture but I can't remember how he did it. Just trying to figure out how to be better at IT. So my question is, can anyone help me with this? I don't even know where to start.

    Read the article

  • VB.net Dataset display different column

    - by Josh
    Hello, I am sure this has to a comon thing I just can't find it. I am making a combobox from my data source. Basically, This is a projects form and the user needs to select the the primary contact which is contrained by the customer id (GETbyCustomerID) set in another field. I have it working... mostly except the combobox only displays the contact ID which is completely useless to the user. I need to know how to display the First and Last name (both are seperate columns in the table). Any help? I am just using the designer.

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >