Posts

Showing posts from September, 2014

html - Struggling to display blob image with php -

I am creating a simple website, I want to allow users to upload and change their avatars. Currently I am able to upload images in a mysql database, such as code stored in the form of blobs: // connected to DB, userID has $ image = $ FILES ['fileToUpload'] ['tmp_name']; $ Fp = fopen ($ image, 'r'); $ Content = fread ($ fp, filesize ($ image)); $ Content = addslashes ($ content); Fclose ($ FP); $ Sql ​​= "Update tbUsers SET ProfileVersion = '" $ Content "'UserID =". User ID; $ Result = mysql_query ($ sql) or die (mysql_error ()); After uploading files when I download files from phpmyadmin, they are saved as .bin files, but can be viewed normally. I'm not sure whether this is correct or not my image is displayed as follows: HTML: & lt ;? Php echo '& lt; Img src = "showPic.php? Q = '. $ _SESSION [' Profile ']'" / & gt; ? & Gt; PHP: if (! $ _ GET ['profile']) &a

javascript - Firefox SDK | Block Loading of Images w.r.t. Domain -

One of my earliest Firefox adsense functionality will be blocked by loading images based on those 2 criteria: IMG's URL or path includes specific words (regx); I have restored this feature on WebRequest in Google Chrome extension (see code below). background.js [Chrome Extension] var regex = '/ example | Example 2 / G '; // - Block Request Function Block Request (Details) {If (Type === 'Image' & Description.value Split (': //') .pop () .mail (regex)) {Return { Cancel: true}; }} // - Apply Blocking FunctionBlocking (type) {if (chrome.webRequest.onBeforeRequest.hasListener (type)) chrome.webRequest.onBeforeRequest.removeListener (type); Chrome.webRequest.onBeforeRequest.addListener (type, {urls: ['https: //*.example.com/proxy/*']}, ['blocked']); } // block function block tracking (a) {if (a) {apply blocking (blockerext); }} I'm trying to replicate it in Firefox, resting on SDK. And it seems that I have to register a s

linux - Creating a 64bit Debian package on a 32bit machine -

I am trying to create an amd64 package using: sudo dpkg- Buildpackage - I386 on the machine The error I get is: < Code> can not run "x86_64 -linux-gnu-strip": any such file or directory /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm on line 215 any suggestions ? There are several ways you can use many Debian developers using pbuilder Which you can create with a weird tool - a quick Google search takes me, but it also has a Debian wiki page. Alternatively, just use virtual environments, either libkvm, or virtualbox, or violet, ... I recently needed 'backport' of an existing package for Ubuntu 12.04 LTS And set up the charge on time for this. Edit from: My recent notes from here When I needed the 64-bit Ubuntu 12.04 environment (RE-) build / backport with an existing package Travis CI / To use the blueprint. My host machine was my 32-bit Ubuntu laptop for this exercise, which used to run Ubuntu 13.10 at the time: Install the 1.5.1

I have data in Excel like below, i want to display two things here -

I have data in excel as below, i want to display two things here 1) If the urea column H = - then the column B should change the color. 2) If MR + VP should come in its own form - SLNo SID RV TT BSA XLD Lact Urea TSI Industries MR VP Seat Nitrate Oxidated ONPG PCR Salam? SB H2S GR 1 R-13 + KA - - + - + - + - - - 2 - 5 TB - KK - - + + + + + - - 3 7.3 R + KA - - + + + + + - - - 4 11.1 R + KA + - + - + - + - - 5 + 15 + KA - + + + + - + - - 6 16.2 RB - K + + + + + - D - - 7 18.04 - KK - - + - + - + - - - 8 18.1 RKK - - + - - - + + - - - 9 20.2 RKA - + + + + + + - - + 10 20.3 T - KA - - + + + + + - - + + 11R / 28.1-K + + + + - - - - + + ans1: I have used conditional formatting option and = ISNUMBER (SEARCH (H5, "-")), it works, but the problem is also empty in the urea column ans 2: Pls suggest Answer 1: Your CF formula is wrong. Find_Text is the first argument; Or, simple code> = H2 = "-" Answer 2 : You can use an event-triggered macr

regex - Python & regular expressions -

Hi I am creating a program that is ! Math (5 + 5) Get more results from Skype, I'm having trouble getting the Résx expression correct, I'm reading docs and I can not get right now I I'm trying to support operators, so , * /, +, -,%, and ** trouble occurs when I try to use **, either I I use a regex and lose exponent options or get exponent option is. Here's my expression: Expr = re.search (r '((\ d +) (\ s *.?. *. * \ **) (\ D +), 'Mathematics (500 ** 1000)') And then I am parse it using the group, Build_expr = {'number1': int (expr.group (2)), 'operator': expr.group (3), 'number2': int (XPRGP (4))} Results of logging leakage modules with exponents: & gt; & Gt; & Gt; Expr.group () '500 ** 1000' & gt; & Gt; & Gt; Expr.group (1) '500 ** 1000' & gt; & Gt; & Gt; Expr.group (2) '500' & gt; & Gt; & Gt; Mathematics (500 + 1000) / P> &a

php - SQL code for checking user log in data -

I want to type a code to login the user's username and password to log in, but only every time Successfully logs in to run it: & lt; PHP $ Conn = mysql_connect ('localhost', 'root'); If (! $ Conn) died ("Could not connect". Mysql.error ()); Mysql_select_db ('swimsafe'); If (isset ($ _ post ['chkdbforpass'])); {$ Email = $ _ POST ['chkdbforemail']; $ Pass = $ _ post ['chkdbforpass']; $ Sql ​​= 'Select * From user where email address = "$ email" and password = "$ pass";; $ Result = mysql_query ($ sql, $ conn); If (! $ Result) died ("Could not query". Mysql_error ()); Echo ("successfully logged in!"); Setcookie ('username', $ email); } Mysql_close (); ? & Gt; Is it enough or do you have more information? mysql _ * is excluded please PDO Or use MySQLi . An OAP to check logins using mysqli (this also takes care of the prevention of SQL injection) T

Why does inverting a global regex always return true in JavaScript -

नमूना कोड यह विज्ञापित के रूप में कार्य करता है: < पूर्व> var re = / abc /; re.test ( "abc"); // सच! Re.test ("abc"); //असत्य; यह नहीं है: var re2 = / abc / g; // अपरिभाषित re2.test ("abc"); // सच! Re2.test ("abc"); क्या देता है? मैंने इसे कई regex के साथ परीक्षण किया है और ऐसा लगता है कि / g ध्वज सभी "पाठ"> से: परीक्षा का उपयोग करें () जब भी आप यह जानना चाहते हैं कि कोई स्ट्रिंग स्ट्रिंग में मिलती है या नहीं (स्ट्रिंग.सर्च विधि के समान); अधिक जानकारी के लिए (लेकिन धीमा निष्पादन) exec विधि का उपयोग करें (String.match विधि के समान) जैसा कि exec (या इसके साथ संयोजन में) के रूप में, एक ही वैश्विक नियमित अभिव्यक्ति उदाहरण पर परीक्षण कई बार कहा जाता है, पिछले मैच से पहले अग्रिम होगा। तो, जी फ्लैग प्रत्येक क्रमिक कॉल पर .test () प्रत्येक मैच में इसे आगे बढ़ाता है (जैसे .exec () ) के समान स्ट्रिंग के माध्यम से आगे बढ़ेगा। यह पिछले इंडैक्स नामक रीगेक्स की संपत्ति को संशोधित करके करता है,

node.js - Hows uninstall express (in order to install a previous version) -

I want to downgrade the Express Edition from 4.0.0 to 3.4.4 globally. So I also tried with pseudo: Simo $ npm uninstall express npm Warning / Uninstall / node-dev / DaysApp / node_modules is not installed in: "Express" and globally: Simo $ sudo npm uninstall -g Express password: do not uninstall npm / usr / local / lib / node_modules not installed in: " Express " and I changed the dependency on the package to version 3.4.4 and install it as $ npm install and $ npm express@3.4.4 < / Code> done But vesion still 4.0.0 Thank you for your help.

c++ - Memory leak caused by removing value from vector -

A few days ago I asked for help to remove the value of the index rather than the value from a vector) I was able to get a solution to compile with the help of Angav, the solution has been marked as 'Answer' in the thread. However, when executing my program with this fix, my program unexpectedly stops, and when it runs through a debugger, it seems that fixes cause the memory leak Is there any insight on how this can be done? Again, my straight uses me to find the value that I am trying to remove: Struct isUnderScore {bool operator ()) (char c) {return C == '_'; }}; I can use it on the string so that the deleted phrases can be easily liked: string.erase (remove_if (string.begin) (), String.end (), IsUnderScore ()), string.end ()); But when it was used on a vector, I had compiler problems, which were solved like this: vector.erase (std) :: remove (vector.begin) (), Vector.end (), std :: string ("_"))); And now I get a memory leak.

java ee - Enable SOAP schema-validation on client-side? -

मैं जेईई 6-क्लाइंट से एक SOAP वेब सेवा को बुला रहा हूं, जैसे: आयात javax.xml.ws.Service; ... कक्षा & lt; T & gt; ServiceClass; ... सेवा सेवा = सेवा.क्रेते (यूआरएल, नया क्यूएन (नाम स्थान, सेवा नाम)); टी सर्विसपोर्ट = (टी) सेवा.टिपोर्ट (सर्विसक्लास); मैं क्लाइंट-साइड पर स्कीमा-सत्यापन कैसे कर सकता हूं (सर्वर को SOAP- अनुरोध भेजने से पहले)? क्या मैं इसे जावा-कोड में कर सकता हूं या XML-config आदि की आवश्यकता है? संपादित करें मैंने भी इस संशोधन की कोशिश की: बुलियन इनबाउंड = सच; बुलियन आउटबाउंड = सच; टी सर्विसपोर्ट = (टी) सेवा.गेटपोर्ट (सर्विसक्लास, नई स्कीमा वैधताप्रभाव (इनबाउंड, आउटबाउंड)); लेकिन कोई प्रभाव नहीं है ... त्रुटि अभी भी सर्वर-साइड पर डाली गई है यदि अनिवार्य मान अनुपलब्ध है। मैं इसे क्लाइंट साइड पर पकड़ा जाना चाहता हूं और कभी भी सर्वर तक नहीं पहुंचता ... क्लाइंट साइड के लिए स्कीमा सत्यापन सक्षम करने के लिए आपको jaxws प्रॉपर्टी: स्कीमा-सत्यापन-सक्षम से true सेट करने की आवश्यकता है। उदाहरण एक्सएमएल विन्यास: & lt; jaxws: क्लाइं

ios - UITableView's cell doesn't work as setting -

I have set the utility cell as the following - (UITableViewCell * ) Table view: (UITableView *) Tableview CellularUritindpath: (NSINXPath *) IndexPath {Static NSSTING * Cell Identifier = "Sale"; DetailCell * cell = [Table view deserves reusable CellWithIdentifier: CellIdentifier]; If (cell == blue) {cell = [[extension alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier]; } If (indexPath.row == 0) {cell. Background color = [UIColor redColor]; UIImageView * bigphoto = [[UIImageView alloc] initWithFrame: CGRectMake (0, 0, 320, 320)]; Bigphoto.image = [UIImage imageNamed: @ "bigphoto.png"]; [Cell ad sbueview: bufoto]; } And {cell. Background color = [UIColor blackColor]; Cell.myphoto.image = [UIImage imageNamed: @ "myphoto.png"]; Cell.phototime.text = @ "2014-03-01"; } Return cell; } - (CGFloat) Table view: (UITableView *) Table view height forRowAtIndexPath: (NSIndexPath *) indexPath {if (indexPath.row == 0) {ret

javascript - iframe append to parent -

। जब मैं निष्पादित करता हूँ $ ('body' ) .append ('helo') अंदर iframe , स्ट्रिंग पैरेंट के साथ जोड़ा गया था। iframe "पोस्ट-टेक्स्ट" आइटमप्रॉप = "टेक्स्ट"> शायद ऐसा कुछ प्रयास करें: लेकिन यह आसान नहीं है। मुझे एक और & lt; iframe id = "demo" & gt; & lt; / iframe & gt; मिला है। Var फ़्रेम = document.getElementById ("डेमो"); Var html = 'data: text / html; charset = utf-8,' + encodeuri ('& lt; बॉडी & gt; हैलो & lt; / body & gt;'); Frame.src = html; मैं व्यक्तिगत रूप से डीआईवी का उपयोग करूँगा क्योंकि यह बहुत अच्छी और उपयोगी है, एक आईफ्रेम कर सकता है और कुछ भी कर सकता है (हां, शायद ऐसा कुछ है जो मुझे नहीं पता है, लेकिन कुछ भी नहीं है मैं अपने हर रोज़ वेब विकास जीवन में उपयोग करता हूं!)। IFrames पुरानी और खराब है संपादित करें: बस मिला, समस्या हल हो गई

python - Calling locals() in a function not intuitive? -

This can be primary, but can help me understand the namespace. What is a good explanation when the function definition is executed, and then what happens later when the function object is executed. Can recursive things recursive. The results are not clear at all; I expected: Local people will include var; Local people will be Y and local people; And locals will include var, locals, and local_2. # function calls to local people (many times), and gives returns to them ... def func (): var = 'Var!' Locals_1 = local (local) local = local (local) local = local () return locales, local locales, locals # # fax is called ... locals, local, localities = fenc () # display results ... print 'Locals:', Localities Number of locals: For local people, number of locals, number of locals, number of locals, number of locals: ',' Locals ': {...},' Local Local ': { ...}} Local_2: {'var': 'var! ',' Localals_1 ': {...},' local for

windows - What happens when revoking write_dac -

Scenario: If a user is writable and the user (user) gives some rights to others Is the users? After this, the administrator has canceled write_dac from this user. Question: What is changed or not given to the rights given to other users? Does it depend? what? does not track windows, which ACE has been added to ACL, therefore, There is no way to remove that was added by a particular user, even if it does.

javascript - Cordova vs Phonegap on Plugin, Support, Documentation, Updates -

Know that the phonegap is built on top of Cordova. After trying me, there are many problems with PhoneGrap outside of different versions PhoneGrap is poorly documented, because their guides are using too many Cordoba clay Those who should switch to PhoneGap See their guide on 3.2 and 3.4 only. 3.2 Uses phonegap on website call, 3.4 it uses Cordova back on the screen. When creating PhoneGrap 3.4 on Eclipse, it's OK. But at PhoneGap 3.3, the building process will not always replace the default files I've implemented or modified. Plugins such as Pluggugin fail on PhoneGrap 3.3 and 3.4 (Is this just me?), No support or feedback in the forum Any new updates on Cordoba, You have to wait for phonegap for integration. Which bug will cause a change in our PhoneGap plug-in Now I'm just thinking of using Cordova Is using Cordova phonegap using plugins Can the phonegap use the plugin from Cordova Is it worth conversion from PhoneGrap to Cordova? Is Cordova's

css - I am using a carousel to show images but cant fix image to cover background using an unordered list -

I have been able to create a carousel for images using html5, css3 and jquery. Unfortunately I can not fully understand the simple task of getting the images to fill the background. They are all different shapes on the rotation. I have changed it so much that I got a mess, can anybody help? CSS .wrapper {position: fixed; Width: 100%; Height: 100%; Top: 0 pixels; Left: 0 pixels; Z-index: 0; Padding-top: 0 pixels; } .slider {Overflow: hidden; } .slider li {margin: 0 auto; List style: none; Width: 100%; Height: 100%; Status: Completed; Top: 0 pixels; Left: 0 pixels; Background size: cover; Background-position: 50% 50%; Background-Repeat: None; } HTML & lt ;! DOCTYPE html & gt; & Lt; Html class = "no-js" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Meta http-equiv = "X-UA-compatible" content = "IE = edge, chrome = 1" & gt; & Lt; Title & gt; Gallery & lt; / Title

c# - How to return multiple data types -

I have a method that I want to be able to return a list of iWebElements, only a list of elements names or Is it possible to return multiple data types with a method of a string array? Is there a more practical way of getting different returns types without using just one method? /// & lt; Summary & gt; /// All the options related to this selected tag are available /// & lt; / Summary & gt; /// & lt; Returns & gt; Returns the list of iWebElements & lt; / Returns & gt; Public listing & lt; IWebElement & gt; Get Database of selectAllOptions (IWebDriver Drivers, Ref DataAbject MasterData) {// Dropdown Menu. Database Retrieval GetObjectRepository (referee masterdata); Var strDropMenuId = masterData.DictObjectRepository ["ID"]; Find the // dropdown menu and drag all the options into the list {var dropMenu = new selectElement (driver.FindElement (By.Id (strDropMenuId)); Return drop menu. Option return type to dictionary & l

ios - Relationship with RKObjectMapping and RKEntityMapping by primary key -

मेरा उत्तर JSON नीचे होना चाहिए "status": [{"id" : 1, "पोस्ट_id": 1, "पोस्ट_स्टेटस": "स्वीकृत"}, {"id": 2, "पोस्ट_आईडी": 2, "पोस्ट_स्टेटस": "अस्वीकृत"}}} < P> मैंने इस प्रतिक्रिया को मानचित्रित करने के लिए RKObjectMapping किया है उस प्रतिक्रिया में "पोस्ट_आईडी" "पोस्ट" नामक एक इकाई की प्राथमिक कुंजी थी और उसका नाम "postID" है। अब मैं "स्थिति" वर्ग पर एक उदाहरण चर पर "पोस्ट" के "NSManagedObject " को मानचित्रित करना चाहता हूं। तो मेरा "स्टेटस" क्लास नीचे जैसा होगा: @interface आदेश: एनएसओबैजैक & lt; RestKitObjectProtocol & gt; @property (मजबूत, NSString * statusId; @property (मजबूत, nonatomic) NSString * postID; @property (मजबूत, नॉटैटॉमिक) NSString * पोस्टस्टैटस; @property (मजबूत, नॉनटामिक) पोस्ट * पोस्ट; @end ऐसा लगता है कि आरके ऑब्जेक्टमैपिंग और RKEntityMapping के बीच एक संब

java - Reference a passed in parameter in JQuery JSP -

I am trying to refer to a parameter in JQuery with Java code even so far away from me : Java: Hashmapped JSP: int i = $ ("# minumumAge") Val (); Var dateOffset = (24 * 60 * 60 * 1000) * i; However, I can not get the minimum egg value in the i variable. Please tell me what is the correct syntax? Try: & lt;% int minAge = ( Integer) request.getAttribute ("minumumAge"); & Gt%; Var I = & lt;% = minAge%>; Var dateOffset = (24 * 60 * 60 * 1000) * i;

Firefox making CSS Rules up? -

Image
यह है कि मैं निरीक्षक को देखता हूं: दो नियमों में एक बायां हाइलाइट की तरह है, जो फ़ायरफ़ॉक्स बना रहे हैं, अगर मैं गणना की शैलियों को देखो मैं इसे देखता हूं: और अंत में यह है मूल सीएसएस कैसे दिखता है: तो फ़ायरफ़ॉक्स यह किसी तरह की स्थिति और चौड़ाई के नियमों को बदल रहा है। कोई भी यह समझा सकता है कि ऐसा क्यों हो रहा है और फ़ायरफ़ॉक्स को उन नियमों को बदलने से कैसे बचें? (क्रोम में, सफारी ठीक काम करता है) "बायाँ हाइलाइट" का उपयोग शैली नियम को इंगित करने के लिए किया जाता है पृष्ठ लोड होने के बाद से डेवलपर टूलबार के भीतर संशोधित किया गया है। पृष्ठ को पुनः लोड करने और / या ब्राउज़र को पुनरारंभ करने से आपके स्टाइलशीट से नियमों की मरम्मत होनी चाहिए। यदि आप इस "त्वरित सुधार" के बाद भी समस्या का सामना कर रहे हैं, तो मेरी अगली सलाह आपकी स्टाइलशीट (एस) स्थिति: निरपेक्ष के लिए, उन्हें एक समय में अक्षम करें और फिर से परीक्षण करें। यह बहुत ही संभावना नहीं है कि फ़ायरफ़ॉक्स अपने स्वयं के नियमों को अपने आप बदल रहा है। जब आप डीबग करना चाहते हैं, तो आपको

c - Programmes won't run on Ubuntu 12.04 and Windows XP -

After assuming eclipse and CB, I found many projects that have not started properly. I assumed that this was due to the use of the OS, so I changed Ubuntu though, some programs that I still tried to run would not work properly. For example, nothing happens when clc-wiki enters this code: #include & lt; Stdio.h & gt; # Maxline 40 / * Define maximum input line size * / int gateline (four lines [], int maxline); Zero per (four to [], four to []); / * Longest input line * / int main () {int c; Int len; / * Current line length * / max maximum; / * Maximum length of time * / four line [MAXLINE]; / * Current input line * / longest [MAXLINE]; / * Longest line saved here * / max = 0; While (line = mg (line, maxline)) gt; {if (line [lane -1]! = '\ N') while ((c = getchar ())! = EOF & amp; = ' \ N ') ++ LAN; If (LAN> Max) {max = len; Copy (longest, line); }} If (max> gt; 0) {/ * one line * / printf ("The longest row with% d characters: \ n", max)

javascript - d3 brush and setting minimum tick marks with a time scale -

edited For 'context' Without worrying about setting the minimum, I successfully implemented a multi series chart with context and focus. The problem occurs when the limit may be small enough to show hours on the dynamic focus chart when the brush is small enough. My question is whether it is possible to set the minimum tick mark or brush can be reduced to restrict that amount to ensure that tikkas do not go for hours, but these days Are limited? The following code sets the minimum tick, but no matter how big the brush is, the way to appear in this way can also be the number (day). function brush () {removeFixedLine (); Var newData = brush.empty ()? X2.domain (): brush.extent (); X.domain (newData); // Radra Tooltip X-Focus Focus .selectAll ("dot") .attr ("cx", function (d) {return x (d.date);}); // Focus radraw lines. Select all ("Path Path"). Ether ("d", line); MinExtent = d3.time.day (brush.example () (1)) - d3.time.da

python - SYN Port Scanner Script: "Mac address to reach destination not found. Using Broadcast" error -

Image
I am writing a SYN port scanner in Python with scp. There are no syntax errors, but unable to send any packets to any destination when I run the script. this code #! / Usr / bin / python #, 'argparse' module user-Freindly command-line interface #it Automatically generates messages and problems on invalid arguments and use argParser = argparse.ArgumentParser (Description = 'A host of For 'TCP SNN Scanner') argParser.add_argument ('- version', '- V', action = 'version', version = '% (progamy) s version 1.0.0') argParser.add_argument ('host' Metavar = 'host', type = str, help = 'Hostname or IP to scan.') ArgParser.add_argument ('- p', metavar = 'port', nargs = 2, type = str, help = ' Ert range scan eg 80 443 ') argParser.add_argument (' -t ', metavar =' timeout ', type = float, help =' time to wait for ACK. ', Default = 1) argument = argParser.parse_args

sitecore - how to match a field name with another field name -

I have two fields that run on a website that I would like to match so that when a user inputs a value of field , It will match the other fields. I am using Sitcom Rocks and am trying to use a query to do this. Select @ # h1 #, @ # Title # from / Sitcom / Content / Home // * [@ # H1 #! = "@ # # Headline #"]; Update # @ # H1 # @ @ # # Title # from / Sitecore / Content / Home // * [@ # Title # = "& lt; id & gt;"]; What am I missing here? items: saving by tapping the event before and after the change It allows to compare the field values ​​of items in: By using it, you can determine which area has been modified, then the second match Change for

android - draw bitmap on canvas with original dimension -

I have to draw a bitmap on my canvas, but it is not displayed with the original size < / P> This is my code: imageview image = (image view) searchVBIID (RID image view); Bitmap BMP1 = BitmapFranet Decondersource (getResources (), orrvable.IC_ Launcher); Bitmap BMP = bitmap.credbitmap (320, 382, ​​bitmap config.argb_8888); Svg svg = SVGParser.getSVGFromResource (getResources (), R.Arkart); Canvas canvins = new canvas (BMP); Canv.drawBitmap (bmp110,10, faucet); Drawable [] layers = new drawback [2]; Layers [0] = svg.createPictureDrawable (); Bitmap Drable Eligible = new Bitmapdroub (getResources (), BMP); Layers [1] = drawables; LayerDrawable Layer = New LayerDrawable (Layers); Image.setImageDrawable (layerDrawable); thnx and if You use something like this: bitmap resizedbitmap = bitmap .createScaledBitmap (bmp1, image.getWidth), image.getHeight (), true); You can >

go - Use 'comma ok' idiom or return pointer? -

निम्नलिखित गो स्निपेट पर विचार करें: func sheep () (int, bool) { वापसी 1, सच} फ़ंक्शन मुख्य () {अगर डॉली, ठीक: = भेड़ () {// कुछ करना}} जैसा कि मैंने पढ़ा है उसे 'कॉमा ओक' मुहावरा कहा जाता है । जहां तक ​​मैं यह बता सकता हूं कि इसका इस्तेमाल 'पाया' और 'न मिला' चीज़ से अलग करने के लिए किया जाता है। उसी माध्यम से प्राप्त किया जा सकता है: प्रकार भेड़ संरचना {} फ़ेन्क भेड़ () * भेड़ (वापसी और भेड़ {}} फ़ंक्शन मुख्य () {यदि डॉली: = भेड़ (); Dolly! = Nil {// do something}} बाद के उदाहरण के लिए एक ही उद्देश्य को पूरा करने लगता है, शायद भी अच्छे। 'कॉमा ओके' उदाहरण के साथ, असाइनमेंट केवल अगर ब्लॉक में वैध है। शायद मुझे कुछ विचारों की याद आ रही है कौन सा पैटर्न पसंदीदा है? और क्यों? एक संक्षिप्त उदाहरण: में जाओ, एक शून्य मान पूरी तरह से अच्छा मूल्य हो सकता है उदाहरण के लिए एक शून्य टुकड़ा (लगभग) एक खाली टुकड़ा की तरह काम करता है, और यह उपयोगकर्ता-निर्धारित सूचक रिसीवर के लिए भी सही हो सकता है। इस कारण से, अल्पविराम-ओके या अल्पविराम-त्

database - GAE - Java - Keyword classification of Datastore Entities -

There are 3 main types of organizations in datastore in my scenario, special users, objects and keywords. The problem is modeling relationships among those items and classifying them. Users can create as many objects as they want and the user-object relationship can be easily applied with an anesthetic link. I have designed inter-objects and inter-user relationships by defining the unit for any relationship. In this way, I can do all fans and fan-out and scale the relationship with the result set, so it is also time-efficient. Now I need to classify the objects for keywords. Each object can be linked to limited things, whereas each key can not get limits. What is the most effective way to implement them? (Time-ability (complexity, ...) and database activity) One of the first methods can be: Give each object a list of keys: The search result will be scale with the set , So it will not depend on the number of connections and keys. Inter-user outlines things and key-object

r - Secret Access Key from AWS for MTurkR -

I am trying to install the MTKR R package for the first time, for which access keys are required, both "log in Key ID "and" Secret Access "from ADS: However, Amazon recently removed" the ability to retrieve the existing secret access key for its AWS (root account). " I tried to create an IAM user and use my access key within the credentials () command, but get the following error: < Code> error (AWS mechanic. Obsolete identity): AWS Identification and Access Management (IAM) user account can not be used for Amazon Mechanical Turk. Is there a way around this issue? Do I have to wait for package updates?

linux - .inputrc override Control+W -

How can I override the control + W inside my .inputrc? The following does not work on its own: "cw": Forwarded word it does works I add the stty werase undef , but then the key 'is mysteriously disabled! To bind you as ^ w your < In the code> .inputrc file, the option is required to use the set bind -TTI-special-character close . The reason for this is that: Starting with version 5.0, readline, Stati reads special character settings and binds them to their readline equivalent, every time readline () / P> was introduced in the Bin-TTI-Special-Character option 5.1 to work around this feature . - Search for the option set bind-tty-special characters off "\ Cw": Forwarded-word contains a slightly old-school method Like .bashrc : delete stty undef bind '"\ cw": Forwarded word'

java - Input editText as hex, send as int? -

I send data from your Android app for a Bluetooth module using the SPP with the following method, which takes an integer I am enter the public zero heck (int i) {try {mmOutStream.write (i); } Catch (IOException e) {}} When I do it uses with an integer like '0xD' I do not work properly, so there is nothing wrong. However, I am trying to get data from an editing text that is formatted so that it can accept as a 0-F input only. From here I thought. I will need to convert to add '0x' string and then int For example entered my editText '4E', I have a new string builder '0x' To begin with is to create. I then add the value of my 4E to the string and convert the int. Although I get an error when he is trying to change int, this is invalid. I know that this is probably so wrong, but I have no better idea about how to do this? Any answer or signal will be DEB highly appreciated. Below is my code for conversions: btnSendHex.setOnClickListener (New

jquery - FineUploader - add data-id to preview li -

I am trying to get the user jQuerySortable and FineUploader I'm following the callback on the Funloader: < Pre> callback: {onComplete: function (id, name, response) {this.setDeleteFileParam ({attachment_id: response.attach_id, action: 'delete_attachment', nonce: Response.delete_nonce}, ID); $ (".qq-upload-list-selector"). Sorted ({genetic: function (item, container, _ super) {var data = $ (".qq-upload-list-selector"). ("Serialize") .get (); var jsonString = JSON.stringify ( Data, blank, ''); console.log (jsonString); _ super (item, container)}}); }} uses jQuerySortable data-id for the serialize method, so I will need to add it to the preview li Complete Callback How can this be done? First, find the handle on the file container element, then, find the appropriate child element at the end, desired Add attribute. callback: {onComplete: function (id, name, response) {var fileContainer = this.getItemByFileId (id

python - How to get the absolute path relative to the project root without double slashes? -

I have defined this function to get the absolute path relative to the project root: < Code> def refight (* x): return os path.normpath (os.path.join (os.path.dirname (__ file__), '..', * x) gET_PATH = (replay ('Django / DIR The problem is that I get a path with double slash (on Windows) like: C: \ \\\ user \\\\ Fuiba \\\\\\\\\\\\\\\\ django \\\\ dir me with 4 slashes Why do you get the path? Is there any way to avoid this behavior or can I reduce it again and again? Thank you! I am using Yuneepath in my projected projects. It is making it very easy to try. It is really good and self-explanation.

yeoman - Gulp-useref is throwing error: "path must be a string" -

I am using a gulpfile.js generated by the mass-sip-webpage generator and A little modified to meet my needs for some reason when I try to run the build process (default task), I am running into a problem. The error 'html' has been thrown during work and most of the error references are in `node_module \ GUI-use \ index.js'. Here is the error output: stream.js: throw 94; // Unwanted flow in pipes TypeError: The path object must be a string on .fs.openSync (fs.js: 427: 18) on object.files.sys (fs.js: 284: 15) on the transform. & Lt; Anonymous & gt; (C: \ Dev Project \ node_modules \ gulp-useref \ index.js: 54: 44) on the array. Then on every (original) conversion. & Lt; Anonymous & gt; (C: \ Dev Project \ node_modules \ gulp-useref \ index.js: 50: 31) at ARR. On each (original) conversion & Lt; Anonymous & gt; (C: \ dev \ project \ node_modules \ gulp-useref \ index.js: 41: 36) but Array.forEf (native) Transform._transform (C: \ dev \ projec

regex - Find and replace first double-quote before special character via grep -

I have a whole bunch of files that have all the blocks of text that look like this: / P> "The opening of each file is different text between double quote and closing right-quote (or whatever is said)" " Maybe not relevant, but in the past i have grep used to search and change it like this: grep -rl 'search './path/to/files/ | xargs sed - I's / is there any way to do something like that, but use a rezux to replace the plain old double-quote opening with a left quote ( " ), Code>) The only reliable way to change the right-two-coat characters is to search on the correct quote, then according to the previous bi-quote she is backwards. I think I'm sure it's possible or what to do. this. I could only do this with PHP scripts, but then I will not find if it is possible from the command line. You can use sed: sed - I.bak 's / "\ ([^" *] "\" / "\ 1 /" file cat file "in the opening and

ios - UITableViewCell's detailTextLabel not use all the available space -

Image
में दिखाया गया है स्क्रीनशॉट में दिखाया गया है। बस सोच कि मैं कैसे विस्तार से टेस्टलाबेल को सभी उपलब्ध स्थान का उपयोग करने के लिए कह सकता हूं, कहें, लाल रंग का क्षेत्र आपको पहले से धन्यवाद। मैं आपको एक UITableViewCell उप-वर्ग की सलाह देता हूं और इसमें अपने सभी सेल कस्टमाइज़ेशन को डाल दिया है। यह इस कोड के जैसा दिख सकता है: CustomCell.h @interface कस्टम सेल्स: UITableViewCell - (आईडी) initWithReuseIdentifier: (NSString *) reuseIdentifier; @end customcell.m #import "कस्टम सीएल एच" @implementation कस्टमसीएल - (आईडी) initWithReuseIdentifier :( NSString *) पुनः उपयोगआईडेंटिफ़ायर {सेल्फ = [सुपर इनिटविथ स्टाइल: यूआईटीबल वीजसेलेल स्टाइलशूचिटल रीसइडेन्टिफायर: पुनः यूजेंटिफायर]; यदि (स्वयं) {// अनुकूलन स्थिति और subviews के आकार से संबंधित नहीं उदाहरण के लिए: self.detailTextLabel.textColor = [UIColor lightGrayColor]; Self.detailTextLabel.text = @ "आआआआ ..."; } स्वस्थ वापसी; } - (शून्य) लेआउटसब्यूव्यूज़ {[सुपर लेआउटस्विअ्यूज़]; // स्थिति और सेव्य

c++ - Gcc preprocessor and pasting -

# PLATFORM3 Define Pasteor (X, Y) X = ## _ ## y #define EVALUATOR (x, y) Pastor (X, Y) # Define platformspace (pretender) Evaluator (funny, platform) Zero platform without extere Specific (Ffunk) (four * x); Compiled with GCC-A, the result is as follows: # 1 "xx.c" # 1 "lt; & gt; # 1 "& lt; Command-Line & gt; "# 1" XX "Extra Zero Ffix (four * x); However: #define PLATFORM linux #define PASTER (x, y) x ## _ ## y #define EVALUATOR (x, y) Pastor (X, Y) # Define Platform-Specific Evaluator (Fun, Platform) Platform Specific (Affx) * X); Results in: # 1 "xx.c" # 1 "& lt; Built-in & gt; "# 1" & lt; Command-line & gt; "# 1" XXC "External Zero Safonicode (four * x); What can I do to make this return 'somefunc_linux'? It seems, BTW. If you want to use Linux as a name, then you Change your compiler options to define it: GCC -Ulinux Or standards:

git - Github as Source Version Control setup -

Image
I deleted the extension of Visual Studio for the Git I created an account on Guitar Hub I do not know how to merge my local repository with my GITHB account or I have a repository for my project As I can use GitHub, I send my code to Visual Studio, it's mer Updates on the account? You can declare a new GitHub repo, and clone it: (section" Then when you're ready Before putting pressure you can make local commitments. This idea is not to push "as soon as I see my code in the visual studio. I see: This is a distributed version control tool: Everything is local, unless you anticipate that you want to publish your local history (here: your commitment back to GitHub).

android - How to access variable defined in onCreate in onCreateView -

I am trying to access the declared variable "adapter" in the onCreate section in the onCreateView section. This is a list every time I check out the content on it, then empty it. Here is the code package com.example.beacon; Import java.util.list; Import com.estimote.sdk.beacon; Import com.estimote.sdk.BeaconManager; Import com.estimote.sdk.Region; Import android.app.Fragment; Importroid.os.Bundle; Android Import Remote option; Import android.util.log; Import android.view.LayoutInflater; Import android.view.View; Import android.view.ViewGroup; Import android.widget.TextView; Public squared frigatebicon piece {Private constant final string TAG = main activity. Class.getSample name (); Private static final string ESTIMOTE_PROXIMITY_UUID = "B9407F30-F5F8-466E-AFF9-25556B57FE6D"; Private static final area ALL_ESTIMOTE_BEACONS = new area ("regional", ESTIMOTE_PROXIMITY_UUID, empty, empty); Private Beacon Manager Beacon Manager; Public LeDeviceListAdapte

java - MigLayout - selective component fill -

Image
I am trying to add a JTabbedPane to a panel, as well as for control I am using Migrates with the following buttons. However, I can not even get the JTabbedPane to fill without the buttons when they are not needed. The following SSCCE: public static zero main (string [] args) {jpn panel = new zpinal (new megallout (new lc.) Filling ())) ; Panel.add (new pocket ("+"); Panel.add (new pocket ("-"), "wrap"); Panel.ed (new zetaabbedpan (), "duration, increase"); Jeffre Frame = New Gefram (); Frame.add (panel); Frame.setSize (new dimension (300, 500)); Frame.setLocationRelativeTo (zero); Frame.setVisible (true); Frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); } This creates a panel that looks like this: However, if I lack layout ( JPanel panel = new JPanel (new MigLayout)); ), looks like: If you do not want to apply a barrier to all the cells, do not say the layout ;-), instead, use the column and row barriers : Three

C++ Macro to replace text with nothing -

MacOS is often used for text replacement. In my case, I have to wipe certain keywords conditionally, so that The compilation is possible in those specific composers which are not specific features. Especially I see where this snippet comes from template & lt; Typename C & gt; Structure is_ size {template & lt; Typename T & gt; Static constexpr auto check (t *) - & gt; // Problem VS2013 typename std :: is_integral & lt; Decltype (std :: declval & lt; t const & gt; () size ()) & gt; :: type; // more stuff}; I am giving it as an example which was causing the question. In the above code, I template & lt; Typename T & gt; Fixed #if COMPILE_WITH_GCC_NEW_ENOUGH constexpr #endif auto-check (T *) - & gt; Because there were other parts where constexpr was to be replaced with the const so that it could be compiled. What I am asking is a way to say like define # constexpr ????????? so that it will be replaced by constex

sql - Replace year in datetime date -

I have a table with the column ( dateDT ), which is based on date time and one variable Formatted in the form of my year in the form ( @selYear ), formatted as int. How can I change the variable input from my table within a date of the year and convert the result into a one time format? I have tried the following dates incorrect dates / year: Convert (DATETIME, (SSLEER + MNST (DDT) + DAY (DDDT )) DTT as the date, Example: @selYear = 2014 dateDT = 2010-05-02 00: 00: 00.000 In this case, my result should be: dateDT = 2014-05-02 00: A solution using the function: DECLARE @selYear VARCHAR (4) = 2014 DECLARE @dateDT DATETI ME = '2010-05-02 00: 00: 00.000' SELECT DATEADD (YEAR, @ selYear - YEAR (@dateDT), @ dateDT) with this small Example is the current year: DECLARE @selYear INT = 200 9 DECLARE @dateDT DATETIME = '2010-05-02 00: 00: 00.000' Selection Date ADD (YEAR, @ selYear - YEAR ( @dateDT), @ dateDT)

php - MYSQL IF statement to different WHERE clause -

I am trying to solve a question on my app, this is the query to try to do this work . Select from SELECT (IF article. Type = 1, join members at INNER members, IID_member = articles.author_id, join INNER company company.id_company = articles.author_id) Where the user says Is articles.tipe = '1' and user = '1'; I have a system that posts articles, but the same user can post on his name or the name of the company that he has created, so, what should I do Trying, if the type of articles is 1, the article was published by his company, and if otherwise, this type is 0, then he is posted on his name, if I use only 1 of them I am, so be mixed I have tried to give different approval but none of them is working for me, can anyone please help? Based on the type of article, get records for both type-type = 0 and article_type = 1 For, if you are conditionally involved on the basis of the article type, here's the question: Select from * Select * (select article.t

matlab - Apply a gaussian distribution in a specific part of an image -

Image
मेरे पास निम्न चित्र और एक संबंधित मुखौटा है। मैं गाऊसी, g = @ (x, y, xc, yc) exp (- ((x-xc) के साथ सफेद सर्कल के अंदर पिक्सल को वज़न करना चाहूंगा ^ 2) /0.5 + ((y-yc) ^ 2) /0.5)); , (xc, yc) में रखा मुखौटा। x , y संबंधित पिक्सेल के निर्देशांक हैं क्या आप कृपया किसी को ऐसा करने का सुझाव दे सकते हैं कि के लिए बिना ? धन्यवाद। अंडाकार के अंदर "भारित" पिक्सल से, मैं मानता हूँ कि आप 2 डी गाऊसी द्वारा तत्वों को गुणा करते हैं यदि हां, तो यहां कोड है: % छवियाँ पढ़ें img = imread ('img.jpg'); Img = im2double (rgb2gray (img)); मास्क = इमेड ('मुखौटा। जेपीजी'); मास्क = im2double (rgb2gray (मुखौटा)) & gt; 0.9; % JPG संपीड़न के परिणामस्वरूप कुछ शोर% गाऊसी फ़ंक्शन जी = @ (एक्स, वाई, एक्ससी, यासी) एक्सपी (- (((x-xc)। ^ 2) / 500 + ((y-yc)। ^ 2)। / 200)); % को मापदंडों के रूप में रूपांतरित करने के लिए संशोधित किया जाना चाहिए% centroid और मुखौटा rp_mask = regionprops (मास्क, 'Centroid', 'BoundingBox', 'Image') प्राप्त करने के

asp.net mvc - IIS Express - HTTP Error 500.19 0x800700b7 on 'mimeMap' for 'fileExtension' set to '.svg' -

I was adding the ability to serve SVG; WOFF files In my hosted web application, I have received the following instructions: Which I have done by adding the following text to my web .config file: & lt; Staticcontent & gt; & Lt; MimeMap file extension = ".json" mimeType = "app / jason" /> & Lt; MimeMap file extension = ".svg" mimeType = "image / svg + xml" /> & Lt; MimeMap file extension = ".woff" mimeType = "app / x-font-woff" /> & Lt; / StaticContent & gt; This works when published in Ezur, however, whenever I use the website to start the website in debug mode for every resource of the website's efforts. IIS-Express gets the following error I HTTP error 500.19 - Internal server error The requested page can not be accessed because the page's related configuration data invalid is. wide error error code 0x800700b7 notification code notification sender send

javascript - three.js cylinder wireframe without diagonals? -

I am trying to attract a THREE.js wireframe cylinder without faces in the face. I'm also moving in the corner of the cylinder of each frame, and thinking that there is no solution to pull it without having to manually create a new set of three with quad face. The exgesheller is fickle as it has to create a new one for each frame.

html - my text is not aligning correctly -

Image
मेरे पास दो & lt; ul & gt; और Im को मेरी दूसरी और lt ; Ul & gt; , जो कि अधिक सामग्री के साथ है इस दूसरी & lt; ul & gt; मेरी अंतिम पंक्ति में प्रतीत होता है बाएं ओर तैरता है और न ही मेरे अंतिम पंक्ति से नीचे दिखाई देता है। इस तरह: कोई व्यक्ति जानता है कि मैं इसे सही कैसे संरेखित कर सकता हूँ? मेरा जेएसडेल समस्या: मेरा HTML: & lt; div id = "उदाहरण" & gt; & Lt; img src = "चित्र / छवि 1। Jpg" width = "180" height = "170" / & gt; & Lt; h2 & gt; 1º उल्ल & lt; / h2 & gt; & LT; ul & gt; & Lt; li & gt; यहां मेरे पास दो सूची आइटम हैं: & lt; / li & gt; & Lt; li & gt; & lt; मजबूत & gt; सूची आइटम 1: & lt; / strong & gt; सूची आइटम की सामग्री 1 & lt; / li & gt; & Lt; li & gt; & lt; मजबूत & gt; सूची आइटम 2 & lt; / strong & gt; सूची आइटम की सामग्री 2 & lt; / li & gt; & Lt; / ul & gt

java - Getting "cannot resolve method" error when trying to implement getSharedPreferences in Android Studio -

I'm trying to create a class key Validby that stores ways to interact with shared options , But I'm just going through a problem defining the class. All I want is to store the conservator with the correct file name to share a shared favorite object, but I can get a "method" receipt reference ( Java .lang.String, int) ' I have a string and an int ... I'm not sure what I'm doing wrong. Any help please appreciate! < Code> package com.farmsoft.lunchguru.utils; import android.content.Content; import android.content.sharedPreferences; import java.util.ArrayList; import java.util.list; import java.util.Map; import org.json .JSONException; / ** * Created by SxS * 2014/04/28 * / Public Class KeyValueDB {Private SharedPreferences SharedPreferences; Public KeyValueDB (string prefName) {SharedPreferences = getSharedPreferences (prefName, Context.MODE_PRIVATE);} getSharedPreferen Ces () A reference needs to be reached For example:. mContext.get

ios - UITableView does not display cell immediately after reloading data -

दृश्य में, सर्वर से तालिका दृश्य लोड डेटा सफलता: ^ (NSArray * array) {If (! _dataSource) {_dataSource = [[@ [] म्यूटिवकॉपी]; } अगर (सरणी) {[_dataSource addObjectsFromArray: सरणी]; [_tableView पुनः लोडडेटा]; }} फिर हर बार जब मैं नीचे से ऊपर खींचता हूं, तो सर्वर से नया डेटा प्राप्त कर लेता है और इसे _dataSource (पहली बार जैसे ही वही) सफलता: ^ (NSArray * सरणी) {if (! _dataSource) {_dataSource = [[@ [] mutableCopy]; } अगर (सरणी) {[_dataSource addObjectsFromArray: सरणी]; [_tableView पुनः लोडडेटा]; }} अब समस्या आ रही है: कभी-कभी नीचे से ऊपर खींचें, और नया डेटा सफलतापूर्वक प्राप्त करें, लेकिन तालिकादृश्य ताजा दृश्य प्रदर्शित नहीं करता है, जब मैं टेबलव्यू को साफ़ कर देता हूं नया सेल प्रदर्शित करने वाला बिट (यहां तक ​​कि स्क्रीन को भी स्पर्श करें) । क्या समस्या यह हो सकती है? संपादित करें क्योंकि हर सेल एक ही ऊंचाई नहीं है, इसलिए मैं पुनः उपयोग सेल नहीं करता, और एक नया सेल init प्रत्येक समय, क्या यह कारण है? // विषयकेल * सेल = [तालिका दृश्य dequeueReusableCellWithIde

java - Non-blocking synchronizers? -

Is there something like "inferior lock" in Java? By doing that, I mean there is a way to maintain the properties of synchronization (nuclear security and memory visibility - the latter can come later, but the first most important thing I am looking for now), but also Do not have more than one thread to wait for the object to monitor? What I see - just to be clear - is not a CAS operation, but it says that the implementation of synchronize keyword, or that but Real synchronization means science that does not block the thread invitation to get a certain action like getters and setters. After the you can see lock stripping techniques (used in concurrenthashmap) that it meets your needs Yes or No. Their basic idea is that if you break your structure in sections and if one section is modified one thread, you can still read it from other areas. You can also try copyOnWriteArrayList where if you are modfying an array, you make a copy and use it for any read tasks, w