Search Results

Search found 31491 results on 1260 pages for 'simple talk'.

Page 65/1260 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Simple WCF question.

    - by bearrito
    So I am learning WCF and I have run across an issue that I believe has to do with Instance Control/State but I am not sure. Workflow is as follows, Basic client/server paradigm. The client calls a Method RetrieveBusinessObjects(criteria) and the server calls the datalayer and then puts them in an IList on the server side. It does not return this list to the calling Client. The client would then call a method say DisplayBusinessObjects() which would retrieve the IList from the Server, serialize them, bring them across the wire and display them. If i try this using the WCFTestClient it works. If I run it from an actual client then I get back an BusinessObject[] of size 0. Which to me indicates I had no objects to return. Is that a state mgmt issue or am I missing something?

    Read the article

  • Simple stupid foreach loop question

    - by user281180
    In the code below i`m trying to read a list of selected projects and a list of all projects available. I want to store the all the projects that have not been selected from the list of all projects. But with the code below, I`m having list of all projects...Where and how to break the second loop incase projectId.Value == selectedProjectId.Value ? public IEnumerable NotselectedProjects; public IEnumerable NotSelectedProjects() { if (this.NotselectedProjects == null) { List<SelectListItem> result = new List<SelectListItem>(); foreach (var selectedProjectId in selectedProjects) { foreach (var projectId in projectLists) { if (projectId.Value != selectedProjectId.Value) { result.Add(new SelectListItem { Selected = false, Text = projectId.Text, Value = projectId.Value }); this.NotselectedProjects = result.AsEnumerable(); } } } } return this.NotselectedProjects; }

    Read the article

  • Simple CanCan problem

    - by sscirrus
    I have just started with CanCan and here's a sample of the code: # Ability.rb def initialize(user) user ||= User.new can :read, Link end # view.html.erb <% if can? :read, @link %> ... <% end %> This is from the github repo for CanCan but this doesn't seem to work (it returns false and stops the ... code from running). When I change the view to <% if can? :read, Link %>, it works. But, this is different to the CanCan readme. Do you know where I'm going wrong here?

    Read the article

  • Simple neon optimization in Android

    - by Peter
    In my Android application, I use a bunch of open source libraries such as libyuv, libvpx, libcrypto, libssl, etc. Some of them come with Android.mk. For others, I hand-crafted Android.mk. The code is built only for arm for now. Here is my Application.mk: APP_ABI := armeabi-v7a APP_OPTIM := release APP_STL := gnustl_static APP_CPPFLAGS := -frtti I am looking for way to generate binaries that are optimized for neon. Browsing the net, I found the following setting that someone is using in his Android.mk: LOCAL_CFLAGS += -mfloat-abi=softfp -mfpu=neon -march=armv7 I wonder if I simply put this setting in Application.mk, will it automatically get applied across all the libraries? A step before each library is built is the following: include $(CLEAR_VARS) Is it better to include LOCAL_CFLAGS directive after this line (instead of including it in Application.mk)? Finally, why doesn't ndk-build automatically optimize for neon when it sees armabi in Application.mk? Regards.

    Read the article

  • Regex replace (in Python) - a more simple way?

    - by Evan Fosmark
    Any time I want to replace a piece of text that is part of a larger piece of text, I always have to do something like: "(?P<start>some_pattern)(?P<replace>foo)(?P<end>end)" And then concatenate the start group with the new data for replace and then the end group. Is there a better method for this?

    Read the article

  • Simple IF statement question

    - by JGreig
    How can I simply the below if statements? if ( isset(var1) & isset(var2) ) { if ( (var1 != something1) || (var2 != something2) ) { // ... code ... } } Seems like this could be condensed to only one IF statement but am not certain if I'd use an AND or OR

    Read the article

  • How to Create a Simple Dictation Pad in Delphi2009+Vista

    - by XBasic3000
    the code are not so complecated.. private { Private declarations } SpSharedRecoContext1 : TSpSharedRecoContext; fMyGrammar : ISpeechRecoGrammar; procedure SpSharedRecoContext1Recognition(ASender: TObject; StreamNumber: Integer; StreamPosition: OleVariant; RecognitionType: SpeechRecognitionType; const Result: ISpeechRecoResult); procedure SpSharedRecoContext1Hypothesis(ASender: TObject; StreamNumber: Integer; StreamPosition: OleVariant; const Result: ISpeechRecoResult); procedure TForm1.FormCreate(Sender: TObject); begin SpSharedRecoContext1 := TSpSharedRecoContext.Create(self); SpSharedRecoContext1.OnHypothesis := SpSharedRecoContext1Hypothesis; SpSharedRecoContext1.OnRecognition :=SpSharedRecoContext1Recognition; fMyGrammar := SpSharedRecoContext1.CreateGrammar(0); fMyGrammar.DictationSetState(SGDSActive); end; procedure TForm1.SpSharedRecoContext1Recognition(ASender: TObject; StreamNumber: Integer; StreamPosition: OleVariant; RecognitionType: SpeechRecognitionType; const Result: ISpeechRecoResult); begin Memo1.Text := Result.PhraseInfo.GetText(0,-1,true); end; procedure TForm1.SpSharedRecoContext1Hypothesis(ASender: TObject; StreamNumber: Integer; StreamPosition: OleVariant; const Result: ISpeechRecoResult); begin Memo1.Text := Result.PhraseInfo.GetText(0,-1,true); end; My Problem, was the vista-OS voice command will intercept on my program. if i say "START", instead of writing start on memo1 it press the start menu on my desktop. or what ever command like START CANCEL EDIT DELETE SELECT etc. please help..... sorry for my english

    Read the article

  • Python/Biomolecular Physics- Trying to code a simple stochastic simulation of a system exhibiting co

    - by user359597
    *edited 6/17/10 I'm trying to understand how to improve my code (make it more pythonic). Also, I'm interested in writing more intuitive 'conditionals' that would describe scenarios that are commonplace in biochemistry. The conditional criteria in the below program is explained in Answer #2, but I am not satisfied with it- it is correct, but isn't obvious and isn't easy to implement for more complicated conditional scenarios. Ideas welcome. Comments/criticisms welcome. First posting experience @ stackoverflow- please comment on etiquette if needed. The code generates a list of values that are the solution to the following exercise: "In a programming language of your choice, implement Gillespie’s First Reaction Algorithm to study the temporal behaviour of the reaction A---B in which the transition from A to B can only take place if another compound, C, is present, and where C dynamically interconverts with D, as modelled in the Petri-net below. Assume that there are 100 molecules of A, 1 of C, and no B or D present at the start of the reaction. Set kAB to 0.1 s-1 and both kCD and kDC to 1.0 s-1. Simulate the behaviour of the system over 100 s." def sim(): # Set the rate constants for all transitions kAB = 0.1 kCD = 1.0 kDC = 1.0 # Set up the initial state A = 100 B = 0 C = 1 D = 0 # Set the start and end times t = 0.0 tEnd = 100.0 print "Time\t", "Transition\t", "A\t", "B\t", "C\t", "D" # Compute the first interval transition, interval = transitionData(A, B, C, D, kAB, kCD, kDC) # Loop until the end time is exceded or no transition can fire any more while t <= tEnd and transition >= 0: print t, '\t', transition, '\t', A, '\t', B, '\t', C, '\t', D t += interval if transition == 0: A -= 1 B += 1 if transition == 1: C -= 1 D += 1 if transition == 2: C += 1 D -= 1 transition, interval = transitionData(A, B, C, D, kAB, kCD, kDC) def transitionData(A, B, C, D, kAB, kCD, kDC): """ Returns nTransition, the number of the firing transition (0: A->B, 1: C->D, 2: D->C), and interval, the interval between the time of the previous transition and that of the current one. """ RAB = kAB * A * C RCD = kCD * C RDC = kDC * D dt = [-1.0, -1.0, -1.0] if RAB > 0.0: dt[0] = -math.log(1.0 - random.random())/RAB if RCD > 0.0: dt[1] = -math.log(1.0 - random.random())/RCD if RDC > 0.0: dt[2] = -math.log(1.0 - random.random())/RDC interval = 1e36 transition = -1 for n in range(len(dt)): if dt[n] > 0.0 and dt[n] < interval: interval = dt[n] transition = n return transition, interval if __name__ == '__main__': sim()

    Read the article

  • Problem in getting multidimensional array from simple xml object

    - by Rishi2686
    Hi there, As a newbie I need your help in getting multidimensional array from simplexml object. suppose my array is like: just for getting idea: Here $data is a simplexml object contains below xml: <users> <user> <id></id> <nm></nm> <gender> <male></male> <female></female> </gender> </user> </users> Here I an perfectly getting array of each user, but in that array when it comes to gender, it shows nothing. i need array of gender too. I am using following code: foreach($data->users as $users) { $arr1 = array(); foreach($users as $user) { foreach($user as $k=>$v) { $arr1[$k] = (string) $v; } } $arr2[] = $arr1; } Any suggestion?

    Read the article

  • A simple way (in java) to remove headers

    - by Andersson Melo
    I need remove non-xml tags from file generated by another program. The file is some like this: Executing Command - Blah.exe ... -----Command Output----- HTTP/1.1 200 OK Connection: close Content-Type: text/xml <?xml version="1.0"?> <testResults> <right>7</right> <wrong>4</wrong> <ignores>0</ignores> <exceptions>0</exceptions> </finalCounts> </testResults> Exit-Code: 15 How to remove the non-xml text easily in java?

    Read the article

  • simple scala question about httpparser

    - by kula
    hi all. i'm a scala newbee. i have one question. in my code ,i try to import httpparse library like this scalac -classpath /home/kula/code/201005/kookle/lib/htmlparser.jar crawler.scala and i run this code. scala main and it tell me that java.lang.NoClassDefFoundError: org/htmlparser/Parser at FetchActor$$anonfun$act$1$$anonfun$apply$1.apply(crawler.scala:21) at FetchActor$$anonfun$act$1$$anonfun$apply$1.apply(crawler.scala:13) at scala.actors.Reaction.run(Reaction.scala:78) at scala.actors.FJTask$Wrap.run(Unknown Source) at scala.actors.FJTaskRunner.scanWhileIdling(Unknown Source) at scala.actors.FJTaskRunner.run(Unknown Source) i check the file./home/kula/code/201005/kookle/lib/htmlparser.jar and it is no problem.anyone can tell me how cause this bug?

    Read the article

  • Trying to get simple jquery animations on a site I created in Dreamweaver

    - by JoeOzz
    Hey guys, another question. I'm trying to do some basic jQuery stuff for my final project. I'll be using it to modify my already existing site created in Dreamweaver a few months ago. However, no matter how I source the framework, it just won't take regardless of whether I host my own copy or link to someone else's like Google's. I'm including my jQuery function calls within my already existing .js file that includes some auto generated functions. I also tried creating a new .js specifically for my jQuery functions and still nothing. I realize this is vague, but any tips? Do I need another framework for jQuery to work off of to make animations like .fadeIn() or .slideDown()? Thanks guys and gals!

    Read the article

  • Simple Binding question, unable to bind to button command in a DataTemplate using MVVM Light Toolkit

    - by deliberative assembly
    I've been attempting to bind to buttons within a DataTemplate without much success. The button does not fire. Button Click works successfully outside of the DataTemplate. Yet if I create a Click="button_click" the click button is fired. The Button Content binds perfectly as well. Example to illustrate.. Why does the command not fire? Advice on how this should be handled this? The example is a simplified version of my real problem, I am currently not using a Listbox. I only recreated the same problem with a listbox..

    Read the article

  • How to write (simple) macro?

    - by krzysz00
    I need to write a macro (with-hooks (monster method who what) &body body) for a game I'm writing. Monster is a CLOS object, method and who are strings and what is a function (#' notation). The macroexpansion would be something to the effect of (add-hook monster method who what) ,@body (remove-hook monster method who) I have absolutely no idea how to write such a macro, and I would appreciate some help.

    Read the article

  • Simple numpy question

    - by dassouki
    I can't get this snippet to work: #base code A = array([ [ 1, 2, 10 ], [ 1, 3, 20 ], [ 1, 4, 30 ], [ 2, 1, 15 ], [ 2, 3, 25 ], [ 2, 4, 35 ], [ 3, 1, 17 ], [ 3, 2, 27 ], [ 3, 4, 37 ], [ 4, 1, 13 ], [ 4, 2, 23 ], [ 4, 3, 33 ] ]) # Number of zones zones = unique1d(A[:,0]) for origin in zones: for destination in zones: if origin != destination: A_ik = A[(A[:,0] == origin & A[:,1] == destination), 2]

    Read the article

  • PHP: Remove Simple Session with Get-Method

    - by elmaso
    Hello, I want to Remove the Sessions from this php code, actually if someone searches i get this url search.php?searchquery=test but if I reload the page, the results are cleaned. how can I remove the Sessions to get the Results still, if someone reloads the page? this are the codes: search.php <?php session_start(); ?> <form method="get" action="querygoogle.php"> <label for="searchquery"><span class="caption">Search this site</span> <input type="text" size="20" maxlength="255" title="Enter your keywords and click the search button" name="searchquery" /></label> <input type="submit" value="Search" /> </form> <?php if(!empty($_SESSION['googleresults'])) { echo $_SESSION['googleresults']; unset($_SESSION['googleresults']); } ?> querygoogle.php <?php session_start(); $url = 'http://www.example.com'; $handle = fopen($url, 'rb'); $body = ''; while (!feof($handle)) { $body .= fread($handle, 8192); } fclose($handle); $json = json_decode($body); foreach($json->responseData->results as $searchresult) { if($searchresult->GsearchResultClass == 'GwebSearch') { $formattedresults .= ' <div class="searchresult"> <h3><a href="' . $searchresult->unescapedUrl . '">' . $searchresult->titleNoFormatting . '</a></h3> <p class="resultdesc">' . $searchresult->content . '</p> <p class="resulturl">' . $searchresult->visibleUrl . '</p> </div>'; } } $_SESSION['googleresults'] = $formattedresults; header("Location: search.php?searchquery=" . $_GET['searchquery']); exit; ?> thank you for your help!!

    Read the article

  • simple toggle problem

    - by meo
    I'm just programming a little function that toggles a content by fading it in and out. this.advancedSearch = function(fieldset, triggerBtn){ fieldset.hide() triggerBtn.click(function(){ fieldset.toggle(function(){ $(this).stop(false, true).fadeIn(300) }, function(){ $(this).stop(false, true).fadeIn(300) }) }) } if just I use toggle() it works, but when i insert the two functions nothing happens and no error is thrown. Is there something i have done wrong?

    Read the article

  • Recommendtations for a simple name registrar

    - by ripper234
    I'm currently registering my domains through GoDaddy. Does the registrar matter? Any recommendations for registrars you're especially happy with? (See this very similar question, that requires API support. I need no such support, hence this question is more generic).

    Read the article

  • Translate from Java to C#: simple code to re-encode a string

    - by Dr. Zim
    We were sent this formula to encrypt a string written in Java: String myInput = "test1234"; MessageDigest md = MessageDigest.getInstance("SHA"); byte[] myD = md.digest(myInput.getBytes()); BASE64Encoder en64 = new BASE64Encoder(); String myOutput = new String ( Java.net.URLEncoder.encode( en64.encode(myD))); // myOutput becomes "F009U%2Bx99bVTGwS3cQdHf%2BJcpCo%3D" Our attempt at writing this in C# is: System.Security.Cryptography.SHA1 sha1 = new System.Security.Cryptography.SHA1CryptoServiceProvider(); string myOutput = HttpUtility.UrlEncode( Convert.ToBase64String( sha1.ComputeHash( ASCIIEncoding.Default.GetBytes(myInput)))); However the output is no where near the same. It doesn't even have percent signs in it. Any chance anyone would know where we are going wrong?

    Read the article

  • Any simple way to "resize" an NSBezierPath?

    - by d11wtq
    I have an NSBezierPath that I'm filling and stroking. I'd like to add some inner glow to the path (a light stroke, just inside of the outer stroke), and the thing that comes to mind is to use the same path shrunk by 1 pixel (the size of the line that is already )stroked. Is there a way to do this? Alternatively, is there some sort of pattern I can use when applying both a border (stroke) and a glow to a bezier path? Example, the (extremely subtle) inner glow on the Google Chrome tabs:

    Read the article

  • Powershell and some simple string manipulation

    - by Pat
    need some help with building a powershell script to help with some basic string manipulation. I know just enough powershell to get in trouble, but can't figure out the syntax or coding to make this work. I have a text file that looks like this - Here is your list of servers: server1 server2.domain.local server3 Total number of servers: 3 I need to take that text file and drop the first and last lines (Always first and last.) Then I need to take every other line and basically turn it into a CSV file. The final output should be a text file that looks like this - server1,server2.domain.local,server3 Any suggestions on where to start? Thanks!

    Read the article

  • SQL simple selection of rows according to their time

    - by iracema78280
    Hello, I have a table with measures and the time this measures have been taken in the following form: MM/DD/YYYY HH:MI:SS AM. I have measures over many days starting at the same time every day.The datas are minute by minute so basically the seconds are always = 0. I want to select only the measures for the first 5 minutes of each day. I would have used the where statement but the condition would only be on the minutes and note the date is there a way to do this? Thanks

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >