Posts

graph algorithms: reachability from adjacency map -

I have a dependency graph, which I used to call map & lt; Node, collection & lt; Node & gt; & Gt; (in Java-Speech, or f (node ​​n) - & gt; Collection [node] as a function; it is a given node n Mapping from is a collection of nodes which depends on n ) graph is potentially cyclic *. Looking at the list of nodes list , I would like to solve it: i.e. map & lt; Node, set & lt; Node & gt; & Gt; ; Example: Example For, (x -> y stands for node y depends on node x) n1 - & gt; N 2 N 2 - & gt; N3 N3 - & gt; N1N3 - & gt; N5N4 - & gt; N2N4 - & gt; N5 N6 - & gt; N1N7 - & gt; N1 presented as adjacent map {n1: [n2], n2: [n3], n3: [n1, n5], n4: [n2, n5] Can be done], N6: [N1], N7: [N1]} . If the badlist = [n4, n5, n1] then badmap = {n4: [n4, n2, n3, n1, n5], n5: [n5] ], N1: [n1, n2, n3, n5]} . Graph Algorithms rush as well as references to the online search, so if I can point to an efficient...

c# - Reading/preserving a PixelFormat.Format48bppRgb PNG Bitmap in .NET? -

I am able to create the Format48bppRgb .png file (with some internal HDR data) using the following C # code: / P> Bitmap BMP16 = New Bitmap (_viewer.Width, _viewer.Height, System.Downings.imaging.pixelformat.format 48bpRGB); System.Drawing.Imaging.BitmapData data16 = bmp16.LockBits (_viewer.ClientRectangle, System.Drawing.Imaging.ImageLockMode.WriteOnly, bmp16.PixelFormat); Unsafe {(Populated BMP 16)} BMP 16.Save ("C: /temp/48bpp.png", System.Downing.imaging.imageformat.png); ImageMagik (and other apps) verify that this is actually a 16bpp image: C: \ Temp & gt; 48bpp.png 48bpp.png PNG 1022x1125 Identify 1022x1125 + 0 + 0 Direct Class 16-bit 900.963kb However, in reading PNG I was frustrated to find out, To change it was changed to Format32bppRgb: Bitmap BMP = new bitmap ("c: /temp/48bpp.png", incorrect); String information = string.format ("pixel format: {0}", BMP pixel format); ... Given that PNG codec can write a Format 48bppRgb...

bash - how to remove only ext3 here in unix? filename.ext1.ext2.ext3 -

Example file: filename.ext1.ext2.ext3 How to remove only ext3 in Unix Bash shell under sun solar? In all directories: find -name "* .ext3" | | MV '{}'? You can pipe output to a find command When reading while typing with the loop spaces, the file name will also read correctly. Do not use the for the file in $ (find ...) creation is very disabled (search must be completed before the loop starts, problems with files with spaces on its name , And it can overload the command line buffer which will be without a little signal. You can also create $ [var% name} % means the small right filter, with the matching globe, the right of an environment variable A single % stands for the minimum possible amount. One double %% corresponds to the highest amount. # and ## for the left side of the string. Also be careful to use quotation marks on the name of the blank space on your name. / P> .- type f -name "* .ext3" | When the file is rea...

datetime - MySQL: Add 30 days to a value in the table -

I am trying to use the ADDDATE function on a value in the table. addOns = ADDDATE (addOns, INTERVAL 30) is addOns where I can not add 30 days where I store datetime / Can i Updated credit SET addOns = ADDDATE (addOns, INTERVAL 30 DAY) - or updated credit SET addOns = ADDDATE (addOns, 30) / Code>

javascript - Is it possible to take data from one web-page and generate another(webpage to be printed) without any interference of server? -

I am trying to prepare a report from that data to take and print data from HTML because the Internet connection Not very consistent, it is important that in print format only a web browser is generated on the client side. Generate both screen and print edition from server at the same time. For class-only items for class = "notepant", attach different parts to the DIV with class = "notepant", and do not just print-only stuff for class = "note-onscreen", and both of them There is nothing extra which should be visible on both screen and print. Then use this CSS: @ Media Screen {.NotOnScreen {Display: None; }} @ Media Print {. NotOnPrint {display: none; }}

php - Warnings from mysql_connect() not populating mysql_error() -

पर्यावरण - PHP5.2.17, MySQL5.0.92 मैं अपने आवेदन में त्रुटि लॉगिंग ढांचे को कार्यान्वित कर रहा हूं और मैं एक डेटाबेस में त्रुटियों और चेतावनियों को लॉग ऑन करने का प्रयास कर रहा हूं। $ db = mysql_connect ('होस्ट', 'डेटाबेस', 'पासवर्ड'); अगर (! $ Db) {लॉग (mysql_error ()); } ... कोड जारी रखें मैं लॉगिंग का परीक्षण करना चाहता था और गलत मेजबान को mysql_connect फ़ंक्शन पर पास करना था। उम्मीद के मुताबिक मुझे स्क्रीन पर चेतावनी मिली चेतावनी: mysql_connect () [function.mysql-connect] अज्ञात MySQL सर्वर होस्ट 'होस्ट' (1) में / path / to / my / php /file.php पंक्ति 4 पर और मेरे लॉग फ़ंक्शन को बुलाया गया था लेकिन mysql_error () शून्य है। पीएचपी मैनुअल (http://php.net/manual/en/function.mysql-connect.php) के अनुसार, mysql_error () को अंतिम MySQL त्रुटि वापस करनी चाहिए मैनुअल में उनके पास एक उदाहरण है कि कैसे mysql_error () का उपयोग करते हुए स्क्रीन पर त्रुटि को गूंजती है। मैंने mysql_error ($ db) का उपयोग करने की कोशिश की, लेकिन यह बताते हुए एक त...

Memcached PHP module: How can you tell if the connection failed? -

एक php फ़ाइल में, मेरे पास है: & lt;? Php $ m = new memcached (); गूंज get_class ($ m); गूंज "& lt; br & gt;"; प्रतिध्वन करें $ m-> addServer ('192.168.1.77', 11211, 1); $ M- & gt; सेट ("foo", "bar"); ? & Gt; चलाने के बाद, आधा सेकंड के बाद, मुझे मिल जाता है: memcached 1 अगर मैं memcached बंद के बारे में 5 सेकंड के बाद, मैं मिलता है: memcached 1 मुझे कुछ और की तरह उम्मीद थी ... Memcached 0 आप कैसे जानते हैं कि आपने सफलतापूर्वक memcached सर्वर को मारा है या नहीं? मैं पूरी तरह से उम्मीद कर रहा था कि यह addServer से एक वापसी मूल्य के रूप में सरल है ...: ( यह मैं किस प्रकार की तलाश कर रहा था: Memcached :: getStats (); तो, मैंने लिखा: add_memcached_server ($ m, $ addr, $ port) {$ एम- & gt; एडसर्वर ($ एडीआर, $ पोर्ट); $ स्टेटस = $ एम- & gt; GetStats (); रिटर्न प्रदाता ($ स्थिति [$ addr। ":"। $ पोर्ट]);} एक आकर्षण की तरह काम करता है ...