Search Results

Search found 50 results on 2 pages for 'sq'.

Page 1/2 | 1 2  | Next Page >

  • In C# VS2008 how to replace new SqlParameter("@values", SqlDbType.SomeType, 1500)) to ("@values", Sq

    - by CodeYun
    In C# VS2008 how to replace new SqlParameter("@Description", SqlDbType.NChar, 1500) or new SqlParameter("@IsRequired", SqlDbType.Bit) to "@Description", SqlDbType.NChar, 1500 or "@IsRequired", SqlDbType.B the idea is to remove new SqlParameter() and leave the parameters inside it. I have thounds of lines code have this pattern. I just want to pass compile by using some regular expression.

    Read the article

  • Mysql query question

    - by brux
    I have 2 tables: Customer: customerid - int, pri-key,auto fname - varchar sname -varchar housenum - varchar street -varchar Items: itemid - int,pri-key,auto type - varchar collectiondate - date releasedate - date customerid - int I need a query which will get me all items that have a releasedate 3 days prior to (and including) the current date. i.e The query should return customerid,fname,sname,street,housenum,type,releasedate for all items which have releasedate within (and including)3 days prior today thanks in advance

    Read the article

  • R: Cut and labels/breaks length conflict

    - by AkselO
    I am working with the cut function to prep data for a barplot histogram but keep running into a seeming inconsistency between my labels and breaks: Error in cut.default(sample(1:1e+05, 500, T), breaks = sq, labels = sprintf("$%.0f", : labels/breaks length conflict Here is an example. I pretend that it is income data, using a sequence of 0 to $100,000 in bins of $10,000. I use the same variable to generate both breaks and labels, with minor formating on the label side. I thought they might for some reason have different lengths when comparing to a character vector, but they appear to have the same length, still. > sq<-seq(0,100000,10000) > cut(sample(1:100000, 500, T),breaks=sq,labels=sprintf("$%.0f",sq)) > length(sprintf("$%.0f",sq)) [1] [11] > length(sq) [1] [11]

    Read the article

  • Choosing randomly all the elements in the the list just once

    - by Dalek
    How is it possible to randomly choose a number from a list with n elements, n time without picking the same element of the list twice. I wrote a code to choose the sequence number of the elements in the list but it is slow: >>>redshift=np.array([0.92,0.17,0.51,1.33,....,0.41,0.82]) >>>redshift.shape (1225,) exclude=[] k=0 ng=1225 while (k < ng): flag1=0 sq=random.randint(0, ng) while (flag1<1): if sq in exclude: flag1=1 sq=random.randint(0, ng) else: print sq exclude.append(sq) flag1=0 z=redshift[sq] k+=1 It doesn't choose all the sequence number of elements in the list.

    Read the article

  • SS Group, The Coralwood, Sector 84, call 09128272424 booking query?

    - by user64521
    The creators of landmark projects like Southend, The Palladians. Delight & Splendours, The Lilac, Aaron Ville, SS Plaza and The Hibiscus now present yet another lifestyle defining choice of affordable homes in New Gurgaon that is called "The Coralwood". BOOK YOUR HOME ON FIRST RATE 2 BHK + Modular Kitchen—1320 sq ft 3 BHK + Modular Kitchen—1570 sq ft 3 BHK + Modular Kitchen—1820 sq ft rate:- 3250 bsp Gurgaon » NH-8 Call me: 09128272424

    Read the article

  • Precision of cos(atan2(y,x)) versus using complex <double>, C++

    - by Ivan
    Hi all, I'm writing some coordinate transformations (more specifically the Joukoswky Transform, Wikipedia Joukowsky Transform), and I'm interested in performance, but of course precision. I'm trying to do the coordinate transformations in two ways: 1) Calculating the real and complex parts in separate, using double precision, as below: double r2 = chi.x*chi.x + chi.y*chi.y; //double sq = pow(r2,-0.5*n) + pow(r2,0.5*n); //slow!!! double sq = sqrt(r2); //way faster! double co = cos(atan2(chi.y,chi.x)); double si = sin(atan2(chi.y,chi.x)); Z.x = 0.5*(co*sq + co/sq); Z.y = 0.5*si*sq; where chi and Z are simple structures with double x and y as members. 2) Using complex : Z = 0.5 * (chi + (1.0 / chi)); Where Z and chi are complex . There interesting part is that indeed the case 1) is faster (about 20%), but the precision is bad, giving error in the third decimal number after the comma after the inverse transform, while the complex gives back the exact number. So, the problem is on the cos(atan2), sin(atan2)? But if it is, how the complex handles that? Thanks!

    Read the article

  • what's the way to determine if an Int a perfect square in Haskell?

    - by valya
    I need a simple function is_square :: Int -> Bool which determines if an Int N a perfect square (is there an integer x such that x*x = N). Of course I can just write something like is_square n = sq * sq == n where sq = floor $ sqrt $ (fromIntegral n::Double) but it looks terrible! Maybe there is a common simple way to implement such predicate?

    Read the article

  • MYSQL, Subquery Reference in Union

    - by christian
    Is there any way to reference a subquery in a union? I am trying to do something like the following, and would like to avoid a temporary table, but the subquery will be drawn from a much larger dataset so it makes sense to only do it once.. SELECT * FROM (SELECT * FROM ads WHERE state='FL' AND city='Maitland' AND page='home' ORDER BY RAND()) AS sq WHERE spot = 'full-banner' LIMIT 1 UNION SELECT * FROM sq WHERE spot = 'leaderboard' LIMIT 1 UNION SELECT * FROM sq WHERE spot = 'rectangle1' LIMIT 1 UNION SELECT * FROM sq WHERE spot = 'rectangle2' LIMIT 1 .... etc,, It's a shame that DISTINCT can't be specified for a single column of a result set.

    Read the article

  • Scala type inference failure on "? extends" in Java code

    - by oxbow_lakes
    I have the following simple Java code: package testj; import java.util.*; public class Query<T> { private static List<Object> l = Arrays.<Object>asList(1, "Hello", 3.0); private final Class<? extends T> clazz; public static Query<Object> newQuery() { return new Query<Object>(Object.class); } public Query(Class<? extends T> clazz) { this.clazz = clazz; } public <S extends T> Query<S> refine(Class<? extends S> clazz) { return new Query<S>(clazz); } public List<T> run() { List<T> r = new LinkedList<T>(); for (Object o : l) { if (clazz.isInstance(o)) r.add(clazz.cast(o)); } return r; } } I can call this from Java as follows: Query<String> sq = Query.newQuery().refine(String.class); //NOTE NO <String> But if I try and do the same from Scala: val sq = Query.newQuery().refine(classOf[String]) I get the following error: error: type mismatch found :lang.this.class[scala.this.Predef.String] required: lang.this.class[?0] forSome{ type ?0 <: ? } val sq = Query.newQuery().refine(classOf[String]) This is only fixed by the insertion of the correct type parameter! val sq = Query.newQuery().refine[String](classOf[String]) Why can't scala infer this from my argument? Note I am using Scala 2.7

    Read the article

  • Reading escape characters with XMLStreamReader

    - by Roman
    Hi I have a problem reading escape characters inside an xml using. javax.xml.stream.XMLStreamReader for instance I have that tag : <imageURL_large>http://image.shopzilla.com/resize?sq=400&amp;uid=1809235620</imageURL_large> and when I read the value it is read like that : http://image.shopzilla.com/resize?sq=400 Any ideas how that could be fixed ?

    Read the article

  • LinqtoSql Pre-compile Query problem with Count() on a group by

    - by Joe Pitz
    Have a LinqtoSql query that I now want to precompile. var unorderedc = from insp in sq.Inspections where insp.TestTimeStamp > dStartTime && insp.TestTimeStamp < dEndTime && insp.Model == "EP" && insp.TestResults != "P" group insp by new { insp.TestResults, insp.FailStep } into grp select new { FailedCount = (grp.Key.TestResults == "F" ? grp.Count() : 0), CancelCount = (grp.Key.TestResults == "C" ? grp.Count() : 0), grp.Key.TestResults, grp.Key.FailStep, PercentFailed = Convert.ToDecimal(1.0 * grp.Count() / tcount * 100) }; I have created this delegate: public static readonly Funct<SQLDataDataContext, int, string, string, DateTime, DateTime, IQueryable<CalcFailedTestResult>> GetInspData = CompiledQuery.Compile((SQLDataDataContext sq, int tcount, string strModel, string strTest, DateTime dStartTime, DateTime dEndTime, IQueryable<CalcFailedTestResult> CalcFailed) => from insp in sq.Inspections where insp.TestTimeStamp > dStartTime && insp.TestTimeStamp < dEndTime && insp.Model == strModel && insp.TestResults != strTest group insp by new { insp.TestResults, insp.FailStep } into grp select new { FailedCount = (grp.Key.TestResults == "F" ? grp.Count() : 0), CancelCount = (grp.Key.TestResults == "C" ? grp.Count() : 0), grp.Key.TestResults, grp.Key.FailStep, PercentFailed = Convert.ToDecimal(1.0 * grp.Count() / tcount * 100) }); The syntax error is on the CompileQuery.Compile() statement It appears to be related to the use of the select new {} syntax. In other pre-compiled queries I have written I have had to just use the select projection by it self. In this case I need to perform the grp.count() and the immediate if logic. I have searched SO and other references but cannot find the answer.

    Read the article

  • Building a network at home, what cables to use (if any)?

    - by Faruz
    My house is currently in ruins and am building it. While doing so, I wanted to design a home network. My main objectives are surfing and HD streaming. The house is one-level, 100 sq/m (about 300 sq/ft), and one of the rooms is a safety room with Reinforced concrete walls. About a year ago, when I started planning, I thought about putting Cat 6 STP cables in the walls and create network points in the rooms. Should I use STP or FTP? I heard that STP is a problem regarding connectors and stuff. Is it really beneficial? Will it work OK if I transfer the wire together with the telephone line? Should I maybe go with WLan and count on 802.11n to enable me to stream HD across the house? is 802.11n that good?

    Read the article

  • System.Data.SqlClient.SqlException: Must declare the scalar variable "@"

    - by Owala Wilson
    Haloo everyone...I am new to asp.net and I have been trying to query one table, and if the value returns true execute another query. here is my code: protected void Button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyServer"].ConnectionString); SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["MyServer"].ConnectionString); int amounts = Convert.ToInt32(InstallmentPaidBox.Text) + Convert.ToInt32(InterestPaid.Text) + Convert.ToInt32(PenaltyPaid.Text); int loans = Convert.ToInt32(PrincipalPaid.Text) + Convert.ToInt32(InterestPaid.Text); con.Open(); DateTime date = Convert.ToDateTime(DateOfProcessing.Text); int month1 = Convert.ToInt32(date.Month); int year1 = Convert.ToInt32(date.Year); SqlCommand a = new SqlCommand("Select Date,max(Amount)as Amount from Minimum_Amount group by Date",con); SqlDataReader sq = a.ExecuteReader(); while (sq.Read()) { DateTime date2 = Convert.ToDateTime(sq["Date"]); int month2 = Convert.ToInt32(date2.Month); int year2 = Convert.ToInt32(date2.Year); if (month1 == month2 && year1 == year2) { int amount = Convert.ToInt32(sq["Amount"]); string scrip = "<script>alert('Data Successfully Added')</script>"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Added", scrip); int areas = amount - Convert.ToInt32(InstallmentPaidBox.Text); int forwarded = Convert.ToInt32(BalanceBroughtTextBox.Text) + Convert.ToInt32(InstallmentPaidBox.Text); if (firsttime.Checked) { int balance = areas + Convert.ToInt32(PenaltyDue.Text) + Convert.ToInt32(InterestDue.Text); SqlCommand cmd = new SqlCommand("insert into Cash_Position(Member_No,Welfare_Amount, BFWD,Amount,Installment_Paid,Loan_Repayment,Principal_Payment,Interest_Paid,Interest_Due,Loan_Balance,Penalty_Paid,Penalty_Due,Installment_Arrears,CFWD,Balance_Due,Date_Prepared,Prepared_By) values(@a,@b,@c,@d,@e,@)f,@g,@h,@i,@j,@k,@l,@m,@n,@o,@p,@q", con); cmd.Parameters.Add("@a", SqlDbType.Int).Value = MemberNumberTextBox.Text; cmd.Parameters.Add("@b", SqlDbType.Int).Value = WelfareAmount.Text; cmd.Parameters.Add("@c", SqlDbType.Int).Value = BalanceBroughtTextBox.Text; cmd.Parameters.Add("@d", SqlDbType.Int).Value = amounts; cmd.Parameters.Add("@e", SqlDbType.Int).Value = InstallmentPaidBox.Text; cmd.Parameters.Add("@f", SqlDbType.Int).Value = loans; cmd.Parameters.Add("@g", SqlDbType.Int).Value = PrincipalPaid.Text; cmd.Parameters.Add("@h", SqlDbType.Int).Value = InterestDue.Text; cmd.Parameters.Add("@i", SqlDbType.Int).Value = InterestDue.Text; cmd.Parameters.Add("@j", SqlDbType.Int).Value = 0; cmd.Parameters.Add("@k", SqlDbType.Int).Value = PenaltyPaid.Text; cmd.Parameters.Add("@l", SqlDbType.Int).Value = PenaltyDue.Text; cmd.Parameters.Add("@m", SqlDbType.Int).Value = areas; cmd.Parameters.Add("@n", SqlDbType.Int).Value = forwarded; cmd.Parameters.Add("@o", SqlDbType.Int).Value = balance; cmd.Parameters.Add("@p", SqlDbType.Date).Value = date; cmd.Parameters.Add("@q", SqlDbType.Text).Value = PreparedBy.Text; int rows = cmd.ExecuteNonQuery(); con.Close();

    Read the article

  • How to code an ALL option into a Combo Box

    - by Edmond
    I have a combo box on my form with the choice of choosing organization 10, 20, 30.... I have added ALL to the combo list box, but am having trouble implementing an all statement in VBA. Below is the case statement I have to get info from organizations 10, 20, 30. How do I get ALL to generate?? Case Is = 1 If cboOrg.ListIndex < 0 Then Call msg("Please select your organization!") Exit Sub End If sQ = sQ & " CC LIKE '" & cboOrg.Value & "*'" ORGCC = Trim(cboOrg.Value)

    Read the article

  • Oracle - correlated subquery problems

    - by FrustratedWithFormsDesigner
    I have this query: select acc_num from (select distinct ac_outer.acc_num, ac_outer.owner from ac_tab ac_outer where (ac_outer.owner = '1234567') and ac_outer.owner = (select sq.owner from (select a1.owner from ac_tab a1 where a1.acc_num = ac_outer.acc_num order by a1.a_date desc, a1.b_date desc, a1.c_date desc) sq where rownum = 1) order by dbms_random.value()) subq order by acc_num; The idea is to get all acc_nums (not a primary key) from ac_tab, that have an owner of 1234567. Since an acc_num in ac_tab could have changed owners over time, I am trying to use the inner correlated subqueries to ensure that an acc_num is returned ONLY if it's most recent owner is 12345678. Naturally, it doesn't work (or I wouldn't be posting here ;) ) Oracle gives me an error: ORA-000904 ac_outer.acc_num is an invalid identifier. I thought that ac_outer should be visible to the correlated subqueries, but for some reason it's not. Is there a way to fix the query, or do I have to resort to PL/SQL to solve this? (Oracle verison is 10g)

    Read the article

  • More useful Sql Server Serivce Broker Queries

    - by ChrisD
    SELECT 'Checking Broker Service Status...' IF (select Top 1 is_broker_enabled from sys.databases where name = 'NWMESSAGE')=1     SELECT ' Broker Service IS Enabled'  -- Should return a 1. ELSE     SELECT '** Broker Service IS DISABLED ***' /* If Is_Broker_enabled returns 0, uncomment and run this code ALTER DATABASE NWMESSAGE SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO Alter Database NWMESSAGE Set enable_broker GO ALTER DATABASE NWDataChannel SET MULTI_USER GO */ SELECT 'Checking For Disabled Queues....' -- ensure the queues are enabled --  0 indicates the queue is disabled. Select '** Receive Queue Disabled: '+name from sys.service_queues where is_receive_enabled = 0 --select [name], is_receive_enabled from sys.service_queues; /*If the queue is disabled, to enable it alter queue QUEUENAME with status=on; – replace QUEUENAME with the name of your queue */ -- Get General information about the queues --select * from sys.service_queues -- Get the message counts in each queue SELECT 'Checking Message Count for each Queue...' select q.name, p.rows from sys.objects as o join sys.partitions as p on p.object_id = o.object_id join sys.objects as q on o.parent_object_id = q.object_id join sys.service_queues sq on sq.name = q.name where p.index_id = 1 -- Ensure all the queue activiation sprocs are present SELECT 'Checking for Activation Stored Procedures....' SELECT  '** Missing Procedure:  '+q.name  From sys.service_queues q Where NOT Exists(Select * from sysobjects where xtype='p' and name='activation_'+q.name) and q.activation_procedure is not null DECLARE @sprocs Table (Name Varchar(2000)) Insert into @sprocs Values ('Echo') Insert into @sprocs Values ('HTTP_POST') Insert into @sprocs Values ('InitializeRecipients') Insert into @sprocs Values ('sp_EnableRecipient') Insert into @sprocs Values ('sp_ProcessReceivedMessage') Insert into @sprocs Values ('sp_SendXmlMessage') SELECT 'Checking for required stored procedures...' SELECT  '** Missing Procedure:  '+s.name  From @sprocs s Where NOT Exists(Select * from sysobjects where xtype='p' and name=s.name) GO -- Check the services Select 'Checking Recipient Message Services...' Select '** Missing Message Service:' + r.RecipientName +'MessageService' From Recipient r Where not exists (Select * from sys.services s where  s.name  COLLATE SQL_Latin1_General_CP1_CI_AS= r.RecipientName+'MessageService') DECLARE @svcs Table (Name Varchar(2000)) Insert into @svcs Values ('XmlMessageSendingService') SELECT  '** Missing Service:  '+s.name  From @svcs s Where NOT Exists(Select * from sys.services where name=s.name COLLATE SQL_Latin1_General_CP1_CI_AS) GO /*** To Test a message send Run: sp_SendXmlMessage  'TSQLTEST', 'CommerceEngine','<Root><Text>Test</Text></Root>' */ Select CAST(message_body as XML) as xml, * From XmlMessageSendingQueue /*** clean out all queues declare @handle uniqueidentifier declare conv cursor for   select conversation_handle from sys.conversation_endpoints open conv fetch next from conv into @handle while @@FETCH_STATUS = 0 Begin    END Conversation @handle with cleanup    fetch next from conv into @handle End close conv deallocate conv ***********************

    Read the article

  • How to generate a random unique string with more than 2^30 combination. I also wanted to reverse the process. Is this possible?

    - by Yusuf S
    I have a string which contains 3 elements: a 3 digit code (example: SIN, ABD, SMS, etc) a 1 digit code type (example: 1, 2, 3, etc) a 3 digit number (example: 500, 123, 345) Example string: SIN1500, ABD2123, SMS3345, etc.. I wanted to generate a UNIQUE 10 digit alphanumeric and case sensitive string (only 0-9/a-z/A-Z is allowed), with more than 2^30 (about 1 billion) unique combination per string supplied. The generated code must have a particular algorithm so that I can reverse the process. For example: public static void main(String[] args) { String test = "ABD2123"; String result = generateData(test); System.out.println(generateOutput(test)); //for example, the output of this is: 1jS8g4GDn0 System.out.println(generateOutput(result)); //the output of this will be ABD2123 (the original string supplied) } What I wanted to ask is is there any ideas/examples/libraries in java that can do this? Or at least any hint on what keyword should I put on Google? I tried googling using the keyword java checksum, rng, security, random number, etc and also tried looking at some random number solution (java SecureRandom, xorshift RNG, java.util.zip's checksum, etc) but I can't seem to find one? Thanks! EDIT: My use case for this program is to generate some kind of unique voucher number to be used by specific customers. The string supplied will contains 3 digit code for company ID, 1 digit code for voucher type, and a 3 digit number for the voucher nominal. I also tried adding 3 random alphanumeric (so the final digit is 7 + 3 digit = 10 digit). This is what I've done so far, but the result is not very good (only about 100 thousand combination): public static String in ="somerandomstrings"; public static String out="someotherrandomstrings"; public static String encrypt(String kata) throws Exception { String result=""; String ina=in; String outa=out; Random ran = new Random(); Integer modulus=in.length(); Integer offset= ((Integer.parseInt(Utils.convertDateToString(new Date(), "SS")))+ran.nextInt(60))/2%modulus; result=ina.substring(offset, offset+1); ina=ina+ina; ina=ina.substring(offset, offset+modulus); result=result+translate(kata, ina, outa); return result; } EDIT: I'm sorry I forgot to put the "translate" function : public static String translate(String kata,String seq1, String seq2){ String result=""; if(kata!=null&seq1!=null&seq2!=null){ String[] a=kata.split(""); for (int j = 1; j < a.length; j++) { String b=a[j]; String[]seq1split=seq1.split(""); String[]seq2split=seq2.split(""); int hint=seq1.indexOf(b)+1; String sq=""; if(seq1split.length>hint) sq=seq1split[hint]; String sq1=""; if(seq2split.length>hint) sq1=seq2split[hint]; b=b.replace(sq, sq1); result=result+b; } } return result; }

    Read the article

  • How to Determine The Module a Particular Exception Class is Defined In

    - by doug
    Note: i edited my Q (in the title) so that it better reflects what i actually want to know. In the original title and in the text of my Q, i referred to the source of the thrown exception; what i meant, and what i should have referred to, as pointed out in one of the high-strung but otherwise helpful response below, is the module that the exception class is defined in. This is evidenced by the fact that, again, as pointed out in one of the answers below the answer to the original Q is that the exceptions were thrown from calls to cursor.execute and cursor.next, respectively--which of course, isn't the information you need to write the try/except block. For instance (the Q has nothing specifically to do with SQLite or the PySQLite module): from pysqlite2 import dbapi2 as SQ try: cursor.execute('CREATE TABLE pname (id INTEGER PRIMARY KEY, name VARCHARS(50)') except SQ.OperationalError: print("{0}, {1}".format("table already exists", "... 'CREATE' ignored")) # cursor.execute('SELECT * FROM pname') while 1: try: print(cursor.next()) except StopIteration: break # i let both snippets error out to see the exception thrown, then coded the try/finally blocks--but that didn't tell me anything about which module the exception class is defined. In my example, there's only a single imported module, but where there are many more, i am interested to know how an experienced pythonista identifies the exception source (search-the-docs-till-i-happen-to-find-it is my current method). [And yes i am aware there's a nearly identical question on SO--but for C# rather than python, plus if you read the author's edited version, you'll see he's got a different problem in mind.]

    Read the article

  • F#: Tell me what I'm missing about using Async.Parallel

    - by JBristow
    ok, so I'm doing ProjectEuler Problem #14, and I'm fiddling around with optimizations in order to feel f# out. in the following code: let evenrule n = n / 2L let oddrule n = 3L * n + 1L let applyRule n = if n % 2L = 0L then evenrule n else oddrule n let runRules n = let rec loop a final = if a = 1L then final else loop (applyRule a) (final + 1L) n, loop (int64 n) 1L let testlist = seq {for i in 3 .. 2 .. 1000000 do yield i } let getAns sq = sq |> Seq.head let seqfil (a,acc) (b,curr) = if acc = curr then (a,acc) else if acc < curr then (b,curr) else (a,acc) let pmap f l = seq { for a in l do yield async {return f a} } |> Seq.map Async.RunSynchronously let pmap2 f l = seq { for a in l do yield async {return f a} } |> Async.Parallel |> Async.RunSynchronously let procseq f l = l |> f runRules |> Seq.reduce seqfil |> fst let timer = System.Diagnostics.Stopwatch() timer.Start() let ans1 = testlist |> procseq Seq.map // 837799 00:00:08.6251990 printfn "%A\t%A" ans1 timer.Elapsed timer.Reset() timer.Start() let ans2 = testlist |> procseq pmap printfn "%A\t%A" ans2 timer.Elapsed // 837799 00:00:12.3010250 timer.Reset() timer.Start() let ans3 = testlist |> procseq pmap2 printfn "%A\t%A" ans3 timer.Elapsed // 837799 00:00:58.2413990 timer.Reset() Why does the Async.Parallel code run REALLY slow in comparison to the straight up map? I know I shouldn't see that much of an effect, since I'm only on a dual core mac. Please note that I do NOT want help solving problem #14, I just want to know what's up with my parallel code.

    Read the article

  • gvim configuration does not work like it should

    - by ganjan
    Hi. I have a little problem with my vim config. This what I got in my home/user/.gvimrc syntax enable "Enable syntax hl colorscheme peaksea set background=dark set gfn=Inconsolata:h11 set nonu set history=1000 set scrolloff=3 set number " turn on line numbers " Save a global session file on session close nmap SQ <ESC>:mksession! ~/.vim/session/Session.vim<CR>:wqa<CR> function! RestoreSession() if argc() == 0 "vim called without arguments execute 'source ~/.vim/session/Session.vim' end endfunction autocmd VimEnter * call RestoreSession() The colorsheme work, but the font has way to much spacing. Every sentence is twice as long. I installed the Inconsolata font and I have the same config on my windows 7 box and it works fine.

    Read the article

  • Algorithm for optimal combination of two variables

    - by AlanChavez
    I'm looking for an algorithm that would be able to determine the optimal combination of two variables, but I'm not sure where to start looking. For example, if I have 10,000 rows in a database and each row contains price, and square feet is there any algorithm out there that will be able to determine what combination of price and sq ft is optimal. I know this is vague, but I assume is along the lines of Fuzzy logic and fuzzy sets, but I'm not sure and I'd like to start digging in the right field to see if I can come up with something that solves my problem.

    Read the article

  • Feature Selection methods in MATLAB?

    - by Hossein
    Hi, I am trying to do some text classification with SVMs in MATLAB and really would to know if MATLAB has any methods for feature selection(Chi Sq.,MI,....), For the reason that I wan to try various methods and keeping the best method, I don't have time to implement all of them. That's why I am looking for such methods in MATLAB.Does any one know?

    Read the article

  • Changing the passphrase of a private key in Windows

    - by janos
    I have a private key in Windows, created by puttygen.exe. I used default options to save it, the tool automatically gave it a .ppk extension, and it looks like this: PuTTY-User-Key-File-2: ssh-rsa Encryption: none Comment: rsa-key-20130627 Public-Lines: 4 AAAAB3NzaC1yc2EAAAABJQAAAIBnvvAhyMs4rdlQd4OdajDw4jIPi6vIjrWjt4l4 5C3wHOSxyQQdtSA8XT3K0rSBnNtZRJTb5mfix67qQe3pHCTMSNsYIaBi8xQJHZRa RxdY+1VtGnSlEma8KO2We9eDNCGiwrRTUzqvTiGCnzU0pF1MXxu3ObISJcpqv+sQ 1GB0cw== Private-Lines: 8 AAAA.......... Private-MAC: XXXXXXXXX Now I need to change the passphrase, and reading from the docs it seemed simple enough: puttygen.exe -P key.ppk But this pops up a window with this error: PuTTYgen Error: Couldn't load private key (unable to open file) I also tried to change the passphrase using ssh-keygen that comes with Git Bash: ssh-keygen.exe -p -f key.ppk It asks for my old passphrase, but then it gives me the error Bad passphrase. Which is not true, because I can add the key in pageant.exe, and I am not mistyping the passphrase... Anything else I can try to change or drop the passphrase?

    Read the article

1 2  | Next Page >