Search Results

Search found 1729 results on 70 pages for 'identifier'.

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

  • Regex to validate for Unique Well Identifier in rails

    - by Jasper502
    I am a regex newbie and can't seem to figure this one out. Here is a link to the required string formats: http://earth.gov.bc.ca/royp-bin/phcgi.exe?PH_QKC=DOCUWI&PH_APP=RMSprodApp&PH_HTML=DOCUWI.htm For example: 100041506421W500 = 1+0+{01-16}+{01-36}+{001-129}+{01-36}+W+{1-6}+0+{0-9} I tried this: ^10[0|2-9]{1}0*([1-9]|1[0-6])0*([1-9]|[12][0-9]|3[0-6])0*([1-9][0-9]|1[0-2][0-9])0*([1-9]|[12][0-9]|3[0-6])W[1-6]0[0-9]$ In a regex validator and it sort of works except that 1041506421W500 and 10000000041506421W500 validates. The entire string can only be 16 characters long. I am pretty sure I am missing something obvious here regarding the leading zeros. Tried the NTS format and running into the same sort of problems.

    Read the article

  • Create unique identifier for different row-groups

    - by Max van der Heijden
    I want to number certain combinations of row in a dataframe (which is ordered on ID and on Time) tc <- textConnection(' id time end_yn number abc 10 0 1 abc 11 0 2 abc 12 1 3 abc 13 0 1 def 10 0 1 def 15 1 2 def 16 0 1 def 17 0 2 def 18 1 3 ') test <- read.table(tc, header=TRUE) The goal is to create a new column ("journey_nr") that give a unique number to each row based on the journey it belongs to. Journeys are defined as a sequence of rows per id up until to end_yn == 1, also if end_ynnever becomes 1, the journey should also be numbered (see the expected outcome example). It is only possible to have end_yn == 0 journeys at the end of a collection of rows for an ID (as shown at row 4 for id 3). So either no end_yn == 1 has occured for that ID or that happened before the end_yn == 0-journey (see id == abc in the example). I know how to number using the data.table package, but I do not know which columns to combine in order to get the expected outcome. I've searched the data.table-tag on SO, but could not find a similar problem. Expected outcome: id time end_yn number journey abc 10 0 1 1 abc 11 0 2 1 abc 12 1 3 1 abc 13 0 1 2 def 10 0 1 3 def 15 1 2 3 def 16 0 1 4 def 17 0 2 4 def 18 1 3 4

    Read the article

  • syntax error : missing ';' before identifier

    - by numerical25
    I am new to c++, trying to debug the following line of code class cGameError { string m_errorText; public: cGameError( char *errorText ) { DP1("***\n*** [ERROR] cGameError thrown! text: [%s]\n***\n", errorText ); m_errorText = string( errorText ); } const char *GetText() { return m_errorText.c_str(); } }; enum eResult { resAllGood = 0, // function passed with flying colors resFalse = 1, // function worked and returns 'false' resFailed = –1, // function failed miserably resNotImpl = –2, // function has not been implemented resForceDWord = 0x7FFFFFFF }; This header file is included in the program as followed #include "string.h" #include "stdafx.h" #include "Chapter 01 MyVersion.h" #include "cGameError.h"

    Read the article

  • Order mysql results without identifier

    - by Alex Crooks
    Usually I would have a table field called ID on auto increment. That way I could order using this field etc. However I have no control over the structure of a table, and wondered how to get the results in reverse order to default. I'm currently using $q = mysql_query("SELECT * FROM ServerChat LIMIT 15"); However like I said there is no field I can order on, so is there a way to tell mysql to reverse the order it gets the results? I.e last row to first row instead of the default.

    Read the article

  • Xinerama creates a panning viewport

    - by iblue
    EDIT: I've created a bug report: https://bugs.freedesktop.org/show_bug.cgi?id=48458 My Setup I have 4 monitors, 1920x1080, which are in portrait mode (rotated left). They are connected to two radeon graphic cards. As usual, a picture says more than a thousand words. The problem Everything works fine, when Xinerama is disabled. But when I enable Xinerama, things get weird. When I move the mouse of the screen and return, the screen contents begin to move with the mouse, only on this monitor. It seems like the virtual display size does not match the real screen size, which activates a panning viewport. Any idea how to stop this? The video I created a video to demonstrate the issue: http://www.youtube.com/watch?v=zq_XHji1P24 xorg.conf This is my xorg.conf: Section "ServerLayout" ##################[ Evilness begins here ]############# Option "Xinerama" "on" # <--- Makes it go b0rked! ##################[ End of all evil ]############# Identifier "BOFH Console of Doom" Screen 0 "Screen-0" 0 0 Screen 1 "Screen-1" RightOf "Screen-0" Screen 2 "Screen-2" RightOf "Screen-1" Screen 3 "Screen-3" RightOf "Screen-2" EndSection Section "ServerFlags" Option "RandR" "false" EndSection Section "Module" Load "dbe" Load "dri" Load "extmod" Load "dri2" Load "record" Load "glx" EndSection Section "Monitor" Identifier "Monitor-0" Option "Rotate" "left" EndSection Section "Monitor" Identifier "Monitor-1" Option "Rotate" "left" EndSection Section "Monitor" Identifier "Monitor-2" Option "Rotate" "left" EndSection Section "Monitor" Identifier "Monitor-3" Option "Rotate" "left" EndSection Section "Device" Identifier "Radeon-0-0" Driver "radeon" BusID "PCI:9:0:0" Option "ZaphodHeads" "DVI-0" Screen 0 EndSection Section "Device" Identifier "Radeon-0-1" Driver "radeon" BusID "PCI:9:0:0" Option "ZaphodHeads" "DVI-1" Screen 1 EndSection Section "Device" Identifier "Radeon-1-0" Driver "radeon" BusID "PCI:4:0:0" Option "ZaphodHeads" "DVI-2" Screen 0 EndSection Section "Device" Identifier "Radeon-1-1" Driver "radeon" BusID "PCI:4:0:0" Option "ZaphodHeads" "DVI-3" Screen 1 EndSection Section "Screen" Identifier "Screen-0" Device "Radeon-0-0" Monitor "Monitor-0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen-1" Device "Radeon-0-1" Monitor "Monitor-1" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen-2" Device "Radeon-1-0" Monitor "Monitor-2" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen-3" Device "Radeon-1-1" Monitor "Monitor-3" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 EndSubSection EndSection

    Read the article

  • Use a custom value object or a Guid as an entity identifier in a distributed system?

    - by Kazark
    tl;dr I've been told that in domain-driven design, an identifier for an entity could be a custom value object, i.e. something other than Guid, string, int, etc. Can this really be advisable in a distributed system? Long version I will invent an situation analogous to the one I am currently facing. Say I have a distributed system in which a central concept is an egg. The system allows you to order eggs and see spending reports and inventory-centric data such as quantity on hand, usage, valuation and what have you. There area variety of services backing these behaviors. And say there is also another app which allows you to compose recipes that link to a particular egg type. Now egg type is broken down by the species—ostrich, goose, duck, chicken, quail. This is fine and dandy because it means that users don't end up with ostrich eggs when they wanted quail eggs and whatnot. However, we've been getting complaints because jumbo chicken eggs are not even close to equivalent to small ones. The price is different, and they really aren't substitutable in recipes. And here we thought we were doing users a favor by not overwhelming them with too many options. Currently each of the services (say, OrderSubmitter, EggTypeDefiner, SpendingReportsGenerator, InventoryTracker, RecipeCreator, RecipeTracker, or whatever) are identifying egg types with an industry-standard integer representation the species (let's call it speciesCode). We realize we've goofed up because this change could effect every service. There are two basic proposed solutions: Use a predefined identifier type like Guid as the eggTypeID throughout all the services, but make EggTypeDefiner the only service that knows that this maps to a speciesCode and eggSizeCode (and potentially to an isOrganic flag in the future, or whatever). Use an EggTypeID value object which is a combination of speciesCode and eggSizeCode in every service. I've proposed the first solution because I'm hoping it better encapsulates the definition of what an egg type is in the EggTypeDefiner and will be more resilient to changes, say if some people now want to differentiate eggs by whether or not they are "organic". The second solution is being suggested by some people who understand DDD better than I do in the hopes that less enrichment and lookup will be necessary that way, with the justification that in DDD using a value object as an ID is fine. Also, they are saying that EggTypeDefiner is not a domain and EggType is not an entity and as such should not have a Guid for an ID. However, I'm not sure the second solution is viable. This "value object" is going to have to be serialized into JSON and URLs for GET requests and used with a variety of technologies (C#, JavaScript...) which breaks encapsulation and thus removes any behavior of the identifier value object (is either of the fields optional? etc.) Is this a case where we want to avoid something that would normally be fine in DDD because we are trying to do DDD in a distributed fashion? Summary Can it be a good idea to use a custom value object as an identifier in a distributed system (solution #2)?

    Read the article

  • PHP Application check name is unique if not append

    - by user270797
    My application requires the user to enter their business name, which the application will automatically create into a unique identifier to be used in URLs, ie "Bob's Cafe" will become "bobs-cafe" But if there are duplicate names I would like the application to add a number so if there is already a "bobs-cafe" we will use "bobs-cafe-1" and likewise if there is already a "bobs-cafe-1" we will use "bobs-cafe-2" Ive used explode and also looked at a regular expressions but I dont know the best way to approach this. Im stuck in being able to grab the number and incrementing it and returning the string

    Read the article

  • radeon display driver clones monitors while using Xinerama

    - by gregmuellegger
    I'm trying to get my two Radeon HD 4770 cards working with three monitors. Xinerama works so far in the way that I have two fully working monitors were I can move windows from one to the other. My problem now is that my third monitor is a clone of my second monitor (displaying the exact same thing). These monitors are connected to the same graphic card ("Screen Middle" and "Screen Right" in the xorg.conf below). Here is my xorg.conf: Section "ServerLayout" Identifier "ThreeMonitors" Screen "Screen Left" 0 0 Screen "Screen Middle" RightOf "Screen Left" Screen "Screen Right" RightOf "Screen Middle" Option "Xinerama" EndSection Section "Monitor" Identifier "Monitor Left" Option "DPMS" EndSection Section "Monitor" Identifier "Monitor Middle" Option "DPMS" EndSection Section "Monitor" Identifier "Monitor Right" Option "DPMS" EndSection Section "Device" Identifier "Device Left" Driver "radeon" VendorName "ATI Technologies Inc" BoardName "ATI Radeon HD 4770 [RV740]" BusID "PCI:3:0:0" Screen 0 EndSection Section "Screen" Identifier "Screen Left" Device "Device Left" Monitor "Monitor Left" SubSection "Display" Depth 24 EndSubSection EndSection Section "Device" Identifier "Device Middle" Driver "radeon" VendorName "ATI Technologies Inc" BoardName "ATI Radeon HD 4770 [RV740]" BusID "PCI:2:0:0" Screen 0 EndSection Section "Screen" Identifier "Screen Middle" Device "Device Middle" Monitor "Monitor Middle" SubSection "Display" Depth 24 EndSubSection EndSection Section "Device" Identifier "Device Right" Driver "radeon" VendorName "ATI Technologies Inc" BoardName "ATI Radeon HD 4770 [RV740]" BusID "PCI:2:0:1" Screen 1 EndSection Section "Screen" Identifier "Screen Right" Device "Device Right" Monitor "Monitor Right" SubSection "Display" Depth 24 EndSubSection EndSection I'm using a fresh Kubuntu 10.10 installation with propsed-updates enabled since this repo contains a xorg fix for using multiple graphic cards. I hope someone can help me out. Very many thanks!!

    Read the article

  • Ubuntu 13.10. After login, no desktop displayed. Two Nvidia Graphics Cards, Four Monitors

    - by jmerkow
    I am working on an issue with my Ubuntu 13.10 installation. I am attempting to get 4 monitors up and running but I am having some trouble. So far, I installed and updated to the latest NVIDIA drivers (331.20). Initially X would not start (after installation) so I replaced my xorg.conf with xorg.conf.failsafe. This fixed that problem, but then I tried to enable the other 2 monitors (other video card) and xorg fails to start once again (after I login there is no desktop). I am fairly new to linux but I am not a complete beginner, but I'm not comfortable poking around too much on my own to troubleshoot yet.... lspci -nn | grep VGA: 03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF110 [GeForce GTX 570 Rev. 2] [10de:1086] (rev a1) 05:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF110 [GeForce GTX 580] [10de:1080] (rev a1) It seems that the nvidia-settings tool does not result in a good xorg.conf file. Here it is: # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 331.20 (buildmeister@swio-display-x86-rhel47-05) Wed Oct 30 18:20:32 PDT 2013 Section "ServerLayout" Identifier "Default Layout" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "1" EndSection ... Section "Monitor" Identifier "Configured Monitor" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "SHARP HDMI" HorizSync 15.0 - 68.0 VertRefresh 55.0 - 76.0 EndSection Section "Monitor" Identifier "Monitor1" VendorName "Unknown" ModelName "Samsung SyncMaster" HorizSync 0.0 - 0.0 VertRefresh 0.0 EndSection Section "Device" Identifier "Configured Video Device" Driver "vesa" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 570" BusID "PCI:3:0:0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 580" BusID "PCI:5:0:0" EndSection Section "Screen" Identifier "Default Screen" Device "Configured Video Device" Monitor "Configured Monitor" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-1" Option "metamodes" "HDMI-0: nvidia-auto-select +640+0, DVI-I-3: nvidia-auto-select +0+1080" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "DVI-I-2: nvidia-auto-select +0+0" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection Section "Extensions" Option "Composite" "Disable" EndSection

    Read the article

  • Simple Constructor With Initializer List? - C++

    - by Alex
    Hi all, below I've included my h file, and my problem is that the compiler is not liking my simple exception class's constructor's with initializer lists. It also is saying that string is undeclared identifier, even though I have #include <string> at the top of the h file. Do you see something I am doing wrong? For further explanation, this is one of my domain classes that I'm integrating into a wxWidgets GUI application on Windows. Thanks! Time.h #pragma once #include <string> #include <iostream> // global constants for use in calculation const int HOURS_TO_MINUTES = 60; const int MINUTES_TO_HOURS = 100; class Time { public: // default Time class constructor // initializes all vars to default values Time(void); // ComputeEndTime computes the new delivery end time // params - none // preconditions - vars will be error-free // postconditions - the correct end time will be returned as an int // returns an int int ComputeEndTime(); // GetStartTime is the getter for var startTime // params - none // returns an int int GetStartTime() { return startTime; } // GetEndTime is the getter for var endTime // params - none // returns an int int GetEndTime() { return endTime; } // GetTimeDiff is the getter for var timeDifference // params - none // returns a double double GetTimeDiff() { return timeDifference; } // SetStartTime is the setter for var startTime // params - an int // returns void void SetStartTime(int s) { startTime = s; } // SetEndTime is the setter for var endTime // params - an int // returns void void SetEndTime(int e) { endTime = e; } // SetTimeDiff is the setter for var timeDifference // params - a double // returns void void SetTimeDiff(double t) { timeDifference = t; } // destructor for Time class ~Time(void); private: int startTime; int endTime; double timeDifference; }; class HourOutOfRangeException { public: // param constructor // initializes message to passed paramater // preconditions - param will be a string // postconditions - message will be initialized // params a string // no return type HourOutOfRangeException(string pMessage) : message(pMessage) {} // GetMessage is getter for var message // params none // preconditions - none // postconditions - none // returns string string GetMessage() { return message; } // destructor ~HourOutOfRangeException() {} private: string message; }; class MinuteOutOfRangeException { public: // param constructor // initializes message to passed paramater // preconditions - param will be a string // postconditions - message will be initialized // params a string // no return type MinuteOutOfRangeException(string pMessage) : message(pMessage) {} // GetMessage is getter for var message // params none // preconditions - none // postconditions - none // returns string string GetMessage() { return message; } // destructor ~MinuteOutOfRangeException() {} private: string message; }; class PercentageOutOfRangeException { public: // param constructor // initializes message to passed paramater // preconditions - param will be a string // postconditions - message will be initialized // params a string // no return type PercentageOutOfRangeException(string pMessage) : message(pMessage) {} // GetMessage is getter for var message // params none // preconditions - none // postconditions - none // returns string string GetMessage() { return message; } // destructor ~PercentageOutOfRangeException() {} private: string message; }; class StartEndException { public: // param constructor // initializes message to passed paramater // preconditions - param will be a string // postconditions - message will be initialized // params a string // no return type StartEndException(string pMessage) : message(pMessage) {} // GetMessage is getter for var message // params none // preconditions - none // postconditions - none // returns string string GetMessage() { return message; } // destructor ~StartEndException() {} private: string message; };

    Read the article

  • What is default javac source mode (assert as identifier compilation)?

    - by waste
    According to Orcale's Java7 assert guide: source mode 1.3 (default) — the compiler accepts programs that use assert as an identifier, but issues warnings. In this mode, programs are not permitted to use the assert statement. source mode 1.4 — the compiler generates an error message if the program uses assert as an identifier. In this mode, programs are permitted to use the assert statement. I wrote such class: package mm; public class ClassTest { public static void main(String[] arg) { int assert = 1; System.out.println(assert); } } It should compile fine if Oracle's info right (1.3 is default source mode). But I got errors like this: $ javac -version javac 1.7.0_04 $ javac -d bin src/mm/* src\mm\ClassTest.java:5: error: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier int assert = 1; ^ (use -source 1.3 or lower to use 'assert' as an identifier) src\mm\ClassTest.java:6: error: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier System.out.println(assert); ^ (use -source 1.3 or lower to use 'assert' as an identifier) 2 errors I added manually -source 1.3 and it issued warnings but compiled fine. It seems that Oracle's information is wrong and 1.3 is not default source mode. Which one is it then?

    Read the article

  • Xamarin bundle ID not matching provisioning Profile

    - by user1019042
    I changed my provision profile 'application name' and 'bundle id' and now my xamarin no longer builds successfully and comes back with this message: Project bundle ID '' does not match specified provisioning profile '15729097-407D-4744-9378-53905C00E62B' Build: 1 error, 0 warnings Where is that profile guid stored? I have looked in the info.plist file and there is no mentioning of it. I hav tried cleaning the build and the solution multiple times and restarting of machine. I think if I know where that id is stored, it can give me insights on how to fix it. Your help is appreciated.

    Read the article

  • JQuery preventDefault() but still add the fragment path to the URL without navigating to the fragment

    - by jdln
    My question is similar to this one but none of the answers solve my problem: Use JQuery preventDefault(), but still add the path to the URL When a user clicks a fragment link, I need to remove the default behaviour of jumping to the fragment but still add the fragment to the URL. This code (taken from the link) will fire the animation, and then add the fragment to the URL. However the fragment is then navigated to, which im my case breaks my site. $("#login_link").click(function (e) { e.preventDefault(); $("#login").animate({ 'margin-top': 0 }, 600, 'linear', function(){ window.location.hash = $(this).attr('href'); }); });

    Read the article

  • What's the best library to do a URL hash/history in JQuery?

    - by alex
    I've been looking around JQuery libraries for the URL hash, but found none that were good. There is the "history plugin", but we all know it's buggy and isn't flexible. I am loading my pages inside a div. I'll need a way to do back/forward along with the url hashing. mydomain.com/#home mydomain.com/#aboutus mydomain.com/#register What's the best library that can handle all of this?

    Read the article

  • An "elegant" way of identifying a field?

    - by Alix
    Hi. I'm writing a system that underlies programmer applications and that needs to detect their access to certain data. I can mostly do so with properties, like this: public class NiceClass { public int x { get; set; } } Then I go in and tweak the get and set accessors so that they handle the accesses appropriately. However this requires that the users (application programmers) define all of their data as properties. If the users want to use pre-existing classes that have "normal" fields (as opposed to properties), I cannot detect those accesses. Example: public class NotSoNiceClass { public int y; } I cannot detect accesses to y. However, I want to allow the use of pre-existing classes. As a compromise the users are responsible for notifying me whenever an access to that kind of data occurs. For example: NotSoNiceClass notSoNice; ... Write(notSoNice.y, 0); // (as opposed to notSoNice.y = 0;) Something like that. Believe me, I've researched this very thoroughly and even directly analysing the bytecode to detect accesses isn't reliable due to possible indirections, etc. I really do need the users to notify me. And now my question: could you recommend an "elegant" way to perform these notifications? (Yes, I know this whole situation isn't "elegant" to begin with; I'm trying not to make it worse ;) ). How would you do it? This is a problem for me because actually the situation is like this: I have the following class: public class SemiNiceClass { public NotSoNiceClass notSoNice { get; set; } public int z { get; set; } } If the user wants to do this: SemiNiceClass semiNice; ... semiNice.notSoNice.y = 0; They must instead do something like this: semiNice.Write("notSoNice").y = 0; Where Write will return a clone of notSoNice, which is what I wanted the set accessor to do anyway. However, using a string is pretty ugly: if later they refactor the field they'll have to go over their Write("notSoNice") accesses and change the string. How can we identify the field? I can only think of strings, ints and enums (i.e., ints again). But: We've already discussed the problem with strings. Ints are a pain. They're even worse because the user needs to remember which int corresponds to which field. Refactoring is equally difficult. Enums (such as NOT_SO_NICE and Z, i.e., the fields of SemiNiceClass) ease refactoring, but they require the user to write an enum per class (SemiNiceClass, etc), with a value per field of the class. It's annoying. I don't want them to hate me ;) So why, I hear you ask, can we not do this (below)? semiNice.Write(semiNice.notSoNice).y = 0; Because I need to know what field is being accessed, and semiNice.notSoNice doesn't identify a field. It's the value of the field, not the field itself. Sigh. I know this is ugly. Believe me ;) I'll greatly appreciate suggestions. Thanks in advance! (Also, I couldn't come up with good tags for this question. Please let me know if you have better ideas, and I'll edit them)

    Read the article

  • Unicode identifiers in Python?

    - by viksit
    Hi all, I want to build a Python function that calculates, and would like to name my summation function S. In a similar fashion, would like to use ? for product, and so on. I was wondering if there was a way to name a python function in this fashion? def S (..): .. .. That is, does Python support unicode identifiers, and if so, could someone provide an example for it? Thanks! Original motivation for this was a piece of Clojure code I saw today that looks like, (defn entropy [X] (* -1 (S [i X] (* (p i) (log (p i)))))) where S is a macro defined as, (defmacro S ... ) and I thought that was pretty cool.

    Read the article

  • problem Keyword token antlr

    - by batman_for
    If the 'for' is used both as a command and as "the English word": for_statement: 'for' ... id: 'for' | ID ; ID: ... right? My problem is how to differentiate the two cases. For example for_statement is only possible beginning of a line (only if preceded by ' ' or '\t'). Thanks.

    Read the article

  • How does twitter server get to know single tweet ID from URL fragment segment?

    - by Morgan Cheng
    Each tweet has a single URL such as http://twitter.com/#!/DeliciousHot/status/23189589820702720. The tweet identification (/DeliciousHot/status/23189589820702720) is in the URL fragment segment which is not actually sent to server. Originally, I thought it works this way: The URL response doesn't have this tweet specific info. It is JavaScript module that extracts tweet id from current browser URL and fetch tweet payload with AJAX. The page content is then updated with the tweet payload. To my surprise, it is doesn't work this way! With Firebug, you can view that response of http://twitter.com/#!/DeliciousHot/status/23189589820702720 has tweet payload "10 Signs of a True Gentleman" text in inline JavaScript. The tweet payload is not fetched by another AJAX. So, how does Twitter server get to know the expected tweet ID even it is in URL fragment segment?

    Read the article

  • C++ 'ClassName Not Declared' Error

    - by Arjun Nayini
    I have this cpp file. dsets.cpp: #ifndef DSETS_CPP #define DSET_CPP //Adds elements to the DisjointSet data structure. This function adds //x unconnected roots to the end of the array. void DisjointSets::addelements(int x){ } //Given an int this function finds the root associated with that node. int DisjointSets::find(int x){ return 0; } //This function reorders the uptree in order to represent the union of two //subtrees void DisjointSets::setunion(int x, int y){ } #endif and this header file dsets.h: #ifndef DSETS_H #define DSET_H #include <iostream> #include <vector> using namespace std; class DisjointSets { public: void addelements(int x); int find(int x); void setunion(int x, int y); private: vector<int> x; }; #include "dsets.cpp" #endif And I keep getting an error that is saying that "DisjointSets has no been declared" ~ ~

    Read the article

  • Wordpress - Get Post Number in a Category

    - by Rfvgyhn
    Is there a way for me to get a pseudo-ID of a post from the category it belongs to? Let's say I have these posts post_id | post_title | post_cat --------+------------+--------- 0 | a post | cat1 1 | a post1 | cat2 2 | a post2 | cat1 3 | a post3 | cat2 ... 57 | a post57 | cat2 I want the posts from cat2 and the posts' ids to be relative to the category they were posted in. Something like post_id | post_title | post_cat | cat_post_id --------+------------+----------+-------- 1 | a post1 | cat2 | 1 3 | a post3 | cat2 | 2 57 | a post57 | cat2 | 3

    Read the article

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