Daily Archives

Articles indexed Sunday January 9 2011

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

  • Pronunciation in programming?

    - by Xepoch
    How do you correctly or erroneously pronounce programming terms? Any that you find need strict correction or history into the early CS culture? Programming char = "tchar" not care? ! = bang not exclamation? # = pound not hash? Exception #! = shebang * = splat not star? regex = "rej ex" not "regg ex"? sql = "s q l" not "sequel" (already answered, just i.e.) Unixen | = pipe not vertical bar? bin = bin as in pin , not as in binary? lib = lib as in library , not as in liberate? etc = "ett see" , not "e t c" (as in /etc and not "&c") Annoyance / = slash not backslash LaTeX = "laytek" not "lay teks"

    Read the article

  • LPR printing in Ubuntu

    - by Ben
    I'm trying to set up printing to a networked LPR printer, but I can't seem to make it work. The connexion information that IT gives is: Print Spooler: printing.domain.edu Printer Name: PrinterName Print port: 515 Bidirectional: Disabled It's an HP LaserJet p4015x, and I'm using the "HP LaserJet p4015x, hpcups 3.10.6 (color, 2-sided printing)" driver, according to CUPS. I have tried installing via the CUPS admin interface as lpd://printing.domain.edu:515/PrinterName, lpd://printing.domain.edu/PrinterName, and http://printing.domain.edu:515/PrinterName, and none of these has worked (i.e. test pages show up as "stopped").

    Read the article

  • CS4326/7 sound chipset on Thinkpad 600E

    - by user7120
    OK, I know this has been a problem for a while, and I know by now this really old Pentium II laptop is really really really obsolete. However, I have installed Lubuntu 10.10 on this laptop and things seem to work fine except the sound. Now I've read and gone through a bunch of tutorials and guides to working around this, none of which have worked. I have gone through this Ubuntu bug report and that doesn't work either. The problem I think is that the latest workaround is (understandably) about two Ubuntu versions behind. Now I'm not sure what has changed since then to make that workaround not work, but I would appreciate any help. Thanks

    Read the article

  • Managing accounts on a private website for a real-life community

    - by Smudge
    Hey Pro Webmasters, I'm looking at setting-up a walled-in website for a real-life community of people, and I was wondering if anyone has any experience with managing member accounts for this kind of thing. Some conditions that must be met: This community has a set list of real-life members, each of whom would be eligible for one account on the website. We don't expect or require that they all sign-up. It is purely opt-in, but we anticipate that many of them would be interested in the services we are setting up. Some of the community members emails are known, but some of them have fallen off the grid over the years, so ideally there would be a way for them to get back in touch with us through the public-facing side of the site. (And we'd want to manually verify the identity of anyone who does so). Their names are known, and for similar projects in the past we have assigned usernames derived from their real-life names. This time, however, we are open to other approaches, such as letting them specify their own username or getting rid of usernames entirely. The specific web technology we will use (e.g. Drupal, Joomla, etc) is not really our concern right now -- I am more interested in how this can be approached in the abstract. Our database already includes the full member roster, so we can email many of them generated links to a page where they can create an account. (And internally we can require that these accounts be paired with a known member). Should we have them specify their own usernames, or are we fine letting them use their registered email address to log-in? Are there any paradigms for walled-in community portals that help address security issues if, for example, one of their email accounts is compromised? We don't anticipate attempted break-ins being much of a threat, because nothing about this community is high-profile, but we do want to address security concerns. In addition, we want to make the sign-up process as painless for the members as possible, especially given the fact that we can't just make sign-ups open to anyone. I'm interested to hear your thoughts and suggestions! Thanks!

    Read the article

  • screnshot in android

    - by ujjawal
    The following is the code I am using to take a screen shot using GLSurfaceView. But I dont know why the onDraw() method in the GLSurfaceView.Renderer Class is not being called. Please if some one can look at the code below and point out what am I doing wrong.`public class MainActivity extends Activity { private GLSurfaceView mGLView; int x,y,w,h; Display disp; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); // ToDo add your GUI initialization code here setContentView(R.layout.main); x=0; y=0; disp = getWindowManager().getDefaultDisplay(); w = disp.getWidth(); h = disp.getHeight(); mGLView = new ClearGLSurfaceView(this); } class ClearGLSurfaceView extends GLSurfaceView { public ClearGLSurfaceView(Context context) { super(context); setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS); mRenderer = new ClearRenderer(); setRenderer(mRenderer); } ClearRenderer mRenderer; } class ClearRenderer implements GLSurfaceView.Renderer { public void onSurfaceCreated(GL10 gl, EGLConfig config) { // Do nothing special. } public void onSurfaceChanged(GL10 gl, int w, int h) { //gl.glViewport(0, 0, w, h); } public void onDrawFrame(GL10 gl) { //gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); int b[]=new int[w*(y+h)]; int bt[]=new int[w*h]; IntBuffer ib=IntBuffer.wrap(b); ib.position(0); gl.glReadPixels(x, 0, w, y+h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, ib); for(int i=0, k=0; i<h; i++, k++) {//remember, that OpenGL bitmap is incompatible with Android bitmap //and so, some correction need. for(int j=0; j<w; j++) { int pix=b[i*w+j]; int pb=(pix>>16)&0xff; int pr=(pix<<16)&0x00ff0000; int pix1=(pix&0xff00ff00) | pr | pb; bt[(h-k-1)*w+j]=pix1; } } Bitmap bmp = Bitmap.createBitmap(bt, w, h,Bitmap.Config.ARGB_8888); try { File f = new File("/sdcard/testpicture.png"); f.createNewFile(); FileOutputStream fos=new FileOutputStream(f); bmp.compress(CompressFormat.PNG, 100, fos); try { fos.flush(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { fos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch(IOException e) { e.printStackTrace(); } } } } ` Please someone help me out. I have just started learning to work on android.

    Read the article

  • Wordpress and Anythingslider Navigation Thumbnails

    - by Tom
    So I am using AnythingSlider in Wordpress. This is why I am trying to call the thumbnails from the original posts. Anything slider will configure thumbnail navigation like this: function formatText(index, panel) { return index + ""; } $(function () { $('.anythingSlider').anythingSlider({ navigationFormatter: formatText // Details at the top of the file on this use (advanced use) }); }); As you can see, the navigationFormatter will allow me to format the nav (including thumbnails) however I want. For example, to format thumbnails, I could do this: navigationFormatter : function(i, panel){ // add thumbnails as navigation links return '<img src="images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i - 1] + '.jpg">'; } So my issue is getting the wordpress slide images to show up there dynamically, rather than in a folder (as the above example shows). For reference, this is my php query that is pulling the posts image (from a script I've already written: <img class="slider-img" style="float:left;" src="<?php if(function_exists('wp_get_post_image')){ echo wp_get_post_image(array( 'return_html' => false, 'width' => 500 )); } ?>" /> I hope this update helps. Thank you guys so much. The Stack overflow community is great!

    Read the article

  • Javascript and VERY LONG string

    - by StealthRT
    Hey all, i am having problems with the below code: function showTableData() { var tableArray; var x = 0; var theHTML; for (i = 0; i < 7032; i++) { if (x = 0) { theHTML = '<tr>' + '<th scope="row" class="spec">' + partNum[i] + '</th>' + '<td>' + Msrp[i] + '</td>' + '<td>' + blah[i] + '</td>' + '<td>' + blahs[i] + '</td>' + '</tr>' + theHTML; x++; }else{ theHTML = '<tr>' + '<th scope="row" class="specalt">' + partNum[i] + '</th>' + '<td class="alt">' + Msrp[i] + '</td>' + '<td class="alt">' + blah[i] + '</td>' + '<td class="alt">' + blahs[i] + '</td>' + '</tr>' + theHTML; x--; } } theHTML = '<table id="mytable" cellspacing="0">' + '<tr>' + '<th scope="col" abbr="Configurations" class="nobg">Part Number</th>' + '<th scope="col" abbr="Dual 1.8">Msrp Price</th>' + '<th scope="col" abbr="Dual 2">blahs Price</th>' + '<th scope="col" abbr="Dual 2.5">Low Price</th>' + '</tr>' + theHTML + '</table>'; $('#example').append(theHTML); } </script> <div id="example"> </div> The problem being that the $('#example').append(theHTML); never executes (or shows on the page). I think its because the string is soooooo long! It has over 7,000 items in the array so im not sure if thats the reason or if its something else? Any help would be great! Thanks! David

    Read the article

  • Go and a bad prime number algorithm

    - by anonymous
    I wrote this prime number sieving algorithm and it doesn't run properly. I can't find the error in the algorithm itself. Could someone help me? This is what it's supposed to print: [2 3 5 7 11 13 17 19 23 29] Versus what it actually prints: [3 5 7 11 13 17 19 23 25 29] . package main import "fmt" func main() { var primes = sieve(makeNumbers(29)) fmt.Printf("%d\n", primes); } func makeNumbers(n int) []int { var numbers = make([]int, n - 1) for i := 0; i < len(numbers); i++ { numbers[i] = i + 2 } return numbers } func sieve(numbers []int) []int { var numCopy = numbers var max = numbers[len(numbers)-1] var sievedNumbers = make([]int, 0) for i := 0; numCopy[i]*numCopy[i] <= max; i++ { for j := i; j < len(numCopy); j++ { if numCopy[j] % numCopy[i] != 0 || j == i { sievedNumbers = append(sievedNumbers, numCopy[j]) } } numCopy = sievedNumbers sievedNumbers = make([]int, 0) } return numCopy }

    Read the article

  • regex to break a string into "key" / "value" pairs when # of pairs is variable?

    - by user141146
    Hi, I'm using Ruby 1.9 and I'm wondering if there's a simple regex way to do this. I have many strings that look like some variation of this: str = "Allocation: Random, Control: Active Control, Endpoint Classification: Safety Study, Intervention Model: Parallel Assignment, Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes Assessor), Primary Purpose: Treatment" The idea is that I'd like to break this string into its functional components Allocation: Random Control: Active Control Endpoint Classification: Safety Study Intervention Model: Parallel Assignment Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes, Assessor) Primary Purpose: Treatment The "syntax" of the string is that there is a "key" which consists of one or more "words or other characters" (e.g. Intervention Model) followed by a colon (:). Each key has a corresponding "value" (e.g., Parallel Assignment) that immediately follows the colon (:)…The "value" consists of words, commas (whatever), but the end of the "value" is signaled by a comma. The # of key/value pairs is variable. I'm also assuming that colons (:) aren't allowed to be part of the "value" and that commas (,) aren't allowed to be part of the "key". One would think that there is a "regexy" way to break this into its component pieces, but my attempt at making an appropriate matching regex only picks up the first key/value pair and I'm not sure how to capture the others. Any thoughts on how to capture the other matches? regex = /(([^,]+?): ([^:]+?,))+?/ => /(([^,]+?): ([^:]+?,))+?/ irb(main):139:0> str = "Allocation: Random, Control: Active Control, Endpoint Classification: Safety Study, Intervention Model: Parallel Assignment, Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes Assessor), Primary Purpose: Treatment" => "Allocation: Random, Control: Active Control, Endpoint Classification: Safety Study, Intervention Model: Parallel Assignment, Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes Assessor), Primary Purpose: Treatment" irb(main):140:0> str.match regex => #<MatchData "Allocation: Random," 1:"Allocation: Random," 2:"Allocation" 3:" Random,"> irb(main):141:0> $1 => "Allocation: Random," irb(main):142:0> $2 => "Allocation" irb(main):143:0> $3 => " Random," irb(main):144:0> $4 => nil

    Read the article

  • Error with MySQL Query

    - by Ken
    Okay, I must be an idiot, because this is my 3rd question for today. Here's my code: date_default_timezone_set("America/Los_Angeles"); include("mainmenu.php"); $con = mysql_connect("localhost", "root", "********"); if(!$con){ die(mysql_error()); } $usrname = $_POST['usrname']; $fname = $_POST['fname']; $lname = $_POST['lname']; $password = $_POST['password']; $email = $_POST['email']; mysql_select_db("`users`, $con) or die(mysql_error()"); $query = ("INSERT INTO `users`.`data` (`id`, `usrname`, `fname`, `lname`, `email`, `password`) VALUES (NULL, '$usrname', '$fname', '$lname', '$email', 'password'))"); mysql_query('$query') or die(mysql_error()); mysql_close($con); echo("Thank you for registering!"); I always get the error returned as: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$query' at line 1. Help a newbie. I'm about to stab my monitor.

    Read the article

  • Jquery Flexigrid reload only if flexigrid initially ran

    - by John
    Im trying to use flexigrid to show results using the values from a form. So when a person clicks a form I want it to load the flexigrid function if its the first time the person clicked the button to initialize the table. Then if someone adjusts the values in the form then clicks the button again it then reloads the flexigrid table with the new form values. How can I do this in one function? Right now I have the flexigrid code running on page load, then if they click the button it runs this: <script type="text/javascript"> $(function() { $('#RunReport').click( function() { var report_name = $('input[name=report-name]').val(); var report_cell = $('input[name=report-cell]').val(); var query_url = encodeURI('name=' + report_name + '&cell=' + report_cell); $('#reporting').flexOptions({ url: '/report.php?' + query_url }).flexReload(); }); }); </script> But instead of having it in both functions I wanted it all in one function only running the reload if flexigrid was already initialized. Hope this makes sense, still new at all of this.

    Read the article

  • Objective C LValue required as unary '&' operand

    - by Bob
    Hello! In my code, I get this error when I try to get a pointer to my class property. (I wrote a small *.OBJ file translator in Python, discarding the normals) CODE: //line: line of text const char *str = [line UTF8String]; Point3D *p1, *p2, *p3; p1 = [Point3D makeX:0 Y:0 Z:0]; p2 = [Point3D makeX:0 Y:0 Z:0]; p3 = [Point3D makeX:0 Y:0 Z:0]; sscanf(str, "t %f,%f,%f %f,%f,%f %f,%f,%f",(&[p1 x]),&([p1 y]),&([p1 z]),&([p2 x]),&([p2 y]),&([p2 z]),&([p3 x]),&([p3 y]),&([p3 z])); Triangle3D *tri = [Triangle3D make:p1 p2:p2 p3:p3];

    Read the article

  • MySQL indexes: how do they work?

    - by bob-the-destroyer
    I'm a complete newbie with MySQL indexes. I have several MyISAM tables on MySQL 5.0x having utf8 charsets and collations with 100k+ records each. The primary keys are generally integer. Many columns on each table may have duplicate values. I need to quickly count, sum, average, or otherwise perform custom calculations on any number of fields in each table or joined on any number of others. I found this page giving an overview of MySQL index usage: http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html, but I'm still not sure I'm using indexes right. Just when I think I've made the perfect index out of a collection of fields I want to calculate against, I get the "index must be under 1000 bytes" error. Can anyone explain how to most efficiently create and use indexes to speed up queries? Caveat: upgrading Mysql is not possible in this case. Using Navicat Light for db administration, but this app isn't required.

    Read the article

  • ListView adapter data change without ListView being notified

    - by brockoli
    I've written a ListActivity that has a custom list adapter. The list is being updated from a ContentProvider when onCreate is run. I also have a service that gets started when I run the app and it first updates the ContentProvider, then sends a Broadcast that the content has been updated. My ListActivity recieves the broadcast and tries to update my ListView. My problem is, I'm getting intermittent errors about the ListView adapter data changing without the ListView being notified. I call the notifyDataSetChanged() method on my list adapter right after I update it. What it seems like is happening is the list is still in the process of being updated after first call in onCreate when it recieves the broadcast from the service to update, so it tries to update my ListView before it's finished updating from it's first run. Does this make sense? Here is some of my code. NOTE: The service is working properly, it gets new data and updates my ContentProvider, and I do get the broadcast in my activity when it is updated. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ctx = this; getPrefs(); setContentView(R.layout.main); // Setup preference listener preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences.registerOnSharedPreferenceChangeListener(listener); // Setup report list adapter ListView nzbLv = (ListView) findViewById(R.id.report_list); nzbla = new NZBReportListAdaptor(ctx); getReports(); nzbla.setListItems(report_list); nzbLv.setAdapter(nzbla); // Broadcast receiver to get notification from NZBService to update ReportList registerReceiver(receiver, new IntentFilter(NZBService.BROADCAST_ACTION)); startService(new Intent(ctx, NZBService.class)); } @Override public void onResume() { super.onResume(); timerHandler.resume(); new updateSabQueue().execute(); //updateList(); } @Override public void onPause() { super.onPause(); timerHandler.pause(); unregisterReceiver(receiver); } private BroadcastReceiver receiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { Toast.makeText(ctx, "NZBService broadcast recieved", Toast.LENGTH_SHORT).show(); updateReportList(); } }; private void updateReportList() { new updateReportList().execute(); } private class updateReportList extends AsyncTask<Void, Void, Boolean> { /* (non-Javadoc) * @see android.os.AsyncTask#onPreExecute() * Show progress dialog */ protected void onPreExecute() { } /* (non-Javadoc) * @see android.os.AsyncTask#doInBackground(Params[]) * Get new articles from the internet */ protected Boolean doInBackground(Void...unused) { getReports(); return true; } /** * On post execute. * Close the progress dialog */ @Override protected void onPostExecute(Boolean updated) { if (updated) { Log.d(TAG, "NZB report list adapter updated"); synchronized(this) { nzbla.setListItems(report_list); } Log.d(TAG, "NZB report list notified of change"); nzbla.notifyDataSetChanged(); } } } Now that this question is answered, I will post my updated code in an effort to help others who might come across it. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ctx = this; getPrefs(); setContentView(R.layout.main); // Setup preference listener preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences.registerOnSharedPreferenceChangeListener(listener); // Setup report list adapter ListView nzbLv = (ListView) findViewById(R.id.report_list); nzbla = new NZBReportListAdaptor(ctx); report_list.addAll(getReports()); nzbla.setListItems(report_list); nzbLv.setAdapter(nzbla); // Broadcast receiver to get notification from NZBService to update ReportList registerReceiver(receiver, new IntentFilter(NZBService.BROADCAST_ACTION)); startService(new Intent(ctx, NZBService.class)); } private class updateReportList extends AsyncTask<Void, Void, ArrayList<Report>> { /* (non-Javadoc) * @see android.os.AsyncTask#onPreExecute() * Show progress dialog */ protected void onPreExecute() { } /* (non-Javadoc) * @see android.os.AsyncTask#doInBackground(Params[]) * Get new articles from the internet */ protected ArrayList<Report> doInBackground(Void...unused) { return getReports(); } /** * On post execute. * Close the progress dialog */ @Override protected void onPostExecute(ArrayList<Report> updated) { nzbla.setListItems(updated); nzbla.notifyDataSetChanged(); } } private ArrayList<Report> getReports() { ArrayList<Report> reports = new ArrayList<Report>(); ContentResolver r = getContentResolver(); Cursor c = r.query(NZBReportProvider.CONTENT_URI, null, null, null, NZBReportProvider.ARTICLE_KEY_ROWID + " DESC"); startManagingCursor(c); Log.d(TAG, "NZBReport cursor.getCount=" + c.getCount()); int title = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_TITLE); int desc = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_DESCRIPTION); int cat = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_CAT); int size = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_SIZE); int link = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_LINK); int catid = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_CATID); int date = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_DATE_ADDED); int group = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_GROUP); if (c.getCount() > 0) { c.moveToFirst(); do { URL url = null; try { url = new URL(c.getString(link)); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } reports.add(new Report(c.getString(title), url, c.getString(desc), c.getString(cat), c.getString(date), c.getString(size), c.getInt(catid), c.getString(group))); } while (c.moveToNext()); } return reports; }

    Read the article

  • Getting Clipboard data in raw format in c++

    - by qwertymk
    I've been playing around with the windows clipboard. I noticed that you can only view the clipboard if you supply a format. I've seen programs that can dump the raw contents of the clipboard. Look at http://www.autohotkey.com/docs/misc/Clipboard.htm#ClipboardAll for an example of what I mean. Is there a way to do something similar, what I want to do is be able to back up the clipboard, manipulate it, then restore it when my program is done. I'm looking for a non-.net solution if that's actually a thing

    Read the article

  • mysql update unique index

    - by atno
    Is there a way to say UPDATE items SET qty=10 WHERE **unique key** instead of saying UPDATE items SET qty=10 WHERE userID=1 AND listID=10 and itemID=100 on the following table? CREATE TABLE IF NOT EXISTS `items` ( `userID` int(20) NOT NULL, `listID` int(20) NOT NULL, `itemID` int(20) NOT NULL, `qty` int(10) NOT NULL, UNIQUE KEY `unique` (`userID`,`listID`,`itemID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

    Read the article

  • Jquery Var Returned As object

    - by alex
    I'm trying to pass a variable from one function to another, but the var elmId is being returned as an object and giving an error. When we click on any of the generated divs we should be able to change the size of the div by choosing a width / height value from the drop down menus. I'm trying to pass the clicked div id which is elmId to function displayVals but it is not working. If we replace "#"+elmId in the function displayVals with the actual id of the first div created with is "#divid1" then it works. Why is the value of var elmId not being passed to displayVals <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/base/jquery-ui.css" type="text/css" media="all" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js" type="text/javascript"></script> <style> .aaa{width:100px; height:100px; background-color:#ccc;} button{width:100px; height:20px;} </style> <button class="idiv">div</button> <select id="width"> <option>100px</option> <option>200px</option> <option>300px</option> </select> <select id="height"> <option>100px</option> <option>200px</option> <option>300px</option> </select> <p></p> <script type="text/javascript"> var divId = 1; $("button").click(function(){ var elm = $('<div id=divid' + divId + ' class=aaa></div>'); elm.appendTo('p'); divId++; }); $("p").click(function(e){ var elmType = $(e.target)[0].nodeName, elmId = $(e.target)[0].id; return displayVals(elmId); }); function displayVals(elmId) { var iwidth = $("#width").val(); var iheight = $("#height").val(); $("#"+elmId).css({width:iwidth, height:iheight}); console.log(elmId); } $("select").change(displayVals); displayVals(); </script>

    Read the article

  • How can I make Vim autosave files when it loses focus?

    - by Peeja
    I'm used to my editors autosaving files when they lose focus. I recently switched to MacVim, and I can't recreate that behavior. I tried this: autocmd BufLeave,FocusLost * wall but if a buffer is unnamed when the window or MacVim loses focus, I get an error like the following: Error detected while processing BufLeave Auto commands for "*": E141: No file name for buffer 1 I'm confused, because :wall's documentation says: Write all changed buffers. Buffers without a file name or which are readonly are not written. so I'd expect it to skip unnamed buffers. Is there a better way to do this?

    Read the article

  • Resizing Images In a Table Using JavaScript

    - by Abluescarab
    Hey, all. I apologize beforehand if none of this makes sense, or if I sound incompetent... I've been making webpages for a while, but don't know any JavaScript. I am trying to make a webpage for a friend, and he requested if I could write some code to resize the images in the page based on the user's screen resolution. I did some research on this question, and it's kind of similar to this, this, and this. Unfortunately, those articles didn't answer my question entirely because none of the methods described worked. Right now, I have a three-column webpage with 10 images in a table in the left sidebar, and when I use percentages for their sizes, they don't resize right between monitors. As such, I'm trying to write a JavaScript function that changes their sizes after detecting the screen resolution. The code is stripped from my post if I put it all, so I'll just say that each image links to a website and uses a separate image to change color when you hover over it. Would I have to address both images to change their sizes correctly? I use a JavaScript function to switch between them. Anyway, I tried both methods in this article and neither worked for me. If it helps, I'm using Google Chrome, but I'm trying to make this page as cross-browser as possible. Here's the code I have so far in my JavaScript function: function resizeImages() { var w = window.width; var h = window.height; var yuk = document.getElementById('yuk').style; var wb = document.getElementById('wb').style; var tf = document.getElementById('tf').style; var lh = document.getElementById('lh').style; var ko = document.getElementById('ko').style; var gz = document.getElementById('gz').style; var fb = document.getElementById('fb').style; var eg = document.getElementById('eg').style; var dl = document.getElementById('dl').style; var da = document.getElementById('da').style; if (w = "800" && h = "600") { } else if (w = "1024" && h = "768") { } else if (w = "1152" && h = "864") { } else if (w = "1280" && h = "720") { } else if (w = "1280" && h = "768") { } else if (w = "1280" && h = "800") { } else if (w = "1280" && h = "960") { } else if (w = "1280" && h = "1024") { } } Yeah, I don't have much in it because I don't know if I'm doing it right yet. Is this a way I can detect the "width" and "height" properties of a window? The "yuk", "wb", etcetera are the images I'm trying to change the size of. To sum it up: I want to resize images based on screen resolution using JavaScript, but my research attempts have been... futile. I'm sorry if that was long-winded, but thanks ahead of time!

    Read the article

  • integriting facebook login button with Facebooker (rails plugin)

    - by dexterdeng
    I was integriting login-button with Facebooker, as I wanted to use facepile and customise the facebook login button, so I have to use facebook js sdk. I used the facebooker to connect facebook. now I found a issue. window.fbAsyncInit = function() { FB.init({ appId: '<%=Facebooker.api_key%>', status: true, cookie: true, xfbml: true }); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); function fblogin(){ var pearms = "email,user_birthday,friends_location,offline_access,publish_stream,read_friendlists,user_birthday,user_location"; FB.getLoginStatus(function(response) { if (response.session) { // logged in and connected user, someone you know window.location = "http://domain/account/link_user_accounts"; return true; } else { // no user session available, someone you dont know FB.login(function(response) { if (response.session) { if (response.perms) { // after logged in the facebook account. $.inspect(response.perms);//return all these perms I expected. it should be fine there. window.location = "http://domain/account/link_user_accounts"; } return true; } else { return false; } },"email,user_birthday,friends_location,offline_access,publish_stream,read_friendlists"); } }) }; Let's say if the api_key is "1111111111". take a look at this line: " ` if (response.session) { if (response.perms) { $.inspect(response.perms); " now I was trying to login , call fblogin() , I'm sure that the response.perms equal to the perms I expected. (btw, at that time, I have a facebook plugin named facepile works too, it showed my friends after I called fblogin() and connected to facebook by typing my email and password ). so now it should run window.location = "http://domain/account/link_user_accounts"; yes, this line run. but the facebook_session can't build successfully. after digging the facebooker's code, I found this from the rails plugin facebooker: def create_facebook_session secure_with_facebook_params! || secure_with_cookies! || secure_with_token! end mostly, it would run secure_with_cookies! , and if the cookies with keys as "fbs_#{Facebooker.api_key}","#{Facebooker.api_key}_ss", "#{Facebooker.api_key}_session_key",.. created, then the facebook_session can be created. but these cookies can't be created after I logged in facebook until I refresh the current page by hand . I noticed if I refresh the page, the cookies with these keys added to the browser. but why they can't be added after I logged in facebook at once? I need these keys to create facebook_session. did I forgot something excepted these code I pasted? anybody help? thank you very much!

    Read the article

  • How can I download information from bank accounts?

    - by Eric Anastas
    There are a number of free finance tracking sites out there like mint.com, wesabe.com etc.. . I've tried all of them and all seem to miss the mark in one way or another. I'm interested in creating my own website, or possibly just a stand alone windows program for tracking my finances in ASP.NET or C#.NET. I'm assuming the answer is no, but is there any way that a personal developer can download transactions from financial websites like these? I know once you login to most financial sites you can download a CSV or Quicken file. Yet I really like how I can log-in to my Mint.com account and update all my accounts with one click.

    Read the article

  • translating play in HTML to python

    - by aharon
    So, I'd like to represent one of Shakespeare's plays, Hamlet, into the following objects (maybe this isn't the best representation, if so please tell me): class Play(): acts = [] ... def add_act(self, act): acts.append(act) class Act(): scenes = [] ... def add_scene(self, scene): scenes.append(scene) class Scene(): elems = [] def __init__(self, title, setting=""): ... def add_elem(self, elem): elems.append(elem) ... class StageDirection(): # elem def __init__(self, text): ... class Line(): # elem def __init__(self, id, text, character = None): ... # A None character represents a continuation from the previous line # id could be, for example, 1.1.1 There are other methods, of course, for printing and such in each of the classes. The question is, how do I get a structure based on these classes (or something like them) from HTML 4 code that looks like this: <H3>ACT I</h3> <h3>SCENE I. Elsinore. A platform before the castle.</h3> <p><blockquote> <i>FRANCISCO at his post. Enter to him BERNARDO</i> </blockquote> <A NAME=speech1><b>BERNARDO</b></a> <blockquote> <A NAME=1.1.1>Who's there?</A><br> </blockquote> <A NAME=speech2><b>FRANCISCO</b></a> <blockquote> <A NAME=1.1.2>Nay, answer me: stand, and unfold yourself.</A><br> </blockquote> <A NAME=speech3><b>BERNARDO</b></a> <blockquote> <A NAME=1.1.3>Long live the king!</A><br> </blockquote> <A NAME=speech4><b>FRANCISCO</b></a> <blockquote> <A NAME=1.1.4>Bernardo?</A><br> </blockquote> <A NAME=speech5><b>BERNARDO</b></a> <blockquote> <A NAME=1.1.5>He.</A><br> </blockquote> <!-- for more, see the source of shakespeare.mit.edu/hamlet/full.html --> translating that into something like this: play = Play() actI = Act() sceneI = Scene("Scene I", "Elsinore. A platform before the castle.") sceneI.add_elem(StageDirection("Francisco at his post. Enter to him Bernardo.")) sceneI.add_elem(Line("Bernardo", "Who's there?")) ... Of course, I don't expect all the code—but what libraries and, when there aren't libraries, logic should I use? Thanks. (This is for a future opensource project and me learning Python for fun—not homework.)

    Read the article

  • Somewhat newb question about assy and the heap.

    - by Eric M
    Ultimately I am just trying to figure out how to dynamically allocate heap memory from within assembly. If I call Linux sbrk() from assembly code, can I use the address returned as I would use an address of a statically (ie in the .data section of my program listing) declared chunk of memory? I know Linux uses the hardware MMU if present, so I am not sure if what sbrk returns is a 'raw' pointer to real RAM, or is it a cooked pointer to RAM that may be modified by Linux's VM system? I read this: How are sbrk/brk implemented in Linux?. I suspect I can not use the return value from sbrk() without worry: the MMU fault on access-non-allocated-address must cause the VM to alter the real location in RAM being addressed. Thus assy, not linked against libc or what-have-you, would not know the address has changed. Does this make sense, or am I out to lunch?

    Read the article

  • Nginx + PHP5-FPM repeated cut outs 502

    - by James
    I've seen a number of questions here that highlight random 502 (Nginx + PHP-FPM = "Random" 502 Bad Gateway) and similar time outs when using Nginx + PHP-FPM. Even with all the questions, I'm still unable to find a solution. Using Ubuntu 10.10 + Nginx + PHP5-FPM + APC and every 1 out of 4 requests ends in a timeout and failure. This isn't a load issue or large traffic, it happens even in dev environment with one person. I am doing this across 3 1GB machines, each with the same configurations and same problems. fastcgi_params fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param REDIRECT_STATUS 200; /etc/php5/fpm/main.conf ; FPM Configuration ; ;include=/etc/php5/fpm/*.conf ; Global Options ; pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log ;log_level = notice ;emergency_restart_threshold = 0 ;emergency_restart_interval = 0 ;process_control_timeout = 0 ;daemonize = yes ; Pool Definitions ; include=/etc/php5/fpm/pool.d/*.conf /etc/php5/fpm/pool.d/www.conf [www] listen = 127.0.0.1:9000 ;listen.backlog = -1 ;listen.allowed_clients = 127.0.0.1 ;listen.owner = www-data ;listen.group = www-data ;listen.mode = 0666 user = www-data group = www-data ;pm.max_children = 50 pm.max_children = 15 ;pm.start_servers = 20 pm.min_spare_servers = 5 ;pm.max_spare_servers = 35 pm.max_spare_servers = 10 ;pm.max_requests = 500 ;pm.status_path = /status ;ping.path = /ping ;ping.response = pong request_terminate_timeout = 30 ;request_slowlog_timeout = 0 ;slowlog = /var/log/php-fpm.log.slow ;rlimit_files = 1024 ;rlimit_core = 0 ;chroot = chdir = /var/www ;catch_workers_output = yes

    Read the article

  • Windows Server 2008 R2 install reboots unexpectedly during "Completing installation" phase

    - by knda
    I am attempting to install Windows Server 2008 R2 onto a Cisco UCS C201 M2 rack mounted server but am having major difficulties and wondering if anyone has some insight or items they could recommend for me to look at to get this one resolved. Installation is being attempted via the Cisco remote console (using CIMC's Virtual dvd-rom).. following the first phase of Setup where the installation files are copied to the target hard drive, then a reboot occurs to load Setup from the HDD, mid-way in the "Completing Installation" phase the system then reboots unexpectedly. System configuration Cisco UCS C201 M2 (2RU rack mounted server) 16GB RAM, 2x 73GB 15K SAS, 4x 300GB 10k SAS Add-on cards - Intel quad-port GigE card (no fibre channel cards) Storage - LSI MegaRAID SAS 9261-8i. onboard SATA is disabled (no SATA drives connected) KVM - Belkin No physical DVD-ROM.. :( I have... Run memtest86+, no RAM faults Disabled/enabled SATA support (BIOS) Attempted install from USB DVD-ROM, no effect Attempted unattended install scripted via Cisco Configuration Manager DVD provided Removed Belkin KVM in case that was causing drama Discovered that the Cisco website is "awesome" for searching for PDFs/Drivers cough, reverted back to Google Downloaded latest LSI drivers from LSI's site and used during Server 2008 install checked Windows ISO against checksum's from MS site checked Windows ISO by using it for an install in a VM Running out of ways to troubleshoot this as I am not sure how to enable any sort of 'verbose' mode during the setup process. Next step I have planned is to remove the Intel NIC and try the installation again.. Edit: Problem was the "Cisco INTEL QUAD PT GBE" (1000/PT) .. will have to see if this card is faulty or if it's just drivers.. thanks for the help.

    Read the article

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