Search Results

Search found 5136 results on 206 pages for 'comment bot'.

Page 170/206 | < Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >

  • How can I extend a LINQ-to-SQL class without having to make changes every time the code is generated

    - by csharpnoob
    Hi, Update from comment: I need to extend linq-to-sql classes by own parameters and dont want to touch any generated classes. Any better suggestes are welcome. But I also don't want to do all attributes assignments all time again if the linq-to-sql classes are changing. so if vstudio generates new attribute to a class i have my own extended attributes kept separate, and the new innerited from the class itself Original question: i'm not sure if it's possible. I have a class car and a class mycar extended from class car. Class mycar has also a string list. Only difference. How can i cast now any car object to a mycar object without assigning all attributes each by hand. Like: Car car = new Car(); MyCar mcar = (MyCar) car; or MyCar mcar = new MyCar(car); or however i can extend car with own variables and don't have to do always Car car = new Car(); MyCar mcar = new MyCar(); mcar.name = car.name; mcar.xyz = car.xyz; ... Thanks.

    Read the article

  • jQuery: If, Else with buttons error

    - by Wipqozn
    I'm running into an odd error. I'm working in Django 1.2, and have implemented the commenting framework. I'm trying to attach a hide/show button to each comment field, but whenever click on a hide/show button, it behaves as if each hide/show button beneath it on the page was clicked. Here's the jQuery code: <input type="Button" id="hideShow" name="hide/show" value="Hide"></input> <script> $("#hideShow").click(function() { if($(this).val() == "Hide") { $("textarea").hide("fast"); $(this).val("Show"); } else { $("textarea").show("fast"); $(this).val( "Hide"); } }); </script> So, when I click the Hide/show button, it will perform the action for each button beneath the clicked button + once for the button itself. So If I click a button, and there are two buttons beneath it, and value=hide it will first hide the 'textarea', than show the text area, than finally hide it again. I'm new to jQuery (although I do have experience in other languages), and I have an -idea- why it's not working: that whenever an action is performed jQuery jumps to the first one, than continues down the page looking for any other actions performed, and responds to each one. So it comes to my first button, sets it as being clicked, and so when jQuery comes across the other buttons it views them all as being 'clicked' and performs actions accordingly. I've thought of a semi-solution to my problem, putting in a variable which tracks how many times it has gone through, and than acting based on -that- action. But I would rather not do that, since it's not really a solution to the problem at hand but a work around. Any input is appreciated.

    Read the article

  • C++ 64bit issue

    - by Bobby
    I have the following code: tmp_data = simulated_data[index_data]; unsigned char *dem_content_buff; dem_content_buff = new unsigned char [dem_content_buff_size]; int tmp_data; unsigned long long tmp_64_data; if (!(strcmp(dems[i].GetValType(), "s32"))) { dem_content_buff[BytFldPos] = tmp_data; dem_content_buff[BytFldPos + 1] = tmp_data >> 8; dem_content_buff[BytFldPos + 2] = tmp_data >> 16; dem_content_buff[BytFldPos + 3] = tmp_data >> 24; } if (!(strcmp(dems[i].GetValType(), "f64"))) { dem_content_buff[BytFldPos] = tmp_data; dem_content_buff[BytFldPos + 1] = tmp_data >> 8; dem_content_buff[BytFldPos + 2] = tmp_data >> 16; dem_content_buff[BytFldPos + 3] = tmp_data >> 24; dem_content_buff[BytFldPos + 4] = tmp_data >> 32; dem_content_buff[BytFldPos + 5] = tmp_data >> 40; dem_content_buff[BytFldPos + 6] = tmp_data >> 48; dem_content_buff[BytFldPos + 7] = tmp_data >> 56; } I am getting some weird memory errors in other places of the application when the second if statement is true and executed. When I comment out the 2nd if statement, the problem works fine. So I suspect the way I am performing bitwise operations for 64bit data is incorrect. Can anyone see anything in this code that needs to be corrected?

    Read the article

  • Can this code cause a memory leak (Arduino)

    - by tbraun89
    I have a arduino project and I created this struct: struct Project { boolean status; String name; struct Project* nextProject; }; In my application I parse some data and create Project objects. To have them in a list there is a pointer to the nextProject in each Project object expect the last. This is the code where I add new projects: void RssParser::addProject(boolean tempProjectStatus, String tempData) { if (!startProject) { startProject = true; firstProject.status = tempProjectStatus; firstProject.name = tempData; firstProject.nextProject = NULL; ptrToLastProject = &firstProject; } else { ptrToLastProject->nextProject = new Project(); ptrToLastProject->nextProject->status = tempProjectStatus; ptrToLastProject->nextProject->name = tempData; ptrToLastProject->nextProject->nextProject = NULL; ptrToLastProject = ptrToLastProject->nextProject; } } firstProject is an private instance variable and defined in the header file like this: Project firstProject; So if there actually no project was added, I use firstProject, to add a new one, if firstProject is set I use the nextProject pointer. Also I have a reset() method that deletes the pointer to the projects: void RssParser::reset() { delete ptrToLastProject; delete firstProject.nextProject; startProject = false; } After each parsing run I call reset() the problem is that the memory used is not released. If I comment out the addProject method there are no issues with my memory. Someone can tell me what could cause the memory leak?

    Read the article

  • BackOffice Database Application FrontEnd - Program in C#/VB.Net or PHP?

    - by HK1
    I'm working on a project where there will be a MySQL database containing data that will mostly be displayed on the web using PHP. However, there is a need here for a back-office data entry application (linked to the same MySQL database) that is feature rich and easy to use. what I'm trying to understand is where we are at with web-based frontends. I find that there are still so many events and features that I can make use of in a Windows Desktop GUI written in something like C#, VB.Net or MS Access. I don't have a lot of experience programming UI for web but it's my impression that it's still more difficult and takes longer to get similar or the same functionality using non-MS web technologies (I dislike ASP.net, sorry) as compared to programming the desktop portion in a traditional desktop application language like C#, VB.Net, or MS Access. jQuery and jQuery UI are definately making things easier. Also, there's very rich online applications like Google Docs and Zoho but it's my impression that these are programmed by some of the top web UI programmers around, not to mention that it takes longer to write it and intensive testing to make it work in all of your target browsers. It also takes extra time and code to "block" browsers that don't meet the requirements. What programming language would you recommend? I know I may not have given enough information here but I'm not sure what I'm missing. If you have questions just leave a comment below so I can edit this post and answer the questions.

    Read the article

  • GetIpAddrTable() leaks memory. How to resolve that?

    - by Stabledog
    On my Windows 7 box, this simple program causes the memory use of the application to creep up continuously, with no upper bound. I've stripped out everything non-essential, and it seems clear that the culprit is the Microsoft Iphlpapi function "GetIpAddrTable()". On each call, it leaks some memory. In a loop (e.g. checking for changes to the network interface list), it is unsustainable. There seems to be no async notification API which could do this job, so now I'm faced with possibly having to isolate this logic into a separate process and recycle the process periodically -- an ugly solution. Any ideas? // IphlpLeak.cpp - demonstrates that GetIpAddrTable leaks memory internally: run this and watch // the memory use of the app climb up continuously with no upper bound. #include <stdio.h> #include <windows.h> #include <assert.h> #include <Iphlpapi.h> #pragma comment(lib,"Iphlpapi.lib") void testLeak() { static unsigned char buf[16384]; DWORD dwSize(sizeof(buf)); if (GetIpAddrTable((PMIB_IPADDRTABLE)buf, &dwSize, false) == ERROR_INSUFFICIENT_BUFFER) { assert(0); // we never hit this branch. return; } } int main(int argc, char* argv[]) { for ( int i = 0; true; i++ ) { testLeak(); printf("i=%d\n",i); Sleep(1000); } return 0; }

    Read the article

  • Are ternary operators not valid for linq-to-sql queries?

    - by KallDrexx
    I am trying to display a nullable date time in my JSON response. In my MVC Controller I am running the following query: var requests = (from r in _context.TestRequests where r.scheduled_time == null && r.TestRequestRuns.Count > 0 select new { id = r.id, name = r.name, start = DateAndTimeDisplayString(r.TestRequestRuns.First().start_dt), end = r.TestRequestRuns.First().end_dt.HasValue ? DateAndTimeDisplayString(r.TestRequestRuns.First().end_dt.Value) : string.Empty }); When I run requests.ToArray() I get the following exception: Could not translate expression ' Table(TestRequest) .Where(r => ((r.scheduled_time == null) AndAlso (r.TestRequestRuns.Count > 0))) .Select(r => new <>f__AnonymousType18`4(id = r.id, name = r.name, start = value(QAWebTools.Controllers.TestRequestsController). DateAndTimeDisplayString(r.TestRequestRuns.First().start_dt), end = IIF(r.TestRequestRuns.First().end_dt.HasValue, value(QAWebTools.Controllers.TestRequestsController). DateAndTimeDisplayString(r.TestRequestRuns.First().end_dt.Value), Invoke(value(System.Func`1[System.String])))))' into SQL and could not treat it as a local expression. If I comment out the end = line, everything seems to run correctly, so it doesn't seem to be the use of my local DateAndTimeDisplayString method, so the only thing I can think of is Linq to Sql doesn't like Ternary operators? I think I've used ternary operators before, but I can't remember if I did it in this code base or another code base (that uses EF4 instead of L2S). Is this true, or am I missing some other issue?

    Read the article

  • TypeError when using v 0.8.1 of FLOT library, but no error with v. 0.7

    - by DanielAttard
    I need some help to figure out why I am getting an error when trying to create a simple graph using the jQuery FLOT library. When I reference version 0.7 of the FLOT library, the page renders correctly: http://attardpropertytax.ca/flot07.html But when I switch to version 0.8.1 of the FLOT library, the page returns an error saying: Uncaught TypeError: Cannot read property 'left' of null http://attardpropertytax.ca/flot81.html The HTML is the same for both pages, so I cannot figure out why the new version 0.8.1 of FLOT returns an error, but the old version 0.7 does not. Any ideas? I somehow stumbled across a work-around that managed to fix my problem. I'm nut sure why, but I had to comment-out the following two sections of code from the v. 0.8.1 FLOT library: This was the first spot: // If the grid is visible, add its border width to the offset for (var a in plotOffset) { if(typeof(options.grid.borderWidth) == "object") { plotOffset[a] += showGrid ? options.grid.borderWidth[a] : 0; } else { plotOffset[a] += showGrid ? options.grid.borderWidth : 0; } } And this was the second spot: if (isNaN(v) || v < axis.min || v > axis.max // skip those lying on the axes if we got a border || (t == "full" && ((typeof bw == "object" && bw[axis.position] > 0) || bw > 0) && (v == axis.min || v == axis.max))) continue; I'm sure eventually @DNS will be taking a look at this question and maybe he will be able to help me understand what is going wrong with my code. Thanks.

    Read the article

  • How to write automated tests for SQL queries?

    - by James
    The current system we are adopting at work is to write some extremely complex queries which perform multiple calculations and have multiple joins / sub-queries. I don't think I am experienced enough to say if this is correct or not so I am agreeing and attempting to function with this system as it has clear benefits. The problem we are having at the moment is that the person writing the queries makes a lot of mistakes and assumes everything is correct. We have now assigned a tester to analyse all of the queries but this still proves extremely time consuming and stressful. I would like to know how we could create an automated procedure (without specifically writing it with code if possible as I can work out how to do that the long way) to verify a set of 10+ different inputs, verify the output data and say if the calculations are correct. I know I could write a script using specific data in the database and create a script using c# (the db is SQL Server) and verify all the values coming out but I would like to know what the official "standard" is as my experience is lacking in this area and I would like to improve. I am happy to add more information if required, add a comment if necessary. Thank you. Edit: I am using c#

    Read the article

  • tracking the position of dragview

    - by user262325
    Hello everyone I put a dragview on an UIView, I hope when I drag the dragview, its superview (UIView) tracks the position of the dragview and moves itself to the position where to keep dragview at the original position on the UIView. The codes show below: #import <UIKit/UIKit.h> @interface DragView : UIImageView { CGPoint startLocation; } @end #import "DragView.h" @implementation DragView - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // Initialization code } return self; } - (void)drawRect:(CGRect)rect { // Drawing code } -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event { CGPoint pt=[[touches anyObject] locationInView:self]; startLocation=pt; [[self superview] bringSubviewToFront:self]; } -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint pt=[[touches anyObject] locationInView:self]; CGRect frame=[self frame]; frame.origin.x+=pt.x-startLocation.x; frame.origin.y+=pt.y-startLocation.y; CGRect frame1=[[self superview] frame];//superview of the dragview frame1.origin.x+=frame.origin.x; //tracks the postion of dragview frame1.origin.y+=frame.origin.y; [[self superview] setFrame: frame1 ]; //move to new position [self setFrame:frame]; } my problem is that the UIView moved but lagged to the movement of the drageview(RED BLOCK). Welcome any comment Thanks interdev

    Read the article

  • Any utility to test expand C/C++ #define macros?

    - by Randy
    It seems I often spend way too much time trying to get a #define macro to do exactly what i want. I'll post my current delemia below and any help is appreciated. But really the bigger question is whether there is any utility someone could reccomend, to quickly display what a macro is actually doing? It seems like even the slow trial and error process would go much faster if I could see what is wrong. Currently, I'm dynamically loading a long list of functions from a DLL I made. The way I've set things up, the function pointers have the same nanes as the exported functions, and the typedef(s) used to prototyp them have the same names, but with a prepended underscor. So I want to use a define to simplfy assignments of a long long list of function pointers. For example, In the code statement below, 'hexdump' is the name of a typdef'd function point, and is also the name of the function, while _hexdump is the name of the typedef. If GetProcAddress() fails, a failure counter in incremented. if (!(hexdump = (_hexdump)GetProcAddress(h, "hexdump"))) --iFail; So lets say I'd like to rplace each line like the above with a macro, like this... GETADDR_FOR(hexdump ) Well this is the best I've come up with so far. It doesn't work (my // comment is just to prevent text formatting in the message)... // #define GETADDR_FOR(a) if (!(a = (#_#a)GetProcAddress(h, "/""#a"/""))) --iFail; And again, while I'd APPRECIATE an insight into what silly mistake I've made, it would make my day to have a utility that would show me the error of my ways, by simply plugging in my macro

    Read the article

  • Commenting out portions of code in Scala

    - by akauppi
    I am looking for a C(++) #if 0 -like way of being able to comment out whole pieces of Scala source code, for keeping around experimental or expired code for a while. I tried out a couple of alternatives and would like to hear what you use, and if you have come up with something better? // Simply block-marking N lines by '//' is one way... // <tags> """ anything My editor makes this easy, but it's not really The Thing. It gets easily mixed with actual one-line comments. Then I figured there's native XML support, so: <!-- ... did not work --> Wrapping in XML works, unless you have <tags> within the block: class none { val a= <ignore> ... cannot have //<tags> <here> (not even in end-of-line comments!) </ignore> } The same for multi-line strings seems kind of best, but there's an awful lot of boilerplate (not fashionable in Scala) to please the compiler (less if you're doing this within a class or an object): object none { val ignore= """ This seems like ... <truly> <anything goes> but three "'s of course """ } The 'right' way to do this might be: /*** /* ... works but not properly syntax highlighed in SubEthaEdit (or StackOverflow) */ ***/ ..but that matches the /* and */ only, not i.e. /*** to ***/. This means the comments within the block need to be balanced. And - the current Scala syntax highlighting mode for SubEthaEdit fails miserably on this. As a comparison, Lua has --[==[ matching ]==] and so forth. I think I'm spoilt? So - is there some useful trick I'm overseeing?

    Read the article

  • Preallocating memory with C++ in realtime environment

    - by Elazar Leibovich
    I'm having a function which gets an input buffer of n bytes, and needs an auxillary buffer of n bytes in order to process the given input buffer. (I know vector is allocating memory at runtime, let's say that I'm using a vector which uses static preallocated memory. Imagine this is NOT an STL vector.) The usual approach is void processData(vector<T> &vec) { vector<T> &aux = new vector<T>(vec.size()); //dynamically allocate memory // process data } //usage: processData(v) Since I'm working in a real time environment, I wish to preallocate all the memory I'll ever need in advance. The buffer is allocated only once at startup. I want that whenever I'm allocating a vector, I'll automatically allocate auxillary buffer for my processData function. I can do something similar with a template function static void _processData(vector<T> &vec,vector<T> &aux) { // process data } template<size_t sz> void processData(vector<T> &vec) { static aux_buffer[sz]; vector aux(vec.size(),aux_buffer); // use aux_buffer for the vector _processData(vec,aux); } // usage: processData<V_MAX_SIZE>(v); However working alot with templates is not much fun (now let's recompile everything since I changed a comment!), and it forces me to do some bookkeeping whenever I use this function. Are there any nicer designs around this problem?

    Read the article

  • PDF (VisPDF component) Problem with DecimalSeparator in Delphi/C++Builder2009

    - by Katsumi
    Hello. I use VisPDF component Delphi/C++Builder 2009 and show text with ShowMessage(FloatToStrF(1.23, ffFixed, 6, 2)); // Output: 1,23 (right!) UnicodeString Text = "Hello world!"; VPDF->CurrentPage->UnicodeTextOutStr( x, y, 0, Text); ShowMessage(FloatToStrF(1.23, ffFixed, 6, 2)); // Output: 1.23 (false!) afer UnicodeTextOutStr() the DecimalSeparator is changed. I have look in VisPDF source and found, that: Abscissa := Angle * Pi / 180; X := XProjection(X) + StrHeight * sin(Abscissa); Y := (YProjection(Y)) - StrHeight * cos(Abscissa); MtxA := cos(Abscissa); MtxB := sin(Abscissa); SetTextMatrix(MtxA, MtxB, -MtxB, MtxA, X, Y); with SetTextMatrix() show up the bug. comment out this line, DecimalSeparator is right, but no text in my pdf. procedure TVPDFPage.SetTextMatrix(a, b, c, d, x, y: Single); var S: AnsiString; begin S := _CutFloat(a) + ' ' + _CutFloat(b) + ' ' + _CutFloat(c) + ' ' + _CutFloat(d) + ' ' + _CutFloat(x) + ' ' + _CutFloat(y) + ' Tm'; SaveToPageStream(S); end; procedure TVPDFPage.SaveToPageStream(ValStr: AnsiString); begin PageContent.Add(string(ValStr)); // PageContent: TStringList; end; I don't understand this function. Can somebody help? VisPDF does not use any DLL or other software to create PDF files. Using VisPDF is very easy and have good examples.

    Read the article

  • EF in a UserControl can't see the app.config?

    - by Sven
    I just created a user control. This control also makes use of my static Entity Framework class to load two comboboxes. All is well and runs without a problem. Design and runtime are working. Then when I stop the application all the forms that contain my UserControl don't work any more in design time. I just see two errors: Error1: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid. Error 2: The variable ccArtikelVelden is either undeclared or was never assigned. (ccArtikelVelde is my UserControl) Runtime everything is still working My static EF Repositoy class: public class BSManagerData { private static BSManagerEntities _entities; public static BSManagerEntities Entities { get { if (_entities == null) _entities = new BSManagerEntities(); return _entities; } set { _entities = value; } } } Some logic happening in my UserControl to load the data in the comboboxes: private void LaadCbx() { cbxCategorie.DataSource = (from c in BSManagerData.Entities.Categories select c).ToList(); cbxCategorie.DisplayMember = "Naam"; cbxCategorie.ValueMember = "Id"; } private void cbxCategorie_SelectedIndexChanged(object sender, EventArgs e) { cbxFabrikant.DataSource = from f in BSManagerData.Entities.Fabrikants where f.Categorie.Id == ((Categorie)cbxCategorie.SelectedItem).Id select f; cbxFabrikant.DisplayMember = "Naam"; cbxFabrikant.ValueMember = "Id"; } The only way to make my forms work again, design time, is to comment out the EF part in the UserControl (see above) and rebuild. It's very strange, everything is in the same assembly, same namespace (for the sake of simplicity). Anyone an idea?

    Read the article

  • Can I make an identity field span multiple tables in SQL Server?

    - by johnnycakes
    Can I have an "identity" (unique, non-repeating) column span multiple tables? For example, let's say I have two tables: Books and Authors. Authors AuthorID AuthorName Books BookID BookTitle The BookID column and the AuthorID column are identity columns. I want the identity part to span both columns. So, if there is an AuthorID with a value of 123, then there cannot be a BookID with a value of 123. And vice versa. I hope that makes sense. Is this possible? Thanks. Why do I want to do this? I am writing an APS.NET MVC app. I am creating a comment section. Authors can have comments. Books can have comments. I want to be able to pass an entity ID (a book ID or an author ID) to an action and have the action pull up all the corresponding comments. The action won't care if it's a book or an author or whatever. Sound reasonable?

    Read the article

  • Memory allocation for a matrix in C

    - by Snogzvwtr
    Why is the following code resulting in Segmentation fault? (I'm trying to create two matrices of the same size, one with static and the other with dynamic allocation) #include <stdio.h> #include <stdlib.h> //Segmentation fault! int main(){ #define X 5000 #define Y 6000 int i; int a[X][Y]; int** b = (int**) malloc(sizeof(int*) * X); for(i=0; i<X; i++){ b[i] = malloc (sizeof(int) * Y); } } Weirdly enough, if I comment out one of the matrix definitions, the code runs fine. Like this: #include <stdio.h> #include <stdlib.h> //No Segmentation fault! int main(){ #define X 5000 #define Y 6000 int i; //int a[X][Y]; int** b = (int**) malloc(sizeof(int*) * X); for(i=0; i<X; i++){ b[i] = malloc (sizeof(int) * Y); } } or #include <stdio.h> #include <stdlib.h> //No Segmentation fault! int main(){ #define X 5000 #define Y 6000 int i; int a[X][Y]; //int** b = (int**) malloc(sizeof(int*) * X); //for(i=0; i<X; i++){ // b[i] = malloc (sizeof(int) * Y); //} } I'm running gcc on Linux on a 32-bit machine.

    Read the article

  • Complex Quary on cassandra

    - by Sadiqur Rahman
    I have heard on cassandra database engine few days ago and searching for a good documentation on it. after studying on cassandra I got cassandra is more scalable than other data engine. I also read on Amazon SimpleDB but as SimpleDB has a limitation 10GB/table and Google Datastore is slower than Amazon SimpleDB, I prefer not to use them (Google Datastore, Amazon SimpleDB). So for making our site scaled specially high write rates with massive data, I like to use Cassandra as out Data Engine. But before starting using cassandra I am confused on "How to handle complex data using casssandra". I am giving you the MySQL database structure below, Please read this and give me a good suggestion. Users Table hasColum ID Primary hasColum email Unique hasColum FirstName hasColum LastName Category Table hasColum ID Primary hasColum Parent hasColum Category Posts Table hasColum ID Primary hasColum UID Index foreign key linked to users-ID hasColum CID Index foreign key linked to Category-ID hasColum Title hasColum Post Index hasColum PunDate Comments hasColum ID primary hasColum UID Index foreign key linked to users-ID hasColum PID Index foreign key linked to Posts-ID hasColum Comment User Group hasColum ID primary hasColum Name UserToGroup Table (for many to many relation only) hasColum UID foreign key linked to Users-ID hasColum GID foreign key linked to Group-ID Finally for your information, I like to use SimpleCassie PHP Class http://code.google.com/p/simpletools-php/ So, it will be very helpful if you can give me example using SimpleCassie

    Read the article

  • Jquery tabs with cookie support restore wrong tab position after page refresh.

    - by zenonych
    Hello, all. I have tricky problem which I can't completely understand... It's jquery tabs with cookie support. I've following code: $(document).ready(function() { var $tabs = $("#tabs").tabs(); $tabs.tabs('select', $.cookie("tabNumber")); $('#tabs ul li a').click(function() { $.cookie("tabNumber", $tabs.tabs('option', 'selected')); }); $('#btnSelect').click(function() { //alert($.cookie("tabNumber")); //$tabs.tabs('select', 2); $tabs.tabs('select', $.cookie("tabNumber")); }); }); So, I've 3 tabs (with positions 0,1,2) inside div named "tabs". When user selects one tab, then tab position stores in cookie. After that if user refresh page, active tab position must be restored. But each time I refresh page I get active tab in previous position (if I select 2nd tab, then after refresh I got active tab in position 1, etc.). I add some test in code (button btnSelect with onclick handler which duplicates load position functionality). So, if I uncomment and use $tabs.tabs('select', 2); Then after I click btnSelect I've got right position. Ok, that's right. Then I comment that line and uncomment next one: alert($.cookie("tabNumber")); So, I select tab, click button, get dialog message "2", and after that tab in position 1 became active. Why?? In both cases I call 'select' method with parameter 2... I know I can use aliases for tabs, but I want to understate why my code doesn't work properly.

    Read the article

  • Facebook Connect: Permissions Error [200] using "stream.publish" with PHP

    - by Sarah
    Hi all, I've been implementing Facebook Connect into a site and am using both the PHP API, to allow me to automatically post data to a user's wall, as well as the JS API, for manual posting, permissions dialogs, etc. When the user uses the manual method it works 100%...the popups are displayed correctly, and the data gets posted to their wall properly. However, when I try to use the PHP API I am getting inconsistencies. When I try posting automatically using the PHP API using one account it works perfect, every time. But for some other accounts it never works, always returning "Permissions error." The error code is 200, and I've checked the Facebook API documentation and it's pretty vague, saying only "Permissions error. The application does not have permission to perform this action." But that's not true, since it works on some accounts and doesn't work on others. First, I've made sure that the users in question have enabled the extended permission "publish_stream" and that the manual method using the JS API works, so it doesn't seem to be a problem with those specific permissions. There are no apparent differences between the Facebook accounts I've used. So my question is has anyone run into this problem and found a solution to it? Is there some sort of other permission setting that users must enable for this to work? I've been searching Google and these forums but have not found any solution. The request I am sending is: (Note: The content/image url/link url are not the actual data I use) $attachment = array( 'caption' => '{*actor*} commented on <title> "<comment>"', 'media' => array( array( 'type' => 'image', 'src' => 'http://www.test.com/image.jpg', 'href' => 'http://www.test.com' ) ) ); $Facebook->api_client->stream_publish('', $attachment); Thanks, Sarah

    Read the article

  • Exporting and reformatting data out of MS Excel

    - by Matt H
    I have a huge Excel spreadsheet containing telephone calling rates to a number of different countries. The format of the columns is: Country, RateLocality, Prefixes, Rate, Wholesale e.g. Afganistan, Default, 93;930;931;9321;9322;9323;9324;9325;9326;9327;9328;9329;9331;9332;9333;9334;9335;9336;9337;9338;9339;9341;9342;9343;9344;9345;9346;9347;9348;9349;9351;9352;9353;9354;9355;9356;9357;9358;9359;9361;9362;9363;9364;9365;9366;9367;9368;9369;9371;9372;9373;9374;9376;938;939; $ 1.023, $0.455 These rates change every so often and I need to get them into another system that can import them using CSV. The eventual format is: LD PREPEND CODE ie. 00 or 011,CountryCode,Area Code,Comment,Connect Cost,Included Seconds,Per Minute Cost,Pricelist,Increment So to convert that above line I'd have 00,"Afganistan",93,"Default",1.023,60,1.023,10 00,"Afganistan",931,"Default",1.023,60,1.023,10 ... 00,"Afganistan",939,"Default",1.023,60,1.023,10 Where 00, 60 and 10 are hard coded and merged with the other data from excel. How can I export this data into the required format given that I need to reformat it as it goes. Should I export to XML and use XSLT or some other process to massage the data into CSV? If that is the case, how do I do it simply and quickly.

    Read the article

  • The "correct" way of using multilingual support

    - by Felipe Athayde
    I just began working with ASP.NET and I'm trying to bring with me some coding standards I find healthy. Among such standards there is the multilingual support and the use of resources for easily handling future changes. Back when I used to code desktop applications, every text had to be translated, so it was a common practice to have the language files for every languages I would want to offer to the customers. In those files I would map every single text, from button labels to error messages. In ASP.NET, with the help of Visual Studio, I have the resort of using the IDE to generate such Resource Files (from Tools - Generate Local Resource), but then I would have to fill my webpages with labels - at least that is what I've learned from articles and tutorials. However, such approach looks a bit odd and I'm tempted to guess it doesn't smell that good as well. Now to the question: 1) Should I keep every single text in my website as labels and manage its contents in the resource files? It looks/feels odd specially when considering a text with several paragraphs. 2) Whenever I add/remove something, e.g.: a button, to an aspx file I would have to add it to the resource file as well, because generating the resource file again would simply override all my previous changes to it. That doesn't feel like a reusable code at all for me. Any comment suggestion on this one? Perhaps I got it all wrong from tutorials as it doesn't seem like a standardized matter - specially if it required recompiling the entire application whenever some change has to be done.

    Read the article

  • Django Many-to-Many Question

    - by DZ
    My questions seems like a common problem that when I have seen any questions on it is never really asked right or not answered. So Im going to try to get the question right, and maybe someone knows how to resolve the issue, or correct my understanding. The problem: When you have a many-to-many relation ship (related_name not through) and you are trying to use the admin interface you are required to input one of the rleationships even though it does not have to exsist for you to create the first entry. Meaning you have to assign a group to an event to create the group. Wow that sounds complicated. So I can see why the question is not getting answered. Lets try the non code explanation example... First and important versions: Django 1.1.1 Phython 2.6 So I have a model where I created a many-to-many realtionship and Im using the related_name Im creating an app that is an event organizer, for simplicty lets say events although they could be anytype). For this first post Im going to stay away from the code and just try to explain. A few keys: (explaining comment) ** - many-to-many So in the model we have 1) The Main Event (this is main model) 2) Groups (link to events and their can be many events for a group) a) Events** I have simplified this example a little becuase I recognize that what does it matter. Just create the event first... But there are specific varations where that will not work. What the many-to-many related_name does it created another table with the indecies of the two other tables. Nothing says that this extra table HAS to be populated. Becuase if I look in the database and work within myPHPadmin I can create a group with out registering an event, since the connection between the two is a seperate table the DB does not care. How do I make the admin interface this realize it? Ok I know thats a lot so I hope I have explained it clearly. Thank you anyone for your comments/thoughts/advice

    Read the article

  • Solving quadratic programming using R

    - by user702846
    I would like to solve the following quadratic programming equation using ipop function from kernlab : min 0.5*x'*H*x + f'*x subject to: A*x <= b Aeq*x = beq LB <= x <= UB where in our example H 3x3 matrix, f is 3x1, A is 2x3, b is 2x1, LB and UB are both 3x1. edit 1 My R code is : library(kernlab) H <- rbind(c(1,0,0),c(0,1,0),c(0,0,1)) f = rbind(0,0,0) A = rbind(c(1,1,1), c(-1,-1,-1)) b = rbind(4.26, -1.73) LB = rbind(0,0,0) UB = rbind(100,100,100) > ipop(f,H,A,b,LB,UB,0) Error in crossprod(r, q) : non-conformable arguments I know from matlab that is something like this : H = eye(3); f = [0,0,0]; nsamples=3; eps = (sqrt(nsamples)-1)/sqrt(nsamples); A=ones(1,nsamples); A(2,:)=-ones(1,nsamples); b=[nsamples*(eps+1); nsamples*(eps-1)]; Aeq = []; beq = []; LB = zeros(nsamples,1); UB = ones(nsamples,1).*1000; [beta,FVAL,EXITFLAG] = quadprog(H,f,A,b,Aeq,beq,LB,UB); and the answer is a vector of 3x1 equals to [0.57,0.57,0.57]; However when I try it on R, using ipop function from kernlab library ipop(f,H,A,b,LB,UB,0)) and I am facing Error in crossprod(r, q) : non-conformable arguments I appreciate any comment

    Read the article

  • How to write a JOIN statement to combine data from disparate tables

    - by Amarundo
    I have the following 2 procedures that I use as my source for a report. As of now, I'm presenting 2 different tables in my SQL Server Reporting Services 2008 R2 report, because it doesn't let me put them together as they belong to 2 different data sets. I want to present them in a single table, but I have not been successful trying to use JOIN here. How do I do that? NOTE: cName in IAgentQueueStats corresponds to UserId in AgentActivityLog. /*** Aggregate values for Call Center Agents for calls, talk and hold time ***/ /*** The detail/row values is per 30-minute interval ***/ ALTER PROCEDURE [dbo].[sp_IAgentQueueStats_OnlyCalls_Grouped] @p_StartDate datetime, @p_EndDate datetime, @p_Agents varchar(8000) AS SELECT [cName] ,sum([nAnswered]) SumNAnswered ,sum([nAnsweredAcd]) SumNAnsweredAcd ,sum([tTalkAcd]) SumTTalkAcd ,sum([nHoldAcd]) SumNHoldAcd ,sum([tHoldAcd]) SumTHoldAcd ,sum([tAcw]) SumTAcw FROM [I3_IC].[dbo].[IAgentQueueStats] WHERE dIntervalStart between @p_StartDate and DATEADD(s, 86400-1, @p_EndDate) AND CHARINDEX ( cName ,@p_Agents)> 0 AND cReportGroup <> '*' AND cHKey3 = '*' and cHKey4 ='*' AND nEnteredAcd > 0 AND cReportGroup <> 'CCFax Email' GROUP BY cName And here is the second one: /*** Aggregate values for Call Center Agents for status/activity time ***/ /*** The detail/row values is per start-time/end-time ***/ ALTER PROCEDURE [dbo].[sp_AgentActivity_Grouped] @p_StartDate datetime, @p_EndDate datetime, @p_Agents varchar(8000) AS SELECT [UserId],[StatusCategory],SUM([StateDuration]) [StatusDuration] FROM ( SELECT [UserId] ,[StatusGroup] ,[StatusKey] , CASE [StatusKey] WHEN 'Available' THEN 'Productive' WHEN 'Follow Up' THEN 'Productive' WHEN 'Campaign Call' THEN 'Productive' WHEN 'Awaiting Callback' THEN 'Productive' WHEN 'In a Meeting' THEN 'Not Your Fault' WHEN 'Project Work' THEN 'Not Your Fault' WHEN 'At a Training Session'THEN 'Not Your Fault' WHEN 'System Issues' THEN 'Not Your Fault' WHEN 'Test' THEN 'Not Your Fault' WHEN 'At Lunch' THEN 'Non Productive' WHEN 'Available, Forward' THEN 'Non Productive' WHEN 'Available, Follow-Me' THEN 'Non Productive' WHEN 'At Play' THEN 'Non Productive' WHEN 'AcdAgentNotAnswering' THEN 'Non Productive' WHEN 'Do Not Disturb' THEN 'Non Productive' WHEN 'Available, No ACD' THEN 'Non Productive' WHEN 'Away from desk' THEN 'Non Productive' ELSE [StatusKey] END StatusCategory ,stateduration FROM [I3_IC].[dbo].[AgentActivityLog] WHERE [StatusDateTime] between @p_StartDate and DATEADD(s, 86400-1, @p_EndDate) AND CHARINDEX ( [UserId] ,@p_Agents)> 0 AND [StatusKey] not in ('Gone Home','Out of the Office','On Vacation','Out of Town') ) a GROUP BY [UserId],[StatusCategory] ORDER BY [UserId], [StatusCategory] desc BTW, if I take some time to comment/reply on your posts, it's not lack of interest, but of understanding...

    Read the article

< Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >