Search Results

Search found 879 results on 36 pages for 'programatically'.

Page 33/36 | < Previous Page | 29 30 31 32 33 34 35 36  | Next Page >

  • Change IE user agent

    - by Ahmed
    I'm using WatiN to automate Internet Explorer, and so far it's been great. However, I would really like to be able to change the user agent of IE so the server thinks it's actually Firefox or some other browser. A Firefox useragent string look something like: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 With the following code RegistryKey ieKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent"); ieKey.SetValue("", "Mozilla/5.0"); ieKey.SetValue("Compatible", "Windows"); ieKey.SetValue("Version", "U"); ieKey.SetValue("Platform", "Windows NT 5.1; en-US"); ieKey.DeleteSubKeyTree("Post Platform"); I have been able to change the IE useragent string from Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; AskTbMP3R7/5.9.1.14019) to Mozilla/4.0 (Windows; U; Windows NT 6.1; Trident/4.0; en-US; rv:1.9.2.13) Now, the question: how do I delete the Trident/4.0 part and add the "Gecko/20101203 Firefox/3.6.13" part after the parentheses? I would really like to do this programatically in C#, without using any IE add-ons. Thanks in advance.

    Read the article

  • File descriptor limits and default stack sizes

    - by Charles
    Where I work we build and distribute a library and a couple complex programs built on that library. All code is written in C and is available on most 'standard' systems like Windows, Linux, Aix, Solaris, Darwin. I started in the QA department and while running tests recently I have been reminded several times that I need to remember to set the file descriptor limits and default stack sizes higher or bad things will happen. This is particularly the case with Solaris and now Darwin. Now this is very strange to me because I am a believer in 0 required environment fiddling to make a product work. So I am wondering if there are times where this sort of requirement is a necessary evil, or if we are doing something wrong. Edit: Great comments that describe the problem and a little background. However I do not believe I worded the question well enough. Currently, we require customers, and hence, us the testers, to set these limits before running our code. We do not do this programatically. And this is not a situation where they MIGHT run out, under normal load our programs WILL run out and seg fault. So rewording the question, is requiring the customer to change these ulimit values to run our software to be expected on some platforms, ie, Solaris, Aix, or are we as a company making it to difficult for these users to get going? Bounty: I added a bounty to hopefully get a little more information on what other companies are doing to manage these limits. Can you set these pragmatically? Should we? Should our programs even be hitting these limits or could this be a sign that things might be a bit messy under the covers? That is really what I want to know, as a perfectionist a seemingly dirty program really bugs me.

    Read the article

  • How to control dojo widget classes, or how to get fine-grained control of style

    - by djna
    I am creating a UI with dojo that is emulting some aspects of an existing thick client application. I need to programatically put two different menu bars on the same page. I have successfully created the two menu bars using new dijit.Menu(); new dijit.MenuItem(); and so on. Now I want to give them slightly different presentation styles. As I'm going to have quite a few pages of this sort my first thought is to use different CSS style classes. And that's the problem: when I create the Menu and it's items we get quite a set of HTML objects, each with CSS classes specified by dojo, and the classes are the same for the items associated with either menu. How can I best get specific control for any one menu? I could determine the dojo-generated ids for each item, and specify styles by ids, but that seems like hard work. Is there an sensible way to control the classes defined by dojo, or a nice CSS way to select only the items associated with one menu bar?

    Read the article

  • Dynamically compose ASP MVC view based on context

    - by robertFall
    I have several views that are composed of several partial views based on context. For example, we have a Project view that shows all the details of a project, which includes the scalar values, name etc, and also all the assigned employees, tasks and/or clients. The problem I have is that certain types of project have all of the above sections while others have only two or even on section, ie. details only. What is the best way to compose the Projects master view? I don't want to have logic to check the project in the view. Is there a way to compose a view in code by programatically rendering the relevant partials and ignoring the rest? Otherwise are there any other ideas how to do this in a maintainable way? I could of course just render the partials using if statements to check if they apply, but that way the view contains VERY important logic. In another situation we want to use this method to display content based on the type of subscription a user has. Thanks!

    Read the article

  • Force windows video driver reload. Is it possible at all?

    - by somemorebytes
    Hi there, Some drivers use parameters written in the registry to configure themselves when they get loaded at boot time. I can modify those values and then reboot, but I would like to know if it is possible to force the driver reload, making the changes effective without rebooting. Specifically, I am talking about the video driver (nvidia). I read somewhere, that calling through pINvoke() [User32.ll]::ChangeDisplaySettings() with a 640x480x8bits resolution,(which is so low that it should not be supported by a modern driver) will force windows to load the "Standard VGA driver", and making another call with the current resolution will load the nvidia driver again. This does not work though. At least in Windows 7, even if the low res is not displayed as "supported" the system reduces the screen to a little square in the center of the screen, showing the low res wihtout unloading the nvidia driver. So, is there any .NET/Win32 API, service to restart, or any way at all to force a video driver reload? Perhaps programatically disabling the device (as you could do from the Device Manager) and reenabling it again? Any idea? Thanks a lot.

    Read the article

  • how does Cocoa compare to Microsoft, Qt?

    - by Paperflyer
    I have done a few months of development with Qt (built GUI programatically only) and am now starting to work with Cocoa. I have to say, I love Cocoa. A lot of the things that seemed hard in Qt are easy with Cocoa. Obj-C seems to be far less complex than C++. This is probably just me, so: Ho do you feel about this? How does Cocoa compare to WPF (is that the right framework?) to Qt? How does Obj-C compare to C# to C++? How does XCode/Interface Builder compare to Visual Studio to Qt Creator? How do the Documentations compare? For example, I find Cocoa's Outlets/Actions far more useful than Qt's Signals and Slots because they actually seem to cover most GUI interactions while I had to work around Signals/Slots half the time. (Did I just use them wrong?) Also, the standard templates of XCode give me copy/paste, undo/redo, save/open and a lot of other stuff practically for free while these were rather complex tasks in Qt. Please only answer if you have actual knowledge of at least two of these development environments/frameworks/languages.

    Read the article

  • Changing property of ItemTemplate controls in ListView

    - by arturito
    I have ListView containig LinkButtons in ItemTemplate. ListView is inside UpdatePanel so it is not doing page refresh. When users click on one the LinkButtons it changes its css property in order to mark the selection: protected void ListView1_ItemCommand1(object sender, ListViewCommandEventArgs e) { ((LinkButton)e.CommandSource).CssClass = "selected"; } That allows multiple selections. But once the page is refreshed the selection disappears, meaning that css property of control goes back to default. <ItemTemplate> <asp:LinkButton ID="local" Text='<%#Eval("Local.Name")%>' runat="server" CommandName="selectLocal" CommandArgument='<%#Eval("Local.Id") %>' CssClass="notSelected" > </asp:LinkButton> <asp:LinkButton ID="guest" Text='<%#Eval("Guest.Name")%>' runat="server" CommandName="selectGuest" CommandArgument='<%#Eval("Guest.Id") %>' CssClass="notSelected" > </asp:LinkButton> </ItemTemplate> How can I select them programatically on page reload? (I'm mainating selection list in session)

    Read the article

  • Change Address/Port of WSDL EndPointAddress at runtime?

    - by Pretzel
    So I currently have 3 WSDLs added as Service References in my solution. They look like this in my app.config file (I removed the "bindings" field, because it's uninteresting): <system.serviceModel> <client> <endpoint address="http://localhost:8080/query-service/jse" binding="basicHttpBinding" bindingConfiguration="QueryBinding" contract="QueryService.Query" name="QueryPort" /> <endpoint address="http://localhost:8080/platetype-service/jse" binding="basicHttpBinding" bindingConfiguration="PlateTypeBinding" contract="PlateTypeService.PlateType" name="PlateTypePort" /> <endpoint address="http://localhost:8080/dataimport-service/jse" binding="basicHttpBinding" bindingConfiguration="DataImportBinding" contract="DataImportService.DataImport" name="DataImportPort" /> </client> </system.serviceModel> When I utilize a WSDL, it looks something like this: using (DataService.DataClient dClient = new DataService.DataClient()) { DataService.importTask impt = new DataService.importTask(); impt.String_1 = "someData"; DataService.importResponse imptr = dClient.importTask(impt); } In the "using" statement, when instantiating the DataClient object, I have 5 constructors available to me. In this scenario, I use the default constructor: new DataService.DataClient() which uses the built-in Endpoint Address string, which is fine and good. But I want the user of the application to have the option to change this value. 1) What's the best/easiest way of programatically obtaining this string? 2) Then, once I've allowed the user to edit and test the value, where should I store it? I'd prefer having it be stored in a place (like app.config or equivalent) so that there is no need for checking whether the value exists or not and whether I should be using an alternate constructor. (Looking to keep my code tight, ya know?) Any ideas? Suggestions?

    Read the article

  • Dojo StackContainer children are not resizing on browser maximise/restore

    - by Andy
    Hi. I have the following nested layout in a dojo 1.4 app: BorderContainer 1 -- Stack Container 1 ----BorderContainer 2 ----BorderContainer 3 The StackContainer is sized with width and height 100%. When I resize the browser window using maximise/restore, the StackContainer correctly resizes to the center region of it's parent BorderContainer. The problem I have is that the StackContainer children (BorderContainer 2 and 3) do not get resized to the StackContainer's contentBox. Is there something special you have to do to force a resize of StackContainer children? I have tried calling StackContainer1.resize() but this makes no difference. Thanks in advance. Additional information: Thanks for the reply peller. The widget hierachy that contains the StackContainer is actually a custom widget, so the StackContainer is not actually in a BorderContainer directly, but has its height and width explicitly set to 100%. This works and the StackContainer is resized correctly on browser maximise. The direct children of the stackcontainer are BorderContainers and it is these BorderContainers that do not get resized when the StackContainer is resized. One point to note is that when the StackContainer is created in markup, the stackcontainer children are empty divs. These divs are then used as placeholders for custom widget creation, e.g. var widget = new com.company.widget(params, placeholderDiv); where placeholderDiv is a direct child of the StackContainer in markup. Should I be adding the programatically created 'widget' to the stackcontainer using addChild instead?

    Read the article

  • Drupal 6 - I am using drupal_execute to insert a CCK node into my site. Everything is working excep

    - by rdurbin
    $form_state['values']['field_prx_mp3_labels'][0][value] = $mp3_labels; $form_state['values']['taxonomy'][0][value] = array('tags'=>array('1'=>'Music')); $errs = drupal_execute('prx_content_node_form', $form_state, (object) $nodeTmp); This is a Drupal 6 site. I am using drupal_execute to create a node programatically. The first line is working for field_prx_mp3_labels. The second (for taxonomy) is not. Here is what my select on the node add for my cck looks like: <select name="taxonomy[2][]" multiple="multiple" class="form-select" id="edit-taxonomy-2" size="9"><option value="">- None -</option><option value="5">Music</option><option value="6">-Rock/Pop</option><option value="7">-Jazz/Blues</option><option value="8">-Classical</option><option value="9">-Music Documentaries</option><option value="10">-Festivals/Concerts</option><option value="11">Arts</option><option value="19">-Literature</option><option value="12">Nature</option><option value="13">History</option><option value="15">-Music</option><option value="14">Culture</option><option value="17">-American Indian</option><option value="18">-Latino</option><option value="16">-Youth Perspective</option></select> I have tried many many variations for line 2 (relating to the taxonomy). This comment seemed close but it hasn't worked for me: http://drupal.org/node/178506#comment-1155576 Thanks!

    Read the article

  • targeting sprites from a method in the document class - null object reference

    - by Freddyk
    Hi I am trying to code a flash app entirely in the document class. I am using GestureWorks with a touch screen. When a user essentially presses a button it calls a method that should hide a specific graphic but not the graphic they touched. Essentially I need a way to refer to a graphic on the screen using a method besides 'e.target'. //This code works because it can access 'e.target'. private function photo1SpriteFlickHandler(e:GestureEvent):void { var openTween:Tween = new Tween(e.target, "x", Strong.easeOut, 232, 970, 5, true); } //this code gives me a null object reference because I am using 'photo1Sprite' rather than 'e.target' private function photo1SpriteFlickHandler(e:GestureEvent):void { var openTween:Tween = new Tween(photo1Sprite, "x", Strong.easeOut, 232, 970, 5, true); } //photo1Sprite has already been programatically added to the screen as so: var photo1Sprite = new TouchSprite(); var photo1Loader=new Loader(); photo1Loader.load(new URLRequest("media/photos1/photo1.jpg")); photo1Loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loaderComplete); photo1Sprite.x = 232; photo1Sprite.y = 538; photo1Sprite.scaleX = .3; photo1Sprite.scaleY = .3; photo1Sprite.blobContainerEnabled = true; photo1Sprite.addEventListener(TouchEvent.TOUCH_DOWN, startDrag_Press); photo1Sprite.addEventListener(TouchEvent.TOUCH_UP, stopDrag_Release); photo1Sprite.addChild(photo1Loader); addChild(photo1Sprite); So I can make photo1Sprite react if my method is attached to it directly using 'e.target' but not if I am trying to call it from a method that was called from another element on the screen.

    Read the article

  • NSFetchedResultsController on secondary UITableView - how to query data?

    - by Jason
    I am creating a core-data based Navigation iPhone app with multiple screens. Let's say it is a flash-card application. The data model is very simple, with only two entities: Language, and CardSet. There is a one-to-many relationship between the Language entity and the CardSet entities, so each Language may contain multiple CardSets. In other words, Language has a one-to-many relationship Language.cardSets which points to the list of CardSets, and CardSet has a relationship CardSet.language which points to the Language. There are two screens: (1) An initial TableView screen, which displays the list of languages; and (2) a secondary TableView screen, which displays the list of CardSets in the Language. In the initial screen, which lists the languages, I am using NSFetchedResultsController to keep the list of languages up-to-date. The screen passes the Language selected to the secondary screen. On the secondary screen, I am trying to figure out whether I should again use an NSFetchedResultsController to maintain the list of CardSets, or if I should work through Language.cardSets to simply pull the list out of the object model. The latter makes the most sense programatically because I already have the Language - but then it would not automatically be updated on changes. I have looked at the NSFetchedResultsController documentation, and it seems like I can easily create predicates based on attributes - but not relationships. I.e., I can create the following NSFetchedResultsController: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name LIKE[c] 'Chuck Norris'"]; How can I access my data through the direct relationship - Language.cardSets - and also have the table auto-update using NSFetchedResultsController? Is this possible?

    Read the article

  • Reference a GNU C DLL built in GCC against Cygwin, from C#/NET

    - by Dale Halliwell
    Here is what I want: I have a huge legacy C/C++ codebase written for POSIX, including some very POSIX specific stuff like pthreads. This can be compiled on Cygwin/GCC and run as an executable under Windows with the Cygwin DLL. What I would like to do is build the codebase itself into a Windows DLL that I can then reference from C# and write a wrapper around it to access some parts of it programatically. I have tried this approach with the very simple "hello world" example at http://www.cygwin.com/cygwin-ug-net/dll.html and it doesn't seem to work. #include <stdio.h> extern "C" __declspec(dllexport) int hello(); int hello() { printf ("Hello World!\n"); return 42; } I believe I should be able to reference a DLL built with the above code in C# using something like: [DllImport("kernel32.dll")] public static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll")] public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); [DllImport("kernel32.dll")] public static extern bool FreeLibrary(IntPtr hModule); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int hello(); static void Main(string[] args) { var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "helloworld.dll"); IntPtr pDll = LoadLibrary(path); IntPtr pAddressOfFunctionToCall = GetProcAddress(pDll, "hello"); hello hello = (hello)Marshal.GetDelegateForFunctionPointer( pAddressOfFunctionToCall, typeof(hello)); int theResult = hello(); Console.WriteLine(theResult.ToString()); bool result = FreeLibrary(pDll); Console.ReadKey(); } But this approach doesn't seem to work. LoadLibrary returns null. It can find the DLL (helloworld.dll), it is just like it can't load it or find the exported function. I am sure that if I get this basic case working I can reference the rest of my codebase in this way. Any suggestions or pointers, or does anyone know if what I want is even possible? Thanks.

    Read the article

  • Problem, executing commands in cmd using c#

    - by srk
    I need to execute the below command in command prompt. C:\MySQL\MySQL Server 5.0\bin>mysql -uroot -ppassword < d:/admindb/aar.sql When i do this manually in cmd, i am getting my results. Now i am trying to do this programatically, to execute it in cmd from c# code. I am using the below code to do it. I am not getting any errors and Result !!! When i debug, i get the value of string commandLine as below, "\"C:\\MySQL\\MySQL Server 5.0\\bin\\\" -uroot -ppassword > \"D:/admindb/AAR12.sql" I guess the problem is with this string, passed to cmd. How to solve this ??. public void Execute() { string commandLine = "\"" + MySqlCommandPath + "\"" + " -u" + DbUid + " -p" + DbPwd + " > " + "\"" + Path.Combine(Path_Backup, FileName_Backup + ExcID + ".sql"); System.Diagnostics.ProcessStartInfo PSI = new System.Diagnostics.ProcessStartInfo("cmd.exe"); PSI.RedirectStandardInput = true; PSI.RedirectStandardOutput = true; PSI.RedirectStandardError = true; PSI.UseShellExecute = false; System.Diagnostics.Process p = System.Diagnostics.Process.Start(PSI); System.IO.StreamWriter SW = p.StandardInput; System.IO.StreamReader SR = p.StandardOutput; SW.WriteLine(commandLine); SW.Close(); }

    Read the article

  • Force orientation change in testcase with fragments

    - by user1202032
    I have an Android test project in which I wish to programatically change the orientation. My test: public class MainActivityLandscapeTest extends ActivityInstrumentationTestCase2<MainActivity> { public MainActivityLandscapeTest() { super(MainActivity.class); } private MainActivity mActivity; private Fragment mDetailFragment; private Fragment mListFragment; private Solo mSolo; @Override protected void setUp() throws Exception { super.setUp(); mSolo = new Solo(getInstrumentation(), getActivity()); mSolo.setActivityOrientation(Solo.LANDSCAPE); mActivity = getActivity(); mListFragment = (Fragment) mActivity.getSupportFragmentManager() .findFragmentById(R.id.listFragment); mDetailFragment = (Fragment) mActivity.getSupportFragmentManager() .findFragmentById(R.id.detailFragment); } public void testPreConditions() { assertTrue(mActivity != null); assertTrue(mSolo != null); assertTrue(mListFragment != null); assertTrue(getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE); } /** * Only show detailFragment in landscape mode */ public void testOrientation() { assertTrue(mListFragment.isVisible()); assertTrue(mDetailFragment.isVisible()); } } The layouts for the activity is in seperate folders, layout-port and layout-land layout-port fragment_main.xml layout-land fragment_main.xml In landscape mode, the layout contains 2 fragments (Detail and list) while in portrait it contains 1(List only). If the device/emulator is already in landscape mode before testing begins, this test passes. If in portrait, it fails with a NullPointerException on mListFragment and mDetailFragment. Adding a delay (waitForIdleSync() and/or waitForActivity()) did NOT seem to solve my problem. How do i force the orientation to landscape in my test, while still being able to find the fragments using findFragmentById()?

    Read the article

  • drawRect gets called on UIView subclass but not on UIViewController

    - by HotFudgeSunday
    My code is working so far but I had to create a Class for the UIView. This is a bit inconvenient because I need to interact with the ViewController too. BTW, I did try [self setNeedsDisplay] on the ViewDidLoad of the UIViewController subclass file but it didn't work. Here's the code, which works on UIView Subclass but doesn't get called on a UIViewController one: - (void)drawRect:(CGRect)rect { UIColor *currentColor = [UIColor redColor]; CGContextRef context = UIGraphicsGetCurrentContext(); someNum = 1; CGContextBeginPath(context); CGContextMoveToPoint(context, 30, 40); [self addDotImageX:30 andY:40]; CGContextSetLineWidth(context, 2); CGContextSetStrokeColorWithColor(context, currentColor.CGColor); CGContextStrokePath(context); } Any ideas on what to try? BTW, this is a TabBar App. I know those can somehow block the calls to drawRect. The Tabs where created programatically, not through a Nib. Eg: NSMutableArray *listOfViewControllers = [[NSMutableArray alloc] init]; UIViewController *vc; vc = [[Education alloc] init]; vc.title = @"Education"; [listOfViewControllers addObject:vc]; vc.tabBarItem.image = [UIImage imageNamed:@"info.png"]; [vc release]; I would appreciate any ideas. I've been through the answers on this site related to setNeedsDisplay not calling drawRect and haven't found an answer for my particular case. Thanks.

    Read the article

  • Probelem, executing commands in cmd using c#

    - by srk
    I need to execute the below command in command prompt. C:\MySQL\MySQL Server 5.0\bin>mysql -uroot -ppassword < d:/admindb/aar.sql When i do this manually in cmd, i am getting my results. Now i am trying to do this programatically, to execute it in cmd from c# code. I am using the below code to do it. I am not getting any errors and Result !!! When i debug, i get the value of string commandLine as below, "\"C:\\MySQL\\MySQL Server 5.0\\bin\\\" -uroot -ppassword > \"D:/admindb/AAR12.sql" I guess the problem is with this string, passed to cmd. How to solve this ??. public void Execute() { string commandLine = "\"" + MySqlCommandPath + "\"" + " -u" + DbUid + " -p" + DbPwd + " > " + "\"" + Path.Combine(Path_Backup, FileName_Backup + ExcID + ".sql"); System.Diagnostics.ProcessStartInfo PSI = new System.Diagnostics.ProcessStartInfo("cmd.exe"); PSI.RedirectStandardInput = true; PSI.RedirectStandardOutput = true; PSI.RedirectStandardError = true; PSI.UseShellExecute = false; System.Diagnostics.Process p = System.Diagnostics.Process.Start(PSI); System.IO.StreamWriter SW = p.StandardInput; System.IO.StreamReader SR = p.StandardOutput; SW.WriteLine(commandLine); SW.Close(); }

    Read the article

  • Update Web Reference in Visual Studio

    - by NeilD
    Hi, I have inherited a web site project that makes use of a number of WCF Web Services hosted on a BizTalk server. We have two environments that I need to deploy this project to, with different URLs for the different BizTalk servers. i.e. In the Staging environment, I need to point the services at xx.xx.xx.101 In the Live environment, I need to point them at xx.xx.xx.102, or whatever. Currently, we've got all of the URLs stored in keys in the web.config file, so that we can change them dynamically... Unfortunately this isn't working! If I change the URL in the web.config to something other than what the project was compiled with, I get an error when calling the service: Server did not recognize the value of HTTP Header SOAPAction: xx.xx.xx.101\ServiceName\MethodName I'm told that the only way they've known to deploy this is to update the web.config URLs, change all of the web references in Visual Studio to match, click on "update web reference" for each reference in Visual Studio, and then compile. It's driving me mad! I've written a pre-build NAnt script to go through and replace all instances of the URL found anywhere in the project directory, and even that isn't making any difference. There must be something else being pulled down from the service when I click the "update reference", but I'm new to working with web services, and so I'm not sure what. Does anyone have any ideas? Is there a way to do this programatically? Thanks.

    Read the article

  • Launch app with specific locale

    - by hermo
    Changing the locale for a device is done in the settings, and can't be done by an app AFAIK. I know how to force my own app to a specific locale, described e.g. here: http://www.tutorialforandroid.com/2009/01/force-localize-application-on-android.html So now to my question. Can I force, programatically, the local of an activity that isn't mine? I can imagine 2 ways this could be possible: Specifying the locale in an Intent used to start the activity. Access and manipulate the configuration of running activities (in the same way as I can modify my own activities' configurations). Any thoughts? Is it possible? Is it reasonable? I guess 2. would be more direct, but require some kind of permission (e.g. the modified atcitiy must allow it in the manifest file). But I'd settle for 1. or similar. What I want is to be able to see certain apps in a different language, but rather not change the system locale. E.g. the Android Market, that only displays comments in one language. Can't think of other things right now. Can't find much written on Locale in the documentation, what is and isn't possible. But hoping some undocumented feature might enable this :)

    Read the article

  • Bing search API and Azure

    - by Gapton
    I am trying to programatically perform a search on Microsoft Bing search engine. Here is my understanding: There was a Bing Search API 2.0 , which will be replaced soon (1st Aug 2012) The new API is known as Windows Azure Marketplace. You use different URL for the two. In the old API (Bing Search API 2.0), you specify a key (Application ID) in the URL, and such key will be used to authenticate the request. As long as you have the key as a parameter in the URL, you can obtain the results. In the new API (Windows Azure Marketplace), you do NOT include the key (Account Key) in the URL. Instead, you put in a query URL, then the server will ask for your credentials. When using a browser, there will be a pop-up asking for a/c name and password. Instruction was to leave the account name blank and insert your key in the password field. Okay, I have done all that and I can see a JSON-formatted results of my search on my browser page. How do I do this programmatically in PHP? I tried searching for the documentation and sample code from Microsoft MSDN library, but I was either searching in the wrong place, or there are extremely limited resources in there. Would anyone be able to tell me how do you do the "enter the key in the password field in the pop-up" part in PHP please? Thanks alot in advance.

    Read the article

  • Create lambda action from function expression

    - by Martin Robins
    It is relatively easy to create a lambda function that will return the value of a property from an object, even including deep properties... Func<Category, string> getCategoryName = new Func<Category, string>(c => c.Name); and this can be called as follows... string categoryName = getCategoryName(this.category); But, given only the resulting function above (or the expression originally used to create the function), can anybody provide an easy way to create the opposing action... Action<Category, string> setCategoryName = new Action<Category, string>((c, s) => c.Name = s); ...that will enable the same property value to be set as follows? setCategoryName(this.category, ""); Note that I am looking for a way to create the action programatically from the function or expression - I hope that I have shown that I already know how to create it manually. I am open to answers that work in both .net 3.5 and 4.0. Thanks.

    Read the article

  • OpenGL ES and real world development

    - by Mark
    Hi Guys, I'm trying to learn OpenGL ES quickly (I know, I know, but these are the pressures that have been thrusted upon me) and I have been read around a fair bit, which lots of success at rendering basic models, some basic lighting and 'some' texturing success too. But this is CONSTANTLY the point at which all OpenGL ES tutorials end, they never say more of what a real life app may need. So I have a few questions that Im hoping arent too difficult. How do people get 3d models from their favorite 3d modeling tool into the iPhone/iPad application? I have seen a couple of blog posts where people have written some python scripts for tools like Blender which create .h files that you can use, is this what people seem to do everytime? Or do the "big" tooling suites (3DS, Maya, etc...) have exporting features? Say I have my model in a nice .h file, all the vertexes, texture points, etc.. are lined up, how to I make my model (say of a basic person) walk? Or to be more general, how do you animate "part" of a model (legs only, turn head, etc...)? Do they need to be a massive mash-up of many different tiny models, or can you pre-bake animations these days "into" models (somehow) Truely great 3D games for the iPhone are (im sure) unbelievably complex, but how do people (game dev firms) seem to manage that designer/developer workflow? Surely not all the animations, textures, etc... are done programatically. I hope these are not stupid questions, and in actual fact, my app that Im trying to investigate how to make is really quite simple, just a basic 3D model that I want to be able to pan/tilt around using touch. Has anyone ever done/seen anything like this that I might be able to read up on? Thanks for any help you can give, I appreciate all types of response big or small :) Cheers, Mark

    Read the article

  • Convert SVG to PDF

    - by Adrian Smith
    How would one go about converting a SVG file to a PDF programatically? (I need to alter the SVG in certain respects before generating the PDF so simply pre-converting it using a tool won't be sufficient.) Ideally using Java but Perl or PHP would be fine too. Obviously I am basically considering Apache FOP and Batik with Java. However no matter how long I search I cannot find a simple introduction on how to do it. Things like SVGConverter have descriptions like "Defines the interface for classes that are able to convert part or all of a GraphicContext", but I don't really know what that means. I have this feeling there must be an API to do this quite simply, provided by FOP or Batik, but I'm just not able to find it at the moment (or perhaps it really doesn't exist.) In terms of the supported SVG features I need, the file has some paths which are filled with some linear gradients. Ideally if I could pass the SVG in as a DOM Document that would be ideal; then I would load my template SVG file, change it as specified by the user, and then generate the PDF.

    Read the article

  • Why is only the first shown window focusable

    - by Miha Markic
    Imagine the code below. Only the first window appears on the top, all of subsequent windows won't nor can they be programatically focused for some reason (they appear in the background). Any idea how to workaround this? BTW, static methods/properties are not allowed nor is any global property. [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Thread t1 = new Thread(CreateForm); t1.SetApartmentState(ApartmentState.STA); t1.Start(); t1.Join(); t1 = new Thread(CreateForm); t1.SetApartmentState(ApartmentState.STA); t1.Start(); t1.Join(); } private static void CreateForm() { using (Form f = new Form()) { System.Windows.Forms.Timer t = new System.Windows.Forms.Timer { Enabled = true, Interval = 2000 }; t.Tick += (s, e) => { f.Close(); t.Enabled = false; }; f.TopMost = true; Application.Run(f); } }

    Read the article

  • Android: Adding header to dynamic listView

    - by cg5572
    I'm still pretty new to android coding, and trying to figure things out. I'm creating a listview dynamically as shown below (and then disabling items dynamically also) - you'll notice that there's no xml file for the activity itself, just for the listitem. What I'd like to do is add a static header to the page. Could someone explain to me how I can modify the code below to EITHER add this programatically within the java file, before the listView, OR edit the code below so that it targets a listView within an xml file! Help would be much appreciated!!! public class Start extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); DataBaseHelper myDbHelper = new DataBaseHelper(null); myDbHelper = new DataBaseHelper(this); try { myDbHelper.openDataBase(); }catch(SQLException sqle){ throw sqle; } ArrayList<String> categoryList = new ArrayList<String>(); Cursor cur = myDbHelper.getAllCategories(); cur.moveToFirst(); while (cur.isAfterLast() == false) { if (!categoryList.contains(cur.getString(1))) { categoryList.add(cur.getString(1)); } cur.moveToNext(); } cur.close(); Collections.sort(categoryList); setListAdapter(new ArrayAdapter<String>(this, R.layout.listitem, categoryList) { @Override public View getView(int position, View convertView, ViewGroup parent) { View view = super.getView(position, convertView, parent); if(Arrays.asList(checkArray3).contains(String.valueOf(position))){ view.setEnabled(false); } else { view.setEnabled(true); } return view; } }); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { if(v.isEnabled()) { String clickedCat = l.getItemAtPosition(position).toString(); Toast.makeText(this, clickedCat, Toast.LENGTH_SHORT).show(); finish(); Intent myIntent = new Intent(getApplicationContext(), Questions.class); myIntent.putExtra("passedCategory", clickedCat); myIntent.putExtra("startTrigger", "go"); startActivity(myIntent); } } }

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36  | Next Page >