Friday, 15 August 2014

c# - Calling multiple methods asynchronously -


Is there any way to call many methods at the same time? I have a Winform app that loads an unreliable amount of data on loading:

  Private Zero Form 1_load (Object Sender, EventEurge E) {LoadValues1 (); LoadValues2 (); LoadValues3 (); LoadValues4 (); LoadValues5 (); LoadValues6 (); LoadValues7 (); LoadValues8 (); }   

These methods have been retrieved and DevExpress LookUpEdits (similar to Windows Dropdownlists) have been populated, so they all look like this:

  DBContext dbContext = new DBContext); ObservableCollection & LT; String & gt; Values1 = New Observational Collection & lt; String & gt; (I.Value1 i.Value1 for i.Value1! = Null & amp; i.Value1.Length & gt; order in dbContext.Items (from i). Undoubtedly ()); Lookup vouchers 1 Properties Datasource = Dismissed year; DevExpress.XtraEditors.Controls.LookUpColumnInfoCollectioncolInfo = Lookup Value1 Properties Column; ColInfo.Clear (); ColInfo.Add (New DevExpress.XtraEditors.Controls.LookUpColumnInfo ("Columns")); ColInfo [0]. Caption = "value1";   

And some of these methods take some time to complete, yet none of them depend on each other, so I thought I could do them at the same time :

  Tasks. Factor Start (-) => load value 1 ()); Work.factor STARTNU (() => LOAD VALUE 2 ()); e.t.c.   

But when the second work is going on, I keep getting an error, and saying that no control can be made from a separate thread that was created on it.

As you have stated, you need to make sure that When accessing UI elements, you need to make sure that you do it on proper reading. It is so easy to use the Task Parallelism library:

  Private Task Scheduler m_TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext ();   

Once you have a task scheduler, you can schedule your tasks to run on the UI thread like this:

  Task. Factor Start New (() = & gt; {Load Values ​​1 ();}, Cancellation Token One, Functioning Option .nm, M_ Task Scheduler);   

Here's the warning that running all your works on the UI thread can still lock things up to you. I recommend that you create a set of categories or collections of certain types , In which you can populate relevant information and once all the data is for you to call another method on the UI thread, which adds your control to the data or whatever specific actions you need Are necessary.

.net - SQL Sever Java Compatible GUID / UUID (Big Endian UniqueIdentifier) -


I am trying to convert a 128 bit binary to a unique identifier in SQL that is similar to Net and Java is. / P>

I know that Java uses big endians, so I want to make that base.

I can get a gap in the right nant, but in reality I am struggling with it in SQL Server.

Java:

  byte [] bytesformase = "google.com" .getBytes ("UTF-8"); MessageDigest MD = MessageDigest.getInstance ("MD5"); Byte [] md5 = md.digest (bytesfomes); Bytebuffer BB = Bitebuffer. Wet (MD5); Longbuffer ig = BB Longbuffer (); Come back to the new UUID (ig.get (0), ig.get (1));   

1d5920f4-b44b-27a8-02bd-77c4f0536f5a returns

. Net

  System.Security.Cryptography.MD5 c = System.Security.Cryptography.MD5.Create (); Byte [] B = C. Compute hash (encoding.utf.getbites ("google.com")); Int z = System.Net.IPAddress.HostToNetworkOrder (BitConverter.ToInt32 (B, 0)); Less y = System.Net.IPAddress.HostToNetworkOrder (Bitcoin.ToInt16 (B, 4)); Small x = System.Net.IPAddress.HostToNetworkOrder (Bitcutone to.Int16 (b, 6)); Guid G = New Guid (z, y, x, b.Skip (8) .oir ()); Greetings;   

1d5920f4-b44b-27a8-02bd-77c4f0536f5a returns

sql

  DECLARE @s VARCHAR (MAX) = 'google COM '-' goolge.com 'DECLARE @ MD5 Binari (16) = Hashbites (' MD5 ', @s) DECLARE @ one binary (4) = convert (binary (4), reverse (convert (binary (4) , LEFT (@ MD5, 4)) DECLARE @ B Binari (2) = Convert (Binari (2), Reverse (Convert (Binari (2), Wright (@ MD5, 12)) DECLARE @ C Binary ( 2) = Convert (Binari (2), Reverse (converter (Binari (2), Wright (@ MD5, 10)) DECLARE @ D Binari (8) = Convert (Binari (8), Wright (@ MD5, 8)) convert Vert (UNIQUEIDENTIFIER, @ A + B + @ C + @ D)   

Returns D86B5A7F-7A25-4895-A6D0-63BA3A706627

I can do all three To create the same value, we convert to an int64, but the GUID is bothering me.

If you correct the spelling of google in your SQL instance (this is goolge in your post), you get the correct result.

Cannot fix the select/delete function. PHP/MySQL/JavaScript -


I have the following script for adding, editing and deleting mysql in friends, and showing it on the index.php file Used to be. So here is my index.php file:

  & lt; Script & gt; Function goDel () {var recslen = document.forms [0]. Length; Var checkbox = "" (i = 1; i  gt; {var con = confirm ("Are you sure you want to delete"); If (con) {document.forms [0] .action = "delete.php? Recsno =" checkbox document.forms [0]. Submit ()}} and {warnings ("no record has been selected.")}} Select function () {// var formname = document.getElementById (formname); Var recslen = document.forms [0]. Length; If (document.forms [0] .topcheckbox.checked == true) {for (i = 1; i  gt; & Lt; TR & gt; & Lt; Td> & Lt; Hour size = "1" node & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Form action = "" method = "post" name = "" id = "" & gt; & Lt; Width of the table = "600" border = "1" align = "center" cellpadding = "2" cell area = "2" & gt; & Lt; TR & gt; & Lt; Td> & Lt; Input name = "top checkbox" type = "checkbox" class = "check" id = "top checkbox" onClick = "selectall ();" Value = "on" & gt; Select all & lt; / Td> & Lt; Td colspan = "3" align = "center" & gt; & Lt; A href = "form.php? Mode = addition" & gt; Add new branch & lt; / A & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> & Lt; Strong & gt; & Lt; A href = "javascript: goDel ()" & gt; Remove & lt; / A & gt; & Lt; / Strong> & Lt; / Td> & Lt; Td> & Lt; Strong & gt; Branch name & lt; / Strong> & Lt; / Td> & Lt; Td> & Lt; Strong & gt; Small name & lt; / Strong> & Lt; / Td> & Lt; TD & gt; & Lt; Strong> Update & lt; / Strong> & Lt; / TD & gt; & Lt; / TR & gt; By & lt;? Included ("conn.php"); $ Sql ​​= "Brand name by SOR, choose short name from branch name $ $; $ result = mysql_query ($ sql, $ connection) or die (mysql_error ()); while ($ line = mysql_fetch_array ($ result)) { ? & Gt; & lt; tr & gt; & lt; td & gt; & lt; input name = "& lt;? Echo $ row ['sn'] ;? & Gt; "Type =" checkbox "class =" check "& gt; & lt; / td> & lt; td & gt; & lt ;? echo per line ['branchname'];? & Gt; Lt; / td & gt; & lt; td & gt; & lt;? Echo per line ['short-n'];? & Gt; & lt; / td> gt; & lt; td & gt; & lt; ; A href = "& lt;? Echo "form.php? Sn =". $ Line ['sn']. "& Amp; mode = update";; & Gt; Updates & lt; / a & gt; & lt; / TD & gt; & lt; / tr & gt; k   

This is my delete.php file :

  & lt ;? php included ("conn.php"); $ Recsno = $ _ receive ["recsno"]; $ data = trim ($ recsno); $ Ex = explosion {$ Id = trim ($ ex [$ i] for $ ($ "$"); $ size = sizeof ($ east); ($ i = 0; $ i & lt; $ size; $ i ++) ); $ Sql ​​= "Remove from branch where sn = '$ id'"; $ result = mysql_query ($ sql, $ connection) or die (mysql_error ());} header ("location: index.php" );? & Gt;   

The problem is that When I check the 1 line and click Delete, it is removing all the rows, like I clicked on selecting all (which I did not do). Thank you in advance.

It looks like the query is not getting the value of $ id $ Id .

Just get the id value

  $ id = $ _REQUEST ["SN"];   

Then delete your query

  $ sql = "$ branch, where sn = '$ id'";    

ios - Programmatically turn off VoiceProcessingIO AGC -


I am using Apple's CoreAudio Framework to record my microphone feed. Automatic gain control seems enabled by default:

  kAUVoiceIOProperty_VoiceProcessingEnableAGC indicates that automatic gain control is enabled (any non-pricing value) or disabled (value of 0) Is capable of form. The value is to read / write UINT 32 on the global audio unit area. Available in OS X v10.7 and later. Declared in AudioUnitProperties.h   

How can I programmatically stop the AGC in CoreAds?

Assume that you voiceprocessor

  UInt32 is using an AUVoiceProcessor Audio Unit named turnoff = 0; Audio UNNet ProPorty (Voice Processor, KUIvoiceOoProperty_VisProsaging ANALACC, QDOUnitScope_GLOBAL, 0, and Turnoff, Safeoff (Turnoff));   

Quick Details: What is doing this is setting Properties on 0 on the audio unit, which in this case disables AGC in the audio units usually There are two sets of controllable values ​​named Properties and Parameters . You can assign these values ​​to AudioUnitSetProperty () / AudioUnitGetProperty () And AudioUnitSetParameter () / can be set / received using the AudioUnitGetParameter () accordingly accordingly.

Note: You should probably check the OSStatus code that AudioUnitSetProperty () returns (this will be equal to noErr if There was no error).

Having issue with PHP URL Redirect Between Multiple Domains -


I have a lack of PHP skills and I have tried to troubleshoot this problem for a while and answered with no luck Have not searched. .. and I'm sure this is something easy.

I have a page on a domain that is checking to see if a cookie exists, and if it is not, then it sends a completely different domain to the user at birth date. Once they enter it and enter it for more than 21 years, they take it back to the original domain, but for some reason my script is not the whole thing, only on the sub-directory of the reference domain Occupation Defense is doing.

Then, the user goes to a fictional URL, abc.com, on the following page:

  & lt ;? Php function over21 () {session_start (); $ REDIRECT_URL = 'http: //xyz.com'; $ Valid = false; If (! $ ($ _COOKIE ["over21"])) {$ validated = true; } If (! $ Valid and released ($ _ session ['over21'])) {$ validated = true; } If ($ valid) {return; } And {$ redirect_url = $ redirect_url} "? Return =". $ _ Server ['REQUEST_URI']; Header ('Location:' $ Redirect_url); Exit (0); }} Over 21 (); ? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Abc.com page & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; Before you can read this content, you will be taken to xyz.com to validate your age & lt; / Body & gt; & Lt; / Html & gt;   

So far so good, now they are sent to xyz.com to enter the date of birth:

   = 21) {Setsuke ("over 21", $ value, time (+ 3600 * 24); $ _SESSION ['over21'] = 1; ? $ = Isset ($ _ receive ['return']) urldecode ($ _ receive ['return']) redirect: './'; Header ("Location:". $ Redirect); Go out; } And {$ _SESSION ['under21'] = 0; Header ("Location: http://google.com"); Go out; }}? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; This is xyz.com & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form & gt; Here is a form with input and to collect such days, months and years of birth. & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

If I have an age verification piece and reference page on the same domain then the script is doing a great job. But how can I modify it so that the age verification page belongs to the domain of reference Capturing full URL, not just subdomain?

Therefore, I think ignoring the same basic comment, just by looking at the session start code, It seems that you were trying to share a session across the domain.

See what you are asking only about me.

'REQUEST_URI' - given the URI to access this page; For example, '/index.html'

Try the HTTP_HOST instead.

similarly:

c# - How to add a listViewItem with its own unique image -


Available to add an entry in the ListView C # add Apment methods

  public virtual List View (ListViewItem value) to public virtual ListViewItem (string text) Add public virtual ListViewItem (string text, int imageIndex) Add public virtual ListViewItem (string text string ImageKey) Add public virtual ListViewItem (string key, string text, integer imageIndex) Sir Form on virtual ListViewItem (String key, String text, add string ImageKey)   

Landscape: I ListViewItems with its unique images have a ListView and dynamic as before Columns want to add.

Question: How would you do this?

code I am working

  private void AddToMyList (SomeDataType message) {string Entrykey = message.ID; // Add your 1 column parameter string [] rowEntry = new string [1]; Line entry [0] = message.name; // make it a list view and its line list is indicated by the listITImline = new list view (line entry, (deviceListView.Items.Count- 1)); // Tag the row entry as unique ID line. Tag = Entrykey; // Add the image to the first column row. Image index = 0; // If the image is given for the project then add the image. Images (ENTERTAINMENT, MESSAGES. MARKERMARKER IKON); / LISTView.Items.Add (line) Add the type of lookup to device list at the end;    

There are two things that you need to do

    < Li> Add an image to the image list if it is not already
  • Create a new ListViewItem and assign it an image from the previous point

    This can be done this way based on your code:

      // add marker icons Antrki imagelistforTypeIcons.Images.Add for image insertion (Entrykey, message.marker.markerIcon); // Use the icon from ImageList which is stored under the Entrykey ListViewItem line = New ListViewItem (rowEntry); Line. Images = Entry; // whatever you need a row later. Tag = Entry; ....   

    In the problem with your code (without really trying to do it) you are specifying in the ImageIndex .

    • You are adding a new image to an image list, but assigning an image to a ListViewRow from a different one
    • You You are providing the image index in the constructor but setting it later 0 (why?)
    • You are providing the wrong image index in the first place, because the image in the image list before you add a new image The index of is calculated.

      If your code can be cured in this way:

        // markerIcon Entrykey imagelistforTypeIcons.Images.Add (Entrykey, message.marker.markerIcon) Pair in ImageList; // Use the icon from ImageList which is stored under the Entrykey ListViewItem line = New ListViewItem (rowEntry); Line. Image Index = Type for Icons.Count- 1; // whatever you need a row later. Tag = Entry;    

ios - Positioning GMSMapView to show multiple annotations at once -


My question is quite similar How can I do the same process (Maps to fit all annotations / markers on the screen Can be resized once) with Google Maps? As I have understood that I want to convert MK Cordinet Region to GMSPOction, is my way right?

is very simple, just:

  @ property (non-standard, Strong) gmmapview * mapview; - (zero) did the FitbusinessWithmarker: (NSARRA *) Marker {GMS Cordined Bounds * Bounds = [[GMSCordinate Boundes Elok] Init] ;; (GMS marker * marker in markers) {Bound = [including limitations: marker.Search]; } GMSCameraUpdate * update = [GMSCameraUpdate Fitbound: border]; [M.MapeWeb moves camera: updates]; [Self. MapView animateToViewingAngle: 50]; }    

java - Factory method to return an implementation of a given Interface -


itemprop = "text">

after

Cast is required because, there is no way in compiling time to tell that an example of a AddressBookFrame is T

To avoid warning, check the order in order:.

  returns uiClass.cast (new addressbookframe);   

To do this in this way, your map implementation will work and the type will be safe.

django - Heroku Custom domains : Error NOT FREE? -


I am on the cedar stack and it seems that

horoko domain: myDomainName

not working:

! Dev apps can not contain custom domains Upgrade to original or production to continue.

and the original pack is 18 $ / m ... while people everywhere are saying that Herokua is free with custom domain ...: (. < P> I tried to contact everyone with support: I had the answer:

I did not know that your app was on Dev category, it does not allow for a level custom domain if you If you are interested in keeping a custom domain on this app, you will need to upgrade to that app at the Basic level.

I I'm really confused because people are saying everywhere

Maybe they update their policy If this is the case then it was a big news:

Maybe they are doing some testing on conversion for new accounts?

/ P> < / Html>

algorithm - Create binary tree from inorder and post order traversal -


I was trying to familarize with the question of creating inorder and postorder transcellal trees. I have written the following code, but something is going wrong that I did not know. Can anyone help me on this?

sample i / p:

in int [] = {4,10,3,1,7,11,8,2}; Int post [] = {4,1,3,10,11,8,2,7}; Public static tree node build posters (int post [], int n, in offset, map and lieutenant integer; Return null; Int rootwall = post [N-1]; Int i = (indexMap.get (rootVal) - offset); Treeoid Root = New Treeode (RootWall); Root.setLeft (buildInorderPostorder (Post, I, Offset, IndexMap, I-Offset)); Root.setRight (buildInorderPostorder (Post, N-1, Offset + Eye, IndexMap, N-1I)); Return route; }

root.setRight seems incorrect. Should not be offset + i , it should be offset + i + 1 :

  root.setRight (buildInorderPostorder (post, n - 1, offset + i + 1, indexmap, n-1-i));    

asp.net - Kendo TabStrip: Getting the Selected Index on the Selected event (MVC 4) -


मेरा टैबस्ट्रिप निम्नानुसार है:

  @ (Html.Kendo ()। TabStrip ( ) .नाम ("टैबअप्लिकेशन्स")। वस्तुओं (आइटम = & gt; {items.Add ()। पाठ ("ऑनलाइन")। चयनित (सत्य); आइटम। जोड़ें ()। पाठ ("ट्रेडिंग");})। एनीमेशन (गलत)। एवलेंट (ई = & gt; ई। चयन करें ("टैबस्ट्रिप_सच्च"))   

जावास्क्रिप्ट में मुझे चयनित आइटम प्राप्त होता है:

  फ़ंक्शन Tabstrip_select (e) {var x = e.item; }   

प्रश्न : मैं इस समारोह से चयनित इंडेक्स (यानी "1") कैसे प्राप्त करूं? मैंने आइटम ऑब्जेक्ट पर देखा लेकिन कुछ भी स्पष्ट नहीं हुआ।

आप वर्तमान में चयनित इंडेक्स प्राप्त कर सकते हैं index () $ (e.item) पर कॉल करने के साथ

  फ़ंक्शन tabstrip_select (e) {var x = e.item; Var selectedIndex = $ (e.item) .index (); }   

डेमो का उपयोग कर।

css - move text from BreadCrumb to the left -


I want to move the text "home" from the breadcrumb "search" to the left, so that it is on the sidebar.

You can see it on the right.

When I type text align: left then it only moves a few px to the left what is the correct code?

Remove the width from the class ".breadcrumb" or "float";;; should work

javascript - Evaluate div.innerHTML with document.write -


I need to write information from external script in my script. I have an html page with div, and Write external script for div with window.onload .

  document.getElementById ('test'). InnerHTML = '& lt; Script src = "http://www.klerk.ru/kurs/informer/informer_txt/?stcbrf=1" & gt; & Lt; / Script & gt; '; Eval (document.getElementById ('test') innerHTML.);   

This external script has many document.write , but it does not work.

My question is how to implement document.write in fixed div

But, is it possible to do something like this? It:

  & lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Script src = "http://www.klerk.ru/kurs/informer/informer_txt/?stcbrf=1" & gt; & Lt; / Script & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;   

and document.write in td ?

You can not load the javascript source file, which runs from any javascript The first initial page load is to come in the browser. The way a javascript reference can not be reached (technical reasons are unknown to me, I consider it to be security).

You can run eval against javascript code block, but javascript file (reference).

c# - Thumb control highlighted and dragging appearance -


I am using thumb controls in a window store app to represent a drag-able image. However, whenever I hook it up, it turns into a gray box, and when I pull it, it turns into a dark brown box. When it is released, it takes the image back as I gave it in the background, is there any way to remove highlighting / highlighting or remove the highlight?

Edit:

Here's my XML for control. I have it in the grid but nothing is with it.

  & lt; Canvas x: name = "PART_background" background = "white" height = "140" width = "20" & gt; & Lt; Thumb X: name = "PART_drag" canvas. Lift = "0" width = "20" height = "50" & gt; & Lt; Thumb.BorderBrush & gt; & Lt; Solid color brush color = "black" opacity = "0" & ​​gt; & Lt; / SolidColorBrush & gt; & Lt; /Thumb.BorderBrush> & Lt; Thumb.Background & gt; & Lt; ImageBrush x: name = "PART_image" section = "none" AlignmentX = "center" /> & Lt; /Thumb.Background> & Lt; / Thumbs & gt; & Lt; / Canvas & gt; If you want to edit the template - it works best in Blend, then change the visuals are some  Border  element in the animation default template and various scenes (Pointrpres, Pointrovr) - it in Animates the opacity of the boundaries. Here is the template extracted. You can easily remove the storyboard to get rid of visual feedback.  
  & lt; Page x: Class = "App132.MainPage" xmlns = "http://schemas.microsoft.com/winfx / 2006 / xaml / presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/ Using xaml "xmlns: local =": App132 "xmlns: d =" http://schemas.microsoft com / expression / blend / 2008 "xmlns: mc =" http://schemas.openxmlformats.org/markup- Compatibility / 2006 "mc: Ignorable =" d "& gt; & Lt; Page.Resources & gt; & Lt; Style x: key = "thumbstyle1" target type = "thumb" & gt; & Lt; Setter property = "background" value = "{static resources thumb backgroundThebrish}" /> & Lt; Setter property = "borderline" value = "1" /> & Lt; Setter Property = "iTebstop" value = "False" /> & Lt; Setter property = "borderbrush" value = "{static resource thumbboardthemebrush}" /> & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate Goal Type = "Thumbs" & gt; & Lt; Grid & gt; & Lt; VisualStateManager.VisualStateGroups & gt; & Lt; VisualState Group x: Name = "General Location" & gt; & Lt; VisualState X: Name = "General" /> & Lt; VisualState X: Name = "Pointer Over" & gt; & Lt; Storyboard & gt; & Lt; Double animation duration = "1" storyboard for "0" TargetProperty = "Opacity" storyboard. TargetName = "BackgroundPointerOver" /> & Lt; Double animation duration = "0" from "0" storyboard. TargetSprint = "Opacity" storyboard Target = "background" /> & Lt; / Storyboard & gt; & Lt; / VisualState & gt; & Lt; VisualState X: Name = "Pressed" & gt; & Lt; Storyboard & gt; & Lt; Double animation duration = "1" storyboard for "0" TargetSprint = "Opacity" storyboard Target = "page-restricted" /> & Lt; DoubleAnimation Term = "0" to = "0" Storyboard.TargetProperty = "Opacity" Storyboard.TargetName = "Background" /> & Lt; / Storyboard & gt; & Lt; / VisualState & gt; & Lt; VisualState X: Name = "Disabled" /> & Lt; / VisualStateGroup & gt; & Lt; VisualStateGroup x: Name = "FocusStats" & gt; & Lt; VisualState X: Name = "Unfoxide" /> & Lt; VisualState X: Name = "Focus" /> & Lt; / VisualStateGroup & gt; & Lt; /VisualStateManager.VisualStateGroups> & Lt; Border x: Name = "background" Borderbrs = "{Templetbading Borderbris}" Bordertiksaij = "{without border partition}" background = "{Binding background}" / & gt; & Lt; Limit x: Name = "BackgroundPointerOver" BorderBrush = "{StaticResource ThumbPointerOverBorderThemeBrush}" BorderThickness = "{TemplateBinding BorderThickness}" background = "{StaticResource ThumbPointerOverBackgroundThemeBrush}" opacity = "0" / & gt; & Lt; Limit x: Name = "BackgroundPressed" BorderBrush = "{StaticResource ThumbPressedBorderThemeBrush}" BorderThickness = "{TemplateBinding BorderThickness}" background = "{StaticResource ThumbPressedBackgroundThemeBrush}" opacity = "0" / & gt; & Lt; / Grid & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; & Lt; /Page.Resources> & Lt; Grid Background = "{Static Resources Software Application Background BackgroundThebrish}" & gt; & Lt; Thumb HorizontalAlignment = "left" height = "270" Margin = "170,230,0,0" VerticalAlignment = "top" width = "390" style = "{StaticResource ThumbStyle1}" / & gt; & Lt; / Grid & gt; & Lt; / Page & gt;    

java - What isn't this code inserting values into SQLite database? -


I'm writing an app for Android. I have to read a txt file and write the data in the SQLite file. I have been successful in completing all the code, but in that part where the values ​​in the database should be entered, it is not working. I have given the code given below:

  Try {content value value = new content value (); Values.put (KEY_NAME, first number); // contact name values.put (KEY_PH_NO, strfinal); // Contact Phone // Line DB Insert insert (tabeline, property, value); } Hold (exception e) {e.printStackTrace (); }   

This code is not entering values ​​in the database and the database remains empty after the operation is complete. what's wrong with that? Thank you. EDIT: OK, here is the full code:

  public class database bands expanding SQLiteOpenHelper {// All static variables // database version private static final integer DATABASE_VERSION = 1; // Database Name Personal Static Last String DATABASE_NAME = "feedsmanager.sqlite"; // Contact table name personal constant last string TABLE_CONTACTS = "table_to_hold_all_values"; // Contact table column name personal constant last string KEY_ID = "id"; Private static final string KEY_NAME = "name"; // ctid private constant last string KEY_PH_NO = "phone_number"; // feedname, address; Feedname; Address etc reference ctx; Public databashendler (reference reference) {super (references, database, ANN, blank, databasebessons); Ctx reference =; } // Creating a table override public whit on a form (SQLiteDatabase db) {//Log.d ("On in Create", "Twitch 1"); String CREATE_CONTACTS_TABLE = "Create Table" + TABLE_CONTACTS + "(" + KEY_ID + "Inkender Primary Key," + KEY_NAME + "TEXT," + KEY_PH_NO + "TEXT);"; // log D. (LibLo v. Contact), "Twitch 1"); Try {db.execSQL (CREATE_CONTACTS_TABLE); } Hold (exception e) {log d. ("Making went wrong:" + E, "twitch 11")}} // log (Debel DBXxcL "," Twitch 1 "); Populate (Database);} Empty Populate (SQLiteDatabase dbs) {String Line =" "; Try {InputStream = ctx.getAssets ()} Open (" Feedchats and Addresses. Txt "); InputStreamReader iz = New InputStreamReader (); BuffettDrR BR = New buffated reader (iz); // SQLiteDatabase; DBS = this.getWritableDatabase (); while ((line = br.readline ()) = null) { // log (here fixed 6 "," twitch 1 "); StringTokenizer stringtoconizer = New string locator (line, "& lt;"); String firstumber = ""; String Stranfinal = ""; FirstNumber = (string) stringToKonizer NXtaille (); ** // To calculate the first digits and strfinal excluded contentValues ​​values ​​= new ContentValues ​​(); Values.put (KEY_NAME, first number); // contact name values.put (KEY_PH_NO, strfinal); // Contact Phone // Line DBS insert insert (tabelagont act, empty, value);} dbs.close ();} hold (exception e) {log d. ("Yes error is" + e, "twitch 12"); }}}    

this.db.insert (TABLE_CONTACTS, zero, value ); . Because I had the same problem a few months ago and this is the solution.

html - Overriding class in chain? -


मेरे पास निम्न है:

  .mainClass a.customizeIt span {background: transparent url ('../images/myimage.png') नहीं-दोहराना; रंग: #ffffff; प्रदर्शन क्षेत्र; फ़ॉन्ट आकार: 13 पीएक्स; }   

क्या ऊपर के किसी अन्य संस्करण को बनाने का कोई तरीका है ताकि कोई पृष्ठभूमि छवि का उपयोग न किया जाए?

  .mainClass a.customizeIt span {color: # FFFFFF; प्रदर्शन क्षेत्र; फ़ॉन्ट आकार: 13 पीएक्स; }   

तत्व में दूसरा संस्करण कैसे संदर्भित किया जाना चाहिए?

- संपादित करें - निम्न संभव है, इसलिए कोई पृष्ठभूमि नहीं है और मैं रंग, डिस्प्ले और फ़ॉन्ट-आकार पुनः उपयोग करें?

  .mainClass a.customizeIt a.no-bg span {background: none;    

क्या यह आप मुख्य है?

html

  & lt; a class = "customizeIt" href = "#" & gt; & lt; span & gt; नमूना 1 & lt; / span & gt; & lt; / a & gt;   

उस भाग में वर्ग की नो-बीजी का उपयोग किया है जिसे आप पृष्ठभूमि छवि को हटाना चाहते हैं, बस नीचे दिखाए

  & lt; एक वर्ग = "कस्टमाइज़ करेंइक्ट नं- bg" href = "#" & gt; & lt; span & gt; नमूना 2 & lt; / span & gt; & lt; / a & gt;   

css

  .mainClass a.customizeIt span {पृष्ठभूमि: पारदर्शी url ('../ images / myimage.png') नहीं-दोहराना; रंग: #fff; प्रदर्शन क्षेत्र; फ़ॉन्ट आकार: 13 पीएक्स; } .mainClass a.no-bg span {background-image: none! महत्वपूर्ण}    

CSS table-cell widths work in Chrome but not FF or IE -


Using a display: Table-cell, I've found, is a useful way to make things stand - especially From a RWD reference where the fixed pix dimension will not work.

Check here :.

In Chrome, it works as expected. When the browser becomes small, then the IMG gets smaller and wrapping text and stuff. But in FF, IE 9 and Opera, the image will not shrink, in fact, all width and height announcements are ignored.

Is there some change, I can do it in my current HTML / CSS to fix it or it is the fact that Chrome is supporting its current layout happy mistake and I Am going about

Thank you!

I'm stupid, I thought it now.

The maximum-width only applies to block-level elements so that the IMG {max-width: 100%;} declaration does not work, preventing the image from being flat-width. The issue was raised by targeting IMG and giving it width: 100%; Boom!

python - "Flattening" a list of dictionaries -


तो मेरा उद्देश्य है:

  fruitColourMapping = [{'सेब': 'लाल'}, {'केला': 'पीला'}]   

से

  अंतिममैप = {'सेब': 'लाल', 'केला ': पीला'}   

एक तरह से मुझे मिल रहा है: <पूर्व> से itertools आयात श्रृंखला फल = सूची (chain.from_iterable ([d.keys ( ) फल के लिए dol)) रंग = सूची (चेन.फ्रेम_इटेरबल (फल में घ के लिए [d.values ​​()) क्लाउर मैपिंग])) वापसी डिक्ट (ज़िप (फल, रंग))

क्या कोई बेहतर और अजगर तरीका है?

  अंतिम map = {} फल में dol के लिए कॉलर मैपिंग: अंतिममैप .update (d)    

Excel Ribbons Doesn't work after file rename -


Hey I'm making macros and then adding them to the customized ribbon at Excel (2010). The problem I have is that every time I rename the original file (save) that I created macros and ribbons and then click on the ribbon / macro, it automatically opens the original file so that the new Can be worked on saved. If I extract the file from the original path and then open the file again by name and using the ribbon to run the macro, it does not run, then I did not find the error file.

I exported the ribbon to the IU and when I open it, by using Notepad ++, can I see the hardcode path of the original file, is there any way to resolve this resolution ?? To change the names of those ribbons, I save the file by different names or different ways each time ....

Custom UI Editor from:

Here's a Microsoft Guide:

When the macro and ribbon are actually coded, avoid the names hard And it will work perfectly. For example, I use one of my macro files:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Custom UI xmlns = "http://schemas.microsoft.com/office/2009/07/customui" & gt; & Lt; Ribbon & gt; & Lt; Tab & gt; & Lt; Tab id = "refund" label = "refund / return" & gt; & Lt; Group id = "financeRefund" label = "refunds and returns" & gt; & Lt; Button ID = "Refresh" view = "true" size = "big" label = "refresh front page" keytip = "R" screentip = "Refresh front page without data clearing in data sheet." OnAction = "refreshfp" imageMso = "recurrence edit" /> & Lt; Button id = "new" visible = "true" size = "large" label = "data update" keytip = "S" screentip = "Clears the changes in the current data sheet, cleared from live sheet to new data." OnAction = "updateData" imageMso = "ExportSharePointList" /> & Lt; / Groups & gt; & Lt; / Tab & gt; & Lt; / Tab & gt; & Lt; / Ribbon> & Lt; / CustomUI & gt;   

Hope this helps

Send data from .NET application to Rails application -


How can I send data from a Windows .NET application into a railway application? The .NET application constantly collects data from certain workspaces and needs to periodically send the data to the database. I want to send applications to the tracks that authenticate the netting application and parse the data received before it is stored in the SQLite database. Thank you.

Create a rail panel and call it using .NET.

Information on creating a web service in the rail on this last question:

It is easy to call web service in .NET (but here is a good place to start: ).

c++ - Run a tutorial in Visual Studio - What kind of "New Project"? -


I want to run the first code in this tutorial with Visual Studio:

As I have not had much experience with Visual Studio, I do not know what type of project should I open (Win32 console application?) And settings that should be for me to run. Thank you for your help. !

You can create a blank (C ++) project, add a source file ( main.cpp ), and then copy that code. However, you will also need it:

  1. Download their header files and libraries and note where you can save them
  2. Right click Project and "Properties" Select.
  3. Go to "C / C ++ -> General".
  4. Add the location of their header to the "Additional Insert Directories" field in the field.
  5. Navigate to "Linker -> General."
  6. "Add the location of their libraries (.lib files) to additional libraries." Linker - & gt; Input ".
  7. Add the names of your libraries that you need to link in the" Additional dependency "field.

networking - Hourly network device restart using Bash in Ubuntu -


OK, this is a strange one. Actually what I am trying to do is run an infinite loop with a gold timer which delays running a wlan0 command to restart the network interface. It seems strange but for some reason the network card stops connecting to the net after about two hours. To stop it, I'm running a web server for this closed UNI and should be able to access it remotely. If the connection goes down then I'm out of luck. :

I found this: It is a very easy way to manage a network interface, reconfiguring only when pinging is off, though it is more complex than I have and some other similar bits Found, but they were equally ambiguous.

Honestly, I am a C-based programmer. At this stage, C # C ++ and Java (Python is not really worth mentioning) Anyway I'm just having fun reading a bake code, which modifies the already existing snippet. :)

So that's what I would like to do in the pseudo code.

  do {sleep 3600s // works sudo ifconfig wlan0 down // works on terminal but not script} while (false);   

It is so beautiful that the script is initially running by the user manually or through the start-up application system, I would like to have it automatic but if the ifconfig command is run as pseudo Which means that the script is run as a pseudo :)

More suggestions and / or signs will be appreciated. I tried to do old echo work to enter the password for the pseudo but as expected, Ubuntu developers have detected how blocking it.

Just got it and this is the second one that I want, but it's running other Bash scripts ???? :)

Editing -1: Okay .... well I used the crontab and I think that I am getting some work, I am not seeing any proof of it as When I call down the ifconfig wlan0 command line But I will leave it to walk tomorrow and see if he can keep himself online :) If not, and I am not thinking what can I do from here?

The way the connection is configured by working on this particular device below is that the command takes the device offline after 20 seconds and then the device automatically finds the network back and again Connects. :) I have no problem with the IP address tied to the MAC address :)

if You want to write a shell script which is up to you, but I'm a big fan of reusing the one that is already there.

Use your script to run every hour, set it to the root account and mess with the interface.

python - Numpy: np.where function given argmax -


I am trying to do this function on two 2D node arrays: Step 1: Search np. Argmax (b, axis = 1) index step 2: find b [index] & gt; A [coordinator] Step 3: Return value in 2D Boolean array.

I tried to do this:

  np.where ((b & gt; a) & amp;; np.argmax (b, axis = 1). Repeat ((3, -1)), right, wrong)   

But there is no dice any ideas?

Thanks in advance.

Based on your comments, I have the best understanding:

  Output = (NPMX (B, Axis = 1) [..., none] == B) & amp; (B & G; A)   

Where we use Normal Broadcasting, its maximum number is in line b :

  np.max (b, axis = 1) [..., none] == b   

or perhaps obvious:

  NPMX (B, Axis = 1) [..., NP.Newxis] == B    

haskell - cabal install pcap windows 64bit -


I can not install the PKP package under Windows 7 (64bit). Does anyone know this?

Error message if I run "cabal install pcap":

cabal.exe: Continuous dependency on a foreign library:

  • unavailable (or Bad file header: pcap.h
  • Unavailable c library: PPP

    I downloaded WinPcap 4.1.2 Developers Pack from here:

    Tried both the installed Mengu / MSYS Scratch: prepackaged GHC 7-6.2 (ghc-7.6.2-x86_64-unknown-mingw32.tar.bz2) and compiled it under the Minig / MSYS.

    There are many problems:

    1. When I provide, the path to pcap.h (--extra-include-dirs) is included, Cabal configure ", but it fails on" cabil build "with" netbet "/in.h". "

    2. If I have MSYS" Mingw-get msys-core-dev ", then installing netinet / in.h, I'm getting different types of tones already defined messages < Li>

      is not libpcap.a in the WinPCap developers pack (this libwpcap .a) and it seems that its not a 64 bit version. I need to compile myself?

      I would appreciate it if anyone could suggest that Windows Under normal circumstances, how is such a situation governed for cable packages?

      The WinPCap developers pack does not have libpcap.a (this is libwpcap.a).

      Correct. For better or worse, while the library is called "libpcap" on UN * X, Au Thus, the flag is linked to -lpcap , it is called "WinPcap" on Windows and the .a file is called "libwpcap.a", which means that if If you create an app with UN * X-style tool, it will be linked to flag -lwpcap . No, even if you're using UN * X-style files on Windows, you do not use the same flag to link to a PAP-based program, Do it on X.

      And, yes, you have to compile yourself 64-bit versions; While they provide a 64-bit version of the .lib file for use with Microsoft Construction Tools, they do not appear to offer the 64-bit version of .a UN * X-like files for the use of the file.

algorithm - Efficient enumeration of subsets -


I am currently working on an algorithm for a mathematical optimization problem and I have to deal with the following situation.

In many circumstances, the algorithm needs to decide which subsetting S ???? N is the best in this situation.
n = {0, 1, 2, ..., 126, 127}
| S | a???? {0, 1, 2, 3, 4, 5} (subtitle size ranges from 0 to 5)

This gives the total number of possible subsets of 265.982.833. (128, 5) + binom (128, 4) + ... + binom (128, 0))

If I make all possible subsets accurate and store them in the array, then This array

In this case, when the algorithm needs to know which element is in one, without any optimization and meaningful storage of conspiracy, without any memory footprint, 265.982.833 entries and one Memory footprint. Specific subsets with index I just need a table lookup. However large memory requirements are not acceptable.

So my question is basically if someone has to think about the algorithm, then on the basis of the index it requires a pre-filled array to calculate the elements efficiently.


Edited samples:
lookupTable [0] = {}
lookupTable [1] = {0}
... lookuplable [127] = {126}
lookupTable [128] = {127}
lookupTable [12 9] = {0, 1}
lookupTable [130] = {0, 2}
... ... lookupTable [265982832 ] = {123, 124, 125, 126, 127}

To create each subset from the previous Direct subset for It is straightforward to represent a subset in the form of a 128-bit number (although obviously most values ​​will not map to a merit subset, and I do not know if the value of 128 in question is either real or just an example. ) That's definitely the first approach I will use; If this works, then it is all O (1) and the storage cost is not high (16 bytes for index instead of 4).

If you really want to store a brief index for the subset, then I have the following recycling, where S (N, K) represents all the values ​​(or the number of subsets) size sizes ≤ k From & lt; N:

s (n, 0) = {{}}}
s (n, k) = (s (n-1, k- 1)) and Audot; {N}) and the union; S (n-1, k) if n ≥ k & gt; 0
s (n, k) = {} if n & lt; K

Where operator P & O; S means "Add s to each element of p (and therefore the result is the same size as P ). Therefore, a counting algorithm is seen as, we get:

S (n, 0) = 1
S (n, k) ) = S (n-1, k-1) + s (n -1, k) if n ≥ k & gt; 0
S (n, k) = 0 if n & lt; K

The second recurrence can be expressed again:

S (n, k) = Σ n I = s S (i-1, k-1)
(which look good with JSM, Grow.)

This is another way of saying that we will generate the set by the largest element, so we start with the set {0 ... k-1} Then with {k} as the greatest element, then with all the {k + 1} , and so on. Within each set of sets, we retrieve the (k-1) -set-shaped set, then start with at least the maximum value and with the maximum value selected by us Work for less than one.

So we can understand that the largest value in the indexed set is in the S (n, k) respectively, in the S (i-1, k -1) to i to k to n the result will be negative; So we add {i} to the result set; Reduce k by 1 and repeat with n now set to i-1 .

If we already add the relevant table of s (n, k) , of which approximately 640 are valid combinations, then instead of replacing it by looking for the code Using binary search> I is at each stage, so calculation takes time k log (n) , which is not terrible.

C# on Android: Xamarin or Unity? -


I am a student and an Android app, probably a game code. I have the opportunity to choose a programming language, I am fine, but I like C # more anyway, however, Android has not originally supported C #, so I am looking for a way to implement it .

I have received many recommendations for exaggeration, but it is not free. I understand, developers should pay for their work, but since I am a student and do not take any advantage of the app, I feel that anything is unfair in paying. I have come into unity, which is free, but there are very few user feedbacks compared to zamindar.

Therefore, I would like to ask you for your recommendations - Integration is very good, or should I sacrifice some money and buy Xamarin? Or is there any other solution?

If you are going to choose to use Xamarin. Android forget it At present, the cost is $ 99.

You may also want to see another note, which essentially knows XNA as well. With Monogam or Unity you will be able to create some good games.

"The shape covered with 32k IL code" is not the actual IL code, but what you have in your output folder in your project if you are going to create a game with sprites and sounds and, 32k is not going too far until you load these resources with net or similar.

parsing - Type-of-address of the sender number (SMS) -


I would like to know what kind of sender number is type-off-address for example , 91 type-off-address in pdu below: 9742020096F6400B 91 9742039333F7

91 means the format of the international phone number and I will add + before this number, sometimes I need to type-off-address Have to face such as D0 , C8 and so on. So what do they mean? Where can I find information about this? Thanks in advance.

- Update -

I got a program called PDUspy . It can recognize type-off-address . So I have found that D0 - alpha (ACS TS 03.38) and the number is shown as text, for example Nikolas . C8 - Customer number . But what do they mean and how to parse these numbers on the basis of these types?

TON / NPI information can be found in section 9.1.2.5. Address value (phone number) is left BCD coded, it is compounded with optional 'F', it is also swapped and then swapped.

An example of parsing the SDU proactive command of the APUU data)

  D0 16 81 03 06 13 01 82 02 81 83 Bb01 00 81 81 F 7 00 F2 02 70 6C Proactive SIM Command - Send Short Message - GSM Mode [D] Order Details Tag [81] Length: 03 Command Number: 06 Command Type: Short Message Command Qualifier Send: 01H 0000 0001 ( SMS packing required by me) Device Identification Tag [82] Length: 02 Source Device: SIM Destination Device: Network SA Ms TPDI Tag [0b] Length: 0B TP-MTI: Send / Submit TP-RD: To accept SC-SMMIT TP-VPF, direct: TP-VP field does not exist TP-RP: TP-North Path Parameter TP- ISDN / Telephone Number Plan Advertising Cost: "007" TP-PID: 00 TP-DCS: F2 TP-UDL: 02 TP-UD: "PL"    

set cell or row background color in a google spreadsheet using google_drive gem on ruby -


I am trying to set the background color for a cell and a line and using the 'google_drive' gem I am It seems that this option is in the 'spreadsheet' gem

  format = Spreadsheet :: Format.new: color = & gt; : Blue ,: pattern_fg_color = & gt; : Yellow, Pattern = & gt; 1   

If the 'google_drive' gem also has this option, please tell me!

Thanks in advance.

The problem is that you : color = & gt; You are trying to set background color by setting. : Blue . Instead, set : pattern_bg_color = & gt; : Blue .

All options: : bottom_color ,: top_color ,: left_color ,:right_color ,: pattern_fg_color ,: pattern_bg_color ,: diagonal_color

Hope this helps is!

Android how to adjust image background to be centered -


I have ToggleButton set to property in android: background The image is with. This background image fits all the backgrounds.

I would like to focus on the image of a small background inside a big toggle, which will save the image from expanding to fit all backgrounds.

Does anyone clue?

If you want to keep the text on top of an image, then you might find the image in the code instead of XML To set something like this:

  Resource R = Miller Resource (); Dry myimage = r.getDrawable (R.drawable.myimage); Button mybutton = findViewById (R.id.mibutton); Myimage.setBounds (0, 0, myimage.getIntrinsicWidth), myimage.getIntrinsicHeight ()); Mybutton.setCompoundDrawables (MyImage, Blank, Blank, Blank);    

syntax - Can typescript export a function? -


Is it possible to export a simple function from typewrite module?

  Module SayHi {export function () {console.log ("Hi"); }} New Sahi ();   

It seems that you can not do that but it is not possible to say that it is not possible?

It's hard to say what you are doing in that example. About exporting export = , External module, but the link code sample you have is internal module.

Rule Thumbs: If you type the module foo {...} , then you are writing an internal module; If you type export something at the top-level in the file, then you are writing an external module. It is rare that you actually get the export module foo the top-level (Since then you want to repeat the name), and it is also rare that you have module foo in a file that had a top-level export (since foo Externally not visible)

The following things are understood (horizontal rules as illustrated by each scenario):


  // exported function 'Foo' module SayHi {export function foo () {Console.log ("hi") with an internal module called SayHi; } Export class bar {}} // N.B. This line can be in another file with a //   

file1.ts

  // This * file * is an external module because it contains top-level ' Export 'export function foo () {console.log (' hi '); } Export class bar {}   

file2.ts

  // This file is also an external module because it contains a ' Import 'announcement import f1 = module (' file1 '); F1.foo (); Var b = new f1.bar ();   

file1.ts

  // This will only work in 0.9.0+. This file is an external / / module because it has a top-level 'export' function f () {} function g () {} export = {alpha: f, beta: g};   

file2.ts

  // This file is also an external module because it has an 'import' declaration import f1 = Required ('file1'); F1.alpha (); // inv f f1.beta (); // invokes    

ruby on rails - Can I practice capistrano on my pc? -


I am studying Ruby on the rail, but I have been stopped in the chapter to deploy with Capitorno, / P>

I would like to know whether I can work with PCIS 7 only with Castistran on my PC?

I do not know exactly what is deploying, there are some things about using multiple servers at different places, can I only practice on a PC? (My PC with Windows 7)

Would you like to have any tutorials or ideas about this?

You can free a micro instance on Amazon for 1 year, and then you can only deploy Can not practice, but also test your application in the production environment. Apart from this, you can install other systems in the VirtualPC (or similar), make proper routing for the inside, and after you configure the environment, you can try to deploy however it will not be easy

ios - Disable Gesture Recognizer for UIImageView in iPad app -


मेरे पास PageControl है और प्रत्येक पृष्ठ ( ViewController ) अलग है छविदृश्य ( UIImageView ) की संख्या, जो गतिशील रूप से बनाए जाते हैं।

प्रत्येक imageview को एक संकेत संकेतक निर्दिष्ट किया गया है (टेप या चाल) चूंकि ये एक PageControl के अंदर हैं, मैं इशारे पहचानकर्ता को सक्षम / अक्षम करना चाहूंगा / <> इसलिए यह स्वाइप से पृष्ठ ईवेंट में हस्तक्षेप नहीं करेगा ।

मुझे पता है कि एक removeGestureRecognizer पद्धति है, लेकिन मैं हर बार उसे निकालने और संलग्न नहीं करना चाहता।

आप उपयोग कर सकते हैं UIGestureRecognizer के गुणों को सक्षम या अक्षम करें जैसे: <पूर्व> स्वाइपजैस्टायरेकिकित्सक.संचालित = नहीं;

या यदि आप स्पर्श नहीं करना चाहते हैं तो नल

  - (BOOL) संकेत के लिए संकेत पहचानकर्ता विधि वापसी का उपयोग कर सकते हैं : (UIGestureRecognizer *) इशारे के लिए पहचानकर्ता चाहिए रीसिव टच: (यूआईटीच *) स्पर्श;    

ios - what's the difference between custom cell class vs files owner -


In the official developer guide (and other guides), it mentions that you need to set the custom square property IBOutlet Cell to make connections This custom class is an objective class only on @protects with the IPolator marker. I am trying to understand why this custom category property for cell differs from file owners of XIB. Files Leave blank to go and all connections will still work, unless the custom class is set on the cell (I click on the cell and I set custom class by cell "identified inspector"). The only thing I could think of is that a file owner can interact with UI visuals.

ctrl + f "To use the outlet for custom cell content" docs.

I had only one question and used it around something. The custom class attribute applies to each view in your XIB which I can see. Ie If you have a XIB with the UI code that has many UI objects, each may have a separate custom class, a custom class, you have the UIView object in the XIB Must be sub-classes of the original class. For example cell custom class should be UITableViewCell .

On the other hand any class (which I can see) for file owner only one more whole XIB Can be from. As an example in my case, I have the custom UITableViewCell with a custom field and some label XIB I have a header view of a table (i.e. UITableView in the object).

In my case, I made no a custom class for my XIB for I just have the file owner of the cell with my UITableViewController Created (which manages my table view), and the properties in the UITableViewController category are linked to my textfield and label. This works for me because I only have ONE example my custom TableViewCell (headers of the entire table, and only one header).

csv - Handling/editing special characters in a huge file(>2gb) -


I wrote in Java and created a CSV file. Since in some areas', 'as part of the price I had closed each column with' '' (("Allen, Zade", "123", "12 road"). So my value appears in the CSV file:

"Call A Value", "Colonel Bee Value" ....

Now when I call this file a postigree (9.1) 'filename . Csv 'database using the CUPPi table' ',' CSV; I get an error: Additional data after the last expected column.

I inspected the record for which the error was displayed and there is a column in which "" "is in the form of a part of its value. >

In short, how is this:

"Christ Church of Helsawi, Christchurch of Jehovah's Witnesses", "Christchurch", "Helsov's congregation of Jehovah's Witnesses"

I'm getting this error, I'm guessing because of the '' 'inside the value in the first column.

Please correct me if I am wrong and it would be great if you can help me during your csv file, you should leave any existing quotations (to change ) .

with \" ) wrapping them in your own quotation first.

java - Extracting application icons still null -


After

I am trying to remove a ArrayList icon images from a folder , but I The time is coming from a NullPointerException I can already extract smaller versions, but they are very small. The icons I am trying to achieve are regular icons of size, the file path icon keeps a list of locations. . iconBIG.add (...) is the place where NullPointerException is pointing to error

  // Global Private ArrayList & Lt; Symbols & gt; IconBIG = New Arrestist & lt; Symbols & gt; (); // Extract sign () ... within (string target: file path) {try {shellfolder shell = ShellFolder.getShellFolder (new file (target)); IconBIG.add (New ImageIcon (shell.getIcon (true)); } Hold (FileNotFoundException e) {e.printStackTrace (); }}   

Edit: I already have full permission to use ShellFolder

Update:. You should be told that new file (target) (which only holds complete paths of applications), if I change

getShellFolder (new file (target )

getShellFolder (new file (c: /foo/bar.lnk) ,

code work I already have it. I have already started to change '/' with >, but I do not understand that it is still saying this error.

To work well, given that This seems to allow the execution of private package here is an example that works on JDK 6 :.

  import java.awt .event.ActionEvent; import java.awt.event.ActionListener; Import java.io.FileNotFoundException; import javax.swing * ;. import sun.awt.shell.ShellFolder; public square ShowShellIcon {private static void createAndShowUI () {final JFrame frame = new Jefrem ( "load Image"); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Jebton Load Button = New Pocket ("Display Image"); loadButton.addActionListener (new ActionListener () {@Override public void actionPerformed (ActionEvent e) {JFileChooser fc = new JFileChooser (System.getProperty ( "user.home")); if (fc.showOpenDialog (zero) == JFileChooser.APPROVE_OPTION ) {try {ShellFolder shell = ShellFolder.getShellFolder (FC .getSelectedFile ()); JOptionPane.showMessageDialog (zero, new ImageIcon (shell.getIcon (right)));} catch (FileNotFoundException ex) {ex.printStackTrace ();} }}}); Frame.add (loadButton); Frame.pack (); Frame.setLocationByPlatform (true); Frame.setVisible (true); } Public static void (String [] args) {SwingUtilities.invokeLater (new Runnable () {public void run () {try {UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ());} catch (Exception ex) {ex.printStackTrace ( );} Create and showIi ();}}}}}}    

Ruby - Splititng Array after getting data from Mysql -


मेरे पास रेस नियंत्रक में डाटा को लाने के लिए मेरा कोड है

  @ मेन = $ connection.execute ("SELECT * FROM builds WHERE platform_type नहीं है")   

यह एक mysql2 प्रकार ऑब्जेक्ट देता है जो मुझे लगता है कि एक सरणी की तरह व्यवहार करता है। < P> मैं इसे 2 सरणियों में विभाजित करना चाहता हूं, पहले एक जहां platform_type 'TOTAL' और बाकी सब कुछ अन्य सरणी में है।

यह वास्तव में एक वस्तु देता है बेशक आप कर सकते हैं

  योग = [] अन्य = [] मुख्य.ईच {| r | (R ['platform_type'] == 'TOTAL'? योग: अन्य) & lt; & lt; R}   

लेकिन क्यों नहीं smith की तरह के साथ एक रेल रास्ता का उपयोग करें:

  Builds.where ("platform_type =?", 'TOTAL') बनाता है जहां ("प्लेटफ़ॉर्म_प्रकार नहीं है?", [शून्य, 'TOTAL'])    

HTML table td display -


I have several HTML tables in which it has some Ruby code embedded it will look below:

  & Lt;% loop-1% & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Td rowspan = "X" & gt; ABCD & lt; / Td> & Lt; TD & gt; Xyz & lt; / TD & gt; & Lt; / TR & gt; & Lt;% loop-2% & gt; & Lt;% If (Condition)% & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; / TD & gt; & Lt; TD & gt; Xyz1 & lt; / TD & gt; & Lt; / TR & gt; & Lt;% end% & gt; & Lt;% end% & gt; & Lt; / Table & gt; & Lt;% end% & gt;   

So many tables are generated based on the loop-1, as shown above. Now each table will have at least one row after the first line, then another loop-2 and some position. For each table, the number of rows after the first line can be variable. I want the first time in the light (x) = number first. The total of the rows for that table.

For example. If after the first line, loop -2 generates 2 more rows, then I should have x = 3

< P> The only possible way you can not do this by using HTML is that how many event status befroe will be your loop. To wit. Before executing the same loop and increasing x each time the condition is found.

jQuery plugin how to add events? -


OK, so I'm new to the jQuery plugin game and I've read a lot and it just seems that the jQuery plugin There are 27 million ways to write For example, take this base plugin pattern:

 ; (Function ($, window) , document, undefined) {var pluginName = 'MyPlugin'; Var defaults = {propertyName: "value"} function plugin (element, option) {this.options = $ .extend ({}, default, options); _defaults = defaults; This._name = pluginName; This.element = element; This.init ();} Plugin.prototype = {init: function}} {/ some ion function}, some method: function (L, option) {// DO SOTHTHING}} $ .fn [pluginName] = function Option) {return.Each (function (! ($! $. Data (this, 'plugin_' + plugin name)) {$. Data (this ('plugin', plugin), 'plugin_' plugin name, new plugin (This, option); and if ($ .isfunction (plugin.protopp [options]) {$ .data (this, 'plugin_' + pluginname) [option] ();}}}}}}}) , Window, document);   

Then we have this simple HTML:

  & lt; a href = " In my plug, we say that we wanted to alert href when the link is clicked and the default action is taken in the link "gtc: mediawidth"   

Obviously this is actually a bad example and the path I want to do is more intense, so please do not say that 'you do not need a plugin for this' because it is not here.

Then we include our plug-ins on our link:

  $ (ten Document) .ready (function () {$ ( 'a'). Each (function () {$ (this) .MyPlugin ();});});   

I do not know if there is a way to add a click: method and simply it is called itself or can some kind of internal event be binding?

I will only add one click event to the init function, then this is cleaner

  Plugin.prototype = {init: function () {// DO INIT $ (this.element) .on ("click", function (e) {e.preventDefault (); warning ($ (this) .attr ("Href"));}); }, Some method: function (L, option) {// DO SOTHTHING ELSE}};   

Or,

You can put it only on a different method:

 ; (Function ($, window, document, undefined) {var pluginName = 'MyPlugin'; var defaults = {propertyName: "value"} function plugin (element, option) {this.options = $ .extend ({}, default, Option); this._defaults = defaults; this._name = pluginName; this.elename = element; this.init (); this.attachEvents (this.element, this.options);} Plugin.prototype = {init: function ( ) {// DO INIT}}, AttachEvents: function (L, Options) {$ (L) .on ("click", function (e) {e.preventDefault (); Alert ($ (this) .attr (" Href "))}};}} $ .fn [pluginName] = function (option) {return.Each (function () (if (! $. Data (this, 'plugin_' + plugin name)) {$. Data ( This, 'plugin_' + pluginname, new address (This, option); and if ($ .isfunction (plugin.protopp [option]) {$ .data (this, 'plugin_' + pluginname) [option] (option;);}});}}) (jquery , Window, document); $ (document) .ready (function () {$ ('a'). MyPlugin ();});    

json - Convert nested hash table recursively in Perl -


मेरे पास नेस्टेड हैश तालिका है, जैसे:

  {"a": { "B": {"c": {"d": "", "e": ""}, "m": ""}, "f": ""}, "h": {"i": और मैं इसे इस तरह प्रारूप में कनवर्ट करना चाहूंगा:  
  {"j": "", "k": ""}}}   

[{"शीर्षक": "ए", "आईफ़ोल्डर": सच है, "बच्चों": [{"शीर्षक": "बी", "आईफ़ोल्डर": सही "," बच्चों ": [{" शीर्षक ":" c " , "" "{" शीर्षक ":" ई "}]}, {" शीर्षक ":" मी "}}}, {" शीर्षक "" "" "," {Title} ":" i ", {" title ":" g "}}}, {" title ":" h "," isfolder ":" true "," children " "Isfolder": "true", "children": [{"title": "j"}, {"title": "k"}]}]}]

इसलिए मैं एक प्रोग्राम लिखा है:

  #! / Usr / bin / perl JSON का उपयोग करें; $ Json = JSON- & gt; नया- & gt; अनुमति_अनुक्रम; $ Struct = []; उप कन्वर्ट रौ () (($ कच्चा, $ ts) = @_; विदेशी मुद्रा (चाबियाँ% $ कच्चे) {यदि ($ कच्चे- & gt; {$ _}) {पुश @ $ ts, {"title" = & gt; $ _, "आइलफोल्डर" = & gt; "सच", "बच्चों" = & gt; []}; & Amp; कनवर्ट करें ($ कच्चे- & gt; {$ _}, @ $ ts [-1] - & gt; {"बच्चों"}); } और {पुश @ $ ts, {"title" = & gt; $ _}; }}} $ Raw_struct = {"a" = & gt; { "बी" = & gt; { "सी" = & gt; { "डी" = & gt; "", "ई" = & gt; ""}, "मी" = & gt; ""}, "F" = & gt; ""}, "एच" = & gt; { "मैं" = & gt; { "जे" = & gt; "", "कश्मीर" = & gt; ""}}}; & Amp; कनवर्ट करें ($ raw_struct, $ struct); प्रिंट $ json- & gt; सुंदर- & gt; सांकेतिक शब्दों में बदलना ($ struct)। "\ N";   

हालांकि, आउटपुट यह हो गया:

  [{"isFolder": "सच", "बच्चों": [{"आफ़ल" : "शीर्षक": "ए"}, "शीर्षक": "i"}]: "सच", "बच्चों": [{"शीर्षक": "के"}, {"शीर्षक": "j"}, {"शीर्षक": "a"}] , "शीर्षक": "एच"}]   

वाकई उलझन में है क्या आप समझ सकते हैं कि यहां समस्या क्या है?

आपने विश्वव्यापी घोषित चर $ raw और $ ts तो बच्चे के तत्व प्रसंस्करण के दौरान हैश अद्यतन माता पिता तत्वों के भविष्य के प्रसंस्करण को प्रभावित करेगा। : <पूर्व> उप कन्वर्ट रौ {मेरे ($ कच्चे, $ ts) = @_; # बाकी कोड

Bash script replace two fields in a text file using variables -


It should be a simple fix, but I can not wrap my head at this time.

There is a comma-delimited file named I my_course that contains a list of some information about them.

I need to get user input about the last two areas and change them accordingly.

Example:

  CSC3210   

, Computer Org & amp; Programming, 3.0, N / A CSC2010, Introduction to Computer Science, 3.0, N / A CSC1010, Computer & amp; Application 3,0, N / A

I get user input for 3 things: course number , position (0 or 1) , and Grade (A, B, C, N / A)

So far, I have tried to match the line which has a course number and the last two fields changed Used to be. I do not know how to modify the previous two areas by using SAL, so I am using this terrible disturbance and SAD:

  temporary = $ (awk -v status = $ status -v grade = $ grade 'BEGIN {FS = ","}; $ (NF) = "" $ (NF-1) = "" /' $ cNum '/ {printf $ 0 " "Status", "grade;} 'my_course) sed -i" s / csc $ cnum. * / $ Temp / g "my_course   

The issue is that I'm moving in here The numbers in the course title can be from 1 to 4 in the field so that Not only the first n fields can not simply print. I have tried to remove the last two areas and add new values ​​for the status and grade but it is not working for me.

Note: I have already checked to ensure that the user validates valid data

Use a simple encoded script:

  BEGIN {FS = "," OFS = FS} $ 0 ~ course {$ (NF-1) = position $ NF = Grade} {print}   

And on the CMD-line, set three parameters, different parameters like curriculum, position and grade.

In action:

  $ cat input CSC3210, computer ORG & amp; Programming, 3.0, N / A CSC2010, Introduction to Computer Science, 3.0, N / A CSC1010, Computer & amp; APPLICATIONS, 3.0, N / A $ AJK-vcourse = "CSC3210" -vstatus = "1" -Agread = "A" -f grade.com Input CSC 3210, Computer Org & amp; Programming, 3.1, a CSC-2010, Introduction to Computer Science, 3.0, N / A CSC 1010, Computer & amp; APPLICATIONS, 3.0, N / A $ AJK-vcourse = "CSC1010" -vstatus = "1" -Agread = "B" -F grade Input Input CSC 3210, Computer ORG & amp; Programming, 3.0, N / A CSC2010, Introduction to Computer Science, 3.0, N / A CSC1010, Computer & amp; APPLICATIONS, 3.1, b    

How to appy one javascript function to multiple textbox onfocus event in asp.net -


I have two JavaScript functions that change the background color and skip the events.

  function ColoronEnter () {var txt1 = document.getElementById ("& lt;% = txtID1.ClientID%>"); Txt1.style.backgroundColor = "red"; } ColoronLeave () {var txt2 = document.getElementById ("& lt;% = txtID1.ClientID%>"); Txt2.style.backgroundColor = ""; }   

I will

  & lt; Asp: textbox id = "txtID1" runat = "server" maxlength = "20" autocomplete = "first name" onfocus = "coloroncenter" onblur = "color lev ()" & gt; & Lt; / Asp: text box & gt;   

This is working well but I want to implement a javascript function in all my text boxes. I have tried

  to the function (_input) {var input = _input; Document.getElementById (input) .style.backgroundColor = "yellow"; } (_input) on the function {var input = _input; Document.getElementById (input) .style.backgroundColor = ""; }   

is trying to call them

  & asp: textbox id = "txtID2" runat = "server" onfocus = "onEnter (txtID2) ) "OnBlur =" onLeave (txtID2) "& gt; & Lt; / ASP: text box & gt; & Lt; ASP: text box id = "TCTID3" run = "server" onfocus = "onEnter (txtID3)" onblur = "onLeave (txtID3)" & gt; & Lt; / Asp: text box & gt;   

This is throwing the error as a Microsoft JScript Runtime error: Unable to fetch the value 'properties': Object is blank or undefined.

How can I call a function in all my text boxes thanks in advance.

Use

    

If you have no restrictions to use jQuery, then use the event to handle it.

ruby on rails - Convert HTML to word file ? -


Converting a Ruby file into a word file ie (docx file) for PDF, we have for Shrimp Mani but the word file GEMI I am trying to convert my HTML file to a word file so that it is editable for the user. What should I do in that case? I was planning to convert that file into a word file whether it would be possible or not

Using the rail:

In initializers / mime_types.rb:
  Mime :: type. Registrar 'app / vnd.ms-word' ,: msword   

In your controller:

You want to export the show action: < Pre> def show @item = item. Paragraph parameter [: id] answer_ what to do. Format | Format.html # show.html.erb format.xml {Render: xml = & gt; @item} format.msword {set_header ('msword', "#{@item.title}.doc")} format.pdf present: pdf = & gt; 'Coming soon ...', Layout = & gt; P_type <'[CacheControl'] ['Content-Dispos'] = "Attachment; File Name = \" # {'} 'as the' Xls' header ['content-WWW]] as DEF set_header (p_type, filename) Filename} \ "" type [type] "type '] =" app / vnd.ms-excel; Charset = UTF-8 '] [' content-type '] = "header / [vide.ms-word]; charset = UTF-8" header [' content-dispute '] = "attachment; filename = \" # {file Name} \ "header ['cache-control'] = '' end end

define a show now. Mmsword .rb # you use any template handler like hamb etc. .
  normal ERB template like normal HTML    

Using object of imported class as global variable of another class in Python -


I have participated in the following problem in Python. I suppose you have 3 files:

1 ) A.py (defines class A):

  class A: def a_method (self): print "global usage experiment" / code>  

2) B.py (defines class B which uses class A's global object method):

  class B: def b_method (self): print "a_method () Calling from ... "obj_a.a_method ()   

3) global_ex.py:

  import from obj_a Obj_b = B () obj_b.b_method ()   

When I run global_ex.py, I get an error:

  Error named: global name 'obj_a' is not defined   

If instead of importing another b.py, I copy them into global_ex.py I work.

What's the problem here? Generally, what is the best way to use an object's methods in an object?

Thanks in advance.

Edit:

Try:

  Import from a class B (): def __init __ (self): self.a_obj = A () DEF B_Maneth (self): Print "Calling A_the (B) B ..." self.a_obj.a_method ()   

or:

  square b (): def __init__ (self, a_inst): self.a_inst = a_inst def b_method (self): print "calling_a_dethod ) From B ... "self.a_inst.a_method ()    

python - How to implement a program that can sent email in linux with exchange server host(outbound.company.com) -


I want to implement the program which can send automatically emails at the given time of each and Make the effect similar to no-answer_mazon.com.
I have tried a lot of solutions, but none of these solutions work.
Who has given this experience, Please give me a solution
Thanks a lot!

  My Python Code & lt; Br> Import smtplib import from email.mime.multipart MIMEMultipart email.mime.text Import from MIMEText # you == recipient's email address me = "no- answer@companyname.com" you = "IDabc@company.com" # message Create Container - The Perfect Mime Type is Multipart / Optional Msg = MIMEMultipart ('Optional') msg ​​['Subject'] = "Link" msg [From '] = Message [' To '] = You Make Body of Message (A plain-text and an HTML version). Text = "Hello! \ NHow are you? \ NHere's the link you wanted: \ nhttp: //www.python.org" html = "" \ & lt; Html> gt; & Lt; Head & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; P & gt; Oh! & Lt; Br> How are you? & Lt; Br> Here & lt; A href = "http://www.python.org" & gt; Link & lt; / A & gt; You wanted & Lt; / P & gt; & Lt; / Body & gt; & Lt; / Html & gt; "#" # Type the two types of text - MIME type of text / plain and text / html Part1 = MIMEText (text, 'plain') part2 = MIMEText (html, 'html') # attach parts to message container # rfc According to 2046, the last part of the multipart message, in this case # HTML message, is the best and preferred Msg.attach (part1) msg.attach (part2) # Exchange saver Send messages via SMTP server. S = smtplib.SMTP ('outbound.companyname.com') # The dispatch function takes 3 arguments: the sender's address, the recipient's address # and the message to send - here it is sent as a string. S.sendmail (me, you, msg.as_string ()) s.quit ()    

< P> Create an Exchange SMTP connector that accepts angry logs from your Linux host and allows that host to relay. Then use that smtp ip / port from your Linux host.

android - Getting row id from database by clicking listview after deleting record -


I have created a database with 5 column ID, name, date, month and year, it is being fully prepared , I'm putting it in the list view. The problem now is that when I delete a record from the database I am unable to work on the correct line ID (to delete or edit it). Because the list view does not point to the database, only the wire shows in the list view.

Is there a way that I can get a record to remove even after I work on the right line ID?

>    

public arrestist & lt; String & gt; GetData () {string [] column = new string [] {KEY_ROWID, KEY_NAME, KEY_DATE, KEY_MONTH, KEY_YEAR}; Cursor c = db.query (DATABASE_TABLE, column, empty, empty, empty, empty, empty); String result = ""; Int iRow = c.getColumnIndex (KEY_ROWID); Int iName = c.getColumnIndex (KEY_NAME); Int iDate = c.getColumnIndex (KEY_DATE); Int iMonth = c.getColumnIndex (KEY_MONTH); Int iYear = c.getColumnIndex (KEY_YEAR); ArrayList & LT; String & gt; String_ar = new arreelist & lt; String & gt; (); (C.moveToFirst () ;; c.isAfterLast (); c.moveToNext ()) {Results = c.getString (iRow) + "" + c.getString (iName) + "\ t \ t" + c . GetString (iDate) + "\ t \ t" + c.getString (iMonth) + "\ t \ t" + c.getString (iYear) + "\ n"; String_array.add (results); } Return string_array; }

Call for the string array in the display activity

  ArrayList & lt; String & gt; Data = db.getData (); ArrayAdapter & LT; String & gt; ArrayAdapter = New Arrayheader & lt; String & gt; (This, android.R.layout.simple_list_item_1, data); Lv.setAdapter (arrayAdapter); Lv.setOnItemClickListener (this);   

After getting the line ID, the elements are removed before the database

  public getFROWID for long () {string [] column = New string [] {KEY_ROWID, KEY_NAME, KEY_DATE, KEY_MONTH, KEY_YEAR}; Cursor c = db.query (DATABASE_TABLE, column, empty, empty, empty, empty, empty); C.moveToFirst (); Int iRow = c.getColumnIndex (KEY_ROWID); ROWID = c.getString (iRow); Long value = tall. Parslong (ROIDID); return value; }   

After the record has been deleted, the function in the database class to get the first line ID

  @Override Public Boolean on ITemLongClick (adapterview & lt ;; & Gt; View list view, integer position, long ID) {IMPID = db.getFROWID () + ID; OpenContextMenu (lv); Back true; }   

Update using simple adapters

  from string [] = {BdayDatabase.KEY_NAME}; Int [] to = {R.id.item_name}; List & lt; Hashmap & lt; String, string & gt; & Gt; Listinfo = New Arrestist & lt; Hashmap & lt; String, string & gt; & Gt; (); Listinfo.clear (); Hashmap & lt; String, string & gt; Hm = new Hashmop & lt; String, string & gt; (); Hm.put ("name", BdayDatabase.KEY_NAME); Listinfo.add (hm); Simple Adapter Adapter = New Simple Adapter (this, LISTINFO, R.Ligh Out.it_layout, from, with); Lv.setAdapter (adapter);   

Thank you in advance

Why do not you list view Bind to database instead of creating an array list ???

In this way, you only need to tie the list visit to your primary key as _id and then when you click on a row, The long ID variable is the database that you clicked in the database

regex - Ruby regexp to match comma, but ignore comma in brackets -


I'm trying to divide the parameter list by regexp.

This is a string with my parameter list:

  "a = b, c = 3, d = [1,3,5,7], e, What do I want:  
  ["a = b", "c = 3", "d = [1,3, 5,7] "," E "," f = g "  

I tried with a lookhead, but Ruby does not allow to keep an eye on a dynamic range , So this will not work:

  / (? & Lt;! \ [], (?! \ W * \]) /   

How to Can I tell regexp to ignore everything in square brackets?

Maybe something like this will work for you:

  str.scan (/ (?: \ [ 

would be a simple non greedy matcher. Some cases of nested brackets Failed.

ruby - Custom Indentation Type for SASS Output -


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

  • 2 जवाब

    मेरी टीम एक के साथ काम कर रही है विक्रेता जो 4-स्पेस हार्ड टैब को 2-स्पेस नरम टैब पर पसंद करता है जो एसएएसएस की विस्तारित आउटपुट शैली के साथ आता है (मुझे पता है, मुझे पता है - हमने उनसे दो स्पेस सौदा में बात करने की कोशिश की, लेकिन वे हिलना नहीं चाहते थे) । हम अपने सभी संकलन को संभालने के लिए उपयोग करते हैं, इसलिए हमारे पास एसएएस-कन्वर्ट कमान के लिए सतह-स्तरीय पहुंच नहीं है जो आपको संकलन के दौरान इंडेंट-स्टाइल सेट करने देता है।

    मैं सक्षम होने से परिचित हूं SASS के लिए 4 अलग आउटपुट शैलियों को बदलने के लिए, और मुझे पता है कि आप अपने स्थानीय पर्यावरण जैसे टैब शैली को बदल सकते हैं, लेकिन मैं सोच रहा था कि क्या यह config.rb फ़ाइल के माध्यम से स्वचालित रूप से करने का एक तरीका है जहां हम आउटपुट सेट करते हैं शैली के साथ शुरू करने के लिए।

    "4-स्पेस हार्ड टैब" जैसी कोई चीज नहीं है एक हार्ड टैब सिर्फ एक कैरेक्टर है।

    यह एडिटर सेटिंग्स है जो तय करता है कि एक टैब कैसे प्रदर्शित किया जाना चाहिए। आप इसे दो, चार, आठ स्थान की चौड़ाई के लिए सेट कर सकते हैं, और यह स्रोत कोड को नहीं बदलेगा।

    मामला यह है कि SASS इंडेंटेशन के लिए समर्थन टैब का समर्थन करता है , एक के साथ टैब जिसका अर्थ इंडेंटेशन का एक स्तर है इसलिए आपके लिए कोई समस्या नहीं होनी चाहिए।

    यदि आप सीएसएस फाइलों के इंडेंटेशन के बारे में बात कर रहे हैं, तो मुझे सच में नहीं समझ में आ रहा है कि आपकी टीम के लिए ऐसा क्यों महत्व है। यदि आप SASS का उपयोग कर रहे हैं, तो सीएसएस फ़ाइलों को संपादित नहीं करना है और शायद ही कभी कभी खोला जाता है (सबसे डिबगिंग डेवलपर टूल्स जैसे फायरबग में होती है, क्या आप जानते हैं?)। उत्पादन में सीएसएस छोटा है और सभी सफ़ेद स्थान शुद्ध हैं।

    एक कार्य धावक उपकरण जैसे कि अपनाने पर विचार करें। आप विकास रूटलाइन चक्र के कुछ चरणों में सीएसएस फ़ाइलों को प्राप्त करने के लिए इसका लाभ उठा सकते हैं। यदि आप इस तरह से जाते हैं तो आप शानदार उपकरण का भी उपयोग कर सकते हैं।

    पीएस दो स्थान रूबी समुदाय के लिए मानक इंडेंटेन्ट है, जो कि SASS का मुख्य भाग है। आप टीम की तरह ज्वार को उकसाना चाहते हैं।

c - Is this the correct explanation for this output of this program? -


  # शामिल हैं & lt; stdio.h & gt; Int main () {struct परीक्षण {char c; Int y; फ्लोट आर; डबल डी; } टी 1; printf ( "% d \ n", sizeof (t1)); वापसी 0; }   

आउटपुट: 24 पर मेरे जीसीसी 4.3.2 उबंटू 12.04

आउटपुट: 20 आइडियान पर

मेरा स्पष्टीकरण: मुझे लगता है 24 सही है मुझे सही है अगर मैं गलत हूँ?

  1. पहला हिस्सा चार 'सी' द्वारा लिया जाएगा 1 बाइट पैडिंग के 3 बाइट के बाद खुद के लिए।
  2. दूसरा हिस्सा पूर्णांक 'वाई' द्वारा लिया जाएगा (इस मामले में कोई पैडिंग आवश्यक नहीं है क्योंकि पूर्णांक 4 बाइट की है, इसलिए यह पूरी तरह से भर जाएगा)।
  3. तीसरा हिस्सा फ्लोट 'आर' द्वारा लिया जाएगा (फ्लैप के रूप में आवश्यक कोई पैडिंग 4 बाइट्स की भी नहीं है)।
  4. अब अगले 4 बाइट्स का टुकड़ा गड़बड़ा जाएगा क्योंकि अगले दोहरे और भंडारण पते को उस डेटा प्रकार के आकार के एक से अधिक होना चाहिए।
  5. और प्रत्येक 4 बाइट्स के अगले 2 भाग को डबल वैरिएबल पर कब्जा कर लिया जाएगा।

    इस प्रकार Size = 1 (char) + 3 (चार मामले में पैड ) + 4 (इंट) + 4 (फ्लोट) + 4 (डबल के लिए गद्दे) + 8 (डबल) = 24

    स्पष्टता के लिए:

    चूंकि खंड 4 बाइट संग्रह में लिया जाता है। इसलिए हर पता 4 से अधिक हो जाएगा। डबल के लिए, अगला पता 1012 होना चाहिए। लेकिन यह 8 का बहुवचन नहीं है। तो यह पैड! और 1016 से शुरू करें स्मृति लेआउट मेरा प्रश्न - 24 सही है और मेरा स्पष्टीकरण सही है या मेरी व्याख्या गलत है अन्य कृपया समझाने के लिए?

    आपका स्पष्टीकरण इस प्रकार सही है कि विशिष्ट संकलक एक उस संरचना के लिए एक विशिष्ट लेआउट के साथ बाइनरी अगर आपने सही ढंग से आउटपुट की भविष्यवाणी की है, तो आपकी भविष्यवाणी निश्चित रूप से सही है इस विशेष समय पर आपके विशिष्ट सेटअप के लिए

    लेकिन संरचना का आकार, किसी भी तरह से नहीं है , सख्ती से सी में परिभाषित किया गया है। इस विषय में परिभाषित होने वाली केवल एक चीज संरचना सदस्यों का क्रम है और पहले सदस्य की ऑफसेट है। पैडिंग और, इसलिए, स्ट्रैट का कुल आकार अनिर्धारित है और इसे कंपाइलर के लिए एक निर्णय के रूप में छोड़ दिया गया है। जाहिर है, मुख्य कारण एक संकलक संरचना पैड होगा अपने व्यक्तिगत प्रकार (जैसा कि आपने ठीक से नोट किया था) के आधार पर सदस्यों के उचित संरेखण के माध्यम से उच्च प्रदर्शन। लेकिन (और यह यहां महत्वपूर्ण है) संकलक लक्ष्य आर्किटेक्चर के आधार पर सबसे कुशल पैडिंग चुनता है। यदि किसी आर्किटेक्चर की 128-बिट इंट है, उदाहरण के लिए, आप कल्पना कर सकते हैं कि आपके स्ट्रैट का आकार अलग-अलग कैसे होगा।

    तो, यदि यह सी भाषा के परिभाषित पहलुओं की बात आती है (या आपने जो वर्णित किया है उसके अलावा कोई अन्य सेटअप) आपकी भविष्यवाणी बेकार होगी यह स्वाभाविक रूप से कुछ सेट अप मैच करता है, लेकिन केवल दुर्घटना से।

Perl: Compare Two CSV Files and Print out differences -


I'm a Noah in Perl and I have a hard time doing this. I have two single-columned CSV files, and I am trying to print the difference in one-third file.

  File 1: 123 124 125 126 File 2: 123 124 127 Expected Output: 125 126 127   

This is what I have so far received, which Not working:

  #! Use / usr / bin / perl strict; Use warnings; My $ sheet; My $ letter_2; My $ count1 = 0; My $ count2 = 0; My $ file1 = 'file1.csv'; My $ file2 = 'file2.csv'; My $ file_out = 'output.csv'; Open (FILE1, "$ file1") or die "Input file can not be opened: $!"; Open (FILE2, "<$ file2") or dead "Input file can not be opened: $!"; While (& lt; FILE1 & gt;) {chomp; $ Count1 ++; # Skip headers; Until next $ count1; My $ row_1; @ $ Row_1 = partition (/, /, $ _); Push @ $ letter1, $ row_1; } @ $ Sheet_1 = Sort {$ a- & gt; [0] & lt; = & Gt; $ B- & gt; [0]} @ $ sheet; While (& lt; FILE2 & gt;) {chomp; $ COUNT2 ++; # Skip headers; Until next $ count2; My $ row_2; @ $ Row_2 = Partition (/, /, $ _); Push @ $ letter_2, $ line_2; } @ $ Sheet_2 = Sort {$ a- & gt; [0] & lt; = & Gt; $ B- & gt; [0]} @ $ letter_2; OUTER: {foreach my $ row_1 (@ $ sheet_1) {foreach my $ row_2 (@ $ sheet_2) {if (@ $ row_1 [0] eq @ $ row_2 [0]) {last OUTER} other {print "@ $ row_1 [0] \ n "; }}}} Closed FILE1; Close FILE2;    

You can use the Pearl module to do this. Otherwise, see below:

Here's an algorithm to compare.

  Use strict; My @ arr1; My @ arr2; My $ a; Open (FIL, "a.txt") or die ("$!"); While (& lt; FIL & gt;) {chomp; $ One = $ _; $ A = ~ s / [\ t;,] * // g; Push @ arr1, $ a if ($ a ne '');}; Close (fil); Open (FIL, "B.text") or die ("$!"); While (& lt; FIL & gt;) {chomp; $ One = $ _; $ A = ~ s / [\ t;,] * // g; Push @ arr2, $ a if ($ a ne '');}; Close (fil); My% arr1hash; My% arr2hash; My @dirfer; Forex Currency (@ AR1) {$ arr1hash {$ _} = 1; } Foreach (@ arr2) {$ arr2hash {$ _} = 1; } Foreach $ a (@ arr1) {If (not defined ($ arr2hash {$ a})) {push @diffarr, $ a; }} Foreach $ a (@ arr2) {If (not defined ($ arr1hash {$ a})) {push @diffarr, $ a; }} Print "Def: \ n"; Foreign currency $ a (@df) {print "$ a \ n"; } # You can print a file instead of: print FIL "$ a \ n";    

How to get rid of PHP Notice: Undefined index: HTTPS in X on line 123 -


I just found out that I have thousands of errors, coming from two files.

I've removed many errors using the isset , but I can not understand how to remove the last two errors. Maybe you guys can help me.

  PHP Notice: The first PHP file from the code HTTPS   

at line 123 on / 123x / xxx / xxx.php which generates errors :

  function curPageURL () {$ pageURL = 'http'; If ($ _SERVER ["HTTPS"] == "on") {$ pageURL} = "S";} $ pageURL. = ": //"; If ($ _SERVER ["SERVER_PORT"]! = "80") {$ pageURL = $ _SERVER ["SERVER_NAME"] ":". $ _ SERVER ["SERVER_PORT"]. $ _ Server ["REQUEST_URI"]; } And {$ pageURL = $ _SERVER ["SERVER_NAME"] $ _ Server ["REQUEST_URI"]; } $ PageURL; }   

more accurate this line:

  if $$ ($ {_SERVER ["HTTPS"] == "on") {$ pageURL} = "S";}   

and

  if (isset ($ tag)) {$ tag = htmlspecialchars ($ _ request ['tag'] , ENT_QUOTES); }    

You can change:

  ($ _SERVER ["HTTPS"] == "ON") {$ pageURL} = ("HTTPS ', $ _SERVER) and $ _SERVER [" HTTPS "] == "at") {$ pageURL} = "S";}   

gives a bullion as I see it first and & amp; Amp; If the statement exits before checking the value of $ _SERVER ["HTTPS"], then it does not exist.

I want to open a text file and edit a specific line in java -


This is a code written instead of editing a particular line. I ....

  PrintWriter author = new print-वाटर (new buffet वाटर (new flamerer ("D: \\ book.txt", true))); Buffettarder BRL = Faucet; FileReader Reader = Faucet; Try {Reader = new FileReader ("d: \\ book.txt"); Br = new buffated reader (reader); String line; System.out.println ((";;;;;;;;;;;;;;;;;;;;; 0; ll .getparameter (" hname ")); Println (request.getParameter ( "Book"); while ((line = breadline ())! = Null () (if (request.getParameter ("hname"). Par (line)) {line = line.replace (request.getParameter ("hname" "GetParameter" ("book"); writer.println (line); writer.close ();}}} hold (FileNotFoundException e) {e.printStackTrace ();} Finally {reader.close () ;}    

Unless you are changing the length (byte) of the line, Then you should rewrite the whole file, where the changed line must be added. It's just a simple change from the current code. First, start your FileWriter without app (because you do not ) just append it to the end of the file

  Print-Author Writer = New Print-Authors (New Buffed Vector (New Flemer ("D: \\ book.txt") After that, read the whole file in memory (if the file is too small) or you write a temporary file as you go And then copy it if you work. The second method is more robust, and requires less code replacement; Just modify the loop of your time so that every line can be modified or not. Open a temporary file to write  
  //. Printwriter author = new print-viter (new buffed viter (new flamer ("D: \\ book.temp"))); // ... then inside your loop ... while ((line = br.readline ()) = null {} (request.getParameter ("hname"). Par (line)) {line = line.replace (Request.getParameter ("hname"), request.getParameter ("book")); } // Always write the line, whether you have changed it or not author.println (line); } // ... and finally ... file real name = new file ("d: \\ book.txt"); RealName.delete (); // Delete the old file new file ("D: \\ book.temp") .name (real name); // Rename Temporary File   

Do not forget to close all your files when you do!