Search Results

Search found 477 results on 20 pages for 'bryan cook'.

Page 4/20 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • typedef of a template with a template type as its parameter

    - by bryan sammon
    Im having a problem with a typedef below, I can seem to get it right: template <typename T> struct myclass1 { static const int member1 = T::GetSomeInt(); }; template <int I> struct myclass2 { typedef myclass1< myclass2<I> > anotherclass; static int GetSomeInt(); }; anotherclass MyObj1; // ERROR here not instantiating the class When I try and initialize a anotherclass object, it gives me an error. Any idea what I am doing wrong? There seems to be a problem with my typedef. Any help is appreciated, Thanks Bryan

    Read the article

  • Difficulties with google authentication

    - by user283405
    I am trying to authenticate google with the following code but google sent me back to the login page again. //STEP# 1 string loginURL = "https://www.google.com/accounts/ServiceLoginBox?service=analytics&nui=1&hl=en-US&continue=https%3A%2F%2Fwww.google.com%2Fanalytics%2Fsettings%2F%3Fet%3Dreset%26hl%3Den%26et%3Dreset%26hl%3Den-US"; request = (HttpWebRequest)WebRequest.Create(loginURL); request.CookieContainer = cookieJar; request.Method = "GET"; request.KeepAlive = true; request.UserAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111217 Fedora/3.0.4-1.fc10 Firefox/3.0.4"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); foreach (Cookie cook in response.Cookies) { cookieJar.Add(cook); } using (StreamReader sr = new StreamReader(response.GetResponseStream()) ) { serverResponse = sr.ReadToEnd(); sr.Close(); } galx = ExtractValue(serverResponse,"GALX","name=\"GALX\" value=\""); Console.WriteLine(galx); //Request# 2 string uriWithData = "https://www.google.com/accounts/ServiceLoginBoxAuth"; request = (HttpWebRequest)WebRequest.Create(uriWithData); request.KeepAlive = true; request.UserAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111217 Fedora/3.0.4-1.fc10 Firefox/3.0.4"; request.Method = "POST"; request.CookieContainer = cookieJar; string param = string.Format("Email={0}&Passwd={1}&continue={2}&service=analytics&nui=1&dsh=8209101995200094904&GALX={3}&hl=en-US&PersistentCookie=yes","**my email address**",p,"",galx); byte[] postArr = StrToByteArray(param); request.ContentType = @"application/x-www-form-urlencoded"; request.ContentLength = param.Length; Stream reqStream = request.GetRequestStream(); reqStream.Write(postArr,0,postArr.Length); reqStream.Close(); response = (HttpWebResponse)request.GetResponse(); foreach (Cookie cook in response.Cookies) { cookieJar.Add(cook); } using (StreamReader sr = new StreamReader(response.GetResponseStream()) ) { serverResponse = sr.ReadToEnd(); Console.WriteLine(serverResponse); // Close and clean up the StreamReader sr.Close(); }

    Read the article

  • Serialize problem with cookie

    - by cagin
    Hi there, I want use cookie in my web project. I must serialize my classes. Although my code can seralize an int or string value, it cant seralize my classes. This is my seralize and cookie code : public static bool f_SetCookie(string _sCookieName, object _oCookieValue, DateTime _dtimeExpirationDate) { bool retval = true; try { if (HttpContext.Current.Request[_sCookieName] != null) { HttpContext.Current.Request.Cookies.Remove(_sCookieName); } BinaryFormatter bf = new BinaryFormatter(); MemoryStream ms = new MemoryStream(); bf.Serialize(ms, _oCookieValue); byte[] bArr = ms.ToArray(); MemoryStream objStream = new MemoryStream(); DeflateStream objZS = new DeflateStream(objStream, CompressionMode.Compress); objZS.Write(bArr, 0, bArr.Length); objZS.Flush(); objZS.Close(); byte[] bytes = objStream.ToArray(); string sCookieVal = Convert.ToBase64String(bytes); HttpCookie cook = new HttpCookie(_sCookieName); cook.Value = sCookieVal; cook.Expires = _dtimeExpirationDate; HttpContext.Current.Response.Cookies.Add(cook); } catch { retval = false; } return retval; } And here is one of my classes: [Serializable] public class Tahlil { #region Props & Fields public string M_KlinikKodu{ get; set; } public DateTime M_AlinmaTarihi { get; set; } private List<Test> m_Tesler; public List<Test> M_Tesler { get { return m_Tesler; } set { m_Tesler = value; } } #endregion public Tahlil() {} Tahlil(DataRow _rwTahlil){} } I m calling my Set Cookie method: Tahlil t = new Tahlil(); t.M_AlinmaTarihi = DateTime.Now; t.M_KlinikKodu = "2"; t.M_Tesler = new List<Test>(); f_SetCookie("Tahlil", t, DateTime.Now.AddDays(1)); I cant see cookie in Cookie folder and Temporary Internet Files but if i will call method like that: f_SetCookie("TRY", 5, DateTime.Now.AddDays(1)); I can see cookie. What is the problem? I dont understand. Thank you for your helps.

    Read the article

  • Use DataSource in DataFormWebPart

    - by Bryan Shen
    I'm writing a custom web part that extends DataFormWebPart. public class MyCustomWebPart : DataFormWebPart{ // other methods public override void DataBind() { XmlDataSource source = new XmlDataSource() { Data = @" <Person> <name cap='true'>Bryan</name> <occupation>student</occupation> </Person> " }; DataSources.Add(source); base.DataBind(); } } The only noticeable thing I do is overriding the DataBind() method, where I use xml as the data source. After I deploy the web part, I set the following XSL to it: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xmp> <xsl:copy-of select="*"/> </xmp> </xsl:template> </xsl:stylesheet> This xsl will surround the input xml with a tag . So I expected the web part to display the original xml data as I wrote in C# code behind. But what shows up in the web part is this: <Person> <name cap="true" /> <occupation /> </Person> All the values within the inner-most tags disappear. What's going on? Can anybody help me? Thanks.

    Read the article

  • Detect Autocomplete

    - by Bryan Marble
    Hello, I have some forms that have inlined labels. I have some javascript (jQuery) that detects when focus has changed or when a user is entering text that changes the class so that the inlined label disappears and isn't blocking the user's view of their entered text. The problem I'm having occurs when the browser autocompletes the form. None of the conditions below are triggered so I can't clear out the inlined label. How can I detect the fact that text has been entered via autocomplete so that I can clear the labels? The js I'm using (from http://www.zurb.com/playground/inline-form-labels): $( document ).ready( function() { $( "label.inlined + .input-text" ).each( function( type ) { $( this ).focus( function() { $( this ).prev( "label.inlined" ).addClass( "focus" ); } ); $( this ).keypress( function() { $( this ).prev( "label.inlined" ).addClass( "has-text" ) .removeClass( "focus" ); } ); $( this ).blur( function() { if( $( this ).val() == "" ) { $( this ).prev( "label.inlined" ).removeClass( "has-text" ) .removeClass( "focus" ); } } ); } ); } ); Thanks! Bryan

    Read the article

  • How to Use DataSource Property in DataFormWebPart

    - by Bryan Shen
    I'm writing a custom web part that extends DataFormWebPart. public class MyCustomWebPart : DataFormWebPart{ // other methods public override void DataBind() { XmlDataSource source = new XmlDataSource() { Data = @" <Person> <name cap='true'>Bryan</name> <occupation>student</occupation> </Person> " }; DataSources.Add(source); base.DataBind(); } } The only noticeable thing I do is overriding the DataBind() method, where I use xml as the data source. After I deploy the web part, I set the following XSL to it: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xmp> <xsl:copy-of select="*"/> </xmp> </xsl:template> </xsl:stylesheet> This xsl will surround the input xml with a tag . So I expected the web part to display the original xml data as I wrote in C# code behind. But what shows up in the web part is this: <Person> <name cap="true" /> <occupation /> </Person> All the values within the inner-most tags disappear. What's going on? Can anybody help me? Thanks.

    Read the article

  • entity framework POCO template in a n-tiers design question

    - by bryan
    HI all I was trying to follow the POCO Template walkthrough . And now I am having problems using it in n-tiers design. By following the article, I put my edmx model, and the template generated context.tt in my DAL project, and moved the generated model.tt entity classes to my Business Logic layer (BLL) project. By doing this, I could use those entities inside my BLL without referencing the DAL, I guess that is the idea of PI; without knowing anything about the data source. Now, I want to extend the entities (inside the model.tt) to perform some CUD action in the BLL project,so I added a new partial class same name as the one generated from template, public partial class Company { public static IEnumerable AllCompanies() { using(var context = new Entities()){ var q = from p in context.Companies select p; return q.ToList(); } } } however visual studio won't let me do that, and I think it was because the context.tt is in the DAL project, and the BLL project could not add a reference to the DAL project as DAL has already reference to the BLL. So I tried to added this class to the DAL and it compiled, but intelisense won't show up the BLL.Company.AllCompanies() in my web service method from my webservice project which has reference to my BLL project. What should I do now? I want to add CUD methods to the template generated entities in my BLL project, and call them in my web services from another project. I have been looking for this answer a few days already, and I really need some guides from here please. Bryan

    Read the article

  • Why is my Android app camera preview running out of memory on my AVD?

    - by Bryan
    I have yet to try this on an actual device, but expect similar results. Anyway, long story short, whenever I run my app on the emulator, it crashes due to an out of memory exception. My code really is essentially the same as the camera preview API demo from google, which runs perfectly fine. The only file in the app (that I created/use) is as below- package berbst.musicReader; import java.io.IOException; import android.app.Activity; import android.content.Context; import android.hardware.Camera; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; /********************************* * Music Reader v.0001 * Still VERY under construction. * @author Bryan * *********************************/ public class MusicReader extends Activity { private MainScreen main; @Override //Begin activity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); main = new MainScreen(this); setContentView(main); } class MainScreen extends SurfaceView implements SurfaceHolder.Callback { SurfaceHolder sHolder; Camera cam; MainScreen(Context context) { super(context); //Set up SurfaceHolder sHolder = getHolder(); sHolder.addCallback(this); sHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // Open the camera and start viewing cam = Camera.open(); try { cam.setPreviewDisplay(holder); } catch (IOException exception) { cam.release(); cam = null; } } public void surfaceDestroyed(SurfaceHolder holder) { // Kill all our crap with the surface cam.stopPreview(); cam.release(); cam = null; } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // Modify parameters to match size. Camera.Parameters params = cam.getParameters(); params.setPreviewSize(w, h); cam.setParameters(params); cam.startPreview(); } } }

    Read the article

  • How to make dynamically generated .net service client read configuration from another location than

    - by Bryan
    Hi, I've currently written code to use the ServiceContractGenerator to generate web service client code based on a wsdl, and then compile it into an assembly in memory using the code dom. I'm then using reflection to set up the binding, endpoint, service values/types, and then ultimately invoke the web service method based on xml configuration that can be altered at run time. This all currently works fine. However, the problem I'm currently running into, is that I'm hitting several exotic web services that require lots of custom binding/security settings. This is forcing me to add more and more configuration into my custom xml configurations, as well as the corresponding updates to my code to interpret and set those binding/security settings in code. Ultimately, this makes adding these 'exotic' services slower, and I can see myself eventually reimplementing the 'system.serviceModel' section of the web or app.config file, which is never a good thing. My question is, and this is where my lack of experience .net and C# shows, is there a way to define the configuration normally found in the web.config or app.config 'system.serviceModel' section somewhere else, and at run time supply this to configuration to the web service client? Is there a way to attach an app.config directly to an assembly as a resource or any other way to supply this configuration to the client? Basically, I'd like attach an app.config only containing a 'system.serviceModel' to the assembly containing a web service client so that it can use its configuration. This way I wouldn't need to handle every configuration under the sun, I could let .net do it for me. Fyi, it's not an option for me to put the configuration for every service in the app.config for the running application. Any help would be greatly appreciated. Thanks in advance! Bryan

    Read the article

  • Efficient alternative to merge() when building dataframe from json files with R?

    - by Bryan
    I have written the following code which works, but is painfully slow once I start executing it over thousands of records: require("RJSONIO") people_data <- data.frame(person_id=numeric(0)) json_data <- fromJSON(json_file) n_people <- length(json_data) for(lender in 1:n_people) { person_dataframe <- as.data.frame(t(unlist(json_data[[person]]))) people_data <- merge(people_data, person_dataframe, all=TRUE) } output_file <- paste("people_data",".csv") write.csv(people_data, file=output_file) I am attempting to build a unified data table from a series of json-formated files. The fromJSON() function reads in the data as lists of lists. Each element of the list is a person, which then contains a list of the attributes for that person. For example: [[1]] person_id name gender hair_color [[2]] person_id name location gender height [[...]] structure(list(person_id = "Amy123", name = "Amy", gender = "F", hair_color = "brown"), .Names = c("person_id", "name", "gender", "hair_color")) structure(list(person_id = "matt53", name = "Matt", location = structure(c(47231, "IN"), .Names = c("zip_code", "state")), gender = "M", height = 172), .Names = c("person_id", "name", "location", "gender", "height")) The end result of the code above is matrix where the columns are every person-attribute that appears in the structure above, and the rows are the relevant values for each person. As you can see though, some data is missing for some of the people, so I need to ensure those show up as NA and make sure things end up in the right columns. Further, location itself is a vector with two components: state and zip_code, meaning it needs to be flattened to location.state and location.zip_code before it can be merged with another person record; this is what I use unlist() for. I then keep the running master table in people_data. The above code works, but do you know of a more efficient way to accomplish what I'm trying to do? It appears the merge() is slowing this to a crawl... I have hundreds of files with hundreds of people in each file. Thanks! Bryan

    Read the article

  • Abstraction: The War between solving the problem and a general solution.

    - by Bryan Harrington
    As a programmer, I find myself in the dilemma where I want make my program as abstract and as general as possible. Doing so usually would allow me to reuse my code and have a more general solution for a problem that might (or might not) come up again. Then this voice in my head says, just solve the problem dummy its that easy! Why spend more time than you have to? We all have indeed faced this question where Abstraction is on your right shoulder and Solve-it-stupid sits on the left. Which to listen to and how often? What is your strategy for this? Should you abstract everything?

    Read the article

  • Why is Farseer not working in Windows Phone 7/8?

    - by Bryan
    I created a new Windows Phone Game (4.0) project in Visual Studio Express 2012 and added the Farseer project to the solution explorer. But adding a reference to the Farseer project is not working. I always get this error message: A reference to 'Farseer Physics XNA WP7' could not be added. References with different refresh levels are not supported. What is wrong? How can I use Farseer in Windows Phone 7/8? I uploaded the two projects on pastebin. Farseer project: pastebin.com/uyRusHxM Windows Phone project: pastebin.com/s74Gr66y

    Read the article

  • Can't remove Ubuntu Desktop from dropdown menu on logon screen

    - by Bryan
    Hello All, I'm running Ubuntu on an Eee PC with the Netbook interface. I installed Ubuntu Desktop via Aptitude to see how well it works on the Eee PC, and after a while I wanted to rid myself of it. So, I purged it using Aptitude, but it still shows up as an option in the dropdown menu on the login screen. Is there any way I can remove the Ubuntu Desktop option from the dropdown menu? It's not a big deal I guess... I'm just curious now how to do it. :)

    Read the article

  • Window focus confusion in unity

    - by Bryan Agee
    I like having focus prevention set to high, so that I don't have some stupid auto-launched app steal my typing in the middle of something else. Unfortunately, Unity keeps focus on the right window while raising the new one. A number of times, this has caused me to close an application by accident that had control of the menu bar, even though it was underneath the new window. Is there a way to prevent raise without focus?

    Read the article

  • Terminal Errors/Package Erros

    - by Bryan
    After running some updates a week ago or so, I've noticed that after any installations via the Ubuntu Software Center or any installed in the GUI have given an error message stating that there was a package error. Also any installations done through the terminal have given the E: Sub-process /usr/bin/dpkg returned an error code (1) message at the end of each install. Oddly, the software is still installed and seems to function properly. Is there any way to get rid of this? I've tried to run apt-get autoclean as recommended on another site, but this doesn't seem to work. I'm fairly new to Linux/Ubuntu, just FYI.

    Read the article

  • Anyone know how to get an LTSP image working with VIA VX855 chipset?

    - by Bryan
    I'm running an LTSP server on Ubuntu 11.10 and can load the i386 image via PXE boot on a VirtualBox VM just fine. However, when I PXE boot a Dell FX130 thin client on the LTSP network the login screen ends up being a white screen with a bunch of wavy black lines going up and down it. The 11.10 splash screen displays just fine as the image is booted, then I get a "INVALID CARD NUMBER" message, then a black screen, then finally the white screen with wavy lines. I'm not sure if the "INVALID CARD NUMBER" message has anything to do with the issue, but in the end the white screen with wavy lines makes me think it's a video driver problem. On the LTSP server, I chrooted into /opt/ltsp/i386 and made sure xserver-xorg-video-openchrome was installed. I did notice that no xorg.conf exits in /etc/X11 though.

    Read the article

  • No wireless and display issues on Dell Inspiron 1210 (Mini 12)

    - by Bryan M.
    I recently upgraded a friend's Dell Mini 12 (Inspiron 1210) from Ubuntu 8.10 to 10.04 netbook edition. After installing, and performing the available updates, I'm unable to detect any wireless networks (it knows it has a wireless card, but won't list any active networks). There also seems to be an issue with the display drivers: when scrolling, resizing, or drawing any windows there is a noticeable lag as I watch the screen redraw. As if there are no compatible display drivers installed. All these problems go away the moment I boot up a version of 8.10. But I'd like to keep 10.04 if possible. Are these common problems? Everything I've read suggest this is laptop should be compatible. Any suggestions? Thanks.

    Read the article

  • Laptop shuts down upon waking from suspend

    - by Bryan Head
    The computer enters suspend either by closing lid, choosing suspend from the top-right drop down, or hitting the power button and pressing suspend. It doesn't matter. I then attempt to wake the computer either by opening the lid (if it was closed) or hitting the power button. Again, doesn't matter. The computer will then immediately shutdown about 50% of the time. It seems to be more likely to shut down the longer it has been on suspend. I took a snapshot of /var/log/pm-suspend.log after a successfully resume and a shutdown. The only difference (outside of timestamps of course) was that a successful resume, after reporting the success of various suspend hooks, writes: Thu Jul 5 21:36:45 PDT 2012: performing suspend Thu Jul 5 21:37:10 PDT 2012: Awake. Thu Jul 5 21:37:10 PDT 2012: Running hooks for resume and then reports successful resume hooks. When it shuts down, the log ends at "performing suspend". I diffed the two files so I know this is the only difference. Thus, it looks like it's not even trying to wake up. Would love some ideas on this one. I've scoured the web but can't seem to find anyone else running into the same issue (it seems more common that the computer shuts down upon entering suspend, or only on hitting the power button to wake, and haven't seen any that are random like mine). I'll update with any requested information.

    Read the article

  • Multiple Key Presses in XNA?

    - by Bryan Harrington
    I'm actually trying to do something fairly simple. I cannot get multiple key presses to work in XNA. I've tried the following pieces of code. else if (keyboardState.IsKeyDown(Keys.Down) && (keyboardState.IsKeyDown(Keys.Left))) { //Move Character South-West } and I tried. else if (keyboardState.IsKeyDown(Keys.Down)) { if (keyboardState.IsKeyDown(Keys.Left)) { //Move Character South-West } } Neither worked for me. Single presses work just fine. Any thoughts?

    Read the article

  • web server response code 500

    - by Bryan Kemp
    I realize that this may spur a religious discussion, but I discussed this with friends and get great, but conflicting answers and the actual documentation is of little help. What does the 500 series response codes mean from the webserver? Internal Server Error, but that is vague. My assumption is that it means that something bad happened to the server (file system corruption, no connection to the database, network issue, etc.) but not specifically a data driven error (divide by zero, record missing, bad parameter, etc). Something to note, there are some web client implementations (the default Android and Blackberry httpclients) that do not allow access to the html boddy if the server response is 500 so there is no way to determine what caused the issue from the client. What I have been been implementing recently is a web service that returns a json payload wrapped in a response object that contains more specific error information if it is data related, but the server response will be 200 since it finished the actual processing. Thoughts?

    Read the article

  • Window focus confusion in unity

    - by Bryan Agee
    I like having focus prevention set to high, so that I don't have some stupid auto-launched app steal my typing in the middle of something else. Unfortunately, Unity keeps focus on the right window while raising the new one. A number of times, this has caused me to close an application by accident that had control of the menu bar, even though it was underneath the new window. Is there a way to prevent raise without focus?

    Read the article

  • Looking for Hosting Companies that Meet the Following Criteria [closed]

    - by Bryan Hadaway
    Possible Duplicate: How to find web hosting that meets my requirements? Please Note: This is not a subjective question and I am not looking for opinions. This is very much an objective question with legitimate use and purpose to identify hosts that offer the following: Multi Domain SSL Certificate Linux Server PHP5+ cPanel Unlimited Storage, Bandwidth, MySql DBs and Addon Domains SSL is mentioned first because this is most important. This is not a single domain or wildcard SSL cert. It's relatively new and unique. It's for the purpose of securing multiple domains on one account without having to have an entirely separate hosting account and SSL cert for every domain. I'm currently using BlueHost/HostMonster which meets all my criteria except for this special kind of SSL cert. Currently, HostGator is the only host that offers everything I've listed that I've been able to find. Again, I'm not requesting recommendations, advice or opinions of the best or most reputable service based on your experiences. I am asking for an objective list of known hosts that offer the aforementioned listed items only. Thereafter, I (and others who this will benefit) can make our comparisons and selection privately.

    Read the article

  • UFW - see configured rules even when inactive

    - by Bryan
    Hello, I'm wondering if it's possible to get UFW to list the configured firewall rules even when it's not enabled. I only have ssh access to the server at this time, and I don't want to enable UFW if there's not a rule configured allowing ssh. However, since UFW is currently not enabled, I just get an "inactive" message when I run "ufw status". Is there a special flag I can use or even some config file I can look at to see what rules are configured even when the firewall is disabled?

    Read the article

  • Nested Classes: A useful tool or an encapsulation violation?

    - by Bryan Harrington
    So I'm still on the fence as to whether or not I should be using these or not. I feel its an extreme violation of encapsulation, however I find that I am able to achieve some degree of encapsulation while gaining more flexibility in my code. Previous Java/Swing projects I had used nested classes to some degree, However now I have moved into other projects in C# and I am avoid their use. How do you feel about nested classes?

    Read the article

  • How do you overcome your own coding biases when handed legacy code?

    - by Bryan M.
    As programmers, we often take incredible pride in our skills and hold very strong opinions about what is 'good' code and 'bad' code. At any given point in our careers, we've probably had some legacy system dropped in our laps, and thought 'My god, this code sucks!' because it didn't fit into our notion of what good code should be, despite the fact that it may have well been perfectly functional, maintainable code. How do you prepare yourself mentally when trying to get your head around another programmer's work?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >