Search Results

Search found 1169 results on 47 pages for 'da coder'.

Page 7/47 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Juggling with JDKs on Apple OS X

    - by Blueberry Coder
    I recently got a shiny new MacBook Pro to help me support our ADF Mobile customers. It is really a wonderful piece of hardware, although I am still adjusting to Apple's peculiar keyboard layout. Did you know, for example, that the « delete » key actually performs a « backspace »? But I disgress... As you may know, ADF Mobile development still requires JDeveloper 11gR2, which in turn runs on Java 6. On the other hand, JDeveloper 12c needs JDK 7. I wanted to install both versions, and wasn't sure how to do it.   If you remember, I explained in a previous blog entry how to install JDeveloper 11gR2 on Apple's OS X. The trick was to use the /usr/libexec/java_home command in order to invoke the proper JDK. In this case, I could have done the same thing; the two JDKs can coexist without any problems, since they install in completely different locations. But I wanted more than just installing JDeveloper. I wanted to be able to select my JDK when using the command line as well. On Windows, this is easy, since I keep all my JDKs in a central location. I simply have to move to the appropriate folder or type the folder name in the command I want to execute. Problem is, on OS X, the paths to the JDKs are... let's say convoluted.  Here is the one for Java 6. /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home The Java 7 path is not better, just different. /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home Intuitive, isn't it? Clearly, I needed something better... On OS X, the default command shell is bash. It is possible to configure the shell environment by creating a file named « .profile » in a user's home folder. Thus, I created such a file and put the following inside: export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7) export JAVA_6_HOME=$(/usr/libexec/java_home -v1.6) export JAVA_HOME=$JAVA_7_HOME alias java6='export JAVA_HOME=$JAVA_6_HOME' alias java7='export JAVA_HOME=$JAVA_7_HOME'  The first two lines retrieve the current paths for Java 7 and Java 6 and store them in two environment variables. The third line marks Java 7 as the default. The last two lines create command aliases. Thus, when I type java6, the value for JAVA_HOME is set to JAVA_6_HOME, for example.  I now have an environment which works even better than the one I have on Windows, since I can change my active JDK on a whim. Here a sample, fresh from my terminal window. fdesbien-mac:~ fdesbien$ java6 fdesbien-mac:~ fdesbien$ java -version java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode) fdesbien-mac:~ fdesbien$ fdesbien-mac:~ fdesbien$ java7 fdesbien-mac:~ fdesbien$ java -version java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) fdesbien-mac:~ fdesbien$ Et voilà! Maximum flexibility without downsides, just I like it. 

    Read the article

  • Can't change screen resolution Ubuntu 10.04 (BT)

    - by Universal Coder
    I'm using Backtrack 5 R2 , what is based on Ubuntu 10.04 LTS. It is installed on Samsung Laptop , and default screen resolution in Windows for it is 1366x768 , but BT/Ubuntu Screen Resolution GUI tool (System=Preferences=Monitors) shows that only resolution available is 1024x768 , and called my monitor as "Unknown". Found a solution , that I have to change resolution in /usr/share/xresprobe/xorg.conf , but I did it , logged out/in and restarted many times , but it took me nowhere. Tried with xrandr , but it shows only mentioned 1024x768 as only solution , and when I tried to input needed resolution , but it did not accept it , because it is not available. As much as I googled , there are a lot of people that had similar problems with BT , but most of them solved with VirtualBox additional tools , but it can't help me , because I've installed it as second OS. In one forum read , that same problems is in Ubuntu 12 , so I ask this question here.

    Read the article

  • Career-Defining Moments

    - by Robz / Fervent Coder
    Originally posted on: http://geekswithblogs.net/robz/archive/2013/06/25/career-defining-moments.aspx Fear holds us back from many things. A little fear is healthy, but don’t let it overwhelm you into missing opportunities. In every career there is a moment when you can either step forward and define yourself, or sit down and regret it later. Why do we hold back: is it fear, constraints, family concerns, or that we simply can't do it? I think in many cases it comes to the unknown, and we are good at fearing the unknown. Some people hold back because they are fearful of what they don’t know. Some hold back because they are fearful of learning new things. Some hold back simply because to take on a new challenge it means they have to give something else up. The phrase sometimes used is “It’s the devil you know versus the one you don’t.” That fear sometimes allows us to miss great opportunities. In many people’s case it is the opportunity to go into business for yourself, to start something that never existed. Most hold back hear for a fear of failing. We’ve all heard the phrase “What would you do if you knew you couldn’t fail?”, which is intended to get people to think about the opportunities they might create. A better term I heard recently on the Ruby Rogues podcast was “What would be worth doing even if you knew you were going to fail?” I think that wording suits the intent better. If you knew (or thought) going in that you were going to fail and you didn’t care, it would open you up to the possibility of paying more attention to the journey and not the outcome. In my case it is a fear of acceptance. I am fearful that I may not learn what I need to learn or may not do a good enough job to be accepted. At the same time that fear drives me and makes me want to leap forward. Some folks would define this as “The Flinch”. I’m learning Ruby and Puppet right now. I have limited experience with both, limited to the degree it scares me some that I don’t know much about either. Okay, it scares me quite a bit! Some people’s defining moment might be going to work for Microsoft. All of you who know me know that I am in love with automation, from low-tech to high-tech automation. So for me, my “mecca” is a little different in that regard. Awhile back I sat down and defined where I wanted my career to go and it had to do more with DevOps, defined as applying developer practices to system administration operations (I could not find this definition when I searched). It’s an area that interests me and why I really want to expand chocolatey into something more awesome. I want to see Windows be as automatable and awesome as other operating systems that are out there. Back to the career-defining moment. Sometimes these moments only come once in a lifetime. The key is to recognize when you are in one of these moments and step back to evaluate it before choosing to dive in head first. So I am about to embark on what I define as one of these “moments.”  On July 1st I will be joining Puppet Labs and working to help make the Windows automation experience rock solid! I’m both scared and excited about the opportunity!

    Read the article

  • How to force ADF to speak your language (or any common language)

    - by Blueberry Coder
    When I started working for Oracle, one of the first tasks I was given was to contribute some content to a great ADF course Frank and Chris are building. Among other things, they asked me to work on a module about Internationalization. While doing research work, I unearthed a little gem I had overlooked all those years. JDeveloper, as you may know, speaks your language - as long as your language is English, that is. Oracle ADF, on the other hand, is a citizen of the world. It is available in more than 25 different languages. But while this is a wonderful feature for end users, it is rather cumbersome for developers. Why is that? Have you ever tried to search the OTN forums for a solution with a non-English error message as your query? I have, once. But how can you force ADF to use English for its logging operations? Playing with your system settings will not help, unfortunately. By default, ADF will output its error messages in the selected locale for the operating system account the application server runs on. The only way to change this behavior is to pass initialization parameters to the JVM used by the application server. It is even possible to specify the language and country/region separately. In the example below, we choose English and the United States respectively. -Duser.language=en -Duser.country=US In the case of WebLogic Server, it is possible to add such parameters in setDomainEnv.sh (or .cmd) to apply the settings to all the managed servers present on a node. In the coming weeks, I will write a few posts about other internationalization issues. Is there anything you would like me to cover? Let me know in the comments.

    Read the article

  • Why do some user agents have spam urls in them (and why are they always Opera/Presto User-Agents)?

    - by Erx_VB.NExT.Coder
    If you go to (say) the last 100 entries (visits) to the botsvsbrowsers.com website (exact link, feel free to take a look: http://www.botsvsbrowsers.com/recent/listings/index.html ), you'd notice that almost every User Agent that has the keywords "Opera" and "Presto" inside them, will almost certainly have a web link (URL/Web Address) inside it, and it won't just be a normal web address, but a HTML anchor tag/link to that address. Why is this so, I could not even find a single discussion about it on the internet, nowhere, I tried varying my search terms many times. If the user agent contains the words "Opera" and "Presto" it doesnt mean it will have this weblink, but it means there is about an 80% change that it will. A typical anchor tag/link inside a user agent will look like this: Mozilla/4.0 <a href="http://osis-uk.co.uk/disabled-equipment">disability equipment</a> (Windows NT 5.1; U; en) Presto/2.10.229 Version/11.60 If you check it out at the website, http://www.botsvsbrowsers.com/recent/listings/index.html you will notice that the back and forward arrows are in there unescaped format. This isn't just true for botsvsbrowsers, but several other user agent listing sites. I'm really confused and feel line I'm in a room full of 10,000 people and am the only one seeing this ghost :). If I'm doing statistical analysis, should I include or exclude this type of user agent from my listing (ie: are these just normal users who've set their user agents to attempt to drive some traffic to their sites as they browser the web), or is there something else going on? The fact that it is so consistent in terms of its format leads me to believe that it is an automated process (the setting or alteration of the user agent) so I cannot decide or understand the process by which this change is made (I know how to change a user agent), but unsure which program or facility is doing this, especially since it is exclusive to Opera (Presto) user agents that are beyond I think an 8 or 9 point something browser version. I've run some statistical tests, parsing entries from all over the place, writing custom programs, to get a better understanding of this. Keep in mind that I see normal URL's in user agents infrequently, they are just text such as +http://www.someSite.com appended to a user agent normally, especially if its a crawler or bot it provided its service URL, this is normal and isnt done with an embedded link (A HREF=) etc, so I'm not talking about "those".

    Read the article

  • Ubuntu 12.10 - Dual monitors

    - by crazy coder
    I'm trying to set up a dual monitor with my laptop (Dell XPS L502X) and a monitor that I recently bought (Dell U2312HM). The cable are alright, because I tried this on Windows and all is fine. In Ubuntu 12.10 doesn't work. If I go to System Settings-Displays, button Detect Displays doesn't do anything. I may also say that I use Bumblebee, and my sudo nvidia-settings command only shows a windows with only nvidia-setting Configuration option.

    Read the article

  • Oracle WebCenter: uma nova vis&atilde;o para os Portais

    - by Denisd
    O conceito de “Portal” existe há muito tempo, mas está sempre mudando. Afinal de contas, o que é um portal? Nos primórdios da internet, o termo “portal” era utilizado para sites que guardavam muitas páginas (ou seja, muita informação). “Portal de notícias” era um termo comum, embora estes “portais” não passassem de um conjunto de páginas estáticas, que basicamente serviam conteúdo aos usuários. Com a evolução da tecnologia, os web sites passaram a ficar mais dinâmicos, permitindo uma interação maior do usuário. Sites de comunidades sociais são o melhor exemplo disso. Neste momento, o “portal” passou a ser não apenas um grupo de páginas, mas um conjunto de serviços e recursos dinâmicos, como a possibilidade de publicar fotos e vídeos, e compartilhar este conteúdo com amigos on-line. Aqui temos o que podemos chamar de “Portais Sociais”. Ao mesmo tempo, dentro das empresas, outra mudança estava acontecendo: a criação de padrões de comunicação entre aplicativos, sendo o mais famoso destes padrões a tecnologia de Web Services. Com estes padrões, as aplicações podem trocar informações e facilitar a experiência dos usuários. Desta forma, é possível desenvolver mini-aplicativos (chamados “portlets”), que publicam informações dos sistemas corporativos nas páginas dos portais internos. Estes portlets permitem interações com os sistemas, para permitir que os usuários tenham acesso rápido e fácil às informações. Podemos chamar estes portais de “Portais Transacionais”. Aqui temos 2 pontos que eu gostaria de chamar a atenção: 1 – O desenvolvimento de portlets é necessário porque eu não consigo publicar uma aplicação inteira no portal, normalmente por uma questão de padrões de desenvolvimento. Explicando de uma forma simples, a aplicação não foi feita para rodar dentro de um portal. Portanto, é necessário desenvolvimento adicional para criar mini-aplicativos que replicam (ou melhor, duplicam) a lógica do aplicativo principal, dentro do portal. 2 – Os aplicativos corporativos normalmente não incluem os recursos colaborativos de um portal (por exemplo, fóruns de discussão, lista de contatos com sensores de presença on-line, wikis, tags, etc), simplesmente porque este tipo de recurso normalmente não está disponível de forma “empacotada” para ser utilizada em um aplicativo. Desta forma, se eu quiser que a minha aplicação tenha um fórum de discussão para que os meus clientes conversem com a minha equipe técnica, eu tenho que desenvolver todo o motor do fórum de discussão dentro do meu aplicativo, o que se torna inviável, devido ao custo, tempo e ao fato de que este tipo de recurso normalmente não está no escopo da minha aplicação. O que acaba acontecendo é que os usuários fazem a parte “transacional” dentro do aplicativo, mas acabam utilizando outras interfaces para atender suas demandas de colaboração (neste caso, utilizariam um fórum fora da aplicação para discutir problemas referentes ao aplicativo). O Oracle WebCenter 11g vem para resolver estes dois pontos citados acima. O WebCenter não é simplesmente um novo portal, com alguns recursos interessantes; ele é uma nova forma de se pensar em Portais Corporativos (portais que reúnem os cenários citados acima: conteúdo, social e transacional). O WebCenter 11g é extenso demais para ser descrito em um único post, e nem é a minha intenção entrar no detalhe deste produto agora. Mas podemos definir o WebCenter 11g como sendo 3 “coisas”: - Um framework de desenvolvimento, aonde os recursos que as minhas aplicações irão utilizar (por exemplo, validação de crédito, consulta à estoque, registro de um pedido, etc), são desenvolvidos de forma a serem reutilizados por qualquer outra aplicação ou portlet que seja executado neste framework. Este tipo de componente reutilizável é chamado de “Task Flow”. - Um conjunto de serviços voltados à colaboração, como fóruns, wikis, blogs, tags, links, people connections, busca, bibliotecas de documentos, etc. Todos estes recursos colaborativos também estão disponíveis como Task Flows, desta forma, qualquer aplicação que eu desenvolva pode se beneficiar destes recursos. - Um “Portal”, do ponto de vista tradicional, aonde os usuários podem criar páginas, inserir e compartilhar conteúdo com outros usuários. Este Portal consegue utilizar os recursos desenvolvidos no Framework, garantindo o reuso. A imagem abaixo traz uma visão deste Portal. Clique para ver em tamanho maior. A grande inovação que o WebCenter traz é que a divisão entre “portal” e “aplicação” desaparece: qualquer aplicação agora pode ser desenvolvida com recursos de portal. O meu sistema de CRM, por exemplo, pode ter um fórum de discussão para os clientes. O meu sistema de suporte pode utilizar Wikis para montar FAQs de forma rápida. O sistema financeiro pode incluir uma biblioteca de documentos para que o usuário possa consultar os manuais de procedimento. Portanto, não importa se eu estou desenvolvendo uma “aplicação” ou um “portal”; o que importa é que os meus usuários agora terão em uma única interface as funcionalidades dos aplicativos e os recursos de colaboração. Este conceito, dentro da Oracle, é chamado de “Composite Applications”, e é a base para a próxima geração dos aplicativos Oracle. Nos próximos posts iremos falar (é claro) sobre como o WebCenter e o UCM se relacionam, e que tipo de recursos podem ser aproveitados nas aplicações/portais. Até breve!

    Read the article

  • MacBook start up problem

    - by DA
    I have an aging, ailing MacBook. The battery died on it a few months ago, but can still use it when plugged in. I recently upgraded it to Snow Leopard. Had it unplugged for a few days. Went to boot it up today and now get this symptom: start up chime white screen with apple logo shuts off That's all it'll do. I tried unplugging and holding down the power button for 30 seconds but that didn't remedy the situation. Any theories? Finally an excuse to get the 27" iMac?

    Read the article

  • mod_rewrite directory path to deeper directory

    - by DA.
    I don't usually work with LAMP and am a bit stumped getting a site working locally. The site is set up to be used via localhost: 1) http://localhost/mysite However, the way the site files are physically on the server the root is located as such: 2) /var/www/mysite/trunk/site I'm trying to figure out a way where I could type #1 but have apache actually looking for the files in #2 so that all of the asset/page links in the web application work. Is mod_rewrite the solution? If so, I'm stumped on the syntax. I have this but it won't work (due, I assume, to it causing an infinite loop) RewriteRule ^mysite/ mysite/trunk/site I have a hunch I need to sprinkle on some regex?

    Read the article

  • Running Subversion on Windows sans Apache?

    - by DA
    We're stuck with a Windows IIS 6 server at the moment. We'd really like to get a decent OS version control system set up for it. Can Subversion run without Apache? Most documentation that I've come across states that Apache is required, but I have seen a few mentions that Subversion can run as a stand-alone-server by itself alongside IIS. Alas, I can't find details on that particular configuration. Is that true and, if so, can anyone point me to some documentation on that?

    Read the article

  • itunes equalizer per track settings

    - by DA
    I'm a little confused about iTune's ability to set eq presets on a per-song basis. I have a song that I open, set to a given EQ preset, then close. When I play this song, however, the audio isn't being adjusted. If I open the EQ and turn it 'on', though, it then obeys the song's eq setting. Of course, if I leave the EQ on, then songs that do not have their own EQ setting default to whatever the EQ was originally set at. Not a HUGE deal, but it means that I would then normally have to have EQ always turned on, set to flat, so that any song that I HAVE given a EQ setting to will use it. Am I understanding how that works correctly? Is there a way to have individual songs use their EQ setting without having to turn on the EQ for everything?

    Read the article

  • How to find full/real email address from Lotus Notes?

    - by DA
    Is there any way to get the full set of email addresses? Example: I receive an email sent to a Lotus group 'all department employees'. I'd like to be able to grab the actual email addresses contained within (not their Lotus user name) so that I could email everyone from a client other than Lotus. Does such an option exist? I believe this was doable in Exchange with a right-click and 'expand nickname' type of action. I'm on a Mac.

    Read the article

  • Excel 2010 - more than 1 calculation within an IF() statement

    - by Da Bajan
    I have a situation where I need to calculate shipping values based on the length of the supply chain. Easy, however I need to have instances where an increased amount is required based on specific date criteria. My example is as follows: Shipvalue = 100 Date1 = 1/1/2013 (Jan) - ship 50% more than usual Date2 = 2/1/2013 (Feb) - ship 25% more than usual Date3 = 3/1/2013 (Mar) - ship 25% more than usual Supply chain length is: June - October 100 days November - March 140 days April - June 100 days The issue I have is that as there is an increase in the number of days, my formula: IF( Date1-(Supply chain length + any extra days)=today's date, shipvalue+(shipvalue X 50%), IF( Date2-(Supply chain length + any extra days)=today's date, shipvalue+(shipvalue x 50%) IF( Date2-(Supply chain length + any extra days)=today's date, shipvalue+(shipvalue x 50%), IF( preceding cell<>0,shipvalue, 0) ) ) ) Now the problem with this is that if the length of the supply chain increases then the formula misses all but the 1st increase. So, I thought of adding a variable that would be incremented and checked every time you made an increased shipping amount. So, how do I do both the calculation for the increased shipping value, and set the variable in one part of the IF statement?

    Read the article

  • on coding style

    - by user12607414
    I vastly prefer coding to discussing coding style, just as I would prefer to write poetry instead of talking about how it should be written. Sometimes the topic cannot be put off, either because some individual coder is messing up a shared code base and needs to be corrected, or (worse) because some officious soul has decided, "what we really need around here are some strongly enforced style rules!" Neither is the case at the moment, and yet I will venture a post on the subject. The following are not rules, but suggested etiquette. The idea is to allow a coherent style of coding to flourish safely and sanely, as a humane, inductive, social process. Maxim M1: Observe, respect, and imitate the largest-scale precedents available. (Preserve styles of whitespace, capitalization, punctuation, abbreviation, name choice, code block size, factorization, type of comments, class organization, file naming, etc., etc., etc.) Maxim M2: Don't add weight to small-scale variations. (Realize that Maxim M1 has been broken many times, but don't take that as license to create further irregularities.) Maxim M3: Listen to and rely on your reviewers to help you perceive your own coding quirks. (When you review, help the coder do this.) Maxim M4: When you touch some code, try to leave it more readable than you found it. (When you review such changes, thank the coder for the cleanup. When you plan changes, plan for cleanups.) On the Hotspot project, which is almost 1.5 decades old, we have often practiced and benefited from such etiquette. The process is, and should be, inductive, not prescriptive. An ounce of neighborliness is better than a pound of police-work. Reality check: If you actually look at (or live in) the Hotspot code base, you will find we have accumulated many annoying irregularities in our source base. I suppose this is the normal condition of a lived-in space. Unless you want to spend all your time polishing and tidying, you can't live without some smudge and clutter, can you? Final digression: Grammars and dictionaries and other prescriptive rule books are sometimes useful, but we humans learn and maintain our language by example not grammar. The same applies to style rules. Actually, I think the process of maintaining a clean and pleasant working code base is an instance of a community maintaining its common linguistic identity. BTW, I've been reading and listening to John McWhorter lately with great pleasure. (If you end with a digression, is it a tail-digression?)

    Read the article

  • Does C# have a future in games development?

    - by IbrarMumtaz
    I recently learned that the MMO Minecraft is powered by Java from a recent interview on CVG.co.uk on a possible collaboration between two former and now competing colleagues. In the interview he bluntly said that the founder of Minecraft is a Java coder and he is a C or C++ coder so they are incompatible with each other. So collaborating on future projects will be difficult. This got me thinking, If Java could do that? What does the future hold for MS very popular C# language and .Net platform as far as games or mainstream games development is concerned?

    Read the article

  • grep pattern interpretted differently in 2 different systems with same grep version

    - by Lance Woodson
    We manufacture a linux appliance for data centers, and all are running fedora installed from the same kickstart process. There are different hardware versions, some with IDE hard drives and some SCSI, so the filesystems may be at /dev/sdaN or /dev/hdaN. We have a web interface into these appliances that show disk usage, which is generated using "df | grep /dev/*da". This generally works for both hardware versions, giving an output like follows: /dev/sda2 5952284 3507816 2137228 63% / /dev/sda5 67670876 9128796 55049152 15% /data /dev/sda1 101086 11976 83891 13% /boot However, for one machine, we get the following result from that command: Binary file /dev/sda matches It seems that its grepping files matching /dev/*da for an unknown pattern for some reason, only on this box that is seemingly identical in grep version, packages, kernel, and hardware. I switched the grep pattern to be "/dev/.da" and everything works as expected on this troublesome box, but I hate not knowing why this is happening. Anyone have any ideas? Or perhaps some other tests to try?

    Read the article

  • Passing integer lists in a sql query, best practices

    - by Artiom Chilaru
    I'm currently looking at ways to pass lists of integers in a SQL query, and try to decide which of them is best in which situation, what are the benefots of each, and what are the pitfalls, what should be avoided :) Right now I know of 3 ways that we currently use in our application. 1) Table valued parameter: Create a new Table Valued Parameter in sql server: CREATE TYPE [dbo].[TVP_INT] AS TABLE( [ID] [int] NOT NULL ) Then run the query against it: using (var conn = new SqlConnection(DataContext.GetDefaultConnectionString)) { var comm = conn.CreateCommand(); comm.CommandType = CommandType.Text; comm.CommandText = @" UPDATE DA SET [tsLastImportAttempt] = CURRENT_TIMESTAMP FROM [Account] DA JOIN @values IDs ON DA.ID = IDs.ID"; comm.Parameters.Add(new SqlParameter("values", downloadResults.Select(d => d.ID).ToDataTable()) { TypeName = "TVP_INT" }); conn.Open(); comm.ExecuteScalar(); } The major disadvantages of this method is the fact that Linq doesn't support table valued params (if you create an SP with a TVP param, linq won't be able to run it) :( 2) Convert the list to Binary and use it in Linq! This is a bit better.. Create an SP, and you can run it within linq :) To do this, the SP will have an IMAGE parameter, and we'll be using a user defined function (udf) to convert this to a table.. We currently have implementations of this function written in C++ and in assembly, both have pretty much the same performance :) Basically, each integer is represented by 4 bytes, and passed to the SP. In .NET we have an extension method that convers an IEnumerable to a byte array The extension method: public static Byte[] ToBinary(this IEnumerable intList) { return ToBinaryEnum(intList).ToArray(); } private static IEnumerable<Byte> ToBinaryEnum(IEnumerable<Int32> intList) { IEnumerator<Int32> marker = intList.GetEnumerator(); while (marker.MoveNext()) { Byte[] result = BitConverter.GetBytes(marker.Current); Array.Reverse(result); foreach (byte b in result) yield return b; } } The SP: CREATE PROCEDURE [Accounts-UpdateImportAttempts] @values IMAGE AS BEGIN UPDATE DA SET [tsLastImportAttempt] = CURRENT_TIMESTAMP FROM [Account] DA JOIN dbo.udfIntegerArray(@values, 4) IDs ON DA.ID = IDs.Value4 END And we can use it by running the SP directly, or in any linq query we need using (var db = new DataContext()) { db.Accounts_UpdateImportAttempts(downloadResults.Select(d => d.ID).ToBinary()); // or var accounts = db.Accounts .Where(a => db.udfIntegerArray(downloadResults.Select(d => d.ID).ToBinary(), 4) .Select(i => i.Value4) .Contains(a.ID)); } This method has the benefit of using compiled queries in linq (which will have the same sql definition, and query plan, so will also be cached), and can be used in SPs as well. Both these methods are theoretically unlimited, so you can pass millions of ints at a time :) 3) The simple linq .Contains() It's a more simple approach, and is perfect in simple scenarios. But is of course limited by this. using (var db = new DataContext()) { var accounts = db.Accounts .Where(a => downloadResults.Select(d => d.ID).Contains(a.ID)); } The biggest drawback of this method is that each integer in the downloadResults variable will be passed as a separate int.. In this case, the query is limited by sql (max allowed parameters in a sql query, which is a couple of thousand, if I remember right). So I'd like to ask.. What do you think is the best of these, and what other methods and approaches have I missed?

    Read the article

  • Sending changes from multiple tables in disconnected dataset to SQLServer...

    - by Stecy
    We have a third party application that accept calls using an XML RPC mechanism for calling stored procs. We send a ZIP-compressed dataset containing multiple tables with a bunch of update/delete/insert using this mechanism. On the other end, a CLR sproc decompress the data and gets the dataset. Then, the following code gets executed: using (var conn = new SqlConnection("context connection=true")) { if (conn.State == ConnectionState.Closed) conn.Open(); try { foreach (DataTable table in ds.Tables) { string columnList = ""; for (int i = 0; i < table.Columns.Count; i++) { if (i == 0) columnList = table.Columns[0].ColumnName; else columnList += "," + table.Columns[i].ColumnName; } var da = new SqlDataAdapter("SELECT " + columnList + " FROM " + table.TableName, conn); var builder = new SqlCommandBuilder(da); builder.ConflictOption = ConflictOption.OverwriteChanges; da.RowUpdating += onUpdatingRow; da.Update(ds, table.TableName); } } catch (....) { ..... } } Here's the event handler for the RowUpdating event: public static void onUpdatingRow(object sender, SqlRowUpdatingEventArgs e) { if ((e.StatementType == StatementType.Update) && (e.Command == null)) { e.Command = CreateUpdateCommand(e.Row, sender as SqlDataAdapter); e.Status = UpdateStatus.Continue; } } and the CreateUpdateCommand method: private static SqlCommand CreateUpdateCommand(DataRow row, SqlDataAdapter da) { string whereClause = ""; string setClause = ""; SqlConnection conn = da.SelectCommand.Connection; for (int i = 0; i < row.Table.Columns.Count; i++) { char quoted; if ((row.Table.Columns[i].DataType == Type.GetType("System.String")) || (row.Table.Columns[i].DataType == Type.GetType("System.DateTime"))) quoted = '\''; else quoted = ' '; string val = row[i].ToString(); if (row.Table.Columns[i].DataType == Type.GetType("System.Boolean")) val = (bool)row[i] ? "1" : "0"; bool isPrimaryKey = false; for (int j = 0; j < row.Table.PrimaryKey.Length; j++) { if (row.Table.PrimaryKey[j].ColumnName == row.Table.Columns[i].ColumnName) { if (whereClause != "") whereClause += " AND "; if (row[i] == DBNull.Value) whereClause += row.Table.Columns[i].ColumnName + "=NULL"; else whereClause += row.Table.Columns[i].ColumnName + "=" + quoted + val + quoted; isPrimaryKey = true; break; } } /* Only values for column that is not a primary key can be modified */ if (!isPrimaryKey) { if (setClause != "") setClause += ", "; if (row[i] == DBNull.Value) setClause += row.Table.Columns[i].ColumnName + "=NULL"; else setClause += row.Table.Columns[i].ColumnName + "=" + quoted + val + quoted; } } return new SqlCommand("UPDATE " + row.Table.TableName + " SET " + setClause + " WHERE " + whereClause, conn); } However, this is really slow when we have a lot of records. Is there a way to optimize this or an entirely different way to send lots of udpate/delete on several tables? I would really much like to use TSQL for this but can't figure a way to send a dataset to a regular sproc. Additional notes: We cannot directly access the SQLServer database. We tried without compression and it was slower.

    Read the article

  • Ado.net Fill method not throwing error on running a Stored Procedure that does not exist.

    - by Mike
    I am using a combination of the Enterprise library and the original Fill method of ADO. This is because I need to open and close the command connection myself as I am capture the event Info Message Here is my code so far // Set Up Command SqlDatabase db = new SqlDatabase(ConfigurationManager.ConnectionStrings[ConnectionName].ConnectionString); SqlCommand command = db.GetStoredProcCommand(StoredProcName) as SqlCommand; command.Connection = db.CreateConnection() as SqlConnection; // Set Up Events for Logging command.StatementCompleted += new StatementCompletedEventHandler(command_StatementCompleted); command.Connection.FireInfoMessageEventOnUserErrors = true; command.Connection.InfoMessage += new SqlInfoMessageEventHandler(Connection_InfoMessage); // Add Parameters foreach (Parameter parameter in Parameters) { db.AddInParameter(command, parameter.Name, (System.Data.DbType)Enum.Parse(typeof(System.Data.DbType), parameter.Type), parameter.Value); } // Use the Old Style fill to keep the connection Open througout the population // and manage the Statement Complete and InfoMessage events SqlDataAdapter da = new SqlDataAdapter(command); DataSet ds = new DataSet(); // Open Connection command.Connection.Open(); // Populate da.Fill(ds); // Dispose of the adapter if (da != null) { da.Dispose(); } // If you do not explicitly close the connection here, it will leak! if (command.Connection.State == ConnectionState.Open) { command.Connection.Close(); } ... Now if I pass into the variable StoredProcName = "ThisProcDoesNotExists" And run this peice of code. The CreateCommand nor da.Fill through an error message. Why is this. The only way I can tell it did not run was that it returns a dataset with 0 tables in it. But when investigating the error it is not appearant that the procedure does not exist. EDIT Upon further investigation command.Connection.FireInfoMessageEventOnUserErrors = true; is causeing the error to be surpressed into the InfoMessage Event From BOL When you set FireInfoMessageEventOnUserErrors to true, errors that were previously treated as exceptions are now handled as InfoMessage events. All events fire immediately and are handled by the event handler. If is FireInfoMessageEventOnUserErrors is set to false, then InfoMessage events are handled at the end of the procedure. What I want is each print statement from Sql to create a new log record. Setting this property to false combines it as one big string. So if I leave the property set to true, now the question is can I discern a print message from an Error ANOTHER EDIT So now I have the code so that the flag is set to true and checking the error number in the method void Connection_InfoMessage(object sender, SqlInfoMessageEventArgs e) { // These are not really errors unless the Number >0 // if Number = 0 that is a print message foreach (SqlError sql in e.Errors) { if (sql.Number == 0) { Logger.WriteInfo("Sql Message",sql.Message); } else { // Whatever this was it was an error throw new DataException(String.Format("Message={0},Line={1},Number={2},State{3}", sql.Message, sql.LineNumber, sql.Number, sql.State)); } } } The issue now that when I throw the error it does not bubble up to the statement that made the call or even the error handler that is above that. It just bombs out on that line The populate looks like // Populate try { da.Fill(ds); } catch (Exception e) { throw new Exception(e.Message, e); } Now even though I see the calling codes and methods still in the Call Stack, this exception does not seem to bubble up?

    Read the article

  • VBScript Multiple folder check if then statement

    - by user2868186
    I had this working before just fine with the exception of getting an error if one of the folders was not there, so I tried to fix it. Searched for a while (as much as I can at work) for a solution and tried different methods, still no luck and my IT tickets are stacking up at work, lol, woohoo. Thanks for any help provided. Getting syntax error on line 60 character 60, thanks again. Option Explicit Dim objFSO, Folder1, Folder2, Folder3, zipFile Dim ShellApp, zip, oFile, CurDate, MacAdd, objWMIService Dim MyTarget, MyHex, MyBinary, i, strComputer, objItem, FormatMAC Dim oShell, oCTF, CurDir, scriptPath, oRegEx, colItems Dim FoldPath1, FoldPath2, FoldPath3, foldPathArray Const FOF_SIMPLEPROGRESS = 256 'Grabs MAC from current machine strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") For Each objItem in colItems MacAdd = objItem.MACAddress Next 'Finds the pattern of a MAC address then changes it for 'file naming purposes. You can change the FormatMAC line of the code 'in parenthesis where the periods are, to whatever you like 'as long as its within the standard file naming convention Set oRegEx = CreateObject("VBScript.RegExp") oRegEx.Pattern = "([\dA-F]{2}).?([\dA-F]{2}).?([\dA-F]" _ & "{2}).?([\dA-F]{2}).?([\dA-F]{2}).?([\dA-F]{2})" FormatMAC = oRegEx.Replace(MacAdd, "$1.$2.$3.$4.$5.$6") 'Gets current date in a format for file naming 'Periods can be replaced with anything that is standard to 'file naming convention CurDate = Month(Date) & "." & Day(Date) & "." & Year(Date) 'Gets path of the directory where the script is being ran from Set objFSO = CreateObject("Scripting.FileSystemObject") scriptPath = Wscript.ScriptFullName Set oFile = objFSO.GetFile(scriptPath) CurDir = objFSO.GetParentFolderName(oFile) 'where and what the zip file will be called/saved MyTarget = CurDir & "\" & "IRAP_LOGS_" & CurDate & "_" & FormatMAC & ".zip" 'Actual creation of the zip file MyHex = Array(80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0) For i = 0 To UBound(MyHex) MyBinary = MyBinary & Chr(MyHex(i)) Next Set oShell = CreateObject("WScript.Shell") Set oCTF = objFSO.CreateTextFile(MyTarget, True) oCTF.Write MyBinary oCTF.Close Set oCTF = Nothing wScript.Sleep(3000) folder1 = True folder2 = True folder3 = True 'Adds folders to the zip file created earlier 'change these folders to whatever is needing to be copied into the zip folder 'Folder1 If not objFSO.FolderExists("C:\Windows\Temp\SMSTSLog") and If not objFSO.FolderExists("X:\Windows\Temp\SMSTSLog") then Folder1 = false End If If objFSO.FolderExists("C:\Windows\Temp\SMSTSLog") Then Folder1 = "C:\Windows\Temp\SMSTSLog" Set FoldPath1 = objFSO.getFolder(Folder1) Else Folder1 = "X:\windows\Temp\SMSTSLog" Set FoldPath1 = objFSO.getFolder(Folder1) End If 'Folder2 If not objFSO.FolderExists("C:\Windows\System32\CCM\Logs") and If not objFSO.FolderExists("X:\Windows\System32\CCM\Logs") then Folder2 = false End If If objFSO.FolderEXists("C:\Windows\System32\CCM\Logs") Then Folder2 = "C:\Windows\System32\CCM\Logs" Set FoldPath2 = objFSO.getFolder(Folder2) Else Folder2 = "X:\Windows\System32\CCM\Logs" Set FoldPath2 = objFSO.getFolder(Folder2) End If 'Folder3 If not objFSO.FolderExists("C:\Windows\SysWOW64\CCM\Logs") and If not objFSO.FolderExists("X:\Windows\SysWOW64\CCM\Logs") then Folder3 = false End If If objFSO.FolderExists("C:\Windows\SysWOW64\CCM\Logs") Then Folder3 = "C:\Windows\SysWOW64\CCM\Logs" set FolderPath3 =objFSO.getFolder(Folder3) Else Folder3 = "X:\Windows\SysWOW64\CCM\Logs" Set FoldPath3 = objFSO.getFolder(Folder3) End If set objFSO = CreateObject("Scripting.FileSystemObject") objFSO.OpenTextFile(MyTarget, 2, True).Write "PK" & Chr(5) & Chr(6) _ & String(18, Chr(0)) Set ShellApp = CreateObject("Shell.Application") Set zip = ShellApp.NameSpace(MyTarget) 'checks if files are there before trying to copy 'otherwise it will error out If folder1 = True And FoldPath1.files.Count >= 1 Then zip.CopyHere Folder1 End If WScript.Sleep 3000 If folder2 = true And FoldPath2.files.Count >= 1 Then zip.CopyHere Folder2 End If WScript.Sleep 3000 If folder3 = true And FoldPath3.files.Count >= 1 Then zip.CopyHere Folder3 End If WScript.Sleep 5000 set ShellApp = Nothing set ZipFile = Nothing Set Folder1 = Nothing Set Folder2 = Nothing Set Folder3 = Nothing createobject("wscript.shell").popup "Zip File Created Successfully", 3

    Read the article

  • Aplicações do SharePoint e Windows Azure

    - by Leniel Macaferi
    Segunda-feira passada eu tive a oportunidade de me apresentar dando uma palestra na SharePoint Conference (em Inglês). Meu segmento na palestra cobriu o novo modelo de Aplicações para Nuvem do SharePoint (SharePoint Cloud App Model) que estamos introduzindo como parte dos próximos lançamentos do SharePoint 2013 e Office 365. Este novo modelo de aplicações para o SharePoint é aditivo para as soluções de total confiança que os desenvolvedores escrevem atualmente, e é construído em torno de três pilares principais: Simplificar o modelo de desenvolvimento tornando-o consistente entre a versão local do SharePoint e a versão online do SharePoint fornecida com o Office 365. Tornar o modelo de execução flexível - permitindo que os desenvolvedores criem aplicações e escrevam código que pode ser executado fora do núcleo do serviço do SharePoint. Isto torna mais fácil implantar aplicações SharePoint usando a Windows Azure, evitando a preocupação com a quebra do SharePoint e das aplicações que rodam dentro dele quando algo é atualizado. Este novo modelo flexível também permite que os desenvolvedores escrevam aplicações do SharePoint que podem alavancar as capacidades do .NET Framework - incluindo ASP.NET Web Forms 4.5, ASP.NET MVC 4, ASP.NET Web API, Entity Framework 5, Async, e mais. Implementar este modelo flexível utilizando protocolos padrão da web - como OAuth, JSON e APIs REST - que permitem aos desenvolvedores reutilizar habilidades e ferramentas, facilmente integrando o SharePoint com arquiteturas Web e arquiteturas para aplicações móveis. Um vídeo da minha palestra + demos está disponível para assistir on-line (em Inglês): Na palestra eu mostrei como construir uma aplicação a partir do zero - ela mostrou como é fácil construir soluções usando a nova aplicação SharePoint, e destacou um cenário web + workflow + móvel que integra o SharePoint com código hospedado na Windows Azure (totalmente construído usando o Visual Studio 2012 e ASP.NET 4.5 - incluindo MVC e Web API). O novo Modelo de Aplicações para Nuvem do SharePoint é algo que eu acho extremamente emocionante, e que vai tornar muito mais fácil criar aplicações SharePoint usando todo o poder da Windows Azure e do .NET Framework. Usar a Windows Azure para estender facilmente soluções baseadas em SaaS como o Office 365 é também algo muito natural e que vai oferecer um monte de ótimas oportunidades para os desenvolvedores.  Espero que ajude, - Scott P.S. Além do blog, eu também estou utilizando o Twitter para atualizações rápidas e para compartilhar links. Siga-me em: twitter.com/ScottGu Texto traduzido do post original por Leniel Macaferi.

    Read the article

  • Oracle Forms Migration Forum - 1/Mar/11 - Lisboa

    - by Claudia Costa
      Modernize o seu Investimento em FormsO Oracle Forms é uma tecnologia de longa data da Oracle que permite desenhar e desenvolver aplicações empresariais de forma rápida e eficiente. Em complemento, o Oracle Reports permite um acesso rápido a toda a informação relevante para o negócio.Como membros da família de produtos Oracle Fusion Middleware, o Oracle Forms e o Oracle Reports garantem grande agilidade, melhor tomada de decisões, mitigação de risco e redução de custos para diversos ambientes de TI.Preserve o seu investimento em FormsO compromisso contínuo da Oracle para com a tecnologia Forms vai permitir-lhe actualizar e reintegrar o investimento já existente. Não só as suas aplicações podem ser implantadas para a Web, como poderão também fazer parte de uma Arquitectura Orientada a Serviços (SOA) construída a partir de Web Services.Nesta sessão de meio dia ficará a conhecer todas as opções de migração de Forms para uma tomada de decisão esclarecida.Iremos abordar os seguintes temas: Modernizar o seu investimento. Tire proveito das mais recentes tecnologias. Escolher o caminho acertado para o seu negócio. Evolução no sentido certo. Preservar activos já existentes. Actualize sem perder o que já investiu. Eleve e modernize o legado Forms na sua organização!Clique aqui para se registar neste evento GRATUITO. Para esclarecimentos adicionais envie-nos um email.   AGENDA Registe-se Agora!

    Read the article

  • Customer Service Experience, Oracle e Cels insieme per innovare le strategie.

    - by Claudia Caramelli-Oracle
    Si è svolto oggi il workshop Oracle "Customer Service Experience. Strategie per progettare un Servizio eccellente e profittevole." che ha visto il contributo del gruppo di ricerca CELS (Research Group on Industrial Engineering, Logistics and Service Operations) e della sezione ASAP SMF dell’Università degli Studi di Bergamo. Giuditta Pezzotta (PhD - Cels) e Roberto Pinto (PhD - Cels) ci hanno presentato la Service Engineering Methodology (SEEM), innovativa piattaforma metodologica che permette di ottimizzare la creazione di valore sia per il cliente finale sia per l’azienda, partendo dalla progettazione del prodotto e arrivando alla progettazione della soluzione prodotto-servizio, e valutando la bontà del prodotto-servizio ipotizzato attraverso strumenti concettuali e di simulazione dei processi. Armando Janigro, CX Strategy Director EMEA - Oracle ha invece parlato di Modern Customer Service, ovvero di come adattarsi in modo agile e veloce alle mutevoli necessità dei clienti, ipotizzando l’adozione in chiave strategica di nuovi strumenti di differenziazione e di leadership come la Customer Experience (CX) e sfruttando le nuove dinamiche di relazione azienda-singolo consumatore per ottimizzare l’esperienza multicanale e per render più efficiente il Customer Service, creando ulteriore valore. A seguire è stata mostrata da PierLuigi Coli, Principal Sales Consultant - Oracle, una demo sui prodotti Service Cloud offerti da Oracle, a supporto di tutti i concetti raccontati nelle sessioni precedenti. Il workshop è stato un’occasione unica per definire i percorsi da intraprendere per sviluppare efficaci strategie di Customer Experience grazie ad approcci e metodologie innovative alla base di uno sviluppo sostenibile del business. Le slide proiettate sono disponibili su richiesta: scrivi a Claudia Caramelli per ogni informazione o chiarimento.

    Read the article

  • Can my loop be optimized any more? (C++)

    - by Sagekilla
    Below is one of my inner loops that's run several thousand times, with input sizes of 20 - 1000 or more. Is there anything I can do to help squeeze any more performance out of this? I'm not looking to move this code to something like using tree codes (Barnes-Hut), but towards optimizing the actual calculations happening inside, since the same calculations occur in the Barnes-Hut algorithm. Any help is appreciated! typedef double real; struct Particle { Vector pos, vel, acc, jerk; Vector oldPos, oldVel, oldAcc, oldJerk; real mass; }; class Vector { private: real vec[3]; public: // Operators defined here }; real Gravity::interact(Particle *p, size_t numParticles) { PROFILE_FUNC(); real tau_q = 1e300; for (size_t i = 0; i < numParticles; i++) { p[i].jerk = 0; p[i].acc = 0; } for (size_t i = 0; i < numParticles; i++) { for (size_t j = i+1; j < numParticles; j++) { Vector r = p[j].pos - p[i].pos; Vector v = p[j].vel - p[i].vel; real r2 = lengthsq(r); real v2 = lengthsq(v); // Calculate inverse of |r|^3 real r3i = Constants::G * pow(r2, -1.5); // da = r / |r|^3 // dj = (v / |r|^3 - 3 * (r . v) * r / |r|^5 Vector da = r * r3i; Vector dj = (v - r * (3 * dot(r, v) / r2)) * r3i; // Calculate new acceleration and jerk p[i].acc += da * p[j].mass; p[i].jerk += dj * p[j].mass; p[j].acc -= da * p[i].mass; p[j].jerk -= dj * p[i].mass; // Collision estimation // Metric 1) tau = |r|^2 / |a(j) - a(i)| // Metric 2) tau = |r|^4 / |v|^4 real mij = p[i].mass + p[j].mass; real tau_est_q1 = r2 / (lengthsq(da) * mij * mij); real tau_est_q2 = (r2*r2) / (v2*v2); if (tau_est_q1 < tau_q) tau_q = tau_est_q1; if (tau_est_q2 < tau_q) tau_q = tau_est_q2; } } return sqrt(sqrt(tau_q)); }

    Read the article

  • Dynamic Array Java program converted to C#

    - by Sef
    Hello, The folowing program was orignally in java. But i still get 1 error with the program in C#. (the eror is listed in comment in the 2nd block of code). using System; using System.Collections.Generic; using System.Linq; using System.Text; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DynArray { public class DynArrayTester { static void Main(string[] args) { DynArray da = new DynArray(5); for (int i = 1; i <= 7; i++) { da.setData(i, i); //da.put(0, 0); //da.put(6, 6); } Console.WriteLine(da); } }/*DynArrayTester*/ } using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DynArray { public class DynArray { //toestand private int[] data; //gedrag public DynArray(int size) { data = new int[size]; } public int getData(int index) { return data[index - 1]; } private void expand(int size) { int[] tmp = data; data = new int[size]; for (int i = 0; i < tmp.Length; i++) { data[i] = tmp[i]; } }/*expand*/ public void setData(int index, int data) { if (0 < index) { if (index > this.data.length) // ***error, does not contain definition for "lenght" and no exetension method "lenght"*** expand(index); this.data[index - 1] = data; } } public override string ToString() { StringBuilder buf = new StringBuilder(); for (int i = 0; i < data.Length; i++) { buf.Append("[" + i + "]"); buf.Append(data[i]); buf.Append('\n'); } return buf.ToString(); } }/*DynArray*/ }

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >