Search Results

Search found 4216 results on 169 pages for 'dr dot'.

Page 19/169 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Strange Array#each Ruby behaviour

    - by with a dot.
    The question is a bit vague, but I am not really sure why this happens: I have the following code: p user.room.users.length user.room.users.each {|usr| puts "b" } user.room.users.each {|usr| puts "a"; usr.enter(Room[Config::entrance]) } which outputs: 5 b b b b b a a a I also made User#enter count how many times it's been called and it returns 3! I am completely baffled by this behaviour. I doubt the code within User#enter is the cause, but if someone thinks it might be relevant I can provide it (I don't want to clutter the question unnecessarily). Edit If it's relevant I am using ruby-1.9.3-p125

    Read the article

  • An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING cla

    - by brz dot net
    I have to find the indentid from the status table based on below two conditions: 1. If there are more than one record having same indentid in status table and the same indentID has count1 in feasibilitystatus table then I don't want to display the record. 2. If there is only one record of indentid in status table and the same indentID has count0 in feasibilitystatus table then I don't want to display the record. Query: select distinct s.indentid from status s where s.status='true' and s.indentid not in(select case when count(s.indentid)>1 then (select indentid from feasibilitystatus group by indentid having count(indentid)>1) else (select indentid from feasibilitystatus group by indentid having count(indentid)>0) end as indentid from status) Error: An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.

    Read the article

  • StructureMap DI on Model Assembly

    - by Dan dot net
    I’m new to Dependency Injection and had a question/need guidance. I had an application that used the repository pattern for data access. I used StructureMap to get the correct repository and all worked well. I have since broken out my model (including the repository logic) into its own assembly and added a service layer. In the interest of DI the service layer class takes an IRepository in its constructor. This seems wrong to me as now all consumers of my model need to know about the repository (at least configure their DI to know which one to use). I feel like that is getting into the guts of the model. What sounds wrong with this?

    Read the article

  • Email continuity services i.e. Messagelabs - Caveats, lessons learned, gotchas?

    - by molecule
    Hi all, I am in the process of reviewing some email continuity solutions such as the one offered by Messagelabs. Solutions such as this are not cheap, however, I believe they reduce complexity when it comes to administration and serves as a feasible DR type solution for emails as opposed to purchasing a new server for DR purposes. Have any of you had first hand experience using this service and what are your opinions and/or feedback? Thanks in advance.

    Read the article

  • how can i sell hp and ibm server cpu?

    - by elvayee
    i'm now working in a company exporting hp and ibm server cpu. Our price is very competitve, and our quality is very high, also, we have good after sale service. But the problem is: we don't have paid B2B. How can I find customers? if anyone knows, pls contact me by msn : melodyhua123 AT hotmail dot com or elvayee123 at gmail dot com thanks!

    Read the article

  • Errors after Google Chrome downgrade

    - by user1933153
    I'm downloaded version 37.0 of Google Chrome but, few plugins and extensions didn't worked. I'm uninstalled that version and install 35.0 again, but now i have some errors. After every Chrome start i get these windows: http://i.imgur.com/rjB1SWJ.png , http://i.imgur.com/gfBa5Ju.png , http:(slash,slash)i(dot)imgur(dot)com/5opKTPE.png And every time i start chrome, i get these errors, it's really annoying, do you have idea how to fix that, or at least hide?

    Read the article

  • Scipy sparse... arrays?

    - by spitzanator
    Hey, folks. So, I'm doing some Kmeans classification using numpy arrays that are quite sparse-- lots and lots of zeroes. I figured that I'd use scipy's 'sparse' package to reduce the storage overhead, but I'm a little confused about how to create arrays, not matrices. I've gone through this tutorial on how to create sparse matrices: http://www.scipy.org/SciPy_Tutorial#head-c60163f2fd2bab79edd94be43682414f18b90df7 To mimic an array, I just create a 1xN matrix, but as you may guess, Asp.dot(Bsp) doesn't quite work because you can't multiply two 1xN matrices. I'd have to transpose each array to Nx1, and that's pretty lame, since I'd be doing it for every dot-product calculation. Next up, I tried to create an NxN matrix where column 1 == row 1 (such that you can multiply two matrices and just take the top-left corner as the dot product), but that turned out to be really inefficient. I'd love to use scipy's sparse package as a magic replacement for numpy's array(), but as yet, I'm not really sure what to do. Any advice? Thank you very much!

    Read the article

  • Need to store GridViewDateTimeValue into DateTimePicker

    - by narmadha
    Hi,I am Using Gridview in WindowsApplication.The following is my code: if (dgvList.SelectedRows.Count > 0) { if (dgvList.SelectedRows[0].Cells != null) { DataGridViewRow dr = dgvList.CurrentRow; txtMaterialName.Text = dr.Cells["MaterialName"].ToString(); dateTimePicker1.Text=DateTime.Parse(dr.Cells["PurchasedDate"].ToString()).ToString(); } } i need to store the PurchasedDate into DateTimePicker,But the Error is "The string was not recognized as a valid DateTime. There is a unknown word starting at index 0." Source="mscorlib" StackTrace: at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s) at Godwins.EditStockAvailabilty.dgvList_SelectionChanged(Object sender, EventArgs e) Can anyone help me,Thanks in advance.........

    Read the article

  • Navigation Bar from database

    - by KareemSaad
    i had soulation .i want to make navigation bar with items i will select them as (category,Product,....) So i made stored to get them throught paramater will pass it,s value from query string as. ALTER Proc Navcategory ( @Category_Id Int ) As Select Distinct Categories.Category,Categories.Category_Id From Categories Where Category_Id=@Category_Id and i mentioned in cs as if (Request.QueryString["Category_Id"] != null) { Banar.ImageUrl = "Handlers/Banner.ashx?Category_Id=" + Request.QueryString["Category_Id"] + ""; using (SqlConnection conn = Connection.GetConnection()) { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "Navcategory"; cmd.Parameters.Add(Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"])); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { LblNavigaton.Visible = true; LblNavigaton.Text = dr["Category"].ToString(); } } } so the result will be ex. Fridge (Category when querstring(category_Id)) 4Door (Product when querystring (Product_Id)) But I want the result fridge4Door.......

    Read the article

  • Attribute lost with yield

    - by Nelson
    Here's an interesting one... There is some code that I'm trying to convert from IList to IEnumerable: [Something(123)] public IEnumerable<Foo> GetAllFoos() { SetupSomething(); DataReader dr = RunSomething(); while (dr.Read()) { yield return Factory.Create(dr); } } The problem is, SetupSomething() comes from the base class and uses: Attribute.GetCustomAttribute(new StackTrace().GetFrame(1).GetMethod(), typeof(Something)) Yield ends up creating MoveNext(), MoveNext() calls SetupSomething(), and MoveNext() does not have the [Something(123)] attribute. I can't change the base class, so it appears I am forced to stay with IList or implement IEnumerable manually (and add the attribute to MoveNext()). Is there any other way to make yield work in this scenario?

    Read the article

  • gridview check duplicates not using sql

    - by Tomasusa
    I have a code: foreach (GridViewRow dr in gvCategories.Rows)<br/> { <br/> if (dr.Cells[0].Text == txtEnterCategory.Text.Trim())<br/> <br/> isError=true; <br/> <br/> } Debugging: dr.Cells[0].Text is always "", even there are records. How to use a loop to check each row to find if a record exists in the gridview not using sql?

    Read the article

  • php replace regular expression

    - by Enkay
    I need to use php to add a space between a period and the next word/letter when there's none. For example, "This is a sentence.This is the next one." needs to become "This is a sentence. This is the next one." Notice the added space after the first period. My problem is that even if I'm able to make a regular expression that finds every dot followed by a letter, how do I then replace that dot with a "dot + space" and keep the letter? Also it needs to keep the case of the letter, lower or upper. Thanks for your input.

    Read the article

  • How can i return dataset perfectly from sql?

    - by Phsika
    i try to write a winform application: i dislike below codes: DataTable dt = new DataTable(); dt.Load(dr); ds = new DataSet(); ds.Tables.Add(dt); Above part of codes looks unsufficient.How can i best loading dataset? public class LoadDataset { public DataSet GetAllData(string sp) { return LoadSQL(sp); } private DataSet LoadSQL(string sp) { SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"].ToString()); SqlCommand cmd = new SqlCommand(sp, con); DataSet ds; try { con.Open(); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); ds = new DataSet(); ds.Tables.Add(dt); return ds; } finally { con.Dispose(); cmd.Dispose(); } } }

    Read the article

  • Pygame - Different sided collision question!

    - by Alex Lockwood
    Hi there everyone! I'm making a Pygame of, basically, "Breakout". I'm using collisions, and want a simple way to have different bounce effects of the different sides of one rectangle. What I currently have for the ball-to-bat collision is this: "dot" = ball; "bat" = bat; so you all understand. if dot.rect.colliderect(bat.rect):<br> dot.dy *= -1 I'd like something that interacts with each side, so could reverse the self.dx value of the ball when it hits the side of the bat, and only reversing the self.dy value when it strikes the top. Thanks!!! :D

    Read the article

  • How to customize JBoss AS7 404 page

    - by user23308
    I already created a custom 404 page inside my web app deployed in JBoss AS 7.1. So if my app is at fubar dot com :8080/Myapp and I go to fubar dot com :8080/Myapp/xyzzy, I get the custom error page (defined in the web app's web.xml file). However, when I go to fubar dot com :8080/xyzzy, JBoss displays the default 404 page which discloses that it's JBoss and which JBoss version. I need to replace this page in order to hide this information. Please advise.

    Read the article

  • Launch ms word template as new document from IE...

    - by Simon
    I have a requirement to launch .dot files (ms word templates) as new documents from the browser... Let me explain... if you click on a .dot file in Windows Explorer it opens a new document and runs any macros... you can right click and edit the template... I want to link to the files, so I use <a href="file://myserver/templates/letter.dot">Letter</a>... However this then prompts for the "Download File" dialogue box... and then if I click "Open" it opens the template in edit mode... not the required new document mode... This may be a technical impossibility but can I achieve the desired result in ActiveX or something??

    Read the article

  • C# Web gridview sortin

    - by tommypiaa
    Any examples how would I enable sorting for the gridview? private void loadlist() { cn.Open(); cmd.CommandText = "select Breed, Name, Image from Animals"; dr = cmd.ExecuteReader(); cn.Close(); } protected void TextBox1_TextChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { AddData(); Addimage(); } protected void AddData() { if (TextBox1.Text != "" & TextBox2.Text != "") { cn.Open(); cmd.CommandText = "insert into Animals (Breed, Name) values ('" + TextBox1.Text + "', '" + TextBox2.Text + "')"; cmd.ExecuteNonQuery(); cmd.Clone(); cn.Close(); loadlist(); } } protected void DisplayData() { cn.Open(); cmd.CommandText = "select Breed, Name from Animals"; dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); cn.Close(); }

    Read the article

  • About a Class Object

    - by Chicko Bueno
    I have a very basic question about a class object. After the class has been created, we need to create a class object. At this point, I'm a bit confused to make either *object or object. Example: CClass object CClass *object What is the difference both of them? And to access class function i need to use dot '.' and arrow '->'. I know dot and arrow used to access class function, but what is the significant meaning for both dot and arrow?

    Read the article

  • User Lockout & WLST

    - by Bala Kothandaraman
    WebLogic server provides an option to lockout users to protect accounts password guessing attack. It is implemented with a realm-wide Lockout Manager. This feature can be used with custom authentication provider also. But if you implement your own authentication provider and wish to implement your own lockout manager that is possible too. If your domain is configured to use the user lockout manager the following WLST script will help you to: - check whether a user is locked using a WLST script - find out the number of locked users in the realm #Define constants url='t3://localhost:7001' username='weblogic' password='weblogic' checkuser='test-deployer' #Connect connect(username,password,url) #Get Lockout Manager Runtime serverRuntime() dr = cmo.getServerSecurityRuntime().getDefaultRealmRuntime() ulmr = dr.getUserLockoutManagerRuntime() print '-------------------------------------------' #Check whether a user is locked if (ulmr.isLockedOut(checkuser) == 0): islocked = 'NOT locked' else: islocked = 'locked' print 'User ' + checkuser + ' is ' + islocked #Print number of locked users print 'No. of locked user - ', Integer(ulmr.getUserLockoutTotalCount()) print '-------------------------------------------' print '' #Disconnect & Exit disconnect() exit()

    Read the article

  • Geszti Péter a HOUG konferencián

    - by Lajos Sárecz
    Közel 100%-os a HOUG konferencia programja, így a március 29. kedd délelotti plenáris eloadások is már ismertek. Dr. Magyar Gábor HOUG elnök és Reményi Csaba Oracle ügyvezeto mellett a Budapesti Corvinus Egyetemrol Dr. Bodnár Viktória tart egy érdekes eloadást "Hogyan reagálnak a vezetok a környezeti változásra?" címmel, illetve a "sztárvendég" Geszti Péter lesz, aki az innováció és kreativitás témában osztja meg velünk tudását és tapasztalatait. Hogy milyen más indokokat lehet felsorolni amellett, hogy valaki regisztráljon és részt vegyen a konferencián, arra idézném a weblapot: Miért érdemes még eljönni az idei konferenciára? Azért, * mert ez az elso HOUG konferencia az Oracle-Sun egyesülést követoen; * mert megismerheti az ügyfelek korábbi tapasztalatait, már hardware témában is, * mert bemutatkozik az ExaLogic, az alkalmazásszerver feladatokra optimalizált hardver-szoftver célrendszer; * mert a résztvevok számára nyílt oktatások, workshopok állnak rendelkezésre végig a konferencia során; * mert megismerheti az iparági legjobb gyakorlatokat az Oracle alkalmazásokra - Siebel, Hyperion, E-Business Suite, Policy Automation. * mert találkozhat a HOUG Egyesület új elnökségével, megismerheti terveiket.

    Read the article

  • Atmospheric Scattering

    - by Lawrence Kok
    I'm trying to implement atmospheric scattering based on Sean O`Neil algorithm that was published in GPU Gems 2. But I have some trouble getting the shader to work. My latest attempts resulted in: http://img253.imageshack.us/g/scattering01.png/ I've downloaded sample code of O`Neil from: http://http.download.nvidia.com/developer/GPU_Gems_2/CD/Index.html. Made minor adjustments to the shader 'SkyFromAtmosphere' that would allow it to run in AMD RenderMonkey. In the images it is see-able a form of banding occurs, getting an blueish tone. However it is only applied to one half of the sphere, the other half is completely black. Also the banding appears to occur at Zenith instead of Horizon, and for a reason I managed to get pac-man shape. I would appreciate it if somebody could show me what I'm doing wrong. Vertex Shader: uniform mat4 matView; uniform vec4 view_position; uniform vec3 v3LightPos; const int nSamples = 3; const float fSamples = 3.0; const vec3 Wavelength = vec3(0.650,0.570,0.475); const vec3 v3InvWavelength = 1.0f / vec3( Wavelength.x * Wavelength.x * Wavelength.x * Wavelength.x, Wavelength.y * Wavelength.y * Wavelength.y * Wavelength.y, Wavelength.z * Wavelength.z * Wavelength.z * Wavelength.z); const float fInnerRadius = 10; const float fOuterRadius = fInnerRadius * 1.025; const float fInnerRadius2 = fInnerRadius * fInnerRadius; const float fOuterRadius2 = fOuterRadius * fOuterRadius; const float fScale = 1.0 / (fOuterRadius - fInnerRadius); const float fScaleDepth = 0.25; const float fScaleOverScaleDepth = fScale / fScaleDepth; const vec3 v3CameraPos = vec3(0.0, fInnerRadius * 1.015, 0.0); const float fCameraHeight = length(v3CameraPos); const float fCameraHeight2 = fCameraHeight * fCameraHeight; const float fm_ESun = 150.0; const float fm_Kr = 0.0025; const float fm_Km = 0.0010; const float fKrESun = fm_Kr * fm_ESun; const float fKmESun = fm_Km * fm_ESun; const float fKr4PI = fm_Kr * 4 * 3.141592653; const float fKm4PI = fm_Km * 4 * 3.141592653; varying vec3 v3Direction; varying vec4 c0, c1; float scale(float fCos) { float x = 1.0 - fCos; return fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25)))); } void main( void ) { // Get the ray from the camera to the vertex, and its length (which is the far point of the ray passing through the atmosphere) vec3 v3FrontColor = vec3(0.0, 0.0, 0.0); vec3 v3Pos = normalize(gl_Vertex.xyz) * fOuterRadius; vec3 v3Ray = v3CameraPos - v3Pos; float fFar = length(v3Ray); v3Ray = normalize(v3Ray); // Calculate the ray's starting position, then calculate its scattering offset vec3 v3Start = v3CameraPos; float fHeight = length(v3Start); float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight)); float fStartAngle = dot(v3Ray, v3Start) / fHeight; float fStartOffset = fDepth*scale(fStartAngle); // Initialize the scattering loop variables float fSampleLength = fFar / fSamples; float fScaledLength = fSampleLength * fScale; vec3 v3SampleRay = v3Ray * fSampleLength; vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5; // Now loop through the sample rays for(int i=0; i<nSamples; i++) { float fHeight = length(v3SamplePoint); float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight)); float fLightAngle = dot(normalize(v3LightPos), v3SamplePoint) / fHeight; float fCameraAngle = dot(normalize(v3Ray), v3SamplePoint) / fHeight; float fScatter = (-fStartOffset + fDepth*( scale(fLightAngle) - scale(fCameraAngle)))/* 0.25f*/; vec3 v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI)); v3FrontColor += v3Attenuate * (fDepth * fScaledLength); v3SamplePoint += v3SampleRay; } // Finally, scale the Mie and Rayleigh colors and set up the varying variables for the pixel shader vec4 newPos = vec4( (gl_Vertex.xyz + view_position.xyz), 1.0); gl_Position = gl_ModelViewProjectionMatrix * vec4(newPos.xyz, 1.0); gl_Position.z = gl_Position.w * 0.99999; c1 = vec4(v3FrontColor * fKmESun, 1.0); c0 = vec4(v3FrontColor * (v3InvWavelength * fKrESun), 1.0); v3Direction = v3CameraPos - v3Pos; } Fragment Shader: uniform vec3 v3LightPos; varying vec3 v3Direction; varying vec4 c0; varying vec4 c1; const float g =-0.90f; const float g2 = g * g; const float Exposure =2; void main(void){ float fCos = dot(normalize(v3LightPos), v3Direction) / length(v3Direction); float fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos*fCos) / pow(1.0 + g2 - 2.0*g*fCos, 1.5); gl_FragColor = c0 + fMiePhase * c1; gl_FragColor.a = 1.0; }

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >