Search Results

Search found 95 results on 4 pages for 'ob'.

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

  • Motherboard Is A MCP61PM-HM Rev 1.OB

    - by Dennis Smith
    I have a compaq presario pc SR5110NX The Processor is AMD Athlon 64 Proceessor3800+ It has 512 mb of Ram and a 40gb Hard Drive Here is my problem I Have 2 Sata One Is Black and the other Is White I have 2 red little cables and they have the letters and numbers on them It Is HP P/N:5188-2897 0720 on the side of the cable.Here is the Mother Board MCP61PM-HM Rev 1.0B I need to now where do the two Sata Connectors Connect Too Please Help Thank You So Much.Ps I am running windows XP Pro

    Read the article

  • how to use ob_start?

    - by user187580
    Hello I am using PHPSavant templating system for a project and I am not sure how to use ob_start in this. I have tried before .. for example, page_header.php -- ob_start(); page_footer.php -- ob_end_flush(); But because now I am using a templating system.. am not sure where to put these function. $template = new Savant3(); $template->some_var = $some_value; $template->display('default_template'); the default_template contains all of and populate section using some variables (set to $template object). Should I be using ob_start and ob_end_flush where my html code is or to include on each and every php file which calls to this template? Any ideas? thanks.

    Read the article

  • ob_start() is partially capturing data

    - by AAA
    I am using the following code: PHP: // Generate Guid function NewGuid() { $s = strtoupper(uniqid(rand(),true)); $guidText = substr($s,0,8) . '-' . substr($s,8,4) . '-' . substr($s,12,4). '-' . substr($s,16,4). '-' . substr($s,20); return $guidText; } // End Generate Guid $Guid = NewGuid(); $alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; function base_encode($num, $alphabet) { $base_count = strlen($alphabet); $encoded = ''; while ($num >= $base_count) { $div = $num/$base_count; $mod = ($num-($base_count*intval($div))); $encoded = $alphabet[$mod] . $encoded; $num = intval($div); } if ($num) $encoded = $alphabet[$num] . $encoded; return $encoded; } function base_decode($num, $alphabet) { $decoded = 0; $multi = 1; while (strlen($num) > 0) { $digit = $num[strlen($num)-1]; $decoded += $multi * strpos($alphabet, $digit); $multi = $multi * strlen($alphabet); $num = substr($num, 0, -1); } return $decoded; } ob_start(); echo base_encode($Guid, $alphabet); //should output: bUKpk $theid = ob_get_contents(); ob_get_clean(); The problem: When i echo $theid, it shows the complete entry, but as it is being inserted into the database, only the first entry in the sequence gets inserted, for example for the entry buKPK, only 'b' is being inserted not the rest.

    Read the article

  • Email function using templates. Includes via ob_start and global vars

    - by Geo
    I have a simple Email() class. It's used to send out emails from my website. <? Email::send($to, $subj, $msg, $options); ?> I also have a bunch of email templates written in plain HTML pierced with a few PHP variables. E.g. /inc/email/templates/account_created.php: <p>Dear <?=$name?>,</p> <p>Thank you for creating an account at <?=$SITE_NAME?>. To login use the link below:</p> <p><a href="https://<?=$SITE_URL?>/account" target="_blank"><?=$SITE_NAME?>/account</a></p> In order to have the PHP vars rendered I had to include the template into my function. But since include does not return the contents but rather just sends it directly to the output, I had to wrap it with the buffer functions: <? abstract class Email { public static function send($to, $subj, $msg, $options = array()) { /* ... */ ob_start(); include '/inc/email/templates/account_created.php'; $msg = ob_get_clean(); /* ... */ } } After that I realized that the PHP vars are not rendered as they are being inside of the function scope, so I had to globalize the variables inside of the template: <? global $SITE_NAME, $SITE_URL, $name; ?> <p>Dear <?=$name?>,</p> ... So the question is whether there is a more elegant solution to this? Mainly I am concerned about my workarounds using ob_start() and global. For some reason that seems to me odd. Or this is pretty much the common practice?

    Read the article

  • ob_start() -> ob_flush() doesn't work

    - by MB34
    I am using ob_start()/ob_flush() to, hopefully, give me some progress during a long import operation. Here is a simple outline of what I'm doing: <?php ob_start (); echo "Connecting to download Inventory file.<br>"; $conn = ftp_connect($ftp_site) or die("Could not connect"); echo "Logging into site download Inventory file.<br>"; ftp_login($conn,$ftp_username,$ftp_password) or die("Bad login credentials for ". $ftp_site); echo "Changing directory on download Inventory file.<br>"; ftp_chdir($conn,"INV") or die("could not change directory to INV"); // connection, local, remote, type, resume $localname = "INV"."_".date("m")."_".date('d').".csv"; echo "Downloading Inventory file to:".$localname."<br>"; ob_flush(); flush(); sleep(5); if (ftp_get($conn,$localname,"INV.csv",FTP_ASCII)) { echo "New Inventory File Downloaded<br>"; $datapath = $localname; ftp_close($conn); } else { ftp_close($conn); die("There was a problem downloading the Inventory file."); } ob_flush(); flush(); sleep(5); $csvfile = fopen($datapath, "r"); // open csv file $x = 1; // skip the header line $line = fgetcsv($csvfile); $y = (feof($csvfile) ? 2 : 5); while ((!$debug) ? (!feof($csvfile)) : $x <= $y) { $x++; $line = fgetcsv($csvfile); // do a lot of import stuff here with $line ob_flush(); flush(); sleep(1); } fclose($csvfile); // important: close the file ob_end_clean(); However, nothing is being output to the screen at all. I know the data file is getting downloaded because I watch the directory where it is being placed. I also know that the import is happening, meaning that it is in the while loop, because I can monitor the DB and records are being inserted. Any ideas as to why I am not getting output to the screen?

    Read the article

  • how to create a progress bar using php output buffering and jquery?

    - by avien
    how to create a progress bar using php output buffering and jquery? i been searching this for weeks, i am desperate to learn this, this is a very big help for me, is someone the here share some codes? i know the this will need to script. i have tried sereval code for my client side script: var request = new XMLHttpRequest(); request.addEventListener("progress", updateProgress, false); function updateProgress(e) { var percent = (e.loaded / e.total) * 100; /** update the with of the progress bar **/ } and to my server side, i dont know how. but actually i want to use this for a mysql query so that i can see the progress of my query and another thing is i dont know how to use output buffering. somebody help me on this please.

    Read the article

  • PHP Session doesn't get read in next page after login validation, Why?

    - by NetStar
    I have a web site and when my users login it takes them to verify.php (where it connects to the DataBase and matches email and password to the user input and if OK puts client data into sessions and take the client to /memberarea/index.php ELSE back to login page with message "Invalid Email or password!") <?php ob_start(); session_start(); $email=$_POST['email']; $pass=md5($_POST['pass']); include("conn.php"); // connects to Database $sql="SELECT * FROM `user` WHERE email='$email' AND pass='$pass'"; $result=mysql_query($sql); $new=mysql_fetch_array($result); $_SESSION['fname']=$new['fname']; $_SESSION['lname']=$new['lname']; $_SESSION['email1']=$new['email1']; $_SESSION['passwrd']=$new['passwrd']; $no=mysql_num_rows($result); if ($no==1){ header('Location:memberarea/index.php'); }else { header("Location:login.php?m=$msg"); //msg="Invalid Login" } ?> then after email id and password is verified it takes them to ` /memberarea/index.php (This is where the problem happens.) where in index.php it checks if a session has been created in-order to block hackers to enter member area and sends them back to the login page. <? session_start(); isset($_SESSION['email'])` && `isset($_SESSION['passwrd'])` The problem is the client gets verified in verify.php (the code is above) In varify.php only after I put ob_start(); ontop of session_start(); It moves on to /memberarea/index.php , If I remove ob_start() It keeps the client on the verify.php page and displays error header is alredy SENT. after I put ob_start() it goes in to /memberarea/index.php but the session is blank, so it goes back to the login page and displays the error ($msg) "Invalid Login" which I programed to display. Can anyone tell me why the session cant pass values from verify.php to /memberarea/index.php

    Read the article

  • Is there a better way to organize my module tests that avoids an explosion of new source files?

    - by luser droog
    I've got a neat (so I thought) way of having each of my modules produce a unit-test executable if compiled with the -DTESTMODULE flag. This flag guards a main() function that can access all static data and functions in the module, without #including a C file. From the README: -- Modules -- The various modules were written and tested separately before being coupled together to achieve the necessary basic functionality. Each module retains its unit-test, its main() function, guarded by #ifdef TESTMODULE. `make test` will compile and execute all the unit tests, producing copious output, but importantly exitting with an appropriate success or failure code, so the `make test` command will fail if any of the tests fail. Module TOC __________ test obj src header structures CONSTANTS ---- --- --- --- -------------------- m m.o m.c m.h mfile mtab TABSZ s s.o s.c s.h stack STACKSEGSZ v v.o v.c v.h saverec_ f.o f.c f.h file ob ob.o ob.c ob.h object ar ar.o ar.c ar.h array st st.o st.c st.h string di di.o di.c di.h dichead dictionary nm nm.o nm.c nm.h name gc gc.o gc.c gc.h garbage collector itp itp.c itp.h context osunix.o osunix.c osunix.h unix-dependent functions It's compile by a tricky bit of makefile, m:m.c ob.h ob.o err.o $(CORE) itp.o $(OP) cc $(CFLAGS) -DTESTMODULE $(LDLIBS) -o $@ $< err.o ob.o s.o ar.o st.o v.o di.o gc.o nm.o itp.o $(OP) f.o where the module is compiled with its own C file plus every other object file except itself. But it's creating difficulties for the kindly programmer who offered to write the Autotools files for me. So the obvious way to make it "less weird" would be to bust-out all the main functions into separate source files. But, but ... Do I gotta?

    Read the article

  • Tile-based 2D collision detection problems

    - by Vee
    I'm trying to follow this tutorial http://www.tonypa.pri.ee/tbw/tut05.html to implement real-time collisions in a tile-based world. I find the center coordinates of my entities thanks to these properties: public float CenterX { get { return X + Width / 2f; } set { X = value - Width / 2f; } } public float CenterY { get { return Y + Height / 2f; } set { Y = value - Height / 2f; } } Then in my update method, in the player class, which is called every frame, I have this code: public override void Update() { base.Update(); int downY = (int)Math.Floor((CenterY + Height / 2f - 1) / 16f); int upY = (int)Math.Floor((CenterY - Height / 2f) / 16f); int leftX = (int)Math.Floor((CenterX + Speed * NextX - Width / 2f) / 16f); int rightX = (int)Math.Floor((CenterX + Speed * NextX + Width / 2f - 1) / 16f); bool upleft = Game.CurrentMap[leftX, upY] != 1; bool downleft = Game.CurrentMap[leftX, downY] != 1; bool upright = Game.CurrentMap[rightX, upY] != 1; bool downright = Game.CurrentMap[rightX, downY] != 1; if(NextX == 1) { if (upright && downright) CenterX += Speed; else CenterX = (Game.GetCellX(CenterX) + 1)*16 - Width / 2f; } } downY, upY, leftX and rightX should respectively find the lowest Y position, the highest Y position, the leftmost X position and the rightmost X position. I add + Speed * NextX because in the tutorial the getMyCorners function is called with these parameters: getMyCorners (ob.x+ob.speed*dirx, ob.y, ob); The GetCellX and GetCellY methods: public int GetCellX(float mX) { return (int)Math.Floor(mX / SGame.Camera.TileSize); } public int GetCellY(float mY) { return (int)Math.Floor(mY / SGame.Camera.TileSize); } The problem is that the player "flickers" while hitting a wall, and the corner detection doesn't even work correctly since it can overlap walls that only hit one of the corners. I do not understand what is wrong. In the tutorial the ob.x and ob.y fields should be the same as my CenterX and CenterY properties, and the ob.width and ob.height should be the same as Width / 2f and Height / 2f. However it still doesn't work. Thanks for your help.

    Read the article

  • Runtime error on UVa Online Judge on Erdos Number

    - by 2012 - End of the World
    I am solving the Erdos number problem from the programming challenges in JAVA. The code runs perfectly in my machine. However on the online judge it results in a runtime error. Could anyone point out the mistake i made? http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=985 Here is the code import java.util.*; import java.io.*; class Main { private String inputLines[]; private String namesToBeFound[]; private String namesInEachBook[][]; private String searchItem; private boolean solnfound=false; private static final BufferedReader br =new BufferedReader(new InputStreamReader(System.in)); static String read() throws IOException { String line; while(true) { line=br.readLine(); if(line==null) break; //eof else if(line.length()==0) continue; //blank line else { line=line.trim().replaceAll("\\s+"," "); return line; } } return null; } public static void main(String args[]) throws IOException { Main ob=new Main(); int totalPapers,calcAuthors,totalScenarios; //First input number of scenarios totalScenarios=Integer.parseInt(read()); //Now start a loop for reading total number of scenarios for(int scenario=1;scenario<=totalScenarios;scenario++) { //Now read the line containing the number of papers and authors StringTokenizer line=new StringTokenizer(read()," "); totalPapers=Integer.parseInt(line.nextToken()); calcAuthors=Integer.parseInt(line.nextToken()); //Read a line containing author names along with book names ob.inputLines=new String[totalPapers]; for(int i=0;i<totalPapers;i++) ob.inputLines[i]=read(); //Read a line containing the names to be searched ob.namesToBeFound=new String[calcAuthors]; for(int i=0;i<calcAuthors;i++) ob.namesToBeFound[i]=read(); //Now generate the array ob.buildArray(); //Now search System.out.println("Scenario "+scenario); for(int i=0;i<calcAuthors;i++) { ob.searchItem=ob.namesToBeFound[i]; if(ob.searchItem.equals("Erdos, P.")) { System.out.println("Erdos, P. 0"); continue; } ob.search(ob.namesToBeFound[i],1,new ArrayList()); if(ob.solnfound==false) System.out.println(ob.searchItem+" infinity"); ob.solnfound=false; } } } private void buildArray() { String str; namesInEachBook=new String[inputLines.length][]; for(int i=0;i<inputLines.length;i++) { str=inputLines[i]; str=str.substring(0,str.indexOf(':')); str+=","; namesInEachBook[i]=new String[(countCommas(str)+1)>>1]; for(int j=0;j<namesInEachBook[i].length;j++) { str=str.trim(); namesInEachBook[i][j]=""; namesInEachBook[i][j]+=str.substring(0,str.indexOf(','))+","; str=str.substring(str.indexOf(',')+1); namesInEachBook[i][j]+=str.substring(0,str.indexOf(',')); str=str.substring(str.indexOf(',')+1); } } } private int countCommas(String s) { int num=0; for(int i=0;i<s.length();i++) if(s.charAt(i)==',') num++; return num; } private void search(String searchElem,int ernosDepth,ArrayList searchedElem) { ArrayList searchSpace=new ArrayList(); searchedElem.add(searchElem); for(int i=0;i<namesInEachBook.length;i++) for(int j=0;j<namesInEachBook[i].length;j++) { if(namesInEachBook[i][j].equals(searchElem)) //Add all authors name in this group { for(int k=0;k<namesInEachBook[i].length;k++) { if(namesInEachBook[i][k].equals("Erdos, P.")) //Found { solnfound=true; System.out.println(searchItem+" "+ernosDepth); return; } else if(searchedElem.contains(namesInEachBook[i][k]) || searchSpace.contains(namesInEachBook[i][k])) continue; searchSpace.add(namesInEachBook[i][k]); } break; } } Iterator i=searchSpace.iterator(); while(i.hasNext()) { String cSearchElem=(String)i.next(); search(cSearchElem,ernosDepth+1,searchedElem); } } }

    Read the article

  • Why Switch/Case and not If/Else If?

    - by OB OB
    This question in mainly pointed at C/C++, but I guess other languages are relevant as well. I can't understand why is switch/case still being used instead of if/else if. It seems to me much like using goto's, and results in the same sort of messy code, while the same results could be acheived with if/else if's in a much more organized manner. Still, I see these blocks around quite often. A common place to find them is near a message-loop (WndProc...), whereas these are among the places when they raise the heaviest havoc: variables are shared along the entire block, even when not propriate (and can't be initialized inside it). Extra attention has to be put on not dropping break's, and so on... Personally, I avoid using them, and I wonder wether I'm missing something? Are they more efficient than if/else's? Are they carried on by tradition?

    Read the article

  • Is it possible to have an out-of-process COM server where a separate O/S process is used for each ob

    - by Tom Williams
    I have a legacy C++ "solution engine" that I have already wrapped as an in-process COM object for use by client applications that only require a single "solution engine". However I now have a client application that requires multiple "solution engines". Unfortunately the underlying legacy code has enough global data, singletons and threading horrors that given available resources it isn't possible to have multiple instances of it in-process simultaneously. What I am hoping is that some kind soul can tell me of some COM magic where with the flip of a couple of registry settings it is possible to have a separate out-of-process COM server (separate operating system process) for each instance of the COM object requested. Am I in luck?

    Read the article

  • How can I store large amount of data from a database to XML (speed problem, part three)?

    - by Andrija
    After getting some responses, the current situation is that I'm using this tip: http://www.ibm.com/developerworks/xml/library/x-tipbigdoc5.html (Listing 1. Turning ResultSets into XML), and XMLWriter for Java from http://www.megginson.com/downloads/ . Basically, it reads date from the database and writes them to a file as characters, using column names to create opening and closing tags. While doing so, I need to make two changes to the input stream, namely to the dates and numbers. // Iterate over the set while (rs.next()) { w.startElement("row"); for (int i = 0; i < count; i++) { Object ob = rs.getObject(i + 1); if (rs.wasNull()) { ob = null; } String colName = meta.getColumnLabel(i + 1); if (ob != null ) { if (ob instanceof Timestamp) { w.dataElement(colName, Util.formatDate((Timestamp)ob, dateFormat)); } else if (ob instanceof BigDecimal){ w.dataElement(colName, Util.transformToHTML(new Integer(((BigDecimal)ob).intValue()))); } else { w.dataElement(colName, ob.toString()); } } else { w.emptyElement(colName); } } w.endElement("row"); } The SQL that gets the results has the to_number command (e.g. to_number(sif.ID) ID ) and the to_date command (e.g. TO_DATE (sif.datum_do, 'DD.MM.RRRR') datum_do). The problems are that the returning date is a timestamp, meaning I don't get 14.02.2010 but rather 14.02.2010 00:00:000 so I have to format it to the dd.mm.yyyy format. The second problem are the numbers; for some reason, they are in database as varchar2 and can have leading zeroes that need to be stripped; I'm guessing I could do that in my SQL with the trim function so the Util.transformToHTML is unnecessary (for clarification, here's the method): public static String transformToHTML(Integer number) { String result = ""; try { result = number.toString(); } catch (Exception e) {} return result; } What I'd like to know is a) Can I get the date in the format I want and skip additional processing thus shortening the processing time? b) Is there a better way to do this? We're talking about XML files that are in the 50 MB - 250 MB filesize category.

    Read the article

  • Data structures for storing finger/stylus movements in drawing application?

    - by mattja?øb
    I have a general question about creating a drawing application, the language could be C++ or ObjectiveC with OpenGL. I would like to hear what are the best methods and practices for storing strokes data. Think of the many iPad apps that allow you to draw with your finger (or a stylus) or any other similar function on a desktop app. To summarize, the data structure must: be highly responsive to the movement store precise values (close in space / time) usable for rendering the strokes with complex textures (textures based on the dynamic of the stroke etc) exportable to a text file for saving/loading

    Read the article

  • How to combine specific column values in an SQL statement

    - by Mehper C. Palavuzlar
    There are two variables in our database called OB and B2B_OB. There are EP codes and each EP may have one of the following 4 combinations: EP OB B2B_OB --- -- ------ 3 X 7 X 11 14 X X What I want to do is to combine the X's in the fetched list so that I can have A or B value for a single EP. My conditions are: IF (OB IS NULL AND B2B_OB IS NULL) THEN TYPE = A IF (OB IS NOT NULL OR B2B_OB IS NOT NULL) THEN TYPE = B The list I want to fetch is like this one: EP TYPE --- ---- 3 B 7 B 11 A 14 B How can I do this in my query? TIA.

    Read the article

  • simplfy javascript code using regex

    - by Pradyut Bhattacharya
    Hi I have a code which can show youtube videos if there are any links to youtube in the text like for example the text example at:- pradyut.dyndns.org http://www.youtube.com/watch?v=-LiPMxFBLZY testing http://www.youtube.com/watch?v=Q3-l22b_Qg8&feature=related this text i m forwarding to the function... function to_youtubelink(text) { if ( text.indexOf ('<') > 0 || text.indexOf ('"') > 0 || text.indexOf ('>') > 0 ) return text; else { var obj_text = new Array(); var oi = 0; while(text.indexOf('http://') >=0) { //getting the paths var si = text.indexOf('http://'); var gr = text.indexOf('\n', si); var sp = text.indexOf(' ', si); var ei; if ( gr > 0 || sp > 0 ) { if ( gr >0 && sp > 0 ) { if ( gr < sp ) { ei = gr ; } else { ei = sp ; } } else if ( gr > 0) { ei = gr; } else { ei = sp; } } else { ei = text.length; } var it = text.substring(si,ei); if ( it.indexOf('"') > 0) { it.substring(0, it.indexOf('"') ); } if(ei < 0) ei = text.length; else ei = text.indexOf(' ', si) ; obj_text[oi] = it; text = text.replace( it, '[link_service]'); oi++; } var ob_text = new Array(); var ob =0; for (oi=0; oi<obj_text.length; oi++) { if ( is_youtubelink( obj_text[oi] ) ) { ob_text[ob] = to_utubelink(obj_text[oi]); ob++; } } oi = 0; while ( text.indexOf('[link_service]') >=0 ) { text = text.replace( '[link_service]', obj_text[oi]); oi ++; } for (ob=0; ob<ob_text.length; ob++) { text = text +"\n\n" + ob_text[ob]; } return text; } } function is_youtubelink(text) { var matches = text.match(/http:\/\/(?:www\.)?youtube.*watch\?v=([a-zA-Z0-9\-_]+)/); if (matches) { return true; } else { return false; } } function to_utubelink(text) { var video_id = text.split('v=')[1]; var ampersandPosition = video_id.indexOf('&'); if(ampersandPosition != -1) { video_id = video_id.substring(0, ampersandPosition); } text = "<iframe title=\"YouTube video player\" class=\"youtube-player\" type=\"text/html\" width=\"425\" height=\"350\" src=\"http://www.youtube.com/embed/" + video_id + "\" frameborder=\"0\"></iframe>" return text; } now i m getting the output properly... but i was thinking if the code could be done better and simplified using regex ...especially getting the urls part... thanks

    Read the article

  • getting the "this" that a function's caller was called with in JavaScript

    - by David Morrissey
    Is it possible to get the this that a function's caller was called with in JavaScript without passing this to the arguments in a way which supports IE as well as Firefox/Chrome et al? For example: var ob = { callme: function() { doSomething() } } function doSomething() { alert(doSomething.caller.this === ob) // how can I make this work? } ob.callme() I'm starting to suspect it's not, but I thought I may as well ask as it'd make my code much shorter and easier to read. Thanks for any information!

    Read the article

  • my javascript code is working in internet explorer but not working in mozilla

    - by goutham
    function buildMenu() { speed=35; topdistance=100; items=6; y=-50; ob=1; if (navigator.appName == "Netscape") { v=".top=",dS="document.",sD=""; } else { v=".pixelTop=",dS="",sD=".style"; } } function scrollItems() { if (ob<items+1) { objectX="object"+ob; y+=10; eval(dS + objectX + sD + v + y); if (y<topdistance) setTimeout("scrollItems()",speed); else y=-50, topdistance+=40, ob+=1, setTimeout("scrollItems()",speed); } }

    Read the article

  • Managed c++ cross threading

    - by Nitroglycerin
    I got a thread: static void TestThread(System::Object ^obj) { Bot ^ob = (Bot^) obj; while( ob->Threads[0]->IsAlive ){ ob->textBox->text = "test"; // Cross threading error... Thread::Sleep(100); } } Dont know what to do i read about InvokeRequired and Invoke but didnt understand it.. Please help

    Read the article

  • Using getElementById inside user control

    - by toraan
    I have a usercontrol that hides a div when a button is clicked. <asp:LinkButton ID="lnkbtn" OnClientClick="ShowHide(); return false;" runat="server" /> <div id="popupPage" style="display:none;"> </div> function ShowHideGotoPopUp() { var ob = document.getElementById("popupPage"); if (ob.style.display == "none") ob.style.display = "block"; else ob.style.display = "none" } There is a problem when I place on page more then 1 usercontrol, all controls has div with same id = popupPage.

    Read the article

  • synchronized in java - Proper use

    - by ZoharYosef
    I'm building a simple program to use in multi processes (Threads). My question is more to understand - when I have to use a reserved word synchronized? Do I need to use this word in any method that affects the bone variables? I know I can put it on any method that is not static, but I want to understand more. thank you! here is the code: public class Container { // *** data members *** public static final int INIT_SIZE=10; // the first (init) size of the set. public static final int RESCALE=10; // the re-scale factor of this set. private int _sp=0; public Object[] _data; /************ Constructors ************/ public Container(){ _sp=0; _data = new Object[INIT_SIZE]; } public Container(Container other) { // copy constructor this(); for(int i=0;i<other.size();i++) this.add(other.at(i)); } /** return true is this collection is empty, else return false. */ public synchronized boolean isEmpty() {return _sp==0;} /** add an Object to this set */ public synchronized void add (Object p){ if (_sp==_data.length) rescale(RESCALE); _data[_sp] = p; // shellow copy semantic. _sp++; } /** returns the actual amount of Objects contained in this collection */ public synchronized int size() {return _sp;} /** returns true if this container contains an element which is equals to ob */ public synchronized boolean isMember(Object ob) { return get(ob)!=-1; } /** return the index of the first object which equals ob, if none returns -1 */ public synchronized int get(Object ob) { int ans=-1; for(int i=0;i<size();i=i+1) if(at(i).equals(ob)) return i; return ans; } /** returns the element located at the ind place in this container (null if out of range) */ public synchronized Object at(int p){ if (p>=0 && p<size()) return _data[p]; else return null; }

    Read the article

  • jQuery live, change in not working in IE6, IE7

    - by fabian
    The code below works as expected in FF but not in IEs... $(document).ready(function() { $('div.facet_dropdown select').live('change', function() { var changed_facet = $(this).attr('id'); var facets = $('select', $(this).closest('form')); var args = window.location.href.split('?')[0] + '?ajax=1'; var clear = false; for(var i = 0; i < facets.length; i++) { var ob = $(facets[i]); var val = ob.val(); if(clear) { val = ''; } args += '&' + ob.attr('id') + '=' + val; if(ob.attr('id') == changed_facet) { clear = true; } } $.getJSON(args, function(json) { for(widget_id in json) { var sel = '#field-' + widget_id + ' div.widget'; $(sel).html(json[widget_id]); } }); }); });

    Read the article

1 2 3 4  | Next Page >