Search Results

Search found 123 results on 5 pages for 'rp'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • #mvvmlight V4 for Windows 8 RP is available

    - by Laurent Bugnion
    I took a moment out of a very busy weekend to publish an update to MVVM Light for Windows 8 Release Preview. You can download the DLLs from the Codeplex site. Or, if you use Nuget, you can update the MVVM Light package, which will install the newest DLLs. For more information about Nuget, visit Nuget.org as well as the MVVM Light Nuget page. Note: I also took the occasion to fix an issue where the DLLs for the .NET 4 framework were not signed. The DLLs contained in this package are properly signed. As usual, feedback is very welcomed! Happy coding Laurent   Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn

    Read the article

  • Windows 8 RP: Sync Apps' list

    - by Tural Teyyuboglu
    I'm testing windows 8 RP. Installed tens of apps from market. What I wanna know is, is there any way to save (or maybe sync with windows live account) installed app list, and install these saved applications in future - RTM version of OS? I mean, somehing like on Apples' devices - icloud features function that I'm talking about. You can install apps on iPhone and sync with iCloud account. Then you can re-install these apps on another device, which signed in with your login into icloud.

    Read the article

  • Wi-Fi performance in Windows 8 RP on a MacBook Air (mid 2011)

    - by Steven Lu
    I was able to install the Boot Camp Windows software using the executable that it provided, and there are no unrecognized or unknown devices in Device Manager. Wi-Fi works but it seems to be limited to an extremely slow 1.5Mbits. Network Center reports an 802.11n connection (at 65Mbps usually) but transfers never reach above about 200kB/s. Being limited to 1/20th of the connection speed of my internet service is quite frustrating. Does anybody experience the same issue? I have been trying to identify the Broadcom Wi-Fi chipset and a driver that I could try to upgrade to but I have made very little progress on Google on this front.

    Read the article

  • calculate AUC (GAM) in R [migrated]

    - by ahmad
    I used the following script to calculate AUC in R: library(mgcv) library(ROCR) library(AUC) data1=read.table("d:\\2005.txt", header=T) GAM<-gam(tuna ~ s(chla)+s(sst)+s(ssha),family=binomial, data=data1) gampred<- predict(GAM, type="response") rp <- prediction(gampred, data1$tuna) auc <- performance( rp, "auc")@y.values[[1]] auc roc <- performance( rp, "tpr", "fpr") plot( roc ) But when I was running the script, the result is: **rp <- prediction(gampred, data1$tuna) Error in prediction(gampred, data1$tuna) : Format of predictions is invalid. > > auc <- performance( rp, "auc")@y.values[[1]] Error in performance(rp, "auc") : object 'rp' not found > auc function (x, min = 0, max = 1) { if (any(class(x) == "roc")) { if (min != 0 || max != 1) { x$fpr <- x$fpr[x$cutoffs >= min & x$cutoffs <= max] x$tpr <- x$tpr[x$cutoffs >= min & x$cutoffs <= max] } ans <- 0 for (i in 2:length(x$fpr)) { ans <- ans + 0.5 * abs(x$fpr[i] - x$fpr[i - 1]) * (x$tpr[i] + x$tpr[i - 1]) } } else if (any(class(x) %in% c("accuracy", "sensitivity", "specificity"))) { if (min != 0 || max != 1) { x$cutoffs <- x$cutoffs[x$cutoffs >= min & x$cutoffs <= max] x$measure <- x$measure[x$cutoffs >= min & x$cutoffs <= max] } ans <- 0 for (i in 2:(length(x$cutoffs))) { ans <- ans + 0.5 * abs(x$cutoffs[i - 1] - x$cutoffs[i]) * (x$measure[i] + x$measure[i - 1]) } } return(as.numeric(ans)) } <bytecode: 0x03012f10> <environment: namespace:AUC> > > roc <- performance( rp, "tpr", "fpr") Error in performance(rp, "tpr", "fpr") : object 'rp' not found > plot( roc ) Error in levels(labels) : argument "labels" is missing, with no default** Can anybody help me to solve this problem? Thank you in advance.

    Read the article

  • Is there a way to save the installed app list on Windows 8 RP?

    - by Tural Teyyuboglu
    I'm testing Windows 8 RP. Installed tens of apps from market. What I wanna know is, is there any way to save (or maybe sync with Windows Live account) installed app list, and install these saved applications in future - RTM version of OS? I mean, somehing like on Apples' devices - icloud features function that I'm talking about. You can install apps on iPhone and sync with iCloud account. Then you can re-install these apps on another device, which signed in with your login into icloud.

    Read the article

  • Configure Active Relying Party STS to Trust Multiple Identity Provider STSes

    - by CodeChef
    I am struggling with the configuration for the scenario below. I have a custom WCF/WIF STS (RP-STS) that provides security tokens to my WCF services RP-STS is an "Active" STS RP-STS acts as a claims transformation STS RP-STS trusts tokens from many customer-specific identity provider STSes (IdP-STS) When a WCF Client connects to a service it should authenticate with it's local IdP-STS The reading that I've done describes this as Home Realm Discovery. HRD is usually described within the context of web applications and Passive STSes. My questions is, for my situation, does the logic for choosing an IdP-STS endpoint belong in the RP-STS or the WCF Client application? I thought it belonged in the RP-STS, but I cannot figure out the configuration to make this happen. RP-STS has a single endpoint, but I cannot figure out how to add more than one trusted issuer per endpoint. Any guidance on this would be very appreciated (I'm out of useful keywords to Google.) Also, if I'm way off please offer alternative approaches. Thanks!

    Read the article

  • Whats wrong with this piece of code?

    - by cambr
    vector<int>& mergesort(vector<int> &a) { if (a.size() == 1) return a; int middle = a.size() / 2; vector<int>::const_iterator first = a.begin(); vector<int>::const_iterator mid = a.begin() + (middle - 1); vector<int>::const_iterator last = a.end(); vector<int> ll(first, mid); vector<int> rr(mid, last); vector<int> l = mergesort(ll); vector<int> r = mergesort(rr); vector<int> result; result.reserve(a.size()); int dp = 0, lp = 0, rp = 0; while (dp < a.size()) { if (lp == l.size()) { result[dp] = (r[rp]); rp++; } else if (rp == r.size()) { result[dp] = (l[lp]); lp++; } else if (l[lp] < r[rp]) { result[dp] = (l[lp]); lp++; } else { result[dp] = (r[rp]); rp++; } dp++; } a = result; return a; } It compiles coorectly but while execution, I am getting: This application has requested the runtime to end it in an unusual way. This is a weird error. Is there something that is fundamentally wrong with the code?

    Read the article

  • Problem with Mergesort in C++

    - by cambr
    vector<int>& mergesort(vector<int> &a) { if (a.size() == 1) return a; int middle = a.size() / 2; vector<int>::const_iterator first = a.begin(); vector<int>::const_iterator mid = a.begin() + (middle - 1); vector<int>::const_iterator last = a.end(); vector<int> ll(first, mid); vector<int> rr(mid, last); vector<int> l = mergesort(ll); vector<int> r = mergesort(rr); vector<int> result; result.reserve(a.size()); int dp = 0, lp = 0, rp = 0; while (dp < a.size()) { if (lp == l.size()) { result[dp] = (r[rp]); rp++; } else if (rp == r.size()) { result[dp] = (l[lp]); lp++; } else if (l[lp] < r[rp]) { result[dp] = (l[lp]); lp++; } else { result[dp] = (r[rp]); rp++; } dp++; } a = result; return a; } It compiles correctly but while execution, I am getting: This application has requested the runtime to end it in an unusual way. This is a weird error. Is there something that is fundamentally wrong with the code?

    Read the article

  • How to make my robot move in a rectangular path along the black tape?

    - by Sahat
    I am working on a robot, it's part of the summer robotics workshop in our college. We are using C-STAMP micro controllers by A-WIT. I was able to make it move, turn left, turn right, move backward. I have even managed to make it go along the black tape using a contrast sensor. I send the robot at 30-45 degrees toward the black tape on the table and it aligns itself and starts to move along the black tape. It jerks a little, probably due to my programming logic below, it's running a while loop and constantly checking if statements, so it ends up trying to turn left and right every few milliseconds, which explains the jerking part. But it's okay, it works, not as smooth as I want it to work but it works! Problem is that I can't make my robot go into a rectangular path of the black tape. As soon as it reaches the corner it just keeps going straight instead of making a left/right turn. Here's my attempt. The following code is just part of the code. My 2 sensors are located right underneath the robot, next to the front wheel, almost at the floor level. It has "index" value ranging from 0 to 8. I believe it's 8 when you have a lot of light coming into the sensor , and 0 when it's nearly pitch black. So when the robot moves into the black-tape-zone, the index value drops, and based on that I have an if-statement telling my robot to either turn left or right. To avoid confusion I didn't post the entire source code, but only the logical part responsible for the movement of my robot along the black tape. while(1) { // don't worry about these. // 10 and 9 represent Sensor's PIN location on the motherboard V = ANALOGIN(10, 1, 0, 0, 0); V2 = ANALOGIN(9, 1, 0, 0, 0); // i got this "formula" from the example in my Manual. // V stands for voltage of the sensor. // it gives me the index value of the sensor. 0 = darkest, 8 = lightest. index = ((-(V - 5) / 5) * 8 + 0.5); index2 = ((-(V2 - 5) / 5) * 8 + 0.5); // i've tweaked the position of the sensors so index > 7 is just right number. // the robot will move anywhere on the table just fine with index > 7. // as soon as it drops to or below 7 (i.e. finds black tape), the robot will // either turn left or right and then go forward. // lp & rp represent left-wheel pin and right-wheel pin, 1 means run forever. // if i change it from 1 to 100, it will go forward for 100ms. if (index > 7 && index2 > 7) goForward(lp, rp, 1); if (index <= 7) { turnLeft(lp, rp, 1); goForward(lp, rp, 1); // this is the tricky part. i've added this code last minute // trying to make my robot turn, but i didn't work. if (index > 4) { turnLeft(lp, rp, 1); goForward(lp, rp, 1); } } else if (index2 <= 7) { turnRight(lp, rp, 1); goForward(lp, rp, 1); // this is also the last minute addition. it's same code as above // but it's for the 2nd sensor. if (index2 > 4) { turnRight(lp, rp, 1); goForward(lp, rp, 1); } } I've spent the entire day trying to figure it out. I've pretty much exhausted all avenues. Asking for the solution on stackoverflow is my very last option now. Thanks in advance! If you have any questions about the code, let me know, but comments should be self-explanatory.

    Read the article

  • Is OpenID this easy to hack or am I missing something?

    - by David
    For those Relying Parties (RP) that allow the user to specify the OpenID Provider (OP), it seems to me than anyone that knows are guesses your OpenID could Enter their own OP address. Have it validate them as owning your OpenID. Access your account on the RP. The RP "could" take measures to prevent this by only allowing the OpenID to validated by the original OP, but... How do you know they do? You could never change your OP without also changing your OpenID.

    Read the article

  • Reusing Object does not work properly

    - by balexandre
    Hi guys, I'm reusing a created Object just to change a Date and the ordinal value, but at the end I get 6 objects exactly as the last. in other words, I'm adding the object as a Reference and I should add as a Value What should I inherit my Object to have the Copy() method ? RecurringPayment rp, copy; rp = new RecurringPayment { ... } payments.Add(rp); // add first object copy = rp; // Copy the original element for (int i = 1; i <= 5; i++) { copy.NextPaymentDate = copy.NextPaymentDate.AddDays(copy.RecurringTime * 7); copy.OrderOrdinal = copy.OrderOrdinal + 1; payments.Add(copy); // add 5 more with X weeks ahead } Thank you

    Read the article

  • Free CodeRush Express: worth the time?

    - by rp
    DevExpress has announced a free express version of CodeRush (for C# and VB.Net). http://blogs.microsoft.co.il/blogs/kim/archive/2008/10/28/coderush-for-free-coderush-xpress-for-visual-studio-announced.aspx I've read about CodeRush Pro and suspect that it is probably worth the money--but I've always had other things I needed to spend the money on. Is CodeRush Express worth the time and effort to download and learn to use. It's help file didn't install and I'm a little frustrated as to how to use it. Thanks, rp

    Read the article

  • Roadmap for Thinktecture IdentityServer

    - by Your DisplayName here!
    I got asked today if I could publish a roadmap for thinktecture IdentityServer (idrsv in short). Well – I got a lot of feedback after B1 and one of the biggest points here was the data access layer. So I made two changes: I moved to configuration database access code to EF 4.1 code first. That makes it much easier to change the underlying database. So it is now just a matter of changing the connection string to use real SQL Server instead of SQL Compact. Important when you plan to do scale out. I included the ASP.NET Universal Providers in the download. This adds official support for SQL Azure, SQL Server and SQL Compact for the membership, roles and profile features. Unfortunately the Universal Provider use a different schema than the original ASP.NET providers (that sucks btw!) – so I made them optional. If you want to use them go to web.config and uncomment the new provider. Then there are some other small changes: The relying party registration entries now have added fields to add extra data that you want to couple with the RP. One use case could be to give the UI a hint how the login experience should look like per RP. This allows to have a different look and feel for different relying parties. I also included a small helper API that you can use to retrieve the RP record based on the incoming WS-Federation query string. WS-Federation single sign out is now conforming to the spec. I made certificate based endpoint identities for SSL endpoints optional. This caused some problems with configuration and versioning of existing clients. I hope I can release the RC in the next days. If there are no major issues, there will be RTM very soon!

    Read the article

  • WCF: WTF! Does WCF raise the bar or just the complexity level?

    - by rp
    I understand the value of the three-part service/host/client model offered by WCF. But is it just me or does it seem like WCF took something pretty direct and straightforward (the ASMX model) and made a mess out of it? Is there an alternative to using SvcUtil's command line step back in time to generate the proxy? With ASMX services a test harness was automatically provided; is there a good alternative today with WCF? I appreciate that the WS* stuff is more tightly integrated with WCF and hope to find some payoff for WCF there, but geeze, otherwise I'm perplexed. Also, the state of books available for WCF is abysmal at best. Juval Lowy, a superb author, has written a good O'Reilly reference book "Programming WCF Services" but it doesn't do that much (for me anyway) for learning now to use WCF. That book's precursor (and a little better organized, but not much, as a tutorial) is Michele Leroux Bustamante's Learning WCF. It has good spots but is outdated in place and its corresponding Web site is gone. Do you have good WCF learning references besides just continuing to Google the bejebus out of things? Thanks, rp

    Read the article

  • Is there a faster way to parse through a large file with regex quickly?

    - by Ray Eatmon
    Problem: Very very, large file I need to parse line by line to get 3 values from each line. Everything works but it takes a long time to parse through the whole file. Is it possible to do this within seconds? Typical time its taking is between 1 minute and 2 minutes. Example file size is 148,208KB I am using regex to parse through every line: Here is my c# code: private static void ReadTheLines(int max, Responder rp, string inputFile) { List<int> rate = new List<int>(); double counter = 1; try { using (var sr = new StreamReader(inputFile, Encoding.UTF8, true, 1024)) { string line; Console.WriteLine("Reading...."); while ((line = sr.ReadLine()) != null) { if (counter <= max) { counter++; rate = rp.GetRateLine(line); } else if(max == 0) { counter++; rate = rp.GetRateLine(line); } } rp.GetRate(rate); Console.ReadLine(); } } catch (Exception e) { Console.WriteLine("The file could not be read:"); Console.WriteLine(e.Message); } } Here is my regex: public List<int> GetRateLine(string justALine) { const string reg = @"^\d{1,}.+\[(.*)\s[\-]\d{1,}].+GET.*HTTP.*\d{3}[\s](\d{1,})[\s](\d{1,})$"; Match match = Regex.Match(justALine, reg, RegexOptions.IgnoreCase); // Here we check the Match instance. if (match.Success) { // Finally, we get the Group value and display it. string theRate = match.Groups[3].Value; Ratestorage.Add(Convert.ToInt32(theRate)); } else { Ratestorage.Add(0); } return Ratestorage; } Here is an example line to parse, usually around 200,000 lines: 10.10.10.10 - - [27/Nov/2002:16:46:20 -0500] "GET /solr/ HTTP/1.1" 200 4926 789

    Read the article

  • Active and Passive Federation in WIF

    - by user102533
    I am trying to understand the difference between Active and Passive federation in WIF. It appears that one would use an Active Federation if the Relying Party (RP) is a WCF Service instead of an ASP.NET application and a Passive Federation if the RP is an ASP.NET application. Is this accurate? So, in a scenario in which an ASP.NET application uses a WCF in the backend, the MS articles suggest using a 'bootstrap' security token that is obtained by the ASP.NET app using an ActAs STS and this token is used to authenticate with the WCF. In this scenario, it appears that we are doing a combination of Active (user - STS - ASP.NET RP) and Passive (ASP.NET - ActAs STS - WCF) Federation?

    Read the article

  • Why can't I reclaim my dynamically allocated memory using the "delete" keyword?

    - by synaptik
    I have the following class: class Patient { public: Patient(int x); ~Patient(); private: int* RP; }; Patient::Patient(int x) { RP = new int [x]; } Patient::~Patient() { delete [] RP; } I create an instance of this class on the stack as follows: void f() { Patient p(10); } Now, when f() returns, I get a "double free or corruption" error, which signals to me that something is attempted to be deleted more than once. But I don't understand why that would be so. The space for the array is created on the heap, and just because the function from inside which the space was allocated returns, I wouldn't expect the space to be reclaimed. I thought that if I allocate space on the heap (using the new keyword), then the only way to reclaim that space is to use the delete keyword. Help! :)

    Read the article

  • script to recursively check for and select dependencies

    - by rp.sullivan
    I have written a script that does this but it is one of my first scripts ever so i am sure there is a better way:) Let me know how you would go about doing this. I'm looking for a simple yet efficient way to do this. Here is some important background info: ( It might be a little confusing but hopefully by the end it will make sense. ) 1) This image shows the structure/location of the relevant dirs and files. 2) The packages.file located at ./config/default/config/packages is a space delimited file. field5 is the "package name" which i will call $a for explanations sake. field4 is the name of the dir containing the $a.dir i will call $b field1 shows if the package is selected or not, "X"(capital x) for selected and "O"(capital o as in orange) for not selected. Here is an example of what the packages.file might contain: ... X ---3------ 104.800 database gdbm 1.8.3 / base/library CROSS 0 O -1---5---- 105.000 base libiconv 1.13.1 / base/tool CROSS 0 X 01---5---- 105.000 base pkgconfig 0.25 / base/tool CROSS 0 X -1-3------ 105.000 base texinfo 4.13a / base/tool CROSS DIETLIBC 0 O -----5---- 105.000 develop duma 2_5_15 / base/development CROSS NOPARALLEL 0 O -----5---- 105.000 develop electricfence 2_4_13 / base/development CROSS 0 O -----5---- 105.000 develop gnupth 2.0.7 / extra/development CROSS NOPARALLEL FPIC-QUIRK 0 ... 3) For almost every package listed in the "packages.file" there is a corresponding ".cache file" The .cache file for package $a would be located at ./package/$b/$a/$a.cache The .cache files contain a list of dependencies for that particular package. Here is an example of one of the .cache files might look like. Note that the dependencies are field2 of lines containing "[DEP]" These dependencies are all names of packages in the "package.file" [TIMESTAMP] 1134178701 Sat Dec 10 02:38:21 2005 [BUILDTIME] 295 (9) [SIZE] 11.64 MB, 191 files [DEP] 00-dirtree [DEP] bash [DEP] binutils [DEP] bzip2 [DEP] cf [DEP] coreutils ... So with all that in mind... I'm looking for a shell script that: From within the "main dir" Looks at the ./config/default/config/packages file and finds the "selected" packages and reads the corresponding .cache Then compiles a list of dependencies that excludes the already selected packages Then selects the dependencies (by changing field1 to X) in the ./config/default/config/packages file and repeats until all the dependencies are met Note: The script will ultimately end up in the "scripts dir" and be called from the "main dir". If this is not clear let me know what need clarification. For those interested I'm playing around with T2 SDE. If you are into playing around with linux it might be worth taking a look.

    Read the article

  • Thinktecture.IdentityServer RC

    - by Your DisplayName here!
    I just uploaded the RC of IdentityServer to Codeplex. This release is feature complete and if I don’t get any bug reports this is also pretty much the final V1. Changes from B1 The configuration data access is now based on EF 4.1 code first. This makes it much easier to use different data stores. For RTM I will also provide a SQL script for SQL Server so you can move the configuration to a separate machine (e.g. for load balancing scenarios). I included the ASP.NET Universal Providers in the download. This adds official support for SQL Azure, SQL Server and SQL Compact for the membership, roles and profile features. Unfortunately the Universal Provider use a different schema than the original ASP.NET providers (that sucks btw!) – so I made them optional. If you want to use them go to web.config and uncomment the new provider. The relying party registration entries now have added fields to add extra data that you want to couple with the RP. One use case could be to give the UI a hint how the login experience should look like per RP. This allows to have a different look and feel for different relying parties. I also included a small helper API that you can use to retrieve the RP record based on the incoming WS-Federation query string. WS-Federation single sign out is now conforming to the spec. Certificate based endpoint identities for SSL endpoints are optional now. Added a initial configuration “wizard”. This sets up the signing certificate, issuer URI and site title on the first run. Installation This is still a “developer” release – that means it ships with source code that you have to build it etc. But from that point it should be a little more straightforward as it used to be: Make sure SSL is configured correctly for IIS Map the WebSite directory to a vdir in IIS Run the web site. This should bring up the initial configuration Make sure the worker process account has access to the signing certificate private key Make sure all your users are in the “IdentityServerUsers” role in your role store. Administrators need the “IdentityServerAdministrators” role That should be it. A proper documentation will be hopefully available soon (any volunteers?). Please provide feedback! thanks!

    Read the article

  • Could some one please explain the various proxy configuration scenarios?

    - by RP.
    I am working on a client application in C# which does a various kinds of communication with a server( eg: uploads, downloads etc ). We have a legacy system which does the same functionality and we get in to proxy configuration related issues frequently.It uses the settings from internet explorer network settings. Most of the time these are due to specific proxy configuration( Eg: Proxy auto-config etc ). I am trying to understand the various scenarios used in corporate environments for proxy configurations. Could some one please explain the various proxy configuration scenarios?

    Read the article

  • PHP script keeps doing mmap/munmap

    - by Aurélien Momow
    Hello, My PHP script contains a loop, which does nothing much more than echoing and dereferencing pointers (like in $tab[$othertab[$i]]- stuff). It was working great until yesterday, when this script starting being VERY slow (like 50 times slower than before). After using strace, i figured out that 90% of the time, the script does mmap/munmap. Here is a random portion of the strace log : mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0152b000 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac014ea000 Here is the result of the strace -c command : % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 82.77 0.004092 0 13542 mmap 9.69 0.000479 0 3642 write 7.54 0.000373 0 13541 munmap 0.00 0.000000 0 100 read 0.00 0.000000 0 88 poll 0.00 0.000000 0 25 4 access ------ ----------- ----------- --------- --------- ---------------- 100.00 0.004944 30938 4 total Here is the php script : function affAnnonce($tabAnnonces, $isDoublon = 0) { GLOBAL $db, $base, $tabDomaine, $doublon, $traduction, $tab_contrat, $tab_emploi, $tab_categ, $tab_metier, $tab_region, $tab_departement, $tab_secteur, $tab_experience, $calc_all, $tabLangues, $tabLanguesNiveau, $tabNoAffAnnonce, $tabHisto; foreach($tabAnnonces AS $tmp) { if (in_array($tmp['id'], $tabNoAffAnnonce) === true) { continue; } $value->host = "../"; foreach($tabDomaine AS $domaine => $valeur) { if ($domaine == $tmp['domaine']) { $value->host = $valeur->host; break; } } // Ordre // secteur;metier;contrat;emploi;region;langues;domaine $tabPushModif = array(); if ($tmp['push_preview'] != '') { $tabPushModif = explode(';', $tmp['push_preview']); $tabPushModif['secteur'] = $tabPushModif[0]; $tabPushModif['metier'] = $tabPushModif[1]; $tabPushModif['contrat'] = $tabPushModif[2]; $tabPushModif['id_emploi'] = $tabPushModif[3]; $tabPushModif['regions'] = $tabPushModif[4]; $tabPushModif['langues'] = $tabPushModif[5]; $tabPushModif['domaine'] = $tabPushModif[6]; } $infoSoc = get_nom_societe($tmp['id_societe']); $number = ($tmp['nb_preview_push'] != '' ? $tmp['nb_preview_push'] : '&nbsp;'); $secteurs = explode ("/", $tmp[secteur]); $sector = ""; $count_sect = count($secteurs); for ($k = 0; $k < $count_sect; $k++) { if ($secteurs[$k] != '') { $sector .= $tab_secteur[$secteurs[$k]].'/'; } } $tmp['poste'] = apresinsertion($tmp['poste']); $tmp['metier'] = $tab_metier[$tmp['metier']]; $tmp['region'] = $tab_region[$tmp['region']]; $tmp['departement'] = $tab_departement[$tmp['departement']]; $tmp['secteur'] = $sector; $tmp['id_contrat'] = $tmp['contrat']; $tmp['contrat'] = $tab_contrat[$tmp['contrat']]; $tmp['emploi'] = $tab_emploi[$tmp['id_emploi']]; $tmp['categorie'] = $tab_categ[$tmp['categorie']]; echo '<tr id="'.($isDoublon ? 'dbl_' : '').$tmp['id'].'"><td align="center" class="tdFirst nowrap dbl_'.$tmp['id'].'" id="aff_'.$tmp['id'].'"'; switch($tmp['affiche']) { case '0': echo ' bgcolor=#DBB7FF'; break; default : ; } echo '><a href=?op=annonces&search4='.$tmp[id].' target=_new>'.$tmp[id].'</a><br />'; echo '<a href="'.$value->host.'" target="blank">'.strtoupper($tmp['domaine']).'<br /><img src="../images/flags/'.$tmp['domaine'].'.png" border=0 align=middle></a>'; echo '</TD><TD align=center class=tdNext'; if ($tmp['filtre'] == 1) echo ' bgcolor=#FF0000'; echo '>'; if ($isDoublon) echo '<a id="'.$tmp['id'].'" class="doublon" href="#">DOUBLON</a> - '; if (($tmp[id_reponse] == 1) || ($tmp[id_reponse] == 2) || ($tmp[id_reponse] == 4) || ($tmp[id_reponse] == 5)) echo '<a href="javascript:voir_annonce(\''.$tmp['id'].'\', \''.$value->host.'\')" onMouseOver="showPreview('.$tmp['id'].');" onMouseOut="hidePreview('.$tmp['id'].');">'.$tmp['poste'].'</a>'; if ($tmp[id_reponse] == 3) echo '<a href="javascript:voir_annonce3(\''.$tmp['url_reponse'].'\')" onMouseOver="showPreview('.$tmp['id'].');" onMouseOut="hidePreview('.$tmp['id'].');">'.$tmp['poste'].'</a>'; if ($tmp['urgent'] == 1) print " - <font class=r_bold>urgent</font>"; if ($tmp['gold'] == 1) print " - <font class=g_bold>gold</font>"; if ($tmp['cvtheque'] == 1) print " - CVthèque"; if ($tmp['url_reponse'] != '' && $tmp['id_reponse'] != 3) { echo '<br /><br />URL - '; $len = strlen($tmp['url_reponse']); if ($len > 50) { $link = substr($tmp['url_reponse'], 0, 47).'...'; } else { $link = $tmp['url_reponse']; } echo '<a href="'.$tmp['url_reponse'].'" style="color: #666;" target="_blank">'.$link.'</a>'; } // Début du div ou sera placé l'annonce echo '<br /><div id="preview_'.$tmp['id'].'" name="preview_'.$tmp['id'].'" class="tdStyle1" style="z-index: 1000; display: none; position: fixed; left: 0px; top: 0px; padding: 4px; border: 1px solid #666; background: #fff; text-align: left; width: 777px;" onMouseOver="showPreview('.$tmp['id'].');" onMouseOut="hidePreview('.$tmp['id'].');">'; $tmp["url"] = substr($tmp["url"], 7); $id_modele = getIdModeleByAnnonce($tmp['id_societe'], $tmp["id"], $tmp['domaine']); $tmp["poste"] = mb_strtoupper($tmp["poste"]); $isFnh = isFnhAnnonce($tmp['id']); $logo = ""; if ($isFnh) { $logo_jpg = getFnhLogo(); $logo = "<img align='center' border='0' src='".$logo_jpg."' />"; } else { if ($id_modele > 0) { if ($tmp['id_reponse'] == 1) { $logo_gif = "../fichiers/societes/".$tmp['id_societe']."/".$id_modele.".gif"; if (file_exists($logo_gif)) { $logo = "<img align=center border=0 src=".$logo_gif.">"; } } else { $rep = "../fichiers/societes/".$tmp['id_societe']."/".$id_modele; $logo_jpg = $rep.".jpg"; $logo_swf = $rep.".swf"; $logo_gif = $rep.".gif"; if (file_exists($logo_jpg)) { $logo = "<img align=center border=0 src=".$logo_jpg.">"; } elseif (file_exists($logo_swf)) $logo = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="120" height="600"> <param name=movie value="'.$logo_swf.'"> <param name=quality value=high> <embed src="'.$logo_swf.'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="120" height="600"></embed> </object>'; elseif (file_exists($logo_gif)) { $logo = "<img align=center border=0 src=".$logo_gif.">"; } } } } if (strlen($logo) > 0 && strlen($tmp['url']) > 0) $logo = "<a href=http://".$tmp['url']." target=_blank>".$logo."</a>"; if (strlen($tmp['url_reponse']) <= 0) { $tmp['url_reponse'] = "../jobs/repondre_annonce.php?id=".$tmp['id']."\" onClick=\""; if ($tmp['contact_email'] == "") $tmp['url_reponse'] .= "alert('".$traduction->aff_word("repondre_courrier", $tabTrad['only_word']).'\n'.$tmp['societe'].'\n'.str_replace("<br />", '\n', ereg_replace("[\r\n\t]", "", $tmp['adresse']))."');"; else $tmp['url_reponse'] .= "popUp(this.href, 'scroll', 540, 400);"; $tmp['url_reponse'] .= "return false;"; } ?> <table width="775" cellspacing="0" cellpadding="0" border=0> <? if ($tmp['id_reponse'] != "2") { ?> <tr> <td width="575" align=center valign=top> <table width="535" border=0 cellspacing=0 cellpadding=2> <tr> <td colspan="2" class="nom_societe"><?=$tmp['societe']?></td> </tr> <tr> <td colspan="2"><hr size=1 color=#000000></td> </tr> <tr> <td colspan="2" align="right"><?=date_2fr($tmp["date_affichage"], 1)?></td> </tr> <tr> <td align="right" class=bold><?=$traduction->aff_word("pays")?>&nbsp;:</td> <td align="left"><?=$tmp['pays0']?></td> </tr> <? if ($tmp['region']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("region")?>&nbsp;:</td> <td align="left"><?=$tmp['region']?></td> </tr> <? } if ($tmp['departement']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("departement")?>&nbsp;:</td> <td align="left"><?=$tmp['departement']?></td> </tr> <? } if ($tmp['ville']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("ville")?>&nbsp;:</td> <td align="left"><?=$tmp['ville']?></td> </tr> <? } if ($tmp['debut']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("debut_travail")?>&nbsp;:</td> <td align="left"><?=$tmp['debut']?></td> </tr> <? } ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("type_contrat")?>&nbsp;:</td> <td align="left"><?=$tmp['contrat']?></td> </tr> <? if ($tmp['emploi']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("type_emploi")?>&nbsp;:</td> <td align="left"><?=$tmp['emploi']?></td> </tr> <? } if ($tmp['salaire']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("salaire")?>&nbsp;:</td> <td align="left"><?=$tmp['salaire']?></td> </tr> <? } if ($tmp['experience']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("experience_metier")?>&nbsp;:</td> <td align="left"><?=$tab_experience[$tmp['experience']]?></td> </tr> <? } if ($tmp['reference']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("reference")?>&nbsp;:</td> <td align="left"><?=$tmp['reference']?></td> </tr> <? } ?> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? if ($tmp['presentation']) { ?> <tr> <td valign=top align="right" class=bold><?=$traduction->aff_word("presentation")?>&nbsp;:</td> <td style="text-align: justify;"><?=$tmp['presentation']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } ?> <tr> <td valign="top" class=bold align="right"><?=$traduction->aff_word("poste")?>&nbsp;:</td> <td valign="top" class=titre_poste align=center><?=$tmp['poste']?></td> </tr> <tr> <td colspan=2>&nbsp;</td> </tr> <tr> <td valign="top" class=bold align="right"><?=$traduction->aff_word("description")?>&nbsp;:</td> <td style="text-align: justify;"><?=$tmp['description']?></td> </tr> <tr> <td width=100%>&nbsp;</td> <td width=405><hr size=1 color=#000000 width=405></td> </tr> <? if ($tmp['profil']) { ?> <tr> <td valign="top" align="right" class=bold><?=$traduction->aff_word("profil")?>&nbsp;:</td> <td valign="top" style="text-align: justify;"><?=$tmp['profil']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } if ($tmp['recommandation']) { ?> <tr> <td valign="top" align="left"></td> <td valign="top" style="text-align: justify;"><?=$tmp['recommandation']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } if ($tmp['contact_nom'] || $tmp['contact_prenom']) { ?> <tr> <td valign="top" align="right" class=bold><?=$traduction->aff_word("contact")?>&nbsp;:</td> <td valign="top" align="left"><?=$tmp['contact_prenom']?>&nbsp;<?=$tmp['contact_nom']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } ?> <? } elseif ($tmp['domaine'] != 'de') { ?> <tr> <td colspan=2><table width="755" align=right valign=top><tr><td><?=$tmp['presentation']?></td></tr></table></td> </tr> <? } ?> <tr> <td rowspan=6>&nbsp;</td> <td><a href="<?=$tmp['url_reponse']?>" target="_blank">&gt;&gt;&nbsp;<?=$traduction->aff_word("repondre_en_ligne")?></a></td> </tr> <tr> <td><a href="../jobs/affiche_imprime_annonce.php?id=<?=$tmp['id']?>" onClick="popUp(this.href, 'scroll', 540, 400);return false;" target="_blank">&gt;&gt;&nbsp;<?=$traduction->aff_word("version_imprimer")?></a></td> </tr> <tr> <td><a href="../jobs/send_friend_annonce.php?id=<?=$tmp['id']?>" onClick="popUp(this.href, 'clean', 400, 300);return false;" target="_blank">&gt;&gt;&nbsp;<?=$traduction->aff_word("envoi_ami")?></a></td> </tr> <tr> <td><a href="./affiche_liste.php?soc=<?=$tmp['societe_clean']?>">&gt;&gt;&nbsp;<?=$traduction->aff_word("toutes_offres")?> <?=$tmp['societe']?></a></td> </tr> <tr> <td><a href="../jobs/index.php">&gt;&gt;&nbsp;<?=$traduction->aff_word("nouvelle_recherche")?></a></td> </tr> <tr> <td><a href="../jobs/index.php" onClick="javascript:retour(); return false;">&lt;&lt;&nbsp;<?=$traduction->aff_word("retour")?></a></td> </tr> <? if ($tmp['id_reponse'] != "2") { ?> </table> </td> <td width="200" align=center class=black_bord valign=top> <table width="190" cellspacing=0 cellpadding=0 border=0> <tr> <td colspan="2" align="center" valign="top" class=bold><? if ($tmp['id_reponse'] != "5") { ?><br><? } ?><?=$logo?><br><br><?=$tmp['societe']?></td> </tr> <? if ($tmp['adresse']) { ?> <tr> <td align="center" colspan=2><?=$tmp['adresse']?></td> </tr> <tr> <td colspan=2>&nbsp;</td> </tr> <? } if ($tmp['contact_tel']) { ?> <tr> <td class=bold align=right><?=$traduction->aff_word("tel")?> :</td> <td align=center><?=$tmp['contact_tel']?></td> </tr> <? } if ($tmp['contact_fax']) { ?> <tr> <td class=bold align=right><?=$traduction->aff_word("fax")?> :</td> <td align=center><?=$tmp['contact_fax']?></td> </tr> <? } if ($tmp['url']) { ?> <tr> <td colspan=2 align=center><a href="http://<?=$tmp['url']?>" target="_blank"><?=$tmp['url']?></a></td> </tr> <? } ?> </table> </td> </tr> <? } ?> </table> <? echo '</div>'; // Fin du div ou sera placé l'annonce echo "</TD><TD align=center class=tdNext><b>".date_2fr($tmp['date_creation'], 1)."</b><br>".date_2fr($tmp['date_affichage'], 1); echo "</TD><TD align=center class=tdNext>".$tmp[societe]."<br>(<i><a href=".$value->host."login/login.php?login=".$infoSoc->email."&pass=".$infoSoc->password." target=_blank>".$infoSoc->nom."</a></i>)<br><a href=index.php?op=entreprise&ac=tableau_bord&id_societe=".$tmp['id_societe'].">compte</a></TD>"; $color = ''; switch($tmp[push_mail]) { case "0": $color = " bgcolor=#DBB7FF"; break; case "2": $color = " bgcolor=#CCCCCC"; break; default : ; } $type_rep = ""; switch ($tmp[id_reponse]) { case 1: $type_rep = "Standard"; break; case 2: $type_rep = "Chartée"; break; case 3: $type_rep = "Metamoteur"; break; case 4: $type_rep = "Reponse sur site"; break; case 5: $type_rep = "Semi-chartée"; break; } print " <td align=center class=tdNext> <table width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td align=center class=cadreBas>".$tmp['contrat']." - ".$tmp['emploi']."</td> <td $color align=center rowspan=4 width=40%> <a onclick=\"javascript:colorannonce(this, '#CFFFCF');\" href=?op=agentalertes&action=modify_push&amp;id_annonce=".$tmp[id]." target=_blank>Modifier push</a><br><br> <a onclick=\"sendPush(this, ".$tmp['id']."); return false;\" href=\"#\">Envoyer Push</a> </td> </tr> <tr> <td align=center class=cadreBas>".(strlen($tmp['metier']) > 0 ? $tmp['metier'] : '<font class=gris_i>'.$tmp['categorie'].'</font>')."</td> </tr> <tr> <td align=center class=cadreBas>".$tmp[secteur]."</td> </tr> <tr> <td align=center>".($number < 500 ? '<font color="red">' : ($number > 1500 ? '<font color="orange">' : '<font color="green">')).$number."</font></td> </tr> </table> </td> <td align=center class=tdNext> <table width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td align=center class=cadreBas>"; if (strlen($tabPushModif['regions']) > 0) { $tab = explode('/', $tabPushModif['regions']); foreach($tab AS $elem) { if (strlen($elem) <= 0) continue; if (strpos($elem, 'dep-') !== false) { echo $tab_departement[substr($elem, 4)]; $query_tmp = 'SELECT region FROM ref_departement WHERE id = "'.substr($elem, 4).'"'; $obj = $db->getObj($query_tmp); if ($obj) { echo ' - '.$tab_region[$obj->region]; $query_tmp = 'SELECT rp.code_pays FROM ref_pays rp INNER JOIN ref_region rr ON rr.pays = rp.id WHERE rr.id = "'.$obj->region.'"'; $obj = $db->getObj($query_tmp); if ($obj) echo ' ('.$obj->code_pays.')'; } } elseif (is_numeric($elem) === false) { echo '<font class=gris_i>'.$tmp['departement'].' - '.$tmp['region'].'</font> ('.$elem.')'; } else { echo '<font class=gris_i>'.$tmp['departement'].'</font> - '.$tab_region[$elem]; $query_tmp = 'SELECT rp.code_pays FROM ref_pays rp INNER JOIN ref_region rr ON rr.pays = rp.id WHERE rr.id = "'.$obj->region.'"'; $obj = $db->getObj($query_tmp); if ($obj) echo ' ('.$obj->code_pays.')'; } } } else echo $tmp['departement']." - ".$tmp['region']." (".$tmp['code_pays'].")"; echo "</td> </tr> <tr> <td align=center class=cadreBas>".$tmp[ville]."</td> </tr> <tr> <td align=center class=cadreBas>"; if (strlen($tabPushModif['metier']) > 0) { $tmpExp = array(); $tab = explode('/', $tabPushModif['metier']); foreach($tab AS $elem) { if (strlen($elem) <= 0) continue; $tmpMetier = explode('-', $elem); if (isset($tmpMetier[1])) { if (in_array($tmpMetier[1], $tmpExp) === true) continue; $tmpExp[] = $tmpMetier[1]; if ($tmpMetier[1] == $tmp['experience']) echo '<b>'.$tab_experience[$tmpMetier[1]].'</b>/'; else echo $tab_experience[$tmpMetier[1]].'/'; } } if (count($tmpExp) <= 0) echo '<font class=gris_i>'.$tab_experience[$tmp['experience']].'</font>'; } else echo $tab_experience[$tmp['experience']]; echo "</td> </tr> <tr> <td align=center>".$tabLangues[$tmp['id_langue']]->langue." - ".$tabLanguesNiveau[$tmp['id_langue_niveau']]->langue_niveau."</td> </tr> </table> </td> <td align=center class=tdNext> <table width=100% cellspacing=0 cellpadding=0 border=0> <tr> <td align=center class=cadreBas>$type_rep</td> </tr> <tr> <td align=center>".$tmp[compteur_vu]."&nbsp;/&nbsp;<a href=?op=gcand&ac=liste&id_annonce=".$tmp[id]."&statut=all target=_new>".$tmp[compteur_repondu]."</a></td> </tr> </table> </td> <td align=center class=tdNext> <table width=100% cellspacing=0 cellpadding=0 border=0> <tr> <td align=center class=cadreBas><a href=?op=annonces&ac=modifier&id_annonce=".$tmp['id']." target=_new>Modifier</a></td> </tr> <tr> <td align=center class=cadreBas><a href='' onClick=\"valid_delete('".$tmp['id']."'); return false;\">Supprimer</a></td> </tr> <tr> <td align=center><a href='' onClick='changeAff(".$tmp['id']."); return false;' id='changeAff_".$tmp['id']."'>".($tmp['affiche'] == 1 ? 'Mettre hors ligne' : 'Mettre en ligne')."</a></td> </tr> </table> </td> <td align=center class='tdNext gris'> <p style=\"color:#444;\"> &nbsp;".nl2br($tmp['push_res']).'</p>'; if (is_array($tabHisto[$tmp['id']])) { echo '<p style="color:#888; padding-top:5px;">'; foreach($tabHisto[$tmp['id']] as $histo) { echo $histo['type_modif'].' '.HumanDateTime($histo['date']).' par '.$histo['user']; if ($histo['new_annonce']) { echo ' [New ID : <a href="index.php?op=annonces&search4='.$histo['new_annonce'].'">'.$histo['new_annonce'].'</a>]'; } echo '<br />'; } echo '</p>'; } echo " </td> <td align=center>&nbsp;".$tmp['source']; if (!empty($tmp['source_ref'])) { echo '<br /><a href="redirect.php?site='.$tmp['source_ref'].'" target="_blank">Voir original</a>'; } echo '</td></tr>'; if (isset($doublon) && !$isDoublon) { $query2 = " SELECT a.*, rp.pays0, rp.code_pays FROM annonces a INNER JOIN ref_pays rp ON rp.id = a.pays WHERE a.id_societe = '".$tmp['id_societe']."' AND a.contrat = '".$tmp['id_contrat']."' AND a.domaine = '".$tmp['domaine']."' AND a.id != '".$tmp['id']."' AND ADDDATE(a.date_creation, INTERVAL 2 MONTH) > '".$tmp['date_creation']."' AND a.poste = \"".addslashes($tmp['poste'])."\" AND a.ville = \"".addslashes($tmp['ville'])."\" AND a.societe = \"".addslashes($tmp['societe'])."\" AND (a.id_societe != 1 OR (a.id_societe = 1 AND a.contact_email = \"".$tab_annonce['contact_email']."\")) ORDER BY a.id DESC"; $tabAnnonces2 = $db->getTab($query2); if (count($tabAnnonces2) > 0) { $tabId = array(); foreach($tabAnnonces2 as $annonc) { $tabId[] = $annonc['id']; } $tmpListAnnonceTab = annoncelist::getHistorique($tabId); $tmpTabHisto = createTabHisto($tmpListAnnonceTab); $tabHisto += $tmpTabHisto; //Additionne les 2 tableaux, contrairement à array_merge il garde les clés !! affAnnonce($tabAnnonces2, 1); foreach($tabAnnonces2 AS $tmpAnn) $tabNoAffAnnonce[] = $tmpAnn['id']; } } } } ?> Only this script is slow, all the others on the same server/domain/directory work great. On an other server, the same script works fine. The script takes up to 90% of CPU when running. Any ideas?

    Read the article

  • implement lazy loading in gwt for bigger widgets

    - by wingdings
    how do i implement lazy loading in gwt just like the one they have in http://www.smartclient.com/smartgwt/showcase/ and so i would like the whole page to be loaded first and and after that i want all widgets to load iv tried Gwt.runasync but it aint doing much also i tried using Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { loadWidgets(); } }); void loadWidgets() { hugeWidgets=load_some_huge_widgets(); RootLayoutPanel rp = RootLayoutPanel.get(); rp.add(hugeWidgets); }

    Read the article

  • Creating PHP Forms with show/hide functionality [migrated]

    - by ronquiq
    I want to create two reports and submit the report data to database by using two functions defined in a class: Here I have two buttons: "Create ES" and "Create RP". Rightnow, my forms are working fine, I can insert data successfully, but the problem was when I click on submit after filling the form data, the content is hiding and displays the fist div content "cs_content" and again I need to onclick to submit again. Could anyone give a solution for this. Requirement : When I click on "Create CS", I should be able to fill the form and submit data successfully with a message within "cs_content" and any form input errors, the errors should display within "cs_content". When I click on "Create RP", I should be able to fill the form and submit data successfully with a message within "rp_content" and any form input errors, the errors should display within "rp_content". home.php <?php require 'classes/class.report.php'; $report = new Report($db); ?> <html> <head> <script src="js/jqueryv1.10.2.js"></script> <script> $ (document).ready(function () { //$("#cs_content").show(); $('#cs').click(function () { $('#cs_content').fadeIn('slow'); $('#rp_content').hide(); }); $('#rp').click(function () { $('#rp_content').fadeIn('slow'); $('#cs_content').hide(); }); }); </script> </head> <body> <div class="container2"> <div style="margin:0px 0px;padding:3px 217px;overflow:hidden;"> <div id="cs" style="float:left;margin:0px 0px;padding:7px;"><input type="button" value="CREATE CS"></div> <div id="rp" style="float:left;margin:0px 0px;padding:7px;"><input type="button" value="CREATE RP"></div><br> </div> <div id="cs_content"> <?php $report->create_cs_report(); ?> </div> <div id="rp_content" style="display:none;"> <?php $report->create_rp_report(); ?> </div> </div> </body> </html> class.report.php <?php class Report { private $db; public function __construct($database){ $this->db = $database; } public function create_cs_report() { if (isset($_POST['create_es_report'])) { $report_name = htmlentities($_POST['report_name']); $from_address = htmlentities($_POST['from_address']); $subject = htmlentities($_POST['subject']); $reply_to = htmlentities($_POST['reply_to']); if (empty($_POST['report_name']) || empty($_POST['from_address']) || empty($_POST['subject']) || empty($_POST['reply_to'])) { $errors[] = '<span class="error">All fields are required.</span>'; } else { if (isset($_POST['report_name']) && empty($_POST['report_name'])) { $errors[] = '<span class="error">Report Name is required</span>'; } else if (!ctype_alnum($_POST['report_name'])) { $errors[] = '<span class="error">Report Name: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['from_address']) && empty($_POST['from_address'])) { $errors[] = '<span class="error">From address is required</span>'; } else if (filter_var($_POST['from_address'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid From address</span>'; } if (isset($_POST['subject']) && empty($_POST['subject'])) { $errors[] = '<span class="error">Subject is required</span>'; } else if (!ctype_alnum($_POST['subject'])) { $errors[] = '<span class="error">Subject: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['reply_to']) && empty($_POST['reply_to'])) { $errors[] = '<span class="error">Reply To is required</span>'; } else if (filter_var($_POST['reply_to'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid Reply-To address</span>'; } } if (empty($errors) === true) { $query = $this->db->prepare("INSERT INTO report(report_name, from_address, subject, reply_to) VALUES (?, ?, ?, ?) "); $query->bindValue(1, $report_name); $query->bindValue(2, $from_address); $query->bindValue(3, $subject); $query->bindValue(4, $reply_to); try { $query->execute(); } catch(PDOException $e) { die($e->getMessage()); } header('Location:home.php?success'); exit(); } } if (isset($_GET['success']) && empty($_GET['success'])) { header('Location:home.php'); echo '<span class="error">Report is succesfully created</span>'; } ?> <form action="" method="POST" accept-charset="UTF-8"> <div style="font-weight:bold;padding:17px 80px;text-decoration:underline;">Section A</div> <table class="create_report"> <tr><td><label>Report Name</label><span style="color:#A60000">*</span></td> <td><input type="text" name="report_name" required placeholder="Name of the report" value="<?php if(isset($_POST["report_name"])) echo $report_name; ?>" size="30" maxlength="30"> </td></tr> <tr><td><label>From</label><span style="color:#A60000">*</span></td> <td><input type="text" name="from_address" required placeholder="From address" value="<?php if(isset($_POST["from_address"])) echo $from_address; ?>" size="30"> </td></tr> <tr><td><label>Subject</label><span style="color:#A60000">*</span></td> <td><input type="text" name="subject" required placeholder="Subject" value="<?php if(isset($_POST["subject"])) echo $subject; ?>" size="30"> </td></tr> <tr><td><label>Reply To</label><span style="color:#A60000">*</span></td> <td><input type="text" name="reply_to" required placeholder="Reply address" value="<?php if(isset($_POST["reply_to"])) echo $reply_to; ?>" size="30"> </td></tr> <tr><td><input type="submit" value="create report" style="background:#8AC007;color:#080808;padding:6px;" name="create_es_report"></td></tr> </table> </form> <?php //IF THERE ARE ERRORS, THEY WOULD BE DISPLAY HERE if (empty($errors) === false) { echo '<div>' . implode('</p><p>', $errors) . '</div>'; } } public function create_rp_report() { if (isset($_POST['create_rp_report'])) { $report_name = htmlentities($_POST['report_name']); $to_address = htmlentities($_POST['to_address']); $subject = htmlentities($_POST['subject']); $reply_to = htmlentities($_POST['reply_to']); if (empty($_POST['report_name']) || empty($_POST['to_address']) || empty($_POST['subject']) || empty($_POST['reply_to'])) { $errors[] = '<span class="error">All fields are required.</span>'; } else { if (isset($_POST['report_name']) && empty($_POST['report_name'])) { $errors[] = '<span class="error">Report Name is required</span>'; } else if (!ctype_alnum($_POST['report_name'])) { $errors[] = '<span class="error">Report Name: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['to_address']) && empty($_POST['to_address'])) { $errors[] = '<span class="error">to address is required</span>'; } else if (filter_var($_POST['to_address'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid to address</span>'; } if (isset($_POST['subject']) && empty($_POST['subject'])) { $errors[] = '<span class="error">Subject is required</span>'; } else if (!ctype_alnum($_POST['subject'])) { $errors[] = '<span class="error">Subject: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['reply_to']) && empty($_POST['reply_to'])) { $errors[] = '<span class="error">Reply To is required</span>'; } else if (filter_var($_POST['reply_to'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid Reply-To address</span>'; } } if (empty($errors) === true) { $query = $this->db->prepare("INSERT INTO report(report_name, to_address, subject, reply_to) VALUES (?, ?, ?, ?) "); $query->bindValue(1, $report_name); $query->bindValue(2, $to_address); $query->bindValue(3, $subject); $query->bindValue(4, $reply_to); try { $query->execute(); } catch(PDOException $e) { die($e->getMessage()); } header('Location:home.php?success'); exit(); } } if (isset($_GET['success']) && empty($_GET['success'])) { header('Location:home.php'); echo '<span class="error">Report is succesfully created</span>'; } ?> <form action="" method="POST" accept-charset="UTF-8"> <div style="font-weight:bold;padding:17px 80px;text-decoration:underline;">Section A</div> <table class="create_report"> <tr><td><label>Report Name</label><span style="color:#A60000">*</span></td> <td><input type="text" name="report_name" required placeholder="Name of the report" value="<?php if(isset($_POST["report_name"])) echo $report_name; ?>" size="30" maxlength="30"> </td></tr> <tr><td><label>to</label><span style="color:#A60000">*</span></td> <td><input type="text" name="to_address" required placeholder="to address" value="<?php if(isset($_POST["to_address"])) echo $to_address; ?>" size="30"> </td></tr> <tr><td><label>Subject</label><span style="color:#A60000">*</span></td> <td><input type="text" name="subject" required placeholder="Subject" value="<?php if(isset($_POST["subject"])) echo $subject; ?>" size="30"> </td></tr> <tr><td><label>Reply To</label><span style="color:#A60000">*</span></td> <td><input type="text" name="reply_to" required placeholder="Reply address" value="<?php if(isset($_POST["reply_to"])) echo $reply_to; ?>" size="30"> </td></tr> <tr><td><input type="submit" value="create report" style="background:#8AC007;color:#080808;padding:6px;" name="create_rp_report"></td></tr> </table> </form> <?php //IF THERE ARE ERRORS, THEY WOULD BE DISPLAY HERE if (empty($errors) === false) { echo '<div>' . implode('</p><p>', $errors) . '</div>'; } } }//Report CLASS ENDS

    Read the article

  • DLLImport error: System.AccessViolationException with Manifest file and c#

    - by RP
    When trying to call (DLLImport) an external c++ dll from a .net application that has a manifest file with requireAdministrator, I get this error trying to call function from the C++ dll in Windows 7 with UAC enabled. Method I am calling: EnCrypts System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. public class BlowFish { [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String EnCrypt(String strData, String strPassword); [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String EnCrypt(String strData, String strPassword, bool doNotUsePassChecking); [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String DeCrypt(String strData, String strPassword, bool doNotUsePassChecking); [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String DeCrypt(String strData, String strPassword); public static String EnCrypts(String strData, String strPassword) { return EnCrypt(strData, strPassword, true); } } }

    Read the article

1 2 3 4 5  | Next Page >