Search Results

Search found 11178 results on 448 pages for 'syntax checking'.

Page 82/448 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • Scala loop returns as Unit and compiler points to "for" syntax?

    - by DeLongey
    Seems like Unit is the theme of my troubles today. I'm porting a JSON deserializer that uses Gson and when it comes to this for loop: def deserialize(json:JsonElement, typeOfT:Type, context:JsonDeserializationContext) = { var eventData = new EventData(null, null) var jsonObject = json.getAsJsonObject for(entry <- jsonObject.entrySet()) { var key = entry.getKey() var element = entry.getValue() element if("previous_attributes".equals(key)) { var previousAttributes = new scala.collection.mutable.HashMap[String, Object]() populateMapFromJSONObject(previousAttributes, element.getAsJsonObject()) eventData.setPreviousAttributes(previousAttributes) eventData } else if ("object".equals(key)) { val `type` = element.getAsJsonObject().get("object").getAsString() var cl = objectMap.get(`type`).asInstanceOf[StripeObject] var `object` = abstractObject.retrieve(cl, key) eventData.setObject(`object`) eventData } } } The compiler spits out the error type mismatch; found : Unit required: com.stripe.EventData and it points to this line here: for(entry <- jsonObject.entrySet()) Questions Confirm that it is indeed the Gson method entrySet() appearing as unit? If not, what part of the code is creating the issue? I've set return types/values for eventData class methods Is there a workaround for the Gson Unit issue? Thanks!

    Read the article

  • best REGEXP friendly Text Editors + most powerful REGEXP syntax?

    - by John
    I am fluent with Microsoft Visual 2005 regular expressions and they are a big time saver. I seem to learn them best by having a vaguely organized cheat sheet thrown at me, at which point I read just a little and play with them until I understand what's going on. That learning approach has worked well for me, for now. I would really like to take this to the next level though. Basically -- What is the REGEXP convention that is generally regarded as the most open-ended and powerful? VS2005 Regexps seem kind of gimped, so maybe I'm a kid playing in a sandbox. Are there text editors out there that can perform a highlight all matches, list lines containing string, or some kind of powerful function like that in conjunction with the very strongest REGEXP language? If not I can just use multiple programs and a weird technique but I'd like to avoid that. I wonder if a stronger REGEXP language or a "stronger" regEXP writer might be able to have his search match all results on all lines even by clicking a "find next" by adding some simple criteria to the search. Anyway, please provide advice!

    Read the article

  • why doesnt' nhibernate support this "exists in list" syntax ??

    - by ooo
    i have the following query and its failing in Nhibernate 3 LINQ witha a "Non supported" exception. Its similar to this question but this question was asked over a year ago so i am positive that the answer is out of date. My DB tables are: VacationRequest (id, personId) VacationRequestDate (id, vacationRequestId) Person (id, FirstName, LastName) My Entities are: VacationRequest (Person, IList) VacationRequestDate (VacationRequest, Date) Here is the query that is getting a "Non supported" Exception Session.Query<VacationRequestDate>() .Where(r => people .Contains(r.VacationRequest.Person, new PersonComparer())) .Fetch(r=>r.VacationRequest) .ToList(); is there a better way to write this that would be supported in Nhibernate? fyi . .the PersonComparer just compared person.Id

    Read the article

  • Is it possible to access JSON properties with relative syntax when using JSON defined functions?

    - by Justin Vincent
    // JavaScript JSON var myCode = { message : "Hello World", helloWorld : function() { alert(this.message); } }; myCode.helloWorld(); The above JavaScript code will alert 'undefined'. To make it work for real the code would need to look like the following... (note the literal path to myCode.message) // JavaScript JSON var myCode = { message : "Hello World", helloWorld : function() { alert(myCode.message); } }; myCode.helloWorld(); My question is... if I declare functions using json in this way, is there some "relative" way to get access to myCode.message or is it only possible to do so using the literal namespace path myCode.message?

    Read the article

  • Option To AutoFormat Query Syntax in SSMS 2005 or 2008?

    - by dragon77
    In TOAD (for SQL or Oracle), there is a simple AUTOFORMAT button that will nicely format your query - I couldn't find that option in SSMS 2005, but was advised by a co-worker that it was available in SSMS 2008. I am unable to locate the option there either. This is VERY helpful when pasting a query from another source. Thanks for any assistance.

    Read the article

  • Empty Datagrid problem in VB6

    - by Hybrid SyntaX
    Hello Recently, i encountered a problem; when I bind a recordset to datagrid ,and run the application the datagrid is not populated even though recordset has data I use the following code Option Explicit Dim conn As New ADODB.Connection Dim cmd As New ADODB.Command Dim recordset As New ADODB.recordset Private Sub InitializeConnection() Dim str As String str = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" + App.Path + "\phonebook.mdb;" & _ "Persist Security Info=False" conn.CursorLocation = adUseClient conn.ConnectionString = str conn.Open (conn.ConnectionString) End Sub Private Sub AbandonConnection() If conn.State <> 0 Then conn.Close End If End Sub Private Sub Persons_Read() Dim qry_all As String ' qry_all = "select * from person,web,phone Where web.personid = person.id And phone.personid = person.id" qry_all = "SELECT * FROM person" Call InitializeConnection cmd.CommandText = qry_all cmd.CommandType = adCmdText Set cmd.ActiveConnection = conn If conn.State = 1 Then Set recordset = cmd.Execute() End If Call BindDatagrid Call AbandonConnection End Sub Private Function Person_Add() End Function Private Function Person_Delete() End Function Private Function Person_Update() End Function Private Sub BindDatagrid() Set dg_Persons.DataSource = recordset dg_Persons.Refresh End Sub Private Sub cmd_Add_Click() Person_Add End Sub Private Sub cmd_Delete_Click() Person_Delete End Sub Private Sub cmd_Update_Click() Person_Update End Sub Private Sub Form_Load() Call Persons_Read End Sub Private Sub mnu_About_Click() frm_About.Show End Sub Thanks in advance

    Read the article

  • What is the preferred syntax for initializing a dict?

    - by daotoad
    I'm putting in some effort to learn Python, and I am paying close attention to common coding standards. This may seem like a pointlessly nit-picky question, but I am trying to focus on best-practices as I learn, so I don't have to unlearn any 'bad' habits. I see two common methods for initializing a dict: a = { 'a': 'value', 'another': 'value', } b = dict( a='value', another='value', ) Which is considered to be "more pythonic"? Which do you use? Why?

    Read the article

  • what's the name of this language that description another language syntax?

    - by Boolean
    for example: <SELECT statement> ::= [WITH <common_table_expression> [,...n]] <query_expression> [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] } [ ,...n ] ] [ COMPUTE { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [ ,...n ] [ BY expression [ ,...n ] ] ] [ <FOR Clause>] [ OPTION ( <query_hint> [ ,...n ] ) ] <query_expression> ::= { <query_specification> | ( <query_expression> ) } [ { UNION [ ALL ] | EXCEPT | INTERSECT } <query_specification> | ( <query_expression> ) [...n ] ] <query_specification> ::= SELECT [ ALL | DISTINCT ] [TOP expression [PERCENT] [ WITH TIES ] ] < select_list > [ INTO new_table ] [ FROM { <table_source> } [ ,...n ] ] [ WHERE <search_condition> ] [ <GROUP BY> ] [ HAVING < search_condition > ] whats the language called?

    Read the article

  • If I'm projecting with linq and not using a range variable what is the proper syntax?

    - by itchi
    I have a query that sums and aggregates alot of data something like this: var anonType = from x in collection let value = collection.Where(c=>c.Code == "A") select new { sum = value.Sum(v=>v.Amount) }; I find it really weird that I have to declare the range variable x, especially if I'm not using it. So, am I doing something wrong or is there a different format I should be following? Also, keep in mind that anonType has about 15 different properties that are all types of aggregates (sums,counts, etc). So I couldn't do something like: int x = collection.Where(c=>c.Code == "A").Sum(v=>v.Amount);

    Read the article

  • Is this a correct syntax (c code found on wikipedia)?

    - by m4design
    I just found this code on wikipedia. Link: http://en.wikipedia.org/wiki/Sizeof#Use The code: /* the following code illustrates the use of sizeof * with variables and expressions (no parentheses needed), * and with type names (parentheses needed) */ char c; printf("%zu,%zu", sizeof c, sizeof(int)); It states that: "The z prefix should be used to print it, because the actual size can differ on each architecture." I tried it on my compiler, but it gives the following result: 'zu,zu'

    Read the article

  • IIS redirects to url beginning with "http://http" although syntax in web.config file appears to be alright

    - by user1608920
    Here's what I have so far: <?xml version="1.0" encoding="UTF-8"?> <configuration> <location path="osb"> <system.webServer> <httpRedirect enabled="true" exactDestination="true" destination="http://50.63.54.135/app/osb" httpResponseStatus="Permanent" /> </system.webServer> </location> </configuration> The above redirect works, but it takes me to http://http//50.63.54.135/app/osb instead of just http://50.63.54.135/app/osb This produces an 404 error. I tried to remove "http://" from destination. Same effect. What am I missing ?

    Read the article

  • What are the SQL Server query syntax not supported by MySQL?

    - by ANP
    I am working in a project where we are using SQL Server database currently. But recently a decision has been taken that the database will be changed to MySQL. I am not using any stored procedures, views, triggers, user defined functions, etc. But I think even then some queries written for SQL Server will not be supported by MySQL. Can anyone help: what are the things that I have to check (and change) so that all the queries will work properly for MySQL also?

    Read the article

  • Rails: saving a string on an object -- syntax problem?

    - by Veep
    Hey there, I am trying to write a simple function to clean a filename string and update the object. When I save a test string it works, but when I try to save the string variable I've created, nothing happens. But when I return the string, the output seems to be correct! What am I missing? def clean_filename clean_name = filename clean_name.gsub! /^.*(\\|\/)/, '' clean_name.gsub! /[^A-Za-z0-9\.\-]/, '_' clean_name.gsub!(/\_+/, ' ') #update_attribute(:filename, "test") #<-- correctly sets filename to test #update_attribute(:filename, clean_name) #<-- no effect????? WTF #return clean_name <-- seems to returns the correct string end Thank you very much.

    Read the article

  • What is the meaning of this pData[1+2*i]<<8|pData[2+2*i] C++ syntax?

    - by user543265
    what is the meqaning of pData[1+2*i]<<8|pData[2+2*i] where pData[ ] is the array containing BYTE data? I have the following function in the main function { .......... .... BYTE Receivebuff[2048]; .. ReceiveWavePacket(&Receivebuff[i], nNextStep); .... ... .. } Where Receivebuff is the array of type BYTE. ReceiveWavePacket(BYTE * pData, UINT nSize) { CString strTest; for(int i = 0 ; i < 60 ; i++) { strTest.Format("%d\n",(USHORT)(pData[1+2*i]<<8|pData[2+2*i])); m_edStatData.SetWindowTextA(strTest); } } I want to know the meaning of ",(USHORT)(pData[1+2*i]<<8|pData[2+2*i]). Can any body please help me?

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >