Daily Archives

Articles indexed Monday January 10 2011

Page 7/36 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Center aligning list of images

    - by Praneeth
    Can some CSS guru help me getting this layout. What I have here is <div class="movieList"> <div class="image" selected = true> <img class="poster" src="image1" selected = true/> </div> <div class="image"> <img class="poster" src="image1"/> </div> <div class="image"> <img class="poster" src="image2"/> </div> . . </div> Thanks

    Read the article

  • php database excel export

    - by user434885
    i am using a php script to export datd from mysql into excel. the first row of the excel sheet is a column headings i want them to appear in bold how do i do this ? i am using hte following code: $con = mysql_connect("localhost","admin","password"); if (!$con) { die('Could not connect to DB: \n' . mysql_error()); } mysql_select_db("ALNMSI", $con); $result = mysql_query("SELECT * FROM survey1"); $filename = "alnmsi_" . date('d-m-Y') . ".xls"; header("Content-Disposition: attachment; filename=\"$filename\""); header("Content-Type: application/vnd.ms-excel"); $flag = false; $flag = false; while($row = mysql_fetch_array($result)) { if(!$flag) { data_keys(); $flag = true; } array_walk($row, 'cleanData'); data_array($row);

    Read the article

  • Managing memory of polymorphic timed events with DLL

    - by Milo
    Here is my issue. My Gui library that I made supports timed events. Basically, I have a class called TimedEvent which users inherit from. They then do: addTimedEvent(new DerivedTimedEvent(...)); However given the nature of timed events, I manage the memory afterwards. So when the timed event has done its thing, my library calls delete on it. Although it runs fine, that is because the exe and the library were both built with msvc 2008. I think I might have trouble if I have 2 versions of the runtime, one for the lib, and one for the exe. What can I do to fix this? I can't create a factory because the derived type is on the exe side of things. I also cannot ask the user to call delete since they might not have a way to keep track of time, or know if the event was delayed for whatever reason. Thanks

    Read the article

  • web developer editor ubuntu

    - by madphp
    Hi, I know theres hundred of questions and answers out there, but cant find one to specifically answer this. I need a web editor that will let me choose a dark themed editor. I understand gvim is one, but im not totally ready to let go of my mouse. I would like something like sublime text editor for windows, but open to other suggestions. The less bloat the best. I dont need a full IDE like eclipse, but willing to compromise, as long as the themes can easily be added. I've tried bluefish, kompozer and not happy with them. Just need a basic text editor that will highlight php syntax on a dark background.

    Read the article

  • Android: Music track visualization

    - by Swathi EP
    Hello all, I want to create an music track visualization for an music player application which should look like as below: you can see in the above image that, there is an equalizer kind of view and it should vary as the music track is played. I need to know the right way to achieve the above visualization, which api to use?, etc., Any suggestion will be greatly helpful to me. Thanks, Swathi

    Read the article

  • Exception in DatePickerDialog

    - by Miya
    Hi, i am trying to create a DatePickerDialog in the class 'dateDisplay.class'. I am calling this activity from 'main.class'. If I call the 'dateDisplay.class' using startActivity(), then the DatePickerDialog works fine. But actually I am using an ActivityGroup (for using tab in my application) and I am starting the 'dateDisplay.class' using the following code : Intent dateIntent=new Intent(context,dateDisplay.class); View v=getLocalActivityManager().startActivity("2",dateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView(); setContentView(v); But an exception is caught, on calling the onCreateDialog() function. And the process is suddently stopped. It shows TargetInvocationException is occured. How can I correct the code? Following is my code: public Dialog onCreateDialog(int id,Bundle b) { Calendar c=Calendar.getInstance(); int day=c.get(Calendar.DAY_OF_MONTH); int month=c.get(Calendar.MONTH); int year=c.get(Calendar.YEAR); Dialog d = null; if(id==DATE_DIALOG_ID) { return new DatePickerDialog(this,dateChangeListener,year,month,day); } else { return null; } } Please help me.. Thank you..

    Read the article

  • Simple jQuery syntax help, don't know where I've gone wrong

    - by Jascination
    I'm having trouble with a jQuery code at the moment, I know WHERE the problem lies, but I don't know what the problem is exactly. Probably very basic, but I'm new to this. You can see a (non)working fiddle here: http://www.jsfiddle.net/CvZeQ/ Basically I want to set different .click function based on whatever is selected (I have 5 image maps, each with a different #mapname, and want each to pertain to a different variable (answer1, answer2, answer3...) so as to store the selected 'answer' for each map.) Here is the code I'm using for one of the maps: $(window).load(function(){ //Get cookies when page loaded var useranswers=$.cookie('survery'); useranswers= JSON.parse (useranswers); // do something with previous answers //#shape functions $('#shape area').hover( function(e){ $('#'+ this.alt).addClass('hover'); }, function(e){ $('#'+ this.alt).removeClass('hover'); } ).click( function(e){ $('img.selected-region').removeClass('selected-region'); }, function(e){ $('#'+ this.alt).addClass('selected-region'); }, function(e){ var answer1 = $(this).attr("class"); }); }); I know the problem lies somewhere with the .click function, but I'm not entirely sure what I've done wrong. Any help would be greatly appreciated.

    Read the article

  • want to make better content display

    - by Rahul Mehta
    Hi, We are developing a social networking project, in this project we are adding content , e.g. images , video,audio,link(html). Currently we are using shadowbox.js to show it.But for better and effectiveness we want to use some other better plugin, or want to make own window for showing images and link. Please help , what is the best solution for this project. I want to know this is the white board quesion means programmer.stackexchange question or stackoverflow quesion? Thanks

    Read the article

  • Examples of IOC/DI over Singleton

    - by Amitd
    Hi, Just started learning/reading about DI and IOC frameworks. Also I read many articles on SO and internet that say that one should prefer DI/IOC over singleton. Can anyone give/link examples of exactly how DI/IOC eliminates/solves the various issues regarding the Singleton pattern? (hopefully code and explanation for better understanding) Also given a system has already implemented Singleton pattern, how to refactor/implement DI/IOC for the same? (any examples for the same?) (Language/Framework no bars..C# would be helpful) Thanks

    Read the article

  • how to use cookies in HttpsURLConnection in android.

    - by sajjoo
    hello guys, actually i am new in Android and now i have to add the cookies in my project. i am using HttpsUrlConnection. here is how i am making request and getting response from a webserver and now i have to add cookies aswell. URL url = new URL(strUrl); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "application/soap+xml; charset=utf-8"); connection.setRequestProperty("Content-Length", ""+ Integer.toString(request.getBytes().length)); connection.setUseCaches (false); connection.setDoInput(true); connection.setDoOutput(true); // send Request... DataOutputStream wr = new DataOutputStream (connection.getOutputStream()); wr.writeBytes (request); wr.flush (); wr.close (); //Get response... DataInputStream is = new DataInputStream(connection.getInputStream()); String line; StringBuffer response = new StringBuffer(); while((line = is.readLine()) != null) { response.append(line); } is.close(); FileLogger.writeFile("Soap.txt", "RESPONSE: " + methodName + "\n" + response); HashMap<String, String> parameters = null; try { parameters = SoapRequest.responseParser(response.toString(), methodName); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } return parameters; any help will be appreciative, thanks

    Read the article

  • Beginning android: how to map a string to a list

    - by user569421
    I just finished the NotepadV1-3 tutorial for Android apps, and I was thinking of creating my own inventory app for fun, which for now basically consists of a list of names (such as "DVD" or "Grocery"), each of which can be clicked, which will bring up another specific list associated with that name. However, with the SQLiteDatabase.insert(..) method, the ContentValue can only take (among many others) "String, String" as argument, and I can't figure out how to input into the database a list of Strings associated with a particular key. I'm having trouble researching on how to resolve this as I am not that familiar with SQL. What would be the best way to store a key with its associated list of Strings? Any pointers and suggestions are appreciated! Android newb :[

    Read the article

  • Tsql to find the start and end date(set based)

    - by priyanka.sarkar_2
    I have the below Name Date A 2011-01-01 01:00:00.000 A 2011-02-01 02:00:00.000 A 2011-03-01 03:00:00.000 B 2011-04-01 04:00:00.000 A 2011-05-01 07:00:00.000 The desired output being Name StartDate EndDate ------------------------------------------------------------------- A 2011-01-01 01:00:00.000 2011-04-01 04:00:00.000 B 2011-04-01 04:00:00.000 2011-05-01 07:00:00.000 A 2011-05-01 07:00:00.000 NULL How to achieve the same using TSQL in Set based approach DDL is as under DECLARE @t TABLE(PersonName VARCHAR(32), [Date] DATETIME) INSERT INTO @t VALUES('A', '2011-01-01 01:00:00') INSERT INTO @t VALUES('A', '2011-01-02 02:00:00') INSERT INTO @t VALUES('A', '2011-01-03 03:00:00') INSERT INTO @t VALUES('B', '2011-01-04 04:00:00') INSERT INTO @t VALUES('A', '2011-01-05 07:00:00') Select * from @t

    Read the article

  • C++ code generation for repeted task

    - by sateesh
    Hi, I have something like below which will get repeated many times based on the function that get called for e.g acceptfunction() { inserter["quantity"] = sdd.getfloat(quantity); inserter["prodtype"] = sdd.getstring(prodtype); : : so on } Like accept above there are 20 more functions(reject,cancel etc) which will do the similar thing.But the parameteres they insert can differ based on function called. How can I automate this kind of code.So that I dont need to write new function from scratch.Basically what I need is if i provide parametres like ("quantity",prodtype) through some text file or xml, it should generate the required function with the input parametres. Is this task can be handled through C++ tempalte Meta programming or someother code generation tool will help me to do this?

    Read the article

  • Using proxy.pac to access Apache 2 with a hostname?

    - by leeand00
    Note that I do not have a DNS on my network, and that is why I am resorting to using a proxy.pac file. I would like to be able to access my development Apache 2 server using a name instead of an ip without setting up a full blown DNS. I am aware of setting names in the C:\Windows\System32\drivers\etc\hosts file and the /etc/hosts files, however I cannot edit the hosts file on all of the devices that I am testing the site on. I've added a proxy.pac file to my Apache2 server and pointed my browsers settings to it at: http://192.168.2.221/proxyutils/proxy.pac ...where 192.168.2.221 is thehostname's ip address. I set the above URL in Firefox in the following manner: From the menubar selecting "Edit-Preferences" In the resulting "Firefox Preferences" window clicking the "Advanced" tab. Clicking the "Network" tab Clicking the "Settings" button. Selecting the "Automatic proxy configuration URL:" radio button. Entering http://192.168.2.221/proxyutils/proxy.pac and pressing OK. The contents of the proxy.pac file on the Apache server function FindProxyForURL(url, host) { if( dnsDomainIs(host, "thehostname") ) return "PROXY 192.168.2.221:80"; return "DIRECT"; } In Firefox I then access the following URL: http://thehostname/wp-blog/ And instead of the development version of the Wordpress blog I am trying to access I get a URL of http://thehostnamehttp/thehostname/wp-blog/ in my address bar and a 404 Not Found page in the browser window. Looking over proxy.pac, it seems like calling dnsDomainIs shouldn't work considering I don't have a DNS setup on my network, but I've also tried just comparing the host argument with the string "hostname" and it yielded the same result, even after modifying the proxy.pac file and clicking the reload button near the proxy settings. This could also be a Wordpress problem, since I've noticed that directories without Wordpress seem to function perfectly normally. (see cross post here) Is there any way I can modify my configuration so that I can access the site using http://thehostname/wp-blog/ ?

    Read the article

  • s3fs: how to force remount on errors?

    - by Alexander Gladysh
    I use s3fs 1.33 on Ubuntu 9.10. Regularily it gives me errors like this: rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32) rsync: close failed on "/mnt/s3/mybucket/filename": Software caused connection abort (103) rsync error: error in file IO (code 11) at receiver.c(731) [receiver=3.0.6] rsync: connection unexpectedly closed (86 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6] Any attempt to work with mounted directory after that gives this error: Transport endpoint is not connected To get rid of this, I have to remount. Is there a way to force a remount automatically?

    Read the article

  • Shorten Emacs timeout of ~/.emacs read

    - by user35042
    My ~/.emacs start-up file is stored in my AFS home directory. Often when I login to a linux machine I will forget to renew my AFS credentials before attempting to edit a local (non-AFS) file with Emacs. When this happens Emacs will attempt to load ~./emacs but cannot because it is in AFS space where I do not have access. Eventually (after a minute or so) Emacs will give up trying to load ~./emacs and continue. But waiting for Emacs to timeout is annoying (typing Ctrl-Z does not seem to interrupt this timeout). I want to shorten the amount of time that Emacs waits before giving up. I have tried the suggestion at this site which says to put the following code in the site-start.el file: (with-timeout (4) (load remote-.emacs)) However, when I do that I get the error Error in init file: Symbol's value as variable is void: remote-\.emacs whenever starting Emacs. How can I shorten this timeout?

    Read the article

  • SQLS Timeouts - High Reads in Profiler

    - by lb01
    Hi I've audited a SQLS2008 server with Profiler for one day.. the overhead didn't seem to trouble this new client my company has. They are using a legacy VB6 application as a front-end. They're experiencing timeouts once SQLS RAM usage is high. The server is currently running x64 sqls2008 on a VM with nearly 9 GB of RAM. SQL Server's 'max server memory option' is currently set to 6GB. I've put the results of the trace in a table and queried them using this query. SELECT TextData, ApplicationName, Reads FROM [TraceWednesday] WHERE textdata is not null and EventClass = 12 GROUP BY TextData, ApplicationName, Reads ORDER BY Reads DESC As I expected, some values are very high. Top Reads, in pages. 2504188 1965910 1445636 1252433 1239108 1210153 1088580 1072725 Am I correct in thinking that the top one (2504188 pages) is 20033504 KB, which then is roughly ~20'000 MB, 20GB? These queries are often executed and can take quite some time to run. Eventually RAM is used up because of the cache fattening, and timeouts occur once SQL cannot 'splash' pages in the buffer pool as much. Costs go up. Am I correct in my understanding? I've read that I should tune the associated T-SQL and create appropriate indices. Obviously cutting down the I/O would make SQL Server use less RAM. OR, maybe it might just slow down the process of chewing up the whole RAM. If a lot less pages are read, maybe it'll all run much better even when usage is high? (less time swapping, etc.) Currently, our only option is to restart SQL once a week when RAM usage is high, suddenly the timeouts disappear. SQL breathes again. I'm sure lots of DBAs have been in this situation.. I'm asking before I start digging out all of the bad T-SQL and put indices here and there, is there is something else I can do? Any advice except from what I know (not much yet..) Much appreciated. Leo.

    Read the article

  • How to browse Windows XP from Mac Finder when name disappears from finder

    - by Chris
    Occasionally, like right at this moment, I cannot access my windows share from my mac. Normally, it works, but every now and then, the computer name won't be displayed under SHARED in Finder. Rebooting the windows computer usually fixes this, but it's inconvenient. The Windows computer can see the Mac on the network. Is there a method of asking finder to poll for windows shares again, or "forcing" finder to look for "desktop"? I'm looking for the equivalent of \desktop in the address bar of a Windows computer. Thanks for the help.

    Read the article

  • Render a 3D image as a 2D vector image

    - by Clinton Blackmore
    Is there any software that will take a 3d model (in any format) and allow you to render it as a 2D vector image (preferable as either an .SVG or .PDF)? My intention is to render LEGO building instructions this way. While there are many tools that let you view them or generate nice, rasterized output, I'd really like to be able to generate vectorized output. Textures are not needed, and hidden line removal may not be needed. I could use a tool that works on any platform (although my preference is OS X, Linux, then Windows). Open source is preferred. If no one knows of a tool that does this, does anyone have a good recommendation of something to hack on and add a feature to output via Cairo?

    Read the article

  • How to estimate freight / shipping costs ??

    - by Vani
    Hi, I am working on a PHP web application and want to know the best way to estimate freight costs in USA. The site deals with construction materials that uses LTL or Truck loads. I found a few sites like www.freightCenter.com that provide quotes using webservice. Two drawbacks, its paid service and the other, my site response time is slow if I use the webservice. Is there a open source tool/logic avaliable for estimating shipping / freight costs?? Or a way to determine the rate per mile per pound for different freight classes? Thank you, Vani

    Read the article

  • Bitmap font rendering, UV generation and vertex placement

    - by jack
    I am generating a bitmap, however, I am not sure on how to render the UV's and placement. I had a thread like this once before, but it was too loosely worded as to what I was looking to do. What I am doing right now is creating a large 1024x1024 image with characters evenly placed every 64 pixels. Here is an example of what I mean. I then save the bitmap X/Y information to a file (which is all multiples of 64). However, I am not sure how to properly use this information and bitmap to render. This falls into two different categories, UV generation and kerning. Now I believe I know how to do both of these, however, when I attempt to couple them together I will get horrendous results. For example, I am trying to render two different text arrays, "123" and "njfb". While ignoring the texture quality (I will be increasing the texture to provide more detail once I fix this issue), here is what it looks like when I try to render them. http://img64.imageshack.us/img64/599/badfontrendering.png Now for the algorithm. I am doing my letter placement with both GetABCWidth and GetKerningPairs. I am using GetABCWidth for the width of the characters, then I am getting the kerning information for adjust the characters. Does anyone have any suggestions on how I can implement my own bitmap font renderer? I am trying to do this without using external libraries such as angel bitmap tool or freetype. I also want to stick to the way the bitmap font sheet is generated so I can do extra effects in the future. Rendering Algorithm for(U32 c = 0, vertexID = 0, i = 0; c < numberOfCharacters; ++c, vertexID += 4, i += 6) { ObtainCharInformation(fontName, m_Text[c]); letterWidth = (charInfo.A + charInfo.B + charInfo.C) * scale; if(c != 0) { DWORD BytesReq = GetGlyphOutlineW(dc, m_Text[c], GGO_GRAY8_BITMAP, &gm, 0, 0, &mat); U8 * glyphImg= new U8[BytesReq]; DWORD r = GetGlyphOutlineW(dc, m_Text[c], GGO_GRAY8_BITMAP, &gm, BytesReq, glyphImg, &mat); for (int k=0; k<nKerningPairs; k++) { if ((kerningpairs[k].wFirst == previousCharIndex) && (kerningpairs[k].wSecond == m_Text[c])) { letterBottomLeftX += (kerningpairs[k].iKernAmount * scale); break; } } letterBottomLeftX -= (gm.gmCellIncX * scale); } SetVertex(letterBottomLeftX, 0.0f, zFight, vertexID); SetVertex(letterBottomLeftX, letterHeight, zFight, vertexID + 1); SetVertex(letterBottomLeftX + letterWidth, letterHeight, zFight, vertexID + 2); SetVertex(letterBottomLeftX + letterWidth, 0.0f, zFight, vertexID + 3); zFight -= 0.001f; float BottomLeftX = (F32)(charInfo.bitmapXOrigin) / (float)m_BitmapWidth; float BottomLeftY = (F32)(charInfo.bitmapYOrigin + charInfo.charBitmapHeight) / (float)m_BitmapWidth; float TopLeftX = BottomLeftX; float TopLeftY = (F32)(charInfo.bitmapYOrigin) / (float)m_BitmapWidth; float TopRightX = (F32)(charInfo.bitmapXOrigin + charInfo.B - charInfo.C) / (float)m_BitmapWidth; float TopRightY = TopLeftY; float BottomRightX = TopRightX; float BottomRightY = BottomLeftY; SetTextureCoordinate(TopLeftX, TopLeftY, vertexID + 1); SetTextureCoordinate(BottomLeftX, BottomLeftY, vertexID + 0); SetTextureCoordinate(BottomRightX, BottomRightY, vertexID + 3); SetTextureCoordinate(TopRightX, TopRightY, vertexID + 2); /// index setting letterBottomLeftX += letterWidth; previousCharIndex = m_Text[c]; }

    Read the article

  • Maintaining last stage when rotating through CATransform3DIdentity

    - by Mikhail Naimy
    Hi. i am rotating imageview through following code.it rotates fine..but when i rotate again , Imageview goes to previous angle( which is in initial stage) and then it rotates...any one can help in this?rotationTransform has been declared as CABasicAnimation* rotationAnimation in .h file.... - (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { UITouch *touch = [touches anyObject]; startTouchPosition = [touch locationInView:self.view]; } - (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { UITouch *touch = [[event allTouches] anyObject]; location = [touch locationInView:self.view]; currentLocationRadians = atan2f(location.y - self.view.frame.size.height/2, location.x - self.view.frame.size.width/2); lastLocationRadians = atan2f(startTouchPosition.y - self.view.frame.size.height/2, startTouchPosition.x - self.view.frame.size.width/2); rotationTransform = CATransform3DIdentity; rotationTransform = CATransform3DRotate(rotationTransform, currentLocationRadians-lastLocationRadians + rad, 0.0, 0.0, 1.0); _imgview.layer.transform = rotationTransform; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { rotationTransform = _imgview.layer.transform; }

    Read the article

  • android steganography

    - by poo123
    Im doing steganography on android...my code is as below.. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.src); picw = mBitmap.getWidth(); pich = mBitmap.getHeight(); pix= new int[picw * pich]; mBitmap.getPixels(pix, 0, picw, 0, 0, picw, pich); try { FileOutputStream fos = super.openFileOutput("dest.png", MODE_WORLD_READABLE); mBitmap.compress(CompressFormat.PNG, 100, fos); fos.flush(); fos.close(); }catch (Exception e) { tv.setText(e.getMessage()); } but whenever i save source image with Bitmap.compress() method pix[0] value before and after compression changed..so i'm unable to extract original data...please help me

    Read the article

  • How to authenticate WCF calls using forms authentication and secutity

    - by Fixer
    I'm planning a set up for a distributed application that spans serveral machines and will use WCF to send data in between. Machine A Front end website http://www.site.com Password protected site using Forms Authentication Machine B WCF Application Service http://service1.site.com/DoSomething.svc Machine C WCF Application Service http://service2.site.com/DoSomething.svc The WCF services on Machine B and Machine C should check that the request from Machine A has been authenticated. How can i check that the request is authenticated across the different machines? I only care that the request is authenticated and not concerned about securing the message body (because we are not sending any sensitive data across the wire), so SSL is not required. What authentication methods can i use for the above scenario?

    Read the article

  • New to Drupal -- how should I create a main page with a mix of dynamic and static content?

    - by Erode
    I apologize for the terribly basic question but I'm not even a particularly adept web dev. I've read that Drupal is great if you know exactly what you want to do (then the API is handy) but I don't even know what I need yet. That is what I am hoping to gain from this discussion. I want a main content page which has a fancy content slider (using jQuery or something) which will be a selector for showing some basic information on these 2 or 3 subjects. I'm stuck on where I should be writing this mix of markup. In the template? Create "content" through a content type? Since there's a fair share of CSS and markup required to do this, I don't know if I can do that through the "basic page" content type that was there. I'm looking for pointers that can teach me how I would become aware of what Drupal can and can not do. Thanks for reading, let me know if I need to clarify anything.

    Read the article

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