Thursday 15 May 2014

c - checking my understanding of pointers/structures and arrays -


All I am just trying to understand some key concepts, and have done my own research but there are some questions and really appreciate it if someone can see if they are right. I am making a review for a test, and our professor told us to understand myself ... so I did and here it went :)

1: Pointer Announce the pointer to keep the address of an element in an array with 10 elements, which are called

  int pointed [10] = {}; Int * thePointer = & amp; Appointed [1];   

Need help with this one ...

2: Write a function that will accept the address of an array and elements in an array Use the information to begin the number and the element of zero

  for the zero array function (int * array, int element) (x = 0; x & Lt; element; x ++); {Array [x] = 0; 3: Create a structure that represents the following structure:   

- 2 fields that hold every 4 BT BCD points Together, they keep the current rotation count (I call them CRC1 and CRC2): speed of 2 beats: 4 Beats Fault Statement: 3 Beats Structure Control Name Motor < Pre> Structure Control Mounter {Unsigned four CRC 1: 4; Unsigned four CRC 2: 4; Unsigned int motor direction: 2; Unsigned int speed: 4; Unsigned error: 3; };

- Type a type to name this new data type: statusDrive_t

  typedef control motor statusDRIVE_T;   

- Make a Merced Drive of named structures to position each 6 drives

  statusDrive_t marsDrive [5] = {< / Code>  

Start each field of the first element of the array with the maximum value

  Mercredrive [0] .CRC1 = 15; Mercredri [0] .RCC 2 = 15;    

1 looks fine, but you & amp; / Code> operator bus:

  int * thePointer = pointed;   

will work because the arrays will get decayed in pointers.

2 Write a function that will accept the address of an array and the number of elements in the array takes your function only one int Was asking, it is not close to it. This question is trying to give you a reference that information passing through the array in the function is lost as the number of elements in the array.

I'm pretty sure they were looking for something else:

  Zero array function (int * arr, int element) // You can (int arr [], ... as well as {int (ii = 0; i & lt; element; i ++) arr [i] = 0;} int main (zero) {int i [4]; arrayfunction (I, 4);   

3 Your typed is incorrect, it should be:

  typedef struct control motor position Dreive_t;   

The syntax is:

  typedef  gt; new name to name it;   

And in this case this type is < The code> struct controlMotor

array is also declared incorrectly. int marsdrive [6] one of the int s The array creates the array you want to type before, so in this case since you have just typed that fancy new one:

  statusDrive_t marsdrive [6];  < / Pre> 

For an array composition controlometer of 6 (numbered 0 to 5) and the last part of 3: start each field of the first element of R. ray with maximum value You need to start the area of ​​the first element. It has been done by:

  marsDrive [0] .CRC1 = ... marsDrive [0] .CRC2 = ...   

Increase the value in [] You are moving away from the first element. You can find the maximum "maximum" size by the number of bits, for example CRC is 1 4 Beats, that means You have a maximum of 1111 2 which is 15 10

objective c - NSError objects with NSFetchedResultsControllers -


This is a simple one: I am currently using a new NSError object every time I Make a fetch on NSFetchedResultsController . It happens in many ways, so currently I have 9 main view controllers, do I create a NSError as a property and use it, or what every time you use it So, to make a new one, it is more conventionally accepted?

I am taking advantage of this to build multiples that if you get more than one error, you can get it independently on both, but if this is not likely to happen then what Is the use of sharing for all forFetch calls acceptable? I am learning a lot of programming conferences and techniques, so if it is a non-issue then I apologize, I would just like to get some feedback on a more specific approach to using the NSError objects Different types of places

You are not actually creating NSError objects are declaring references of objects and then passing a reference to a method, which creates a reference which creates an NSError object.

  NSError * err; // just a reference, no object created / it creates an object, but you do not do that = [nserro error: dadmin: @ "afu" code: 0 user ink: nil]; // You do this .... BOOL success = [fetchedResultsController performFetch: & amp ;;];   

The distinction is that you are not actually creating a bunch of objects that require overhead. So if you reuse the same variable for all of them or you create a new variable for each one, then it is not affecting the display.

To answer the question ... either use 1 or the variable that you see fit. Some code may fail on any error and may refuse to continue so 1 error is OK. Try other code and continue so that you can keep all the errors and finally remove them. This is the case of the time that best fits with specific coding working at that time.

css - Can't wrap my head around accessing fonts on server (getting 404 errors in console) -


So I've downloaded a new font named "Aleph", it's in Hebrew, but it's irrelevant because I have to activate it I'm unable to I am pretty sure that I am doing something really stupid, but I am trying to implement it for hours, but there is no benefit.

What I found:

8 files: / P>

4 x normal eot, svg, ttf, woff

4 x bold eot, svg , Ttf, woff

and the stylesheet .css is a stylesheet file, which now has the following code:

  @ font-face {font-family: 'Alef' ; Src: url ("/ wp-content / themes / duet / Alef-bold.eot"); Src: url ("/ wp-content / themes / duet / Alef-bold.eot? #imix") format ('embedded-opentype'), url ("/ wp-content / themes / duet / Alef-bold.woff "Format ('woff'), url (" / wp-content / themes / duet / Alef-bold.ttf ") format ('truetype'), url (" / wp-content / themes / duet / Alef-bold .svg # alefbold ") format ('SVG'); font-weight: bold; Font style: normal; } @ Font-faces {font-family: 'Alef'; Src: url ("/ wp-content / themes / duet / Alef-regular.eot"); Src: url ("/ wp-content / themes / duet / Alef-regular.eot? #fix") format ('embedded-opentype'), url ("/ wp-content / themes / duet / Alef-regular.woff ") Format ('woff'), url (" / wp-content / themes / duet / Alef-regular.ttf ") format ('truetype'), url (" / wp-content / themes / duet / Alef-regular .svg # alefregular ") format ('SVG'); Font weight: normal; Font style: normal;   

I have uploaded all files to my subject directory: / wp-content / themes / duet /

My main CSS file is called Style.css, In the same directory, I added this code to the file:

  @ font-face {font-family: 'Alef'; Src: url ('Alef.eot'); Src: url format ('Alef.eot? # Formix') format ('embedded-opentape'), url ('Alef.woff') format ('woff'), url ('Alef.ttf') format ('truetype' ), URL ('Alef.svg # webfont') format ('SVG'); }   

Then what I did, this line was added to my header.php:

     

And of course I set up my page [font-family: Alef;)

What am I doing wrong? I'm getting 404 errors for files in Chrome's console. This error shows the correct URL to the right of the console.

Two main problems:

  • You are referring 12 different files But you only have 8 (Alef.eot, etc. Alef-regular.eot, etc. Alef-bold.eot, etc.)
  • I think your copy '2' src 'statement reports

    What do I do here:

    • Remove the font-face declaration in style.css. Stylesheet Take the font-face announcements out of CSS and style.css
    • Use only one 'src' declaration with all the URLs separated by commas.

      The code I will use here: (your file path is replaced): prefix

      Extra: Of course, here's the bold version ...

        `@ font-face {font-family: 'Alef'; Source: 'url (' / wp-content / themes / duet / Alef-bold.woff) 'format (' woff '), url (' / wp-content / themes / duet / Alef-bold.ttf ') format ('Truetype'), url ('/ wp-content / themes / duet / Alef-bold .svg # Alef') format ('SVG'); font-weight: bold; Font style: normal; }    

python - What is parent in PySide QSelectionModel.isRowSelected() function? -


I need to determine which rows are selected in association with someone. From the scene, I call the function to get the selection. I want to call the function, from that object that gives this function object. This function takes two arguments: the row I want to test, and a parent argument, which is one. This is where I am lost What is it parents for reasoning? Where does it come from? Conceptually, I do not understand why I needed this parameter, and firmly, I do not know which work function I should go to work on.

You parent to QTreeView , example In the case of your use, it is the relevant parts of the documentation:

The model is used by item models, delegates and selection models to find an item in the model ...
While referencing top-level items in a model, invalid indexes are often used as the original index Land. "

with QtCore.QModelIndex () will create an invalid index, which argues that you are looking for. In this example, you select the rows To print the situation, you can use the context menu:

  # ./UIR / bin / NYY Python # - * - Coding: UTF-8 - * - Import from QTGui , Kyutikor Class Mayvando (QtGui.QTableView): def __init __ (self, not the original = no): Super (Mayvando, .__ (ini row number itself) range (3) t) __ (self.modelSource = QtGui.QStandardItemModel (self) to the original): column item number ([3]): Item = QtGui.QStandardItem () item.setText ( "row: {0} column: { 0} ". format (row number, column number) items. Append (items) SelfkmodelSourcekappendRow (items) self .actionselectedRows = QtGui.QAction (self) SelfkactionSelectedRowsksetText (" Select the lines ") self .actionSelectedRows.triggered.connect (self.on_actionSelectedRows_triggered) self.contextMenu = QtGui.QMenu (self) self.contextMenu.addAction (auto.actionselectedRows) self.setModel (self.modelSource) self.setContextMenuPolicy (QtCore.Qt.CustomContextMenu) self .setSelectionBehavior (QtGui.QAbstractItemView.SelectRows) self.horizontalHeader (). SetStretchLastSection (True) self.customContextMenuRequested.connect (self.on_customContextMenuRequested) @ QtCore.pyqtSlot (bool) def on_actionSelectedRows_triggered (self-state) in the range of line numbers (self.model (). RowCount ()): info = " row {0} ".format (rowNumber) if self.selectionModel () Kaiarro selected (line number, QtCore.QModelIndex ()): info + =" selected "else: info + =" not selected "print info @ QtCore .pyqtSlot (QtCore.QPoint) DF on_customContextMenuRequested (self, position): Self ContextMenu.exec_ (self.mapToGlobal (pos)) If __name__ == "__main__": import sys app = QtGui.QApplication (sys.argv) app.setApplicationName ('MyWindow') Main = MyWondo () Main. Position (333, 222) main.show () sys.exit (app.exec_ ())    

javascript - Image appear at mouse location -


When I click on the canvas I'm trying to create an image instead of the coordinate mouse.

I see it now, but I can only understand how to do this with automatic updating coordinates and the image will follow the mouse after "onclick".

I need to make it so that the image can only be accessed at the place I click, not following the cursor.

  & lt ;! DOCTYPE html & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Style & gt; Body {margin: 0 px; Padding: 0 pixels; } & Lt; / Style & gt; & Lt; / Head & gt; & Lt; Title & gt; Click to create a sad face & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Canvas ID = "Mikevas" width = "2000" height = "1000", onClick = "mesephus ();" & Gt; & Lt; / Canvas & gt; & Lt; Script type = "text / javascript" & gt; Write a message (canvas, message) {var ctx = canvas.getContext ('2d'); Ctx.clearRect (0, 0, canvas wide, canvas.height); Ctx.font = '18pt Calibri'; Ctx.fillStyle = 'black'; Ctx.fillText (Message, 10, 25); } GetMousePos function (canvas, EVT) {var rect = canvas.getBoundingClientRect (); Return {x: evt.clientX - rect.left, y: evt.clientY - rect.top}; } Var Canvas = document.getElementById ('myCanvas'); Var ctx = canvas.getContext ('2d'); Message to 'canvas.addEventListener' ('MouseMove', function (evt) {var mousePos = getMousePos (canvas, evt); = 'Click to make a face appear on coordinates:' + mousePos.x + ',' + MousePos.y; write message (canvas, message);}, false); Function makeface () {canvas.addEventListener ( 'MouseMove', function (evt) {var mousePos2 = getMousePos (canvas, evt); var headx = mousePos2.x; var substance = mousePos2.y; var message = 'appears you face made Is, you are currently in coordinates: '+ mousePos2.x +', '+ mousePos2.y; write message (canvas, message); var header = 50; var smile offset x = 0; var frownoffsety = 33; var smilerad = 20; var eyeoffsety = -10; var lefteyeoffsetx = -15; var righteyeoffsetx = -lefteyeoffsetx; var eyerad = 8; ctx.strokeStyle = "blue"; ctx.lineWidth = 5; ctx.beginPath (); ctx. arc (headx, alcoholic, headrad 0,2 * Math.PI, true); ctx.closePath (); ctx.stroke () ;. ctx.beginPath () ctx.arc (headx + smileoffsetx, alcoholic + frownoffsety, sm ilerad, - 20 * Mathematics. PI, - 80 * Math.PI, true) ;. ctx.stroke (); ctx.beginPath () ctx.arc (headx + lefteyeoffsetx, alcoholic + eyeoffsety, eyerad 0,2 * Math. PI, true); ctx .fillStyle = "blue"; ctx.fill (); ctx.beginPath () ctx.arc (headx + righteyeoffsetx, alcoholic + eyeoffsety, eyerad 0,2 * Math.PI, true); Ctx.fill ();}, false); } & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

This is happening because the memos function of your writing is clearing the whole canvas.

This is my quick and dirty solution:

  & lt; Canvas id = "myCanvas" width = "2000" height = "1000" onClick = "document.madeFace = 0; message ();" & gt; & Lt; / Canvas & gt;   

...

  function Mesefes () {canvas.addEventListener ( 'mousemove', function (evt) {var mousePos2 = getMousePos (canvas, UK ); Document.madeFace = document.madeFace || mousePos2; / * Added * / var message = 'You have seen the face, you are currently in coordinates:' + mousePos2.x + ',' + mousePos2.y; mousePos2 = Document.madeFace; / * Added * / var HeadX = MousePos 2.x; var Headley = MousePos 2.y;   

...

What is this code When the user clicks, then store the coordinates of the face. , Then the variable "document.madeFace" gets reset to 0 and therefore the coordinates of the face are re-calculated.

But whenever the mouse moves, the face is still again Is prepared, and therefore it will also appear, even if the entire canvas is removed.

c# - Cannot show quickly list of images in WPF ItemsControl -


I have the item control (listbox) with some custom complex data templates. And something to show the window with this listbox Take seconds!

My list box contains an image in the datataplet:

  & lt; Image Stretch = "Uniform" x: name = "image" Grid.ColumnSpan = "1" source = "{Binding ImagePath}" Horizontal Alignment = "Statch" Vertical Alignment = "Stretch" width = "Auto" Grid. Column = "0" minway = "20" minhite = "20" D: layoutoverride = "gridbox" margin = "1,0,1, 1" />   

Almost all the emailpaths are faucet. I saw that this generates a blank exception, but the wpf engine hides it! I think this is the source of the problem, is it possible to disable image loading when I know the image path is zero !?

Add this datatyger your DataTemplate : < / P>

  & lt; Data Trigger Binding = "{Binding Image Path}" Value = "{x: Faucet}" & gt; & Lt; Setter target name = "image" property = "source" value = "{x: faucet}" /> & Lt; / DataTrigger & gt;    

vb.net - Using objects in shared functions -


कृपया नीचे दिए गए कोड को देखो:

  Imports System.Data.SqlClient सार्वजनिक कक्षा व्यक्ति निजी आईडी स्ट्रिंग निजी नाम स्ट्रिंग सार्वजनिक समारोह की जांच के रूप में (ByVal personid स्ट्रिंग के रूप में) के रूप में बूलियन 'व्यक्ति पर कुछ जांच करें देखने के लिए यदि वह हटाए समाप्ति समारोह सार्वजनिक तौर पर साझा उप हटाएँ के लिए तैयार है () मंद वी न्यू वाहन मंद के रूप में के रूप में पी नया व्यक्ति End Sub समाप्ति कक्षा लोक कक्षा वाहन निजी VRM स्ट्रिंग सार्वजनिक समारोह की जांच के रूप में (ByVal vehicleid स्ट्रिंग के रूप में) के रूप में बूलियन 'वाहन पर कुछ जांच करें देखने के लिए यदि वह हटाए समाप्ति समारोह के लिए तैयार है के रूप में निजी साझा उप हटाएँ () मंद पी नया व्यक्ति मंद वी न्यू वाहन मंद objCommand SqlCommand मंद objCon रूप SqlConnection मंद objDR के रूप में के रूप में के रूप में SqlDataReader मंद _ConString प्रयास करें के रूप में स्ट्रिंग = के रूप में "डेटा स्रोत = IANSCOMPUTER; प्रारंभिक सूची = टेस्ट; एकीकृत सुरक्षा = सच; MultipleActiveResultSets = सच" objCon = नई SqlConnection (_ConString) objCommand = नया एसक्यूएल कॉमांड ("से चयन करें * व्यक्ति प्रारंभ थे & lt; DATEADD (वर्ष, -6, "& amp; अब & amp;") ") objDR = objCommand.ExecuteReader करते objDR.Read तो p.check (objDR (" आईडी ")) और v.check (objDR (" vehicleid ") ) फिर 'निष्पादित हटाने बयान है, जो हटाता व्यक्ति और वाहन के अंत लूप objDR.Close () objCommand.Connection = objCon objCon.Open () objCommand.ExecuteNonQuery () पकड़ने पूर्व अपवाद के रूप में अंत में समाप्त तो End Sub समाप्ति कक्षा   

ध्यान दें कि साझा समारोह (व्यक्ति.दबाना) में व्यक्ति और वाहन का संदर्भ होता है और व्यक्ति और वाहन में उदाहरण चर का उपयोग करता है। असल में व्यक्ति और वाहन पर व्यक्ति से पहले एक जांच की जानी चाहिए और वाहन को हटाया जा सकता है।

क्या यह साझा समारोह से व्यक्ति और वाहन को संदर्भित करने के लिए खराब अभ्यास है? क्या यह हटाए गए फ़ंक्शन में उदाहरण चर का उपयोग करने के लिए खराब अभ्यास है। हटाएं फ़ंक्शन हजारों व्यक्तियों और वाहनों को दैनिक रूप से हटा देगा ।

यह जरूरी नहीं कि उन्हें साझा करने के लिए एक बुरा अभ्यास है, लेकिन यदि वे अपनी कक्षाओं में उन्हें पुन: करने के लिए एक अच्छा अभ्यास साझा कर रहे हैं। साझा तुरन्त तत्कालीन वैश्विक कार्य करता है, जो मेरे मन में, वर्ग के हस्ताक्षर को दूषित नहीं करना चाहिए।

तो यह मेरे अनुमान में बेहतर अभ्यास होगा:

  स्ट्रॉन्ग एंड क्लास पब्लिक के रूप में स्ट्रिंग एंड क्लास पब्लिक क्लास वाहन प्राइवेट वीआरएम क्लास पर्सनवेनियर पब्लिक शेयरिंग सब डिलीट () डिम वि के रूप में नई व्हीकल डिम पी के रूप में नई व्यक्ति ... एंड पब्लिक शेयर फंक्शन चेक (इंस्ट्रूमेंट स्ट्रिंग) बूलियन के रूप में ... एंड फंक्शन एन्ज क्लास पब्लिक क्लास व्हेयल क्रॉसर प्राइवेट शेयर्ड सब डिस्काउंट () नई पीढ़ी के रूप में नए व्यक्ति के रूप में नई वाहन ... अंत उप सार्वजनिक साझा समारोह चेक (वाहन के रूप में स्ट्रिंग) बूलियन के रूप में ... अंत समारोह अंत वर्ग   

लोगों के बारे में दार्शनिक बहस में मिलता है यह, लेकिन अगर यह मेरा कोड था तो मैं कुछ भी साझा नहीं करता। मैं "न्यू अप" को एक VehicleCrusher पसंद करता है, जब मुझे इसकी आवश्यकता होती है और जैसे ही मैं कर रहा हूँ, तब सब कुछ NET को निपटाने देता है।

ios - Restrict iPhone/iPad App to iPhone 4 and higher only? -


I'm looking to create my app so that it works only on iPhone4 or higher, and not 3GS.

How can I do this? Is this architecture done by setting it into Standard Arms 7 / ERM 7

and the valid architecture is named ARM 7 & amp; Armv7s?

Or do I need to see the deployment goal? And set it up in a certain iOS version?

Thanks in advance!

Deployment target is only allowing you to target a specific iOS version and a 3GS iOS 6 Can run. If you are blocking the old device from running your application, then you can do some testing for the device model within AppDelegate and restrict functionality.

This is a warning that your app will not likely be in the app store. What feature (s) are you trying to avail that does not support a 3GS?

javascript - jquery show hide div based on select value -


I have a selection list with Valence 'All' and 'Custom' on the 'div' selection with the value 'custom' 'A div should appear with resources, and if the value is' all', then it should be hidden.

The form is:

  & lt; Div & gt; & Lt; Label & gt; Privileges: & lt; / Labels & gt; & Lt; Select name = "privilege" id = "privilege" class = "" onclick = "buyer userzobs.shoppillagez ();" & Gt; & Lt; Option id = "all" value = "all" & gt; All & lt; / Options & gt; & Lt; Option id = "custom" value = "custom" & gt; Custom & lt; / Option & gt; & Lt; / Select & gt; & Lt; / Div & gt; & Lt; Div class = "resource" style = "display: none;" & Gt; Resources & lt; / Div & gt;   

and it has JavaScript for:

  appearances: function () {var specialization = jQuery ('# privileges'); Choose Var = this.value; Privileges.change (function () {if (select === 'custom') {$ ('resource'). Show ();}}); }   

How should this look to work? Sorry, I know it should be simple, but I'm new to it all.

You can use:

  var privileges = jQuery ('# Privilege '); Choose Var = this.value; Privileges.change (function () {if ($ (this) .val () == 'custom') {$ ('. Resource'). Show ();} else $ ('. Resources'). Hide () Hide // div if the value is not "custom"}};   



Displaying a python file in HTML keeping the spaces etc -


I have written some python code, which I want to appear on my website, but clearly copy and paste text Due to HTML it is almost unreadable because recognizing the carrier returns and extra vacancy is not being removed.

Is there an easy way to show it in HTML as if it's a text editor or CDsing crap out of it?

& lt; Pre & gt; or & lt; Code & gt; ...



Where like queries on multidimensional arrays in php -


मान लीजिए मेरे पास एक php array है:

  $ shop = array (array ( "नाम" = & gt; "टॉम", "स्तर" = 1.2;), ऐरे ("नाम" = "gt;" माइक "," स्तर "= 0.01), सरणी (" नाम "= & gt;" जॉन "," स्तर "= & gt; 1.15));   

मैं इस सरणी को मेरी एसक्यूएल तालिका को फ़िल्टर करने के समान फ़िल्टर करना चाहता हूँ माना जाता है कि मैं हर सरणी चाहता हूँ जहां स्तर 1 से अधिक है। मैं फिर से दोहरा सकता हूं और अगर बयानों के साथ जांच कर सकता हूं। क्या इसका कोई php समाधान है?

वह है जिसे आप ढूंढ रहे हैं:

  $ परिणाम = array_filter ($ दुकान, फ़ंक्शन ($ आइटम) {वापसी $ आइटम ['स्तर']> 1;}); print_r ($ परिणाम);   

आउटपुट:

  सरणी ([0] = & gt; सरणी ([नाम] = & gt; टॉम [स्तर] = & gt; 1.25) [2 ] = & Gt; ऐरे ([नाम] = & gt; जॉन [स्तर] = & gt; 1.15))    

asp.net mvc - visual studio not updating html / javascript to server / browser -


This is an MVC 4 app using a hot towel SPA template whenever I change anything in HTML and / or Javascript So I can clear the browser cache to display the new code. F5, cntrl-F5, shift-F5, nothing works

I am not usually a web dev and I am just learning this. I have done regular MVC before and it was not the issue, what can I do with it, where HTML and Javascript are in my project (i.e. in the / app folder)? I am trying to understand it. I can completely remove the HTML file and run the app and it's still going on as I did. Clear the cache and run and then I can get updates.

This is using IIS Express using Firefox, Chrome, IE ...

Thank you ..

In Opera and Chrome (and possibly others), you can disable caching in 'development mode'.

While in DevTools, the second option in the Settings menu

Disable cache (while DevTools is open)

mysql - Sorting in php Arrayss -


My SQL table contains IDs, book names, styles and ratings. Currently my array looks like this in my SQL table (Output Array ([book] => Array ([0] = & gt; array ([0] => 1 [1] => one Book [2] = & gt; Fictional / Horror [4] => 8.9) [1] => Array ([0] => 2 [1] => two book [2] = Comedy [4] => 8.3)))

I want to sort this array from the title to the DESC with the title in the future. The array variable $ The book is so why did i try to do ksort ($ book) also arsort for some reason? Thank you!

If you are enabled: Instead Use SQL Sorting, because only use ARA-functionality of speed and flexibility (use DB engine where it is an appapriate) if you really need it!

Or Select ID, Book name, Style, / P>

If you still have to use array sorting , Use usort in PHP:

  & lt;? Php // book array $ bookAre ['book'] [0] = array (2, 'book one', 'fictional / horror', 8.9); $ Booker ['book'] [1] = array (1, 'book two', 'comedy', 8.3); Function sortByIndex ($ a, $ b) {return $ a [0] - $ b [0]; } Usort ($ bookArray ['book'], 'Sortboy Index'); Echo 'RESULT =' print_r ($ bookArray, true); ? & Gt; Results in this output: RESULT = Array ([book] => Array ([0] => Array ([0] => 1 [1] => Book two [2] => ; Comedy [3] => 8.3) [1] => Array ([0] => 2 [1] => a book [2] => Fiction / Horror [3] = & Gt; 8.9)))  

The book comes here first, because in my example I created the first index with the first 'book two' value.

asp.net mvc 4 - IE6/7 Column Layout CSS Issue -


I am trying to create a header that has 3 columns (fixed - liquid - liquid) in my header section in < Code> ASP.NET MVC4 layout templates and I do not get much to work with IE 6+, Chrome, FF, etc.

Especially I need to see it

  | -------------------------------------- | | Cover | | | --------- | | ---------- | | --------- | | | | Left | | Title | | Right | | | | --------- | | ---------- | | --------- | | | -------------------------------------- |   

Hold (to support IE6 and IE7 on one side) is that I need some wrapping when the window falls below 500px; To see something like this, this wrapping needs to be done only with those browsers which can support media queries. (I.e. for IE and LT; 9, squash while resizing 'title' in the example given above)

  | ---------------- ---------------------- | | Header-cover | | | --------- | | --------- | | | | Left | | Right | | | | --------- | | --------- | | | | | | ---------------------------------- | | | | Title | | | | ---------------------------------- | | | -------------------------------------- |   

Here is the CSS that I have yet received

  .content-wrapper {margin: 0 auto; Max-width: 1140px; } .header-wrapper {text-align: center; Vertical-alignment: text-down; } .header-left-box {float: left; Width: 160px; } .header-right-box {float: right; Margins: Auto; } .header-center-box {min-width: 200px; Background: None; Margins: Auto; Width: 50%; Padding: 4px; } .site-logo {background-image: url ('/ content / picture / logo.png'); Repeat Background: No Repetition; Background-position: top left; Display area; Width: 130px; Height: 80px; Margin-down: 5px; }   

And here is the relevant piece of MVC4 template

    

In addition to Jason's reply, for browser-specific coding or stylesheet, you have JavaScript enabled in addition to IE Can use for other browsers.

  if (navigator.userAgent.toLowerCase (). IndexOf ('chrome')! = -1) {document.write ('& lt; link rel = "stylesheet" type = "text / Css "href =" style-ch.css "media =" all "/> gt; '); }   

simply & lt ;! - If [IE 6]> gt; & Lt ;! [Endif] - & gt; , it will run some code (like) in the example above, load Chrome-specific stylesheet) only when the browser used is specified.

Of course you can also specify the browser version, such as: .indexOf ('chrome 11')

Make sure that this code is The declaration has been declared to declare the regular / cross-arms stylesheet (s), or it will not work.

I can not see why you will be bothered with optimization for IE6 and IE7 because they are really old. But this is your personal choice :)

javascript - Struggling to make an object always follow the mouse in box2dweb -


I'm trying to learn how to use box2dweb and want to make an object (a circle in this case) While not only dragging the mouse all the time, this idea can be used for an air hockey type game where the circle is your paddle.

However, the wheel is not correctly connected to the mouse, instead it swings around that point where the mouse cursor and if the distance objects have a mouse cursor, then behaves like a distance .

I can not tell what I am doing, but I am still new to it, so any help would be appreciated.

You can see the code (depending on the demo code) so far:

< P> It was managed to understand, my problem was a misunderstanding of the difference between the mousezage definition target and the mousezheng target. I need to set the definition goal in the center of the ball, not the mouse cursor. Once I did it that it worked perfectly.

objective c - How to determine first week day in iOS? -


I am using Tapku's calendar in my application and I want to determine whether the week is Sunday or Monday Should I start the user settings for the first time, but for some reasons it returns 1 (Sunday) to a device where the underlying calendar starts on Monday (and so it should be back in 2) on Monday. :

  NSCalendar * Cal = [[NSCallander Allok] Init With Calender Identifier: NSGGorian Calendar]; [Cal before wieck];   

What am I missing?

OK, so it has been found that this is the right way to do this:

  [[NSC calendar calendar] First Wake]    

javascript - "The iterator is bound to the context object." -


अंडरस्कोर.जे.एस दस्तावेज़ीकरण कहता है:

_ प्रत्येक (सूची, इटरेटर, [प्रसंग])

तत्वों की एक सूची पर बदलता है, प्रत्येक में पुनरावृत्त समारोह के लिए प्रत्येक उपज। इटरेटर संदर्भ वस्तु के लिए बाध्य है, यदि कोई पारित किया गया है। इटरेटर के प्रत्येक आमंत्रण को तीन तर्कों के साथ बुलाया जाता है: (तत्व, अनुक्रमणिका, सूची)। यदि सूची एक जावास्क्रिप्ट ऑब्जेक्ट है, तो इटरेटर का तर्क (मान, कुंजी, सूची) होगा। प्रत्येक कार्य ([1, 2, 3], अलर्ट)

  _। के लिए मूल के लिए प्रतिनिधि। = & Gt; प्रत्येक संख्या में बारी-बारी से चेतावनी ... _.each ({एक: 1, दो: 2, तीन: 3}, अलर्ट); = & Gt; बदले में प्रत्येक संख्या मान सचेत करता है ...   

ऊपर बोल्ड पाठ वाला क्या मतलब है? क्या कोई ऐसा उदाहरण प्रदान करता है जो इसे समझाएगा?

इसका अर्थ है, आपके इटरेटर फंक्शन के अंदर, मान यह का संदर्भ तर्क के रूप में आपके पास हो जाएगा।

उदाहरण के लिए:

  var arr = [ 1, 2, 3]; फ़ंक्शन इटरेटर (एल, आई, सूची) {console.log (यह)} _.each (एआर, इटरेटर, एआर); // पूरे सरणी को 3 बार लॉग करेगा   

यदि आप ऑब्जेक्ट विधि को इटरेटर के रूप में पास करना चाहते हैं, तो यह उपयोगी है, और यह विधि यह का उपयोग करती है। उदाहरण:

  var arr = [1, 2, 3]; Var myObj = {foo: 5, addFoo: फ़ंक्शन (एल, i, lst) {console.log (el + this.foo)}}; // यह 3 बार एनएएन लॉग करेगा, क्योंकि फंक्शन के अंदर 'यह' // विंडो का मूल्यांकन करेगा, और कोई विंडो नहीं है। फू इसलिए this.foo // अपरिभाषित हो जाएगा, और अपरिभाषित + 1 नाएन _.ईच (arr, myObj.addFoo) है; // यह, दूसरी ओर, इरादा के रूप में काम करता है इसे myObj से मूल्य का // मिल जाएगा, और 6 में प्रवेश करेगा, फिर 7, फिर 8 _.each (arr, myObj.addFoo, myObj);   



java - Adding to custom linked list causes NullPointerException -


Therefore, adding stuff to my custom linked list NullPointerException , And I can not understand why, for my life, the program aims to emulate a chest of a drawer, in which there is a list in which the drawers are nodes. Each of the drawers has a list in which the domestic items are included in the form of nodes.

There are relevant bits of code here error occurs when I have a: new chestoff drivers (3); In my UI category:

  Public class chestoff drivers {Private Stable Onyelist Chest; Private static int [] parametres; Public Chest Of Driers (Intro Drawers) {chest = new OwnList (); Surge (); } To make public static void () (for (int i = 0; i & lt; parametres.length; i ++) {Object drawer = New drawer (i, paramometers [i]); Chest.add (i, drawer ); // This is causing the error}}}   

class is referred to here for the square of the drawer int. I requires drawer capability in the form of ID and int parametres before the list is made in the parametres [] array is filled and it contains the drawer's capacity Information for The included list in question ( OwnList) is 100% working correctly because it is part of a given curriculum content, it is similar to Java itself. I have another test Tested the class in class and it worked fine, I made a mistake here, please help!

< P> The problem is that you are not starting the parametres array, this field is empty by default Aagi you're either will be initiated where it is proclaimed, or addition to a stable starting block, why are two fields and construction method static? They are definitely looking like an example state ...

This is a better version:

  Public Ultimate Division Chestoff Drawers {Private Finals O'Neilist Chest = New Onlist (); Private Final Ent Parameters; Public Chest Of Drawers (Intra Drawers) {If (Dare & Lt; 0) Exclude New Invalid Argument Exceptions ("Drafts can not be negative"); Chest = new onilist (); Parametres = new int [drawer]; // & lt; - I believe that it means the initial (); } Private Zero Start () (for (int i = 0; i & lt; parametres.length; i ++) {Object Drawer = New Drawer (I, Parameters [i]); //   

I'm not sure that you really need parameters array to include (a new array of int Zero values ​​will be filled) - But I'll leave it as one exercise the reader: -)

asp.net mvc - Passing value from action link to route constraint -


I have a custom subdomain route barrier (implementing the IROTE Consultant) from the action link (in particular the subdomain value) I want to give a way that the value in the URL is invisible, by passing the value through the path value collection, I could not hide the value from the URL. It always appears in the url.

How can I get it? Is there another way to pass data so that the value is invisible?

You can create a link to your action method with the value you need. Then grab the "hidden" value in the verb method and continue redirecting the value to the cookie / session / tempdata.

In this way, the information you can require, and its value will not show up in the URL you redirect.

Positioning the element second time using JQuery UI's position does not work as expcted -


यह मेरा बेला है:

HTML:

  & lt; आईएमजी src = "http://cdn.tacky.me/m/static/settings16.png" class = "settings-icon" / & gt; & Lt; div id = "control-panel" & gt; & Lt; img src = "http://cdn.tacky.me/m/static/settings16.png" / & gt; & Lt; a href = "#" शैली = "फ्लोट: राइट" id = "close-cp" & gt; एक्स & lt; / a & gt; & Lt; div class = "link_container" & gt; & lt; a href = "#" & gt; प्रोफाइल दिखाएं & lt; / a & gt; & lt; / div & gt; & Lt; / div & gt;   

सीएसएस:

  .settings-icon {मार्जिन: 100px; कर्सर: सूचक; } # नियंत्रण-पैनल {स्थिति: निरपेक्ष; ऊंचाई: ऑटो; चौड़ाई: ऑटो; शीर्ष: 0; बाएं: 0; पृष्ठभूमि रंग: #fff; फ़ॉन्ट-परिवार: एरियल, बिना-सेरिफ़; कुछ भी डिस्प्ले मत करो; Z- सूचकांक: 4; }   

जावास्क्रिप्ट:

  $ ('settings-icon')। क्लिक करें (फ़ंक्शन () {$ ('# control-panel')। स्थिति ($: '$ settings-icon'), my: 'left top', at: 'left top'}); $ ('# control-panel')। Show ();}); $ ('# Close-cp')। क्लिक करें (फ़ंक्शन (इवेंट) {event.preventDefault (); $ ('# control-panel')। Hide ();});   

मैं क्या करने की कोशिश कर रहा हूं: मेरे पास एक सेटिंग्स छवि है, जिस पर क्लिक करके यह इस आईएमजी के आस-पास एक पूरी तरह से डिज़ाइन किए गए div (contgrol-panel) नाम रखता है

मैं क्या देख रहा हूं:

पहली बार मैं आईएमजी पर क्लिक करता हूँ यह ठीक काम करता है

मैं क्लिक करके नियंत्रण कक्ष को खारिज कर देता हूं

Repro कैसे करें

जाओ पर क्लिक करें

  • पहली बार सेटिंग्स आइकन पर क्लिक करें
  • कंट्रोल पैनल को खारिज कर दें जो एक्स पर क्लिक करके नीचे जाता है
  • क्लिक करें

    P> आपको नियंत्रण कक्ष को 0 से वापस करने की आवश्यकता है, इसे बंद होने के बाद। यहां अपडेट किया गया बेला है।
      $ ('settings-icon')। क्लिक करें (फ़ंक्शन () {$ ('# control-panel')। स्थिति ({: of $ (this) , My: 'left top', at: 'left top'}); $ ('# control-panel')। Show ();}); $ ('# Close-cp') क्लिक करें (फ़ंक्शन (इवेंट) {event.preventDefault (); $ ('# control-panel')। सीएसएस ({top: '0px', left: '0px'}) छिपाना(); });    

  • javascript - addEventListener keydown not working -


    I made some basic pong codes available on the Internet and tried to add keypresses, the code is here:

    I added it:

      canvas.addEventListener ("keydown", hand button, true);   

    After this current code:

      canvas.addEventListener ("mousemove", trackPosition, true); Canvas.addEventListener ("Masudown", BTNClick, True);   

    And I also added:

      Function HandleDown (e) {console.log ("debug"); Console.log ("keycode:" + e.keycode); }   

    But the function is never called even though I try to press on different keys, why is it so? I'm pretty sure the canvas is in focus.

    You can not assign events in the canvas because you cursor with cursor Can not focus on You will need to assign an event to the window:

      window.addEventListener ("keydown", handle, true);    

    text - Adding a list of words to a txt file Java -


    I'm trying to add a list of words that a user has taken through a LoginPan input menu and without Do I archive them in a text file? There is already overwriting the txt file for example

    bell cool Hello Java compilation

    I have the problem that it depends on my writing Does that help me ??

      import javax.swing.JDialog; Import java.util.Arrays; Import javax.swing *; Import java.util. *; Import java.io * *; Write public class {public static zero main (string [] args) IOException throws {PrintWriter out = new PrintWriter (aFileWriter); String word = joppenpan.showinputdialog (empty, "enter a word"); Out.print (word); Out.close (); AFileWriter.close (); }}   

    OK now is adding the file but not going to a new line for the new word ??

    Open file:

    PrintWriter exits = new print-author

    Add a string to the file:

    out.println ("text") (new buffed vter (new fluffer ("outflame", true)); ;

    Close the file:

    out.close ();

    Better. < / Div>

    mapping - Populating a lookup field in MS dynamics -


    This is a follow-up question as I am trying to send web-form data through freeform in MS Dynamics 2011 . We had an extension created to send data to MS Dynamics, and it was created in such a way that we can add additional fields because we found that we wanted to collect that data.

    Thank you for the people who have many patients in that thread, and some more research on my part, I have now received it through the skull that the lookup values ​​do not have numerical values, but unique IDs ( GUIDs). I also felt how to identify the GUID of a lookup value, but then, when I went to create an array with a GUID to map field data in MS Dynamics, it was populating.

    Here are some code:

      $ ConfigData ['FieldMapping'] = array ('first_name' = & gt; array ('name' = & gt; 'first Name ',' value '= & gt; tap),' last_name '= & gt; array (' name '= array (' name '=' gtc: 'email address 1', 'value' = & gt; null) , 'Email address' = & gt; arrays (& gt; 'last name', 'value' = & gt; tap), 'email' = & gt; 'name' = & gt; 'emailaddress1', 'value' = '' '=' '' = ' & Gt; 'new_selfreportedcredithistory', 'value' = & gt; array ('Excellent' => 100000000, 'Good' => 100000001, 'Reasonable' => 100000002, 'Poor' = Array (' Name '= & gt;' campaign ',' ma '= & Gt; Array (' USDA '= & gt;' B53EA05A- '& gt; 100000003,' Bad '=> 100000005,)),' Campaign_Name '= & gt; 2C29-E211-8C3A-78E3B5101ED7' , 'Radio Advertising' = & gt; 8F254BB4-5575-E211-8AAB-78E3B510ED7 ',' Postcard '=> 4F8E216D-9C1D-A211-8DA = -78E3B508542D',) ), 'Cadrered' = & gt; array ('name' = & gt; 'Sodosource code', 'value' = & gt; tap));   

    I kept the quote around the GUID, because when I did not leave them in quotes, I got warnings of PHP syntax errors from Dreamweaver. However, when I examine one of my forms and convert a value of that text (Lefthan column) into a form where its GUID is identified, that field is still not mapping. Credit_history field mapping is fine - but this is going to an option set field, not the lookup field. I have copied the option set field mapping because it seems that it can work: it was creating an array to translate our "" which can send our form to the value that MS Dynamics is using Will recognize for the field and thus will know how to generate data.

    Do anyone have any idea why this can not work? Alternatively, is my question unclear to troubleshoot? (I know I have not given you a complete code for detail- and when we are planning to make a separate change to expand this group, and when we want to map these areas I can say, 'I am able to understand myself like you, if I can.)

    I do not know what you're doing, or how it's working, but CRM SDK In addition, lookup fields is actually type EntityReference which both GUID, and lookup unit of unit logical name as follows. So whatever your process is that translates your data, it must accept the unit logical name as well (all the lower case). Looks like campaign in your case ...

    html - Wrap text in div with ellipses (+ drop wrapping of floating div) -


    OK, my head has been beaten against the desk for awhile .. want to get it

    1) Header (NAV) should not be wrapped on one line (includes new-back, nav-title and nav-next)

    2) When you want to delete the window , And when the window does not allow the ability to display all the text, then it should be disconnected with aliases (like 'also Hut long .. ')

    Here am I:

      & lt; Div class = "nav" & gt; & Lt; Div class = "nav-back" & gt; & Lt; & Lt; / Div & gt; & Lt; Div class = "nav-title" & gt; & Lt; Div class = "nav-main-title" & gt; Want to wrap it with oval & lt; / Div & gt; & Lt; Div id = "default-page-sub-title" class = "nav-sub-title" & gt; Here's the same & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "nav-next" & gt; & Gt; & Lt; / Div & gt;   

    you '

    CSS pre> .nav .nav-main-title,. Nav .nav-sub-title {white-space: nowrap; Hidden flurry; Lesson-Overflow: Oval; Width: Heir; }

    Scheme:function assistance -


    I am quite new to the plan and, I was thinking of a number that each number was given a given list I have so far to roam in:

      (cube-it-list) (cond [(empty? Lst) empty] [and (opposition (cube-it ( First list) (cube   

    But every time I execute the program I get an error and I'm not sure why this help The best way to do this is to get better and effective way

    The function looks fine For example, this problem works:

      (define (cube- (Cube-it-list))))))) (* xxx) (define (cube-it-list)) (Cube-it-list '(1 2 3 4 5)) & gt; '(1 8 27 64 125), as a "better and effective way to do this", paste it on @SVK's answer and on the input list, to solve it The idiomatic way is the type of problem in which the input list includes the implementation of a function for each element, to create an output list with the results:  
      (map cube-this' (1 2 3 4 5)) = & gt; '(1 8 27 64 125)    

    Disable escape characters in a MySQL query -


    Is there a way to disable escape characters in a MySQL query? For example, for the following table:

      mysql> Choose * from Test1; + ------------------------ + ------- + | Name | Price | + ------------------------ + ------- + | C: \\ Media \ data \ temp \ | 1 | | C: \\ Media \ data \ temp | 2 | | / Unix / Media / Data / Temporary | 3 | | / Unix / Media / Data / Temporary / | 4 | + ------------------------ + ------- +   

    I wanted to I have a valid query:

      mysql> Select * from test1 where name = 'c: \\ media \ data \ temp \';   

    I know that instead of

      mysql> Choose * from Test1, where name = 'C: \\\\ media \\ data \ temp \\';   

    But I am using this query my_snprintf (), so instead of me

      c: \\\\\\\\ media Using \\\\ data \\\\ temp \\\\   

    ... and so on! Is there a way to disable escape characters for a single MySQL query?

    You can disable Backspace migrations by setting in SQL mode:

     < Code> - Save Mode & amp; Disable backslash SET @old_sql_mode = @@ sql_mode; SET @@ sql_mode = CONCAT_WS (',', @@ sql_mode, 'NO_BACKSLASH_ESCAPES'); - Select the query 'C: \\ Media \ data \ temp \'; - Enable Backslash SET @@ sql_mode = @ old_sql_mode;    

    php - Multiple ids with one form -


    I really do not know what I want, but I will try, I know that my code is awful and one It's a big mess, I'm really very bad / any help would be appreciated.

    I am building a shop for my game, and there is a database in which the price / type / id of pocon in Pokan Shop. Right now I'm working around it, it displays all the pokémon in the store and they all have a shopping button, but for some reason whatever you try to buy it only at the top of the list I buy only I hope I have explained that here is my code.

      if ($ _POST ['A'] == '1') {$ token = mysql_real_escape_string ($ _ POST ['token']); $ Token = bar_tag ($ token); $ Sql234 = "Select-ticket ticket"; $ Result2 = mysql_query ("select * ticket" ticket); While ($ row2 = mysql_fetch_array ($ result2)) {$ sql23 = "Select * User WHERE user name = '". $ _ Session ['username']. "')"; $ Result = mysql_query ("Choose user WHERE user name = '". $ _ Session [' username ']. "'" "); While ($ line = mysql_fetch_array ($ result)) {resonant "you have". $ Line ['ticket']. "Ticket"; Echo "& lt; p & gt; & lt; / p & gt; ; If (isset ($ _ POST ['slot1'])) {if ($ row ['ticket']> gt; = $ row2 ['price']) {resonant "you have bought" $ Row2 ['Pokemon'] ""; MySQL_query ("UPDATE user set ticket = ticket -". $ Line 2 ['value']. ​​"WHERE user name = '". $ _ Session [' username ']. "'") Or die (mysql_error ()) ; Type VALUES ('. $$ 2 [' pokemon ']'. '', '". $ _ Session [' user name] 'in Mysql_query (" user_pokemon (pokemen, related, XP, time_stamp, slot, level, type) '', '100', '', time (). '', '0', '5', ''. $ Line2 ['type']. '') ") Or die (mysql_error ()) ;} Else {echo "you can not afford". $ Line 2 ['Pokemon']. ""}}}}}}? & Gt; & lt ;? php $ result = mysql_query (select "ticket" Ticket "); while ($ line = mysql_fetch_array ($ result)) {$ sql2 =" SELECT * FROM pokemon WHERE name = '". $ Line [' pokemon ']."'; $ Result2 = mysql_query ($ sql2) Or die (mysql_error ()); $ Ba Ttle_get2 = mysql_fetch_array ($ result2); echo '' img src = "pokemon / ' $ Line ['type']. '' $ Battle_get2 ['pic']. '' Limit = 0> & Lt; / A & gt; '; $ Idd = mysql_real_escape_string ($ line2 ['id']); $ Iddd = strip_tags ($ idd); ? & Gt; & Lt; / Span & gt; & Lt; Form name = "slot 1" action = "" method = "post" & gt; & Lt; Div align = "center" & gt; & Lt; P & gt; & Lt; Period & gt; & Lt; Select name = "A" id = "" & gt; & Lt; Option value = "1" & gt; Buy & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = "hidden" name = "token" id = "token" value = "& lt ;? php echo $ iddd ;? & gt;" / & Gt; & Lt; Br / & gt; & Lt; Input type = "submit" class = "submit" value = "accept" name = "slot 1" & gt; & Lt; / Span & gt; & Lt; / P & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; Period & gt; & Lt ;? Php echo $ row ['pokemon']; ? & Gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; / P & gt; & Lt; Period & gt; & Lt ;? Php echo "Type:"; Echo ['type'] per line; ? & Gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; / P & gt; & Lt; Period & gt; & Lt ;? Php echo "value:"; Echo ['value'] per line; Echo "
    "; }? & Gt;

      Below are you doing wrong: $ sql234 = "SELECT * FROM Ticketshop "; $ Result2 = mysql_query ("select * ticket" ticket); Here you are not adding any condition to fetch a particular record, please see the improvement below: $ sql234 = "select * ticket ticket '& lt; field name & gt; & gt; ='". $ Token $ Result2 = mysql_query ($ sql234);    

    AngularJS: "Global" menu buttons for multiple views -


    I've dipped a lot (lately) in the corner, but I'm struggling with a way to design my layout

    For my site I have created a menu containing an input field and some buttons. The idea is that the input field to be mixed with both of the buttons should be facilitated by the function. So ask for visual A, the input field should function as the search bar only. If the user clicks on a button then the input field value should be used as the basis for creating a new item in the second view.

    The search function works well for A view, but I switch the buttons I doubt (or know, but do not know how to know) This is because the outlined button view (ng - view) and thus is not the controller

    I have searched for "many controllers / ideas", where there is a difference in adding suggestions to a function or creating a service. The problem is that I do not know that all Sector Good Practice what or if it is necessary for my case.

    Menu + input field is another view. It should be its own controller based on the route - $ ($ routeChangeSuccess, ...) - You can use that switch to switch between the appropriate HTML / template. If your templates are large, you can include ng-inside ng-switch directives. Otherwise, do not bother, and HTML inside each ng-switch-in-in-line

    For example how to use $ routeChangeSuccess (but not ng-switch), see

    Highcharts - Column Chart - Y Axis DateTime -


    I highlight a line chart on the hiker which displays the datetime label correctly but if it does change Type: Column labels are replaced with numbers and all columns have the same height.

    (To check the error, only the type of migration type: column on JSN)

    The reason for this is that the column has been created as value from zero and since your values ​​have been created by date.ITC, zero is January 1, 1970. Since the labels extend such a big time It's doing some weird work. Specify one minute for your yAxis and it will start from there.

      yAxis: {min: date.UTC (2013,0,1), ...},    

    ip - Django - Model Boolean Check with Python Ping -


    I have a working DSLAM management site for the current DSL connection I currently do want me to work, DSLAM IP By automatically developing the address, the DSLAM status updates itself. If a good request, he Boolean = true will return and save Boolean = false and against. So far it is not working and it is not sure where to go from here.

    models.py
      import models from import os, sys class DslamManager (models.Manager): def dslam_status (self, ip_address): If os.system ( 'ping '+ ip_address): dslam_status = Super (DslamManager, self) .Get (ip_address) dslam_status = true dslam_status.save () and: dslam_status = Super (DslamManager, self) dslam_status = false dslam_status.save () class location (models.Model ): LOCATION_NAME = models.CharField (MAX_LENGTH = 30) island_name = models.CharField (MAX_LENGTH = 30) class meta: command = ['LOCATION_NAME'] def __unicode __ (self): return self.location_name class DSLAM (models.Model) : dslam_name = models.CharField (MAX_LENGTH = 32) ip_address = models.CharField (MAX_LENGTH = 128) location = models.ForeignKey (location) Note = models.TextField (empty = S ) Dslam_status = models.BooleanField () objects = DslamManager () class meta: command = ['location', 'id'] def __unicode __ (self): return self.dslam_name    

    I've decided adding ModelAdmin. It takes a little time to refresh, but it is trying to ping the list of IP addresses.

      list_display = DSLAM_STATUS DEF ('DSLAM_STATUS',) (self, obj): if os.system ('Ping W1-n 1' + obj.ip_address): DSLAM_STATUS = Any other false : DSLAM_STATUS = true return DSLAM_STATUS DSLAM_STATUS.boolean = true DSLAM_STATUS.allow_tags = true   

    It only does some work of time, but I believe the time it starts pinging ip_address It's too early at times

    matlab - In an assignment A(I) = B, the number of elements in B and I must be the same -


    Now, I understand the problem here, what I do not understand is how should I get started ?

    For example, in my case, an array is generated at the end of each for loop in 'P', which is programmed to run 101 times, the output of P looks like this

    p =

    -0.0149 -0.0149 Now, I want to store this value in a different variable at the end of each for loop and I want to increase its index. .

    So, what should be the dimension of that variable?

    I have tried to start -> & gt; A = RAND (2,101);

    If you do not want to pre-assign the array A, then after you for the loop erasurement You can add values ​​to each A in each:

      A = []; To get the loop pa vector (every move should be 2x1) A = [AP]; End   

    or you can write directly in the loop:

      A (:, i) = p; % But your P-vector does not look like 1x2 and 2x1 if it's 2x1, then you should start one as a rand (101,2)    

    excel - sumifs using range cell - error 1004 -


    I need your help.

    If I am running this code, then there is no problem (note the sheet 1.ange ("F2: BL6991")

      column = sheet 2. range ("A1"). End (xltorite). Column 'for the MSBBbox (colonumber) J = 3 for the column for the I = 2, the ronemember sheet 2. Seals (i, j). Value = application Worksheet function. SUMIfs (Sheet 1. range ("F2: BL6991"), Sheet 1. Category ("E2: E6991"), Sheet 2.Cells (i, 1)) Next I Next   

    But when I try to change this code: (I change my code from Sheet1.Range ("F2: BL6991") for Sheet 1. Category (Cells (2, J + 3) , Cells (6991, J + 3))

      column = sheet 2. category ("A1"). End (xltorit) column 'msblogbox ( Columbar) for Jammu = 3 for the column I = 2 to the daily sheet 2. Seals (i, J) Value = Application Worksheet Function SMIFs (Sheet 1. Range (Cells (2, J + 3), Cells (6991, J + 3), Sheet 1. Range ("E2: E9 9 1 "), Sheet 2. Seals (I, 1)) Next Me next which   

    I got 1004 error.

    Even when I < Code> << Pre> sheet 1.ange (cells (2,6), cells (6991, 6))

    or error using this code Also found:

      sheet 2.kel (i, j) value = varResult varResult = Application.WorksheetFunction.SUMIfs (_ Arg1: = Sheet1.Range (cell (2, 6), to Learn (691, 6)), _ Arg2: = Sheet1.Range ("E2: E6991"), _ Arg3: = Sheet2.Cells (i, 1))   

    Can you guide me where I do wrong and how to fix it?

    TIA

    Your main problem is that SUMIF

      SUMIF (category, criteria, [sum_range])   

    This will work:

      range range as 1 range set range 1 Set range 1 = worksheet ("sheet 1"). Range ("F2: BL6991") Colnumber = Sheet2.Range ("A1"). End (xltorite). I = 2 to 10 set for the column column for J = 3 = worksheet ("Sheet2"). Cell (i, 1) sheet 2.class (i, j). Value = App Worksheet Function. SumIf (Category 1, Bet) Next I Next j    

    uicollectionview - Giving an absolute position to a UICollectionViewCell -


    what UICollectionViewCell is possible to control the layout because it is a full X or Y gives status ?

    I want to use the UICollectionView in each row of a table to make a simple 5 day calendar now I made a set of ideas with absolute x values ​​in cell

    Yes, but you will need the UIcollectionViewLayout sub-class.

    Help remove things with my help.

    ios - giving a number for each cell in UITableView -


    I wrote a code that gives each cell a number starting from 8 in my table, this app is in hours

      - (UITableViewCell *) TableView: (UITableView *) Table View CellForouaitindPath: (NSIndexPath *) indexPath {static NSString * CellIdentifier = @ "cell"; UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: For CellEdentifierIndexPath: indexPath]; While (hour and lieutenant; 15) {if (hour == 12) {hour = 1; } And {NSString * str = [NSString stringWithFormat: @ "% d", hour]; Cell.textLabel.text = [Course objectAtIndex: indexPath.row]; Cell.detailTextLabel.text = str; NSLog (@ "% @", str); Hours ++; Return cell; }} Return cell;}   

    When I run the app with the simulator, but when I scroll, the number changes in the first and second cells and I want to add numbers Do not change even if I scroll to the table.

    How can I do this? thank you in advanced.

    It seems that the hour is defined outside the method and < Code> indexPath . If you want to make sure that the displayed string remains constant for one cell, then you should definitely be able to calculate it from indexPath , thus far If the table exits cells out of order, they should keep their correct text.

    Exceptions in my code - Java -


    I am new to Java programming I am preparing an assignment and I need some help with my code, say instructions I need to manage exceptions in my numberOfRows () and convertFileArray () methods. This exercise requires reading from a CSV file, in a multidimensional array of files Converts, prints the array on the screen. My program works fine, the only issue I have is that I did not know which exceptions I can handle in those 2 ways.

    I wrote the general exception because I do not know what to do. Any suggestion will really be helpful. Also, I am posting only to the class where I have to keep blocks blocking my efforts. thank you in advanced.

    Here's my code:

      import java.io. *; Import java.nio.file. *; Import java.util.StringTokenizer; Public Class ReadFiles {int rows = 0; Int column = 0; String s = null; Private string [] [] arrayValues; Path file path; Public Readfile (string name) {filePath = Paths.get ("C: \\ stock \\" + name); //newMSFT.csv System.out.println ("path to enter file" + filePath.toString ()); } Public Boolean file attributes () {if (Files.exists (filePath)) returns true; Second false return; } Public integer numberoffro (try {InputStream data = new BufferedInputStream (Files.newInputStream (filePath)); BufferedReader Reader = new BufferedReader (new InputStreamReader (data)); S = reader.readLine (); While (s! = Null) {Rows ++; S = reader.readLine ();}} Grip (Exception E) {System.out.println ("Message:" + E);} Return Rows;} Public Zero ConvertFileFile () {{ Try InputStream Data = New BufferedInputStream (Files.newInputStream (filePath)); BufferedReader Reader = New BufferedReader (New InputStreamReader (Data)); S = reader.readLine (); StringTokenZZ = New Str (Int x = 0; x and lt; rows; x ++) {z} for the string (rows); [string] [rows] [column]; for the string [z];); ArrayValues ​​= new string [rows] [column]; = New StringTokenizer (S, ","); // When there are still more tokens, keep it in the array: int y = 0; while (z.hasMoreTokens ()) {array value [x] [y] = z .nextToken (); y ++;} S = reader.readLine ();} System.out.println ("An array was created and" + rows + "rows and" + column + "columns.); } Hold (exception e) {System.out.println ("Message:" + E); E.printStackTrace (); }} Public Zero printRay () {data from the system.out.println ("array is;;;);) (for int one = 0; one & lt; rows; a ++) {string output = zero; (Int b = 0; b & lt; column; b ++) {System.out.print (arrayValues ​​[a] [b] + "");} System.out.println ();}} Public string [] [] getArrayValues ​​() {return arrays;}}    

    Your method throws IOException . Try try {s = reader.readLine ();} hold (IOException e) {e.printStackTrace ();}

    and throws the following exceptions:

    • Invalid unauthorized Exception - If an invalid combination of options is specified
    • Unsupported operation exception - If an unsupported option is specified
    • IOException - If there is an I / O error
    • SecurityException - In the case of default provider, and a security manager has been installed, check the read read method in the file Is invited to check.

      So its up-to-date and what exceptions you want to handle

    java - array out of bounds adding a byte array to another -


    Working on a bit of crypto and the limit ran out of an array outside the exception, I searched it on paper several times and Everyone seems right to me so I can not really determine the origin of the error, if anyone will help that would be horrible!

      static byte [] encrypt (byte [pt] pytes, javax.crypto.SecretKey key, byte [] IV) {byte [CT]; Byte [pt]; Byte [ptBlock, ctBlock; Int bytes; // The number of bytes in the last block is left / / it comes in the game / Swap and accessories / extra bytes with the last 2 blocks, in case the last block of plain text is not whole bytes = ptBytes. Length% 16; // pad the plain text array to the appropriate length pt = Arrays.copyOf (ptBytes, (ptBytes.length) / 16) + 1) * 16); Println (Arrays.toString (PT)); // ctBlock = one block of cipher text ctBlock = new byte [16]; // CT to padded PT CT = new byte length [pt.length]; // Encryption / I am for the current block of plain / cipher text, we are on (int i = 1; i & lt; = ((ptbytes.length) / 16) +1; i ++) (I == 1) Make the first segment of {// ptBlock} the whole plain text ptBlock = Arrays.copyOfRange (pt, 0, (i * 16)); // I = 1 after XOR obtains a new plain text With IV (int j = 0; j   

    It says that the error is on this line

      ct [k] = ctBlock [k-16];   

    Which does not make much sense, the array is CT length 48, and CTBLL is lane 16 and in case of this error where this error is in the loop, i would be 2 or 3 That's why I'm adding 16 byte array of any size to the other third part. Array whistle or third third and as I said I discovered it on paper and it seemed to be legally inactive!

    Thanks in advance!

    Consider the case when i = 3 .

     for  (int k = (i-1) * 16; k & lt; (i * 16) -1, k ++) {whistle} = ctblock [k - 16]; }   

    here -

    • Kashmir begins with 32
    • the status goes to 32 < 47
    • The array index for ctBlock gets 32 - 16 = 16, and balm! The array index is not bound!

      Quick correction -

       for  (int k = (i - 1) * 16; k    

    excel - Runtime error 1004 on autofilling data -


    Text after "div class =" itemprop = "text">

    My code is considered to be formatting the formula in my "IF" 2 = J2 and so on in column "L" , But the runtime error is facing 1004.

    I want the macro to complete the entire column until the column in the column hits the last line.

    code:

      sub siteaccess () in as dim mySheet worksheet, myOtherSheet worksheet, Mybook workbook set mybook = Excel.ActiveWorkbook set mySheet = myBook.Sheets ( "SiteAccessReports") set myOtherSheet = myBook.Sheets (Long as FF dim as "Sheet1") FF = myOtherSheet.Range ( "L 2: L". & amp; myOtherSheet.Cells (myOtherSheet.Rows.Count , "L") and (xlUp) .Row with Sheet ("Sheet1") .Range ("L2 .ount") .formula = "= IF (RC [-2] = RC [-1] , "" "", "" Yes "") "Selection.AutoFill Destination: = Range (" L2: L "& FF), Type: = Interval sub    

    me Sure that there is a better answer to end the error line with end = xlFillDefault but for any other yet:

      sub siteaccess () dim mybook workbook dim myOtherSheet Worksheet FF Long set in as dim mybook = Excel.ActiveWorkbook set as myOtherSheet = myBook.Sheets ( "Sheet1") FF = myOtherSheet.Range ( "the 1:" & Amp; MyOtherSheet.Cells (myOtherSheet.Rows.Count, "K") _ .End (xlUp) .row Sheet ("Sheet1") .Range ("L2"). Select .CountRange ("L2"). Formula = "= IF (RC [-2] = RC [-1]," "No" "," "Yes" ")" Selection AutoFill Destination: = Category ("L2: L" and FF), Type: = End with XlFillDefault End End    

    C# code to fill color in a table cell in a word document -


    I have created a word document in which C # is used, I now have a cell in this table with red I want to fill. While searching on the net, I came to know that I can use the shading object to do this. But I could not find any information about how I can use it.

    I tried to do something like this:

      doc.Tables [thatTable] .ell (1,4) range. Background Pattern Color   

    But how can I set a color using this ???

    If you look into this, you will see the dublodollar constant; There is an enumeration list to see more information about.

    In order to select the table cell, your code looks correct, so you only have one background color for WdColors.

    java - Coloring area under the curve in achartengine in android -


    How to paint the area under the curve in the worm chart line for Android. Enter image details here

    It should be as simple as:

      FillOutsideLine fill = new FillOutsideLine (FillOutsideLine.Type.BOUNDS_ALL); Fill.setcolor (Color.GREEN); SeriesRenderer.addFillOutsideLine (filling);    

    Android reading html file from external storage -


    I'm trying to show html files in / storage / sdcard0 / ...

      Webview Engine = (Webview) (SearchWebID (R.D. WebViv 1)); Engine.setWebViewClient (new WebViewClient ()); Engine.loadUrl (Environmental.getExternalStorageDirectory (). GetPath () + "testing.html");   

    But failed to display webpage ... Can anyone help? Thanks!

    resolved !!! "File: ///" front =] =]

      engine.load URL ("File: ///" + Environment GateInstance Store Directory (.) GetPath () + "Test .html");    

    jquery - how to open multiple lightbox -


    I have a gallery on one page when you click on one of the thumbnails, the gallery is shown for this album Will give. Inside the album, when you click on the image, a large and clear version clicked on the image will appear in a lightbox. I'm just wondering how can I open two lightbox instead of one, it may be a stack on top of the other or bottom. I need to open two, there is a code below which I am using, If you click on it, just open a lightbox.

      & lt; A href = "images / headboards / lhb1.jpg" class = "triggerlightbox" & gt; ; & Lt; Img src = "pictures / headboards / hb1.jpg" alt = "headboard" width = "620" height = "350" /> gt; & Lt; / A & gt;    

    Create two or more link images with the same value of the attribute rel < / Code> like this:

      & lt; A rel = "group" href = "picture / headboards / lhb1.jpg" class = "triggerlight box" & gt; & Lt; Img src = "picture / headboards / hb1.jpg" alt = "headboard" width = "620" height = "350" /> gt; & Lt; / A & gt; & Lt; A rel = "group" href = "images / headboards / lhb2.jpg" class = "triggerLightbox" & gt; & Lt; IMG src = "picture / headboards / hb2.jpg" alt = "headboard" width = "620" height = "350" /> & Lt; / A & gt;   

    Good luck!

    How to find files with specific case-insensitive extension names in Python -


    इस सवाल का पहले से ही एक उत्तर है: < / P>

    • 4 जवाब

      glob.glob () केस-संवेदी है।
      क्या पायथन में विशेष केस-असंवेदनशील एक्सटेंशन नामों के साथ फाइल ढूंढने का कोई आसान तरीका है।

      मॉड्यूल ग्लोब मॉड्यूल से पैटर्न मिलान पर और अधिक नियंत्रण प्रदान करता है:

        & gt; & gt; & gt; आयात ओएस & gt; & gt; & gt; Fnmatch आयात फ़िल्टर से & gt; & gt; & gt; फ़िल्टर (os.listdir ('।'), '*। [पीपी] [याय]')   

      आप नियमित अभिव्यक्ति मैच के बाद भी इसका उपयोग कर सकते हैं:

       <कोड> & gt; & gt; & gt; आयात ओएस, पुनः & gt; & gt; & gt; [Re.search (r '\। Py $', filename, re.IGNORECASE)]     में os.listdir ('।' में फ़ाइल नाम के लिए फ़ाइलनाम)

    ios - Is there any Apple api like google Place Search API -


    In my iPhone app I am using the MKMap Kit, currently I am a Google Play API, but according to Google's doctor , I should use my values ​​only in Google Maps but unfortunately, with iOS 6, Mkamakit will go to Apple.

    Is there any Apple API like Google Place Search API -

    I am using it now - "My API Key"

    < Div class = "post-text" itemprop = "text">

    I believe you want this?

    php - Combining AND/OR eloquent query in Laravel -


    How can I write the following or similar types of queries using Supernatural?

    SELECT * FROM A_table WHERE (keyword% like one% or% like keyword%) and C = 1 and D = 5

    I And where / & amp;

      Ideal:   

    Where you can nest:

      Model: where (function ($ query) {$ query-> where ('a', 'like', 'keyword'); $ query- & gt; or_ where (' B ',' likes', 'keyword');}) - & gt; Where ('c', '=', '1');   

    It should be created from: SELECT * model from where (one% keyword% or% keyword%) and C = 1 < / Div>

    c++11 - Unhandled exception Error in C++ Recursion -


    I have this function which uses recursion to find the longest sequence of numbers. But every time I run it, I get this error message:

    0x002871D9 increasing SEC In XE: 0xC0000005: Write access violation location 0x01060EC0.

      int seqeter (int grid, int startPos, int seq) {sequence maxseq; Maxseq.size = 0; (For grid [startPos.y] & lt; grid [startPos.x + rows] (integer rows = 0; rows & lt; MAXROWS; rows ++) {for (integer cols = 0; Columns    

    You are not moving beyond your startPos - Repeat never stops and you crash the stack immediately.

    extjs4 - Set combobox value after loading json store -


    I have a COMBOBOX which I'm loading with this controller (code snippet below)

     < Code> Ext.getCmp ("combovalue2") getStore () loadRawData (value 2) ..   

    value2 is the object being derived from the object and it works successfully (I verify this onclick of kickboxes). Below is a code snippet of code box in my form panel

      {xtype: 'combo', id: "combovalue2", name: 'cpa', cls: 'extracombobox', force selection: is correct Query Module: 'Local', Field Label: 'Alliance', Displayfield: 'Label', Wellfield: 'numAe', Empty Text: 'Select Alliance', Store: New Ext.data.JsonStore ({fields: ["numAe   

    This looks like my Jason

      "cpaList": [{"label": "a communication", "id" " "", "Numerator", "numf": 999, "numAe": 483, "pctFeeCalc": 0, "pctFeeBasisPoint": {}, "label": "AC Nielsen, Inc.", "ID": "MMV" , "Number": 999, "numAe": 876, "pctFeeCalc": 20, "pctFeeBasisPoint": {}, "label": "Acer Worldwide Inc.", "id": "CAA", "numoff": 999, "numAe": 619, "pctFeeCalc": 0, "pctFeeBasisPoint": {}, "label": "Advantech, Inc.", "id": "SLE", "numoff": 999, "numee" : 592, "pctFeeCalc": 0, "pctFeeBasisPoint": 0}, {"label": "epho limited", "id": "nan", "numoff": 999, "numAe": 95 9, "pctFeeCalc "," PctFeeBasisPoint ": 0}, {" L "ABL": "All System Go", "ID": "BCS", "Mailoff": 999, "NMAE": 944, "PTTeconomic": 25 , "Ptfefilesepoint": {}, {"label": "Elisa Annie Lock", "ID": "GRE", "Mailoff": 999, "NewEe": 36 9, "PTTeconomic  

    Mapping: 'cpaList'}

    But I have a hard time displaying the value that should be displayed when theombbox is provided. I want to set the value of the Combo box coming from JSSN (This means that the value is an array of 2 objects and the one I want to set is the string) and also I display the array of data in the combobox which I am loadRawData (value2) .

    You should not have RawData to load, because of the appearance of your code, your store Must have changed or you have to use a portion of your JSON data.

    Your root is 'cpaList' Shop does not know what to do with it If you want to keep your code in the way, do the following:

      Ext.getCmp ("Combustible 2"). GetStore () LoadData (value2.cpaList);   

    Otherwise you will have to change your store to match your data. If you actually define this store instead and set your combo store in the defined store, instead of loading it automatically on the render, then you do not need to request a separate AJAX request and your The code now belongs to your store.

      var store = Ext.create ('Ext.data.Store', {autoLoad: true, proxy: {type: 'ajax', url: '/ varvarurlis', reader: {type : 'Jason', root: 'CPIST' // The root of your data that has an array of fields for store}}, field: ["numAe", "label"]});    

    postgresql - configuring heroku database connection in padrino - DATABASE_URL fails -


    There was a problem getting the pedometer (0.11.2) application for me to run nowadays, the errors I'm taking back It was suggested that the connection URL was not working, e.g.

      2013-06-20T12: 55: 59.040527 + 00: 00app [Web 1]: / app / seller / bundle / ruby ​​/ 1.9.1 / gemstone / DM-core-1.2. 1 / Leash / DM-Core / Adapter RB: 12: In 'new': + option + must have or know the address: URI or string, but but I was able to see my mind worsened and I was unable to see that until I read this article, the problem Been and checked my environment variable, i.e. in the console:      & gt; Heroku config === myapp Config Vars HEROKU_POSTGRESQL_COBALT_URL: postgres: // blah blah blah ...   

    Looking at it I DATABASE_URL continuous database. Turned HEROKU_POSTGRESQL_COBALT_URL in db and is everything worked Is the docs old? Eg:

    iphone - Printing a PDF with UIPrintInteractionController ios 5 works but in ios 6 doesnt work and crash my app -


    I print a problem with UIPrintInteractionController to a device with iOS 5 I send a PDF when I press is sending the print button file printer and work, but when I iOS would test a device with 6 I> p app does not work and crash

      Save \ 032in \ 032folder \ 032Aptana \ 032Rubles._ipp._tcp.local. Go: -Printer-Properties Failed: Undefined Error: 0 No document-format-supported attribute was found or no supported format was found. No media-call-database was found in response to the printer. Deciding the values ​​of the generic media size did not get any print-quality-supported feature, no outstanding-supported attributes were found for general quality. Set single-sided   

    Here is my code: (self.myPDF a NMutableSData type)

      UIPrintInteractionController * controller = [UIPrintInteractionController sharedPrintController]; If (controller & amp; & amp; [UIPrintInteractionController canPrintData: self.myPDF]) {UIPrintInfo * printInfo = [UIPrintInfo printInfo]; PrintInfo.outputType = UIPrintInfoOutputGeneral; PrintInfo.jobName = [NSString stringWithFormat: @ "coupon"]; PrintInfo.orientation = UIPrintInfoOrientationPortrait; PrintInfo.duplex = UIPrintInfoDuplexLongEdge; Controller.printinfo = printinfo; Controller Showzarenz = No; Controller Printing ITAM = Self MIPDF; Zero (^ completionHandler) (UIPrintInteractionController *, bool, NSError *) = ^ (UIPrintInteractionController * printController, BOOL complete, NSError * error) {if (Full & amp ;! & amp; error) {UIAlertView * av = [[UIAlertView alloc ] InitWithTitle: @ "Error." Message: [NSString stringWithFormat: NSLocalizedString (@ "An error occurred while printing:% @", @ "typographical error"), error] representatives: cancelButtonTitle zero: @ "OK" OtherButtonTitles: zero, zero]; [Avi show]; [Avi release]; }}; [Controller present permission: Yes complete handler: complete handler]; }   

    I do not have an airprint-supported printer, but I have used this easy print. Note: Printing works with Safari using the elephant print on iOS 6.

    Does anyone know what is wrong? = (

    Test it with an airprint printer simulator that comes with XPPix. May be easy print does not support new features in AirPrint.

    java - Sometimes it shows components of panel, sometimes it doesnt even show panel in frame -


    I'm making a very basic application here, I've coded many times more complex applications but for some reason I am getting an error with the panel which sometimes shows its components and sometimes it is not even shown in the panel frame

    The panel is composed of two basic components: 1 button and 1 Gtex field Buttons are shown sometimes, does not the Jetx field show up?

    I am using a grid background layout. The following is very simple code:

      Start the public class Start JFrame ActionListener {Public Stable HomeList home; Public stable string user = "default"; Public GridBagConstraints c = New GridBagConstraints (); Public start () {super ("title"); This.pack (); This.setSize (800, 500); // w h. This.setBackground (Color.DARK_GRAY); This.setLocationRelativeTo (zero); This.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); This.setResizable (wrong); This.setVisible (true); Zipel panel = new zpn (); Pane.setLayout (New GridBagLayout ()); Pane.setPreferredSize (new dimension (300, 100)); Pane.setBackground (Color.BLUE); This.getContentPane () Add (panel, BorderLayout.CENTER); Jebton Button = New Pocket ("Enter"); Button.setActionCommand ("Login to"); Button.addActionListener (this); C.gridx = 0; C. Grady = 0; Pane.add (button, c); JTextField text = new JTextField (20); Text.setVisible (true); C.gridx = 1; C. Grady = 0; Pane.add (text, c); } Public static zero main (string [] args) {new start (); } @ Override Public Zero Action Perfid (ActionAvent AE) {If ("Login". Ammons Ignore Sees (AE.Attection Commands)) {this.dispose (); Home = new homelist (user); The problem is that you  setVisible (true)    / Code> Before adding components of jframe   

    perl populating arrays with filenames from user defined directory? -


    I'm trying to populate two arrays with file names from a user-defined directory I'm still working Yes, if the file is in the same directory where I am running the program. The final goal of this code is to convert a file from one format to another using the script, and export a new defined file to the user-defined directory.

      # export directory to my $ export_dir = $ argv [0] "\\". Print "export directory: \" $ export_dir \ "\ n \ n" if DEBUG; # Get the current working directory my $ cwd_dir = getcwd; # Change the slash with slash for Windows compatibility $ cwd_dir = ~ s / \ // \\ / g; Print "current work directory: \" $ cwd_dir \ "\ n \ n" if DEBUG; # Get a list of zip files in the directory my @zip_files = glob "* .zip";   

    This code works when the zip file is in the current working directory. How can I work it where the zip file is in a user-defined directory? (In this case, a subfolder, but where the user defines the export directory).

    Just enter the name of the directory in a previous glob device:

      My @zip_files = glob "$ export_dir \\ * .zip";   

    Ideally, you should use the file :: device CPAN module to create file paths in OS-independent mode, link-coding < Code> "\\" for Windows and "/" for UNIX.

    php - json_decode returns JSON_ERROR_SYNTAX but online formatter says the JSON is OK -


    I have a very strange problem.

    I have a JSON webservice.

    When I check it with this website

    Everything is fine.

    But when I load my code with this code:

      $ data = file_get_contents ('http: //www.mywebservice'); If (! $ Data below) {$ obj = json_decode ($ data); Switch (json_last_error ()) {case JSON_ERROR_NONE: echo '- JSON_ERROR_NONE'; break; Case JSON_ERROR_DEPTH: Echo '- JSON_ERROR_DEPTH'; break; Case JSON_ERROR_STATE_MISMATCH: Echo '- JSON_ERROR_STATE_MISMATCH'; break; Case JSON_ERROR_CTRL_CHAR: Resonant '- JSON_ERROR_CTRL_CHAR'; break; Case JSON_ERROR_SYNTAX: Echo "\ r \ n \ r \ n - SYNTAX error \ r \ n \ r \ n"; break; Case JSON_ERROR_UTF8: Resonance '- JSON_ERROR_UTF8'; break; Default: Echo '- Unknown Arrow'; break; }   

    I got the error: SYNTAX error

    which could not help at all.

    This is a nightmare

    I think that with PHP 5.5 I can use this function:

    (But I have yet to run PHP 5.5 , And I'm not sure this function will give me more details)

    I had to face the same problem, in fact some hidden letters have been ignored and you need to remove it. Here's a global code that works in many cases:

      & lt ;? Php $ checkLogin = file_get_contents ("http://yourwebsite.com/JsonData"); // This will remove the unwanted characters I // Check for details for http://www.php.net/chr ($ i = 0; $ i & lt; = 31; ++ $ i) {$ checkLogin = Str_replace (chr ($ i), "", $ checkLogin); } $ CheckLogin = str_replace (chr (127), "", $ checklogin); // This is the most common part // Some files start with 'FBBBF', so that the start of the file can be marked. (Binary level) // Here we find out and we remove it, basically it is the first 3 letter if (0 === strings (bin2hex ($ checklogin, 'efbbbf')) {$ checkLogin = substr ($ Checklogin, 3); } $ CheckLogin = json_decode ($ check log); Print_r ($ checkLogin); ? & Gt;    

    c# - Button Click Event fired after Response.Redirect -


    In the click event, I have one in the database, and one of the Response.Redirect records Preview.

    The strange issue is that if I click on the button 3 times, then I will get 3 new records in the database. That's strange, because response. Redirect is executed after the first entry.

    NB:

    • The button is completing the postback because I have to upload the file to the server

    • I have a response with a false-true option. Tried to redirex

    • I tried server.Transfer

      Here is my code:

        Secure void B_Save_Click (Object Sender, EventAgages e) {Insert_Account (); Response.Redirect ("index.aspx"); }   

      This button has been clicked fast and insert slower Basically, you are submitting several requests before you have a chance to come back in redirection.

      The simple solution is to block the button on the client side using Javascript. You can show some sort of processing notification, it is usually seen with submitting a shopping cart and choice.

    c++ - C++11 std::shared_ptr from std::cout -


    मुझे std :: cout में एक std :: shared_ptr & lt ; Std :: ostream & gt;

    चूंकि यह स्पष्ट रूप से नहीं किया जाना चाहिए:

      std :: shared_ptr & lt; std :: ostream & gt; p_cout (& amp; std :: अदालत);   

    और यह संभव नहीं है क्योंकि यह std :: ostream की प्रतिलिपि बनाना संभव नहीं है:

      std :: shared_ptr & lt; std :: ostream & gt; P_cout = std :: make_shared & lt; std :: ostream & gt; (std :: cout);   

    क्या कोई कानूनी कार्यवाही जानता है?

    आवश्यकता क्या है अजीब है, लेकिन आप निश्चित रूप से std :: ostream में एक shared_ptr में एक संकेतक को स्टोर कर सकते हैं, आप एक उचित डिस्पोजेसर क्रिया का ध्यान रख सकते हैं :, जैसे: std :: shared_ptr & lt; std :: ostream & gt; (& amp; std :: cout, [] (शून्य *) {});

    Oracle SQL Query to get missing date from two joined tables -


    I'm trying to write Oracle SQL query and I'm unable to get the right result.

    For the tables below, I would first like to get all the records from DEVICE where DEVICE.MODEL = 'UNITA' and for those results, give me a DEVICE. CUSTOMER_ID has no record where PROFILE is located. TYPE = 'TEST' CUSTOMER_ID is joining both tables Any ideas about preparing this query?

      table device: id - sequence primary key (NUMBER (10)) generated DEVICE_NUMBER - unique (varchar) CUSTOMER_ID (varchar) model (varchar) table profile: ID - Order generated primary key (NUMBER (10)) CUSTOMER_ID (varchar) TYPE (varchar)    

    if i need , Then this should do the trick:

      SELECT d.ID, d.evice_number, d.Customer_ID, d.model, device DE LEFT JOIN profile p current D.Customer_ID = p. Customer_ID WHERE d.Model = 'UNITA' and (PIID is zero or P. type = 'tes   

    This works because of the left left , which will give the profile.id if a match profile < / Code> line customer_id . If there is a matching line, then the test for Profile.Type = 'TEST' will determine what is included.

    In a SQL Belal field, enter profile.id and profiles. Type results in values ​​because I think they explain things more clearly.


    Appendix : Some confusion over my share of needs; This query may be close to what it needs:

      SELECT d.ID, d.Device_Number, d.Customer_ID, d.Model, p.id AS PID, p. D.Customer_ID = p.Customer_ID and p.Type = Profile PD on 'Exam' Model = 'unitata' and piid is null    

    Adding PHP code to Drupal Page for adding Javascript -


    I am trying to open a link in a popup on some drop pages without javascript address bar and so on. I have learned that you can not just embed JS in the "Full HTML" view. (Commented on script tags with HTML tags) I used the API function using the PHP function drupal_add_js (), but with the HTML code the php code is commented with comment. I.e

      & lt ;? Php $ myscript = 'function open window () {var browser = navigator.appName; If (Browser == A Microsoft Internet Explorer ????) {window.opener = self; } Window.open ("/ page / terms-use", "null", "width = 900, height = 750, toolbar = no, scrollbars = no, location = no, resizable = yes"); Window.moveTo (0,0); Window.resizeTo (screen.width, screen.height-100); Self.close (); } '; Drupal_add_js ($ myscript, 'inline'); // If $ myscript points to a theme .js file then change 'theme' to the other ultimate? & Gt;   

    When pages are viewed, it appears in the browser as follows:

        

    I used to use the PHP filter module to give the page creator user to use PGP, but still the same happens. Is it because of a rich text editor? But why is it also in PHP code mode?

    This is usually controlled by a custom module or theme function. But assuming that your code should work, being placed in the field on the node. This issue is likely to be a text format setting. Assuming that Drupal 7, you can go to / admin / config / content / formats. I think you are using PHP format. So you want to inspect the settings for this format and make sure PHP filter is enabled.

    c++ - casting using reinterpret_cast causes: OverflowError: signed integer is less than minimum -


    im casting

      char * कुछ = reinterpret_cast & lt; char * & gt; (& amp; GPBuffer );   

    और वापस की तुलना में:

      चार temp1 [400]; स्ट्रिंग बफर = रीइन्टरिप_कास्ट & lt; स्ट्रिंग & amp; & gt; (temp1);   

    मुझे पता है कि यह चारों को स्ट्रिंग करने के लिए बेवकूफ लग रहा है परन्तु यह वही है जो मुझे चाहिए और यह काम करता है!

    लेकिन अगर मैं "कुछ" आंतरिक क्यू) एक अलग धागा के लिए, और मैं वापस डालने की कोशिश, मुझे प्राप्त होता है:

    0x00000000009bb2dd in std :: basic_string, std :: allocator & gt; :: operator = (यह = 0x48410790, __str = ट्रैसबैक (सबसे हाल ही में कॉल अंतिम): फ़ाइल "/usr/share/gdb/python/libstdcxx/v6/printers.py", पंक्ति 469, to_string रिटर्न में self.val ['_ M_dataplus'] ['_ M_p']। स्ट्रिंग (एन्कोडिंग, लम्बाई = लेन) ओवरफ्लो त्रुटि: कम से कम हस्ताक्षरित पूर्णांक) /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++ पर /4.1.2/bits/basic_string.h:486

    कोई भी इस त्रुटि से परिचित है?

    आप एक सादे वर्ण सरणी लेते हैं, उसे स्ट्रिंग में डालते हैं, और बस यह काम करने की अपेक्षा करते हैं? आप सोचते हैं कि आप बहादुर हैं।

    फिर भी, जो त्रुटि आपको मिल रही है वह डीबगर की पायथन स्क्रिप्ट से आता है जो एक पठनीय रूप में std :: string को प्रिंट करने की कोशिश करता है। चूंकि आपके पास कुछ भी है, लेकिन एक मान्य std :: स्ट्रिंग है, कुछ स्क्रिप्ट में जांच की जाती है और त्रुटि को फेंकता है यह एक सामान्य C ++ त्रुटि नहीं है।

    what does "::" (double colon) operator mean in "Chunk::new" in Java? -


    I'm getting through a biscuit process, and inside the entry it says

      # # Java Runtime Environment has received a serious error: # # java.lang.OutOfMemoryError: 1035152 bytes for request :: New. Swap out of place? # # Internal Error (Allocation cpp: 215), pid = 2060, tid = 3980 # Error: Chunk :: New # # JRE Version: 6.0_21-B 0 # Java VM: Java Hotspot (TM) Server VM (17.0- B17 Mixed Mode Windows-x86) # If you want to submit a bug report, please see: # http://java.sun.com/webapps/bugreport/crash.jsp #   

    My question is not particularly about out-of-memory error, but how to interpret chuck :: new phrase

    I think apparently double call Not an operator in Java, but I do not know what it is. Will there be anything in my situation?

    That means there is nothing in Java before version 8 (see).

    What you are looking for refers to the C ++ code. The first word is the name of the class, the second method is the name :: is also called itself.

    The error you are receiving is of the CV + code itself.