Daily Archives

Articles indexed Saturday June 30 2012

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

  • Declraing namespace schema with prefix in XSD/XML

    - by user1493537
    I am new to XML and I have a couple of questions about prefix. I need to "add the root schema element and insert the declaration for the XML schema namespace using the xc prefix. Set the default namespace and target of the schema to the URI test.com/test1" I am doing: <xc:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://test.com/test1" targetNamespace="http://test.com/test1"> </xc:schema> Is this correct? The next one is: "insert the root schema element, declaring the XML schema namespace with the xc prefix. Declare the library namespace using the lib prefix and the contributors namespace using the cont prefix. Set the default namespace and the schema target to URI test.com/test2" The library URI is http://test.com/library and contributor URI is test.com/contributor I am doing: <xc:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:lib="http://test.com/library" xmlns:clist="http://test.com/contributor" targetNamespace="http://test.com/test2"> </xc:schema> Does this look right? I am confused with prefix and all. Thanks for the help.

    Read the article

  • Listing documents directory contents in UITableView

    - by user1493543
    So I've researched extensively on how to list the files in the documents directory in a table view and after much deliberation, came up with this code. Whenever I run this, the app crashes with EXEC_BAD_ACCESS. I've been busting my head for hours, so any help would be appreciated. All I'm doing is acquiring the files in the documents directory and trying to list them in a table view... Code is pasted in link below. http://pastie.org/4178767 Edit- App crashes in numberOfRowsInSection: method.

    Read the article

  • C# Silverlight - XmlDictionary from Uri

    - by Robert White
    I've been developing a Silverlight application for a company's website and have encountered a problem. Up until now I have been programming this locally, now I need to publish the program onto the website; the issue is that FileStream can only access local files with elevated permissions. Here's a snippet of code: using (FileStream fileStream = new FileStream(@"E:\Users\LUPUS\Documents\Visual Studio 2010\Projects\Lycaon5\Lycaon5\acids.xdb", FileMode.Open)) { using (XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(fileStream, XmlDictionaryReaderQuotas.Max)) { //Read the XML file out. } } Without changing anything to do with XmlDictionaryReader reader - How could I go about reading the files from a relative Uri? Many Thanks, Rob. P.s. Apologies for the lack of formatting, me cave man, me don't know how.

    Read the article

  • Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in

    - by user1493540
    <html> <title>Title</title> <body> <link type="text/css" rel="stylesheet" href="css/bootstrap.css"/> </body> <center> <? mysql_connect ("localhost", "root","") or die (mysql_error()); mysql_select_db ("dbname"); $term = $_POST['term']; $sql = mysql_query("select * from items where name like '%$term%'"); while ($row = mysql_fetch_array($sql)){ echo '<table class="table - striped"> <theader> <tr> <th>ID</th> <th></br> Name</th></tr>'; echo ' <tbody><td>'.$row['id']; echo'</td>'; echo '<td>'; echo '</theader>' .$row['name']; echo '</td>'; echo ''; } ?> </center> <script src="js/bootsrap.js"> </script> </html> I'm, getting this error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/runedev1/public_html/itemdb/search.php on line 19 When I run the code on localhost using Xampp, it works fine, when I upload it to the web-host, the error appears. Yes, I am changing the database name, user and password when putting it on the webhost.

    Read the article

  • What is C# equivalent of PHP's mysql_fetch_array function?

    - by Mike Biff
    I am learning C#/ASP.NET and I am wondering what the C# equivalent of the following PHP code is? I know the userid, and I want to fetch the rows from this table into the array of the variable "row", so I then can use it as "row['name']" and "row['email']. $result = mysql_query("SELECT email, name FROM mytable WHERE id=7"); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { printf("Email: %s Name: %s", $row["email"], $row["name"]); } Thanks.

    Read the article

  • chaining array of tasks with continuation

    - by Andrei Cristof
    I have a Task structure that is a little bit complex(for me at least). The structure is: (where T = Task) T1, T2, T3... Tn. There's an array (a list of files), and the T's represent tasks created for each file. Each T has always two subtasks that it must complete or fail: Tn.1, Tn.2 - download and install. For each download (Tn.1) there are always two subtasks to try, download from two paths(Tn.1.1, Tn.1.2). Execution would be: First, download file: Tn1.1. If Tn.1.1 fails, then Tn.1.2 executes. If either from download tasks returns OK - execute Tn.2. If Tn.2 executed or failed - go to next Tn. I figured the first thing to do, was to write all this structure with jagged arrays: private void CreateTasks() { //main array Task<int>[][][] mainTask = new Task<int>[_queuedApps.Count][][]; for (int i = 0; i < mainTask.Length; i++) { Task<int>[][] arr = GenerateOperationTasks(); mainTask[i] = arr; } } private Task<int>[][] GenerateOperationTasks() { //two download tasks Task<int>[] downloadTasks = new Task<int>[2]; downloadTasks[0] = new Task<int>(() => { return 0; }); downloadTasks[1] = new Task<int>(() => { return 0; }); //one installation task Task<int>[] installTask = new Task<int>[1] { new Task<int>(() => { return 0; }) }; //operations Task is jagged - keeps tasks above Task<int>[][] operationTasks = new Task<int>[2][]; operationTasks[0] = downloadTasks; operationTasks[1] = installTask; return operationTasks; } So now I got my mainTask array of tasks, containing nicely ordered tasks just as described above. However after reading the docs on ContinuationTasks, I realise this does not help me since I must call e.g. Task.ContinueWith(Task2). I'm stumped about doing this on my mainTask array. I can't write mainTask[0].ContinueWith(mainTask[1]) because I dont know the size of the array. If I could somehow reference the next task in the array (but without knowing its index), but cant figure out how. Any ideas? Thank you very much for your help. Regards,

    Read the article

  • how to scan a LAN for live hosts using PHP and SNMP?

    - by aag
    I would like to have a quick script listing all active hosts in a LAN, and I am a bit lost. From other posts I figured that this can be done most effectively by polling the DHCP server (in my case a Lancom router) using SNMP. However, I am not familiar with the SNMP commands in PHP. Is snmpwalk() the correct function? Can I get snmpwalk() or any other php function to return an array that contains a list of all live hosts?

    Read the article

  • Parallel.For maintain input list order on output list

    - by romeozor
    I'd like some input on keeping the order of a list during heavy-duty operations that I decided to try to do in a parallel manner to see if it boosts performance. (It did!) I came up with a solution, but since this was my first attempt at anything parallel, I'd need someone to slap my hands if I did something very stupid. There's a query that returns a list of card owners, sorted by name, then by date of birth. This needs to be rendered in a table on a web page (ASP.Net WebForms). The original coder decided he would construct the table cell-by-cell (TableCell), add them to rows (TableRow), then each row to the table. So no GridView, allegedly its performance is bad, but the performance was very poor regardless :). The database query returns in no time, the most time is spent on looping through the results and adding table cells etc. I made the following method to maintain the original order of the list: private TableRow[] ComposeRows(List<CardHolder> queryResult) { int queryElementsCount = queryResult.Count(); // array with the query's size var rowArray = new TableRow[queryElementsCount]; Parallel.For(0, queryElementsCount, i => { var row = new TableRow(); var cell = new TableCell(); // various operations, including simple ones such as: cell.Text = queryResult[i].Name; row.Cells.Add(cell); // here I'm adding the current item to it's original index // to maintain order in the output list rowArray[i] = row; }); return rowArray; } So as you can see, because I'm returning a very different type of data (List<CardHolder> -> TableRow[]), I can't just simply omit the ordering from the original query to do it after the operations. Also, I also thought it would be a good idea to Dispose() the objects at the end of each loop, because the query can return a huge list and letting cell and row objects pile up in the heap could impact performance.(?) How badly did I do? Does anyone have a better solution in case mine is flawed?

    Read the article

  • Monotouch Example for QuickLook PDF

    - by nbonwit
    I am looking for a bare-bones pdf viewer example using the QuickLook Monotouch API. I have searched and have found bits and pieces but just can't seem to get it all integrated. I will be reading the pdf from a file pre-saved to the Personal folder on the iPad and would like to show the pdf as a modal view. If someone could post a bare-bones example, that would be much appreciated. What I have so far is below. Thanks! path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); pdfPath = System.IO.Path.Combine(path, "pdfReport.pdf"); QLPreviewController myPdfController = new QLPreviewController(); MyPdf pdfToShow = new MyPdf("", new Uri("")); // Not sure about this line myPdfController.DataSource = pdfPath; // Not sure what this line should be PresentModalViewController(myPdfController, true);

    Read the article

  • Why doesn't sed's automatic printing deliver the expected results?

    - by CodeGnome
    What Works This sed script works as intended: $ echo -e "2\n1\n4\n3" | sed -n 'h; n; G; p' 1 2 3 4 It takes pair of input lines at a time, and swaps the lines. So far, so good. What Doesn't Work What I don't understand is why I can't use sed's automatic printing. Since sed automatically prints the pattern space at the end of each execution cycle (except when it's suppressed), why is this not equivalent? $ echo -e "2\n1\n4\n3" | sed 'h; n; G' 2 1 2 4 3 4 What I think the code says is: The input line is copied to the hold space. The next line is read into the pattern space. The hold space is appended to the pattern space. The pattern space (line1 + newline + line2) is printed automatically because we've reached the end of the execution cycle. Obviously, I'm wrong...but I don't understand why. Can anyone explain why this second example breaks, and why print suppression is needed to yield the correct results?

    Read the article

  • Jquery datatable Hidden column showing after calling another script .how can i hide the column specified permanently?

    - by Sreenath Plakkat
    My table is <table id="EmployeesTable" style="width: 100%;" class="grid-table06 border-one"> <thead> <tr> <th width="80%" align="left" valign="middle">Name</th> <th width="20%" align="left" valign="middle">Department</th> <th>Id</th> </tr> </thead> </table> My script as follows $(function () { $(".switchDate").click(function () { var id = $(this).attr("rel"); fetchEmployeedetails(id); }); fetchEmployeedetails(@model.Id); //on load function fetchEmployeedetails(id) { $("#EmployeesTable").dataTable({ "bProcessing": true, "bServerSide": true, "sAjaxSource": "/Employees/FetchDetails?Deptid=" + id + "&thresholdLow=4&threshold=100", "sPaginationType": "full_numbers", "bDestroy": true, "aaSorting": [[1, 'desc']], "asStripClasses": ['color01', 'color03'], "aoColumnDefs": [{ "aTargets": [2], "bVisible": false }, { "aTargets": [1], "fnRender": function (oObj) { return "<a href='#showemployees' rel='" + oObj.aData[2] + "'></a>"; } }] }); } }); On load it works fine not showing the hidden "Id" column but in case when I choose the id by switchDate on click function it causes the hidden column to be visible for second. How can I hide the column permanently?

    Read the article

  • Endless scroll paging in jquery Safari

    - by socheata
    I'm using : $(window).scroll(function () { if ($(window).scrollTop() + 10 >= ($(document).height() - $(window).height())) { loadContent(); } } It works fine with Chrome, IE, Firefox but except in Safari. In function loadContent, I used JSON to load data, as this tutorial. But while I test in Safari, It takes the content twice from JSON. If the other takes 9 items, then Safari takes 18 items. Does anyone know how to solve this problem? Thanks.

    Read the article

  • Error in Ordinary Differential Equation representation

    - by Priya M
    UPDATE I am trying to find the Lyapunov Exponents given in link LE. I am trying to figure it out and understand it by taking the following eqs for my case. These are a set of ordinary differential equations (these are just for testing how to work with cos and sin as ODE) f(1)=ALPHA*(y-x); f(2)=x*(R-z)-y; f(3) = 10*cos(x); and x=X(1); y=X(2); cos(y)=X(3); f1 means dx/dt;f2 dy/dt and f3 in this case would be -10sinx. However,when expressing as x=X(1);y=X(2);i am unsure how to express for cos.This is just a trial example i was doing so as to know how to work with equations where we have a cos,sin etc terms as a function of another variable. When using ode45 to solve these Eqs [T,Res]=sol(3,@test_eq,@ode45,0,0.01,20,[7 2 100 ],10); it throws the following error ??? Attempted to access (2); index must be a positive integer or logical. Error in ==> Eq at 19 x=X(1); y=X(2); cos(x)=X(3); Is my representation x=X(1); y=X(2); cos(y)=X(3); alright? How to resolve the error? Thank you

    Read the article

  • rbenv not changing ruby version

    - by user1443338
    So i installed rbenv according to the github directions. I am running OSX but i have tried this on a Ubuntu 12.04 VM and got the same results. The following is what i get in my terminal when i try to change ruby versions: rbenv versions * 1.9.3-p0 (set by /Users/user/.rbenv/version) 1.9.3-p125 rbenv global 1.9.3-p0 rbenv rehash ruby -v ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0] which ruby /usr/bin/ruby Anyone have any ideas as to why rbenv isnt actually switching the ruby version like it thinks it is? Aslo there is no .rbenv file in the local directory that would be causing the ruby version to default to 1.8.7 rbenv local rbenv: no local version configured for this directory

    Read the article

  • Accessing red5 server outside the localhost

    - by user1039290
    I am new on red5 server so I stuck in. I am trying to record videos from webcam and save them in to my server. To do this, I installed red5 to my server. In addition, I also downloaded red5recorder and put it into my webapps folder. But there is any information about its implementation details. Whatever. So I go on with Red5 SimpleRecorder tutorial. Everything works fine when I tried in my server, but there is a problem when I try to connect to server from other computer to record a video. Actually, video recording is handled but the recorded video is not uploaded to the server. When I work in localhost it works fine, but from outside I couldn't be able to record or upload the video. I change the red5-web.properties document, and set virtual host to my server's IP but it again only works in localhost. What could be the reason? Is it about file permissions? or what could it be? Kind regards, Can

    Read the article

  • Google I/O 2012 - Breaking the JavaScript Speed Limit with V8

    Google I/O 2012 - Breaking the JavaScript Speed Limit with V8 Daniel Clifford Are you are interested in making JavaScript run blazingly fast in Chrome? This talk takes a look under the hood in V8 to help you identify how to optimize your JavaScript code. We'll show you how to leverage V8's sampling profiler to eliminate performance bottlenecks and optimize JavaScript programs, and we'll expose how V8 uses hidden classes and runtime type feedback to generate efficient JIT code. Attendees will leave the session with solid optimization guidelines for their JavaScript app and a good understanding on how to best use performance tools and JavaScript idioms to maximize the performance of their application with V8. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 3049 113 ratings Time: 47:35 More in Science & Technology

    Read the article

  • Compiling to a binary from source

    - by Chords
    I'm using WKHTMLTOPDF on a 64-bit Linux server and I'm running into problems with the version. Seen here: http://code.google.com/p/wkhtmltopdf/downloads/list There's slim pickins when it comes to pre-compiled binaries. I started with version 0.9.9 which has a few bugs. I upgraded to 0.11.0 RC 1 to find a slew of new problems, namely the following: http://code.google.com/p/wkhtmltopdf/issues/detail?id=730 I think 0.10 RC 2 would work, and the thread above suggests compiling from the source has a fix for the error I'm getting, but I don't know how to do that. Can anyone explain how I can create a static binary myself, or would anyone be willing to create and post one for the countless people waiting for this fix?

    Read the article

  • is it okay to use random URLs instead of passwords?

    - by stew
    Is it considered "safe" to use URL constructed from random characters like this? http://example.com/EU3uc654/Photos I'd like to put some files/picture galleries on a webserver that are only to be accessed by a small group of users. My main concern is that the files should not get picked up by search-engines or curious power-users that poke around my site. I've set up an .htaccess file, just to notice that clicking on http://user:pass@url/ links doesn't work well with some browsers/email clients, prompting dialogs and warnings messages that confuse my not-too-computer-savy users.

    Read the article

  • Restore SQL Server 2008 db without affecting users

    - by Chris Moschini
    When I restore a db in Sql Server 2008 R2 from data on another server, it makes a mess of the users. I have a Windows User and MsSql Login named Web_SqlA on both machines. Before the Restore, Web_SqlA is properly mapped to the right Windows user in the database. After the Restore, Web_SqlA is still listed as a user for the db, but it's no longer tied to the Windows user, causing Trusted Connections to it to fail. How can I Restore the db without breaking this user each time? I see that this: Sql Server Database Restore And this: Sql Server Database Restore Address fixing these orphaned users after the fact; I'm looking to prevent overwriting the users during the Restore in the first place - everything else should be restored, but leave my users be. How can I go about that?

    Read the article

  • How to setup wireless access on smoothwall router?

    - by John
    I am in the process of redoing my home network, I have a couple of ipads and laptops that I need wireless access for. I plan to use this old computer as my router with smoothwall installed on it. My question is, how do I go about setting up wireless access on my network using a computer with smoothwall on it? Sounds like the best way is to connect a regular WAP to the network. Cany anyone confirm?

    Read the article

  • Puppet gives SSL error because master is not running?

    - by Daniel Huger
    I started with two clean machines this time. My master is running 12.04 Version: 2.7.11-1ubuntu2 Depends: ruby1.8, puppetmaster-common (= 2.7.11-1ubuntu2) My client is 10.04 Version: 2.6.3-0ubuntu1~lucid1 Depends: puppet-common (= 2.6.3-0ubuntu1~lucid1), ruby1.8 To setup Puppet tutorial: http://shapeshed.com/setting-up-puppet-on-ubuntu-10-04/ To connect master and client: http://shapeshed.com/connecting-clients-to-a-puppet-master/ The first time I tried to connect master to client failed with SSL_connect error. So I did rm -rf /etc/puppet/ssl/ to remove all the keys inside ssl folders. It looked like it work.... BUT client# puppet agent --server puppet --waitforce 60 --test /usr/lib/ruby/1.8/facter/util/resolution.rb:46: warning: Insecure world writable dir /etc/condor in PATH, mode 040777 /usr/lib/ruby/1.8/puppet/defaults.rb:67: warning: Insecure world writable dir /etc/condor in PATH, mode 040777 info: Creating a new SSL key for giab10 warning: peer certificate won't be verified in this SSL session info: Caching certificate for ca warning: peer certificate won't be verified in this SSL session warning: peer certificate won't be verified in this SSL session info: Creating a new SSL certificate request for mybox123 info: Certificate Request fingerprint (md5): XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX warning: peer certificate won't be verified in this SSL session warning: peer certificate won't be verified in this SSL session warning: peer certificate won't be verified in this SSL session warning: peer certificate won't be verified in this SSL session info: Caching certificate for mybox123 err: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed warning: Not using cache on failed catalog It cached but then it couldn't retrieve it. Let me stop here.... worrying I would mess something up. But let's check master's status. * master is not running WoW.... ??? master# service puppetmaster start * Starting puppet master [OK] master# service puppetmaster status * master is not running I think time is sync. Well, we are behind a firewall so the port to sync time is disbaled. I checked with date and they seem okay. What about master not running? Is that the cause? Any help is appreciated. Thanks! /var/lib/puppet/log/masterhttp.log [2012-06-30 00:13:25] INFO WEBrick 1.3.1 [2012-06-30 00:13:25] INFO ruby 1.8.7 (2011-06-30) [x86_64-linux] [2012-06-30 00:13:25] WARN TCPServer Error: Address already in use - bind(2) [2012-06-30 00:19:40] INFO WEBrick 1.3.1 [2012-06-30 00:19:40] INFO ruby 1.8.7 (2011-06-30) [x86_64-linux] [2012-06-30 00:19:40] WARN TCPServer Error: Address already in use - bind(2) [2012-06-30 00:28:58] INFO WEBrick 1.3.1 [2012-06-30 00:28:58] INFO ruby 1.8.7 (2011-06-30) [x86_64-linux] [2012-06-30 00:28:58] WARN TCPServer Error: Address already in use - bind(2) [2012-06-30 15:31:25] INFO WEBrick 1.3.1 [2012-06-30 15:31:25] INFO ruby 1.8.7 (2011-06-30) [x86_64-linux] [2012-06-30 15:31:25] WARN TCPServer Error: Address already in use - bind(2) 1 S puppet 5186 1 0 80 0 - 29410 poll_s 15:44 ? 00:00:00 /usr/bin/ruby1.8 /usr/bin/puppet master --masterport=8140 4 S root 5235 5005 0 80 0 - 2344 pipe_w 15:45 pts/0 00:00:00 grep --color=auto puppet kill -9 5186 puppet master service puppetmaster status * master is not running I always have this error, but I always ignored it. http://pastebin.com/exbpArjv What could it mean? Time sync? Package not installed? Then how could we do puppetca in the first place?

    Read the article

  • After deleting log files, Ubuntu server still saying there is no space

    - by Mark
    My Ubuntu server has stopped due to a lack of disk space. I deleted some log files which has grown huge very quickly. But df -h still shows I have no space left. When I run du -sh /* I can see that I should have plenty of disk space left after deleting the logs. I ran lsof +L1 and it brought up two files: /var/log/mail.log and /var/log/mail.err. These are two logs I had deleted. I restarted apache, postfix and mysql (mysql wont restart because of lack of disk space, it think) but still df -h shows no space.

    Read the article

  • Samba as a PDC and offline authentication

    - by Aimé Barteaux
    Say I have a Windows laptop which has been connected to a domain. The domain has a Samba server as a PDC. Now say that I move the laptop outside of the network (the network is completely inaccessible). Will I be able to logon into accounts I have accessed before on the laptop (through GINA)? Update: Looking at the smb.comf documentation I noticed the setting winbind offline logon: This parameter is designed to control whether Winbind should allow to login with the pam_winbind module using Cached Credentials. If enabled, winbindd will store user credentials from successful logins encrypted in a local cache.. To me it looks like this solves the issue but can anyone else confirm it and/or point out if any additional values need to be set?

    Read the article

  • Anyone else experiencing high rates of linux server crashes today?

    - by Bron Gondwana
    Just today, Sat June 30th - starting soon after the start of the day GMT. We've had a handful of blades in different datacentres as managed by different teams all go dark - not responding to pings, screen blank. They're all running Debian Squeeze - with everything from stock kernel to custom 3.2.21 builds. Most are Dell M610 blades, but I've also just lost a Dell R510 and other departments have lost machines from other vendors too. There was also an older IBM x3550 which crashed and which I thought might be unrelated, but now I'm wondering. The one crash which I did get a screen dump from said: [3161000.864001] BUG: spinlock lockup on CPU#1, ntpd/3358 [3161000.864001] lock: ffff88083fc0d740, .magic: dead4ead, .owner: imapd/24737, .owner_cpu: 0 Unfortunately the blades all supposedly had kdump configured, but they died so hard that kdump didn't trigger - and they had console blanking turned on. I've disabled console blanking now, so fingers crossed I'll have more information after the next crash. Just want to know if it's a common thread or "just us". It's really odd that they're different units in different datacentres bought at different times and run by different admins (I run the FastMail.FM ones)... and now even different vendor hardware. Most of the machines which crashed had been up for weeks/months and were running 3.1 or 3.2 series kernels. The most recent crash was a machine which had only been up about 6 hours running 3.2.21.

    Read the article

  • Sonicwall NSA 3500, public ip for SSL VPN clients is not visible

    - by SlyMcFly
    I have a Sonciwall NSA 3500 and I'm setting up the SSL VPN according to this guide. I get through setting up the Sonicwall router, but then to test it says "Users can now go to the public IP of the sonicwall. Notice the new “click here for SSL login” hyper link". However, when I go to the public ip of the Sonicwall I don't get a web page, it just times out. Is there some other setting that I'm missing in order to make the SSL VPN login page public?

    Read the article

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