Search Results

Search found 24 results on 1 pages for 'daniil harik'.

Page 1/1 | 1 

  • Using design-patterns to transform web-service model classes into local model classes and vise versa

    - by Daniil Petrov
    There is a web-application built with play framework 1.2.7. It contains less than 10 model classes. The main purpose of the application is a lightweight access to a complex remote application (more than 50 model classes). The remote application has its own SOAP API and we use it for synchronization of data. There is a scheduled job in the web-app which makes requests to the remote app. It gets bunches of objects from the remote model and populates corresponding objects of the local model. Currently, there are two groups of classes - the local model and the remote model (generated from wsdl schema). It is not allowed to make any modifications to the remote model. Transformations are being made in the scheduled job class. When it gets objects from the remote app it creates local objects. Recently, it was decided to add a possibility to modify the remote objects. It requires more transformations on our side. We need to transform from remote to local model when reading objects and from local to remote when changing objects. I wonder if this would be possible to use some design-patterns to reduce a number of transformations?

    Read the article

  • Backup broken PostgreSQL 8.4 without pg_dump

    - by Daniil
    So. I have a problem. PostgreSQL 8.4 won't start or restart without any output given. But it worked for 3 monthes until hosting provider doesn't rebooted server. Now it is completly broken. It wan't start and doesn't give any output or log. pg_dump: [archiver (db)] connection to database "postgres" failed: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? Now I want to backup (or just start pgsql socket) my database to reinstall postgesql. How?

    Read the article

  • WPF Binding KeyDown event to Command

    - by Daniil Harik
    Hello, I want to bind KeyDown event handler (when user presses Ctrl+C and Ctrl+V) on Telerik's GridView to RelayCommand object in my ViewModel. I know about this post http://blog.functionalfun.net/2008/09/hooking-up-commands-to-events-in-wpf.html But I'm still bit confused about implementation of my scenario. I just don't understand how it works. Could someone point out how should my scenario be implemented. Thank You very much!

    Read the article

  • WPF TextBlock highlight certan parts based on search condition

    - by Daniil Harik
    Hello, I have TextBlock that has Inlines dynamicly added to it (basically bunch of Run objects that are either italic or bold). In my application I have search function. I want to be able to highlight TextBlock's text that is in being searched for. By highlighting I mean changing certain parts of TextBlock text's color (keeping in mind that it may highlight several different Run objects at a time). I have tried this example http://blogs.microsoft.co.il/blogs/tamir/archive/2008/05/12/search-and-highlight-any-text-on-wpf-rendered-page.aspx But it seams very unstable :( Is there easy way to solve this problem?

    Read the article

  • jQuery upload file using jQuery's ajax method (without plugins)

    - by Daniil Harik
    Hello, At moment I want to implement picture upload without using any plug-ins. My upload form looks like this <form action="/Member/UploadPicture" enctype="multipart/form-data" id="uploadform" method="post"> <span style="display: none;"> <div class="upload" id="imgUpl"> <h3>Upload profile picture</h3> <div class="clear5"></div> <input type="file" name="file" id="file" /> <button class="btn-bl" id="upComplete"><span>Upload</span></button> </div> </span> </form> And my jQuery code is: $('#upComplete').click(function () { $('#up').hide(); $('#upRes').show(); var form = $("#uploadform"); $.ajax({ type: "POST", url: "/Member/UploadPicture", data: form.serialize(), success: function (data) { alert(data); } }); $.fancybox.close(); return false; }); If I open firebug, I can see that ajax() method does simple form post (not multi-part) and POST content is empty Is it possible to do files upload using jQuery ajax() method or should I do this in any other way? Thank You very much

    Read the article

  • .NET Get timezone offset by timezone name

    - by Daniil Harik
    Hello, In database I store all date/times in UTC. I know user's timezone name ("US Eastern Standard Time" for example). In order to display correct time I was thinking that I need to add user's timezone offset to UTC date/time. But how would I get timezone offset by timezone name? Thank You!

    Read the article

  • LinQ to objects GroupBy() by object and Sum() by amount

    - by Daniil Harik
    Hello, I have pretty simple case which I started solving using foreach(), but then I thought I could do It using Linq Basically I have IList that contains PaymentTransaction objects and there are 2 properties Dealer and Amount I want to GroupBy() by Dealer and Sum() bv amount. I tried to accomplish this using following code, but unfortunately it does not work var test = paymentTransactionDao.GetAll().GroupBy(x => x.Dealer).Sum(x => x.Amount); Want exactly I'm doing wrong here? I'm sorry if this question is too simple. Thank You

    Read the article

  • How to use Boost 1.41.0 graph layout algorithmes

    - by daniil-k
    Hi I have problem using boost graph layout algorithmes. boost verision 1_41_0 mingw g++ 4.4.0. So there are issues I have encountered Can you suggest me with them? The function fruchterman_reingold_force_directed_layout isn't compiled. The kamada_kawai_spring_layout compiled but program crashed. Boost documentation to layout algorithms is wrong, sample to fruchterman_reingold_force_directed_layout isn't compiled. This is my example. To use function just uncomment one. String 60, 61, 63. #include <boost/config.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/graph_utility.hpp> #include <boost/graph/simple_point.hpp> #include <boost/property_map/property_map.hpp> #include <boost/graph/circle_layout.hpp> #include <boost/graph/fruchterman_reingold.hpp> #include <boost/graph/kamada_kawai_spring_layout.hpp> #include <iostream> //typedef boost::square_topology<>::point_difference_type Point; typedef boost::square_topology<>::point_type Point; struct VertexProperties { std::size_t index; Point point; }; struct EdgeProperty { EdgeProperty(const std::size_t &w):weight(w) {} double weight; }; typedef boost::adjacency_list<boost::listS, boost::listS, boost::undirectedS, VertexProperties, EdgeProperty > Graph; typedef boost::property_map<Graph, std::size_t VertexProperties::*>::type VertexIndexPropertyMap; typedef boost::property_map<Graph, Point VertexProperties::*>::type PositionMap; typedef boost::property_map<Graph, double EdgeProperty::*>::type WeightPropertyMap; typedef boost::graph_traits<Graph>::vertex_descriptor VirtexDescriptor; int main() { Graph graph; VertexIndexPropertyMap vertexIdPropertyMap = boost::get(&VertexProperties::index, graph); for (int i = 0; i < 3; ++i) { VirtexDescriptor vd = boost::add_vertex(graph); vertexIdPropertyMap[vd] = i + 2; } boost::add_edge(boost::vertex(1, graph), boost::vertex(0, graph), EdgeProperty(5), graph); boost::add_edge(boost::vertex(2, graph), boost::vertex(0, graph), EdgeProperty(5), graph); std::cout << "Vertices\n"; boost::print_vertices(graph, vertexIdPropertyMap); std::cout << "Edges\n"; boost::print_edges(graph, vertexIdPropertyMap); PositionMap positionMap = boost::get(&VertexProperties::point, graph); WeightPropertyMap weightPropertyMap = boost::get(&EdgeProperty::weight, graph); boost::circle_graph_layout(graph, positionMap, 100); // boost::fruchterman_reingold_force_directed_layout(graph, positionMap, boost::square_topology<>()); boost::kamada_kawai_spring_layout(graph, positionMap, weightPropertyMap, boost::square_topology<>(), boost::side_length<double>(10), boost::layout_tolerance<>(), 1, vertexIdPropertyMap); std::cout << "Coordinates\n"; boost::graph_traits<Graph>::vertex_iterator i, end; for (boost::tie(i, end) = boost::vertices(graph); i != end; ++i) { std::cout << "ID: (" << vertexIdPropertyMap[*i] << ") x: " << positionMap[*i][0] << " y: " << positionMap[*i][1] << "\n"; } return 0; }

    Read the article

  • Rails 2.3.5, Ruby 1.9, SQLite 3 incompatible character encodings: UTF-8 and ASCII-8BIT

    - by Daniil Harik
    Hello, I know that question with same title has been asked almost 6 month ago. I have Googled for this problem and I have not found any working solution. Has there been any fixes for this very critical problem? I need to get my website running ASAP. Just to get the site up and running I'm even ready to add utf8 conversion methods to all my variables or risk to upgrade to Rails 3 beta Thank You in advance!

    Read the article

  • Memory mapped files causes low physical memory

    - by harik
    I have a 2GB RAM and running a memory intensive application and going to low available physical memory state and system is not responding to user actions, like opening any application or menu invocation etc. How do I trigger or tell the system to swap the memory to pagefile and free physical memory? I'm using Windows XP. If I run the same application on 4GB RAM machine it is not the case, system response is good. After getting choked of available physical memory system automatically swaps to pagefile and free physical memory, not that bad as 2GB system. To overcome this problem (on 2GB machine) attempted to use memory mapped files for large dataset which are allocated by application. In this case virtual memory of the application(process) is fine but system cache is high and same problem as above that physical memory is less. Even though memory mapped file is not mapped to process virtual memory system cache is high. why???!!! :( Any help is appreciated. Thanks.

    Read the article

  • WPF layout with several fixed height parts and certain parts relative to window size

    - by Daniil Harik
    Hello, At moment my main layout consists of vertically oriented stack panel and it looks like this: Root StackPanel StackPanel - fixed Height 150 (horizontal orientation) StackPanel - relative Height must be behalf of free space left on screen (but at least 150 px). Used by Telerik GridView Control, if I don't specify Height or MaxHeight Telerik GridView Height becomes very large and does not fit my window. StackPanel - fixed Height 100 (horizontal orientation) StackPanel - relative Height must be half of free space left on screen (but at least 150 px). Used by Telerik GridView Control, if I don't specify Height or MaxHeight Telerik GridView Height becomes very large and does not fit my window. StackPanel - fixed Height 100 (horizontal orientation) The view must totally fit available screen size. The problem is that I don't understand how to make certain areas of my view resize depending on available screen size. Is there is easy way to solve it, or should I be binding to Window height property and doing math? Thank You very much!

    Read the article

  • Binary socket and policy file in Flex

    - by Daniil
    Hi, I'm trying to evaluate whether Flex can access binary sockets. Seems that there's a class calles Socket (flex.net package). The requirement is that Flex will connect to a server serving binary data. It will then subscribe to data and receive the feed which it will interpret and display as a chart. I've never worked with Flex, my experience lies with Java, so everything is new to me. So I'm trying to quickly set something simple up. The Java server expects the following: DataInputStream in = ..... byte cmd = in.readByte(); int size = in.readByte(); byte[] buf = new byte[size]; in.readFully(buf); ... do some stuff and send binary data in something like out.writeByte(1); out.writeInt(10000); ... etc... Flex, needs to connect to a localhost:6666 do the handshake and read data. I got something like this: try { var socket:Socket = new Socket(); socket.connect('192.168.110.1', 9999); Alert.show('Connected.'); socket.writeByte(108); // 'l' socket.writeByte(115); // 's' socket.writeByte(4); socket.writeMultiByte('HHHH', 'ISO-8859-1'); socket.flush(); } catch (err:Error) { Alert.show(err.message + ": " + err.toString()); } The first thing is that Flex does a <policy-file-request/>. I've modified the server to respond with: <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <site-control permitted-cross-domain-policies="master-only"/> <allow-access-from domain="192.168.110.1" to-ports="*" /> </cross-domain-policy> After that - EOFException happens on the server and that's it. So the question is, am I approaching whole streaming data issue wrong when it comes to Flex? Am I sending the policy file wrong? Unfortunately, I can't seem to find a good solid example of how to do it. It seems to me that Flex can do binary Client-Server application, but I personally lack some basic knowledge when doing it. I'm using Flex 3.5 in IntelliJ IDEA IDE. Any help is appreciated. Thank you!

    Read the article

  • jQuery delegates with plugins

    - by Daniil Harik
    Hello, jQuery delegates are great, especially when using with table row click events. I was wondering if it's possible to use delegates with plug-ins as well? For example if I attach elastic plug-in to every text area, I would do: $("textarea").elastic(); But how would I attach this plug-in using delegate?

    Read the article

  • NInject2 Interceptor usage with NHibernate transactions

    - by Daniil Harik
    Hello, In my previous project we used NHibernate and Spring.NET. Transactions were handled by adding [Transaction] attribute to service methods. In my current project I'm using NHibernate and NInject 2 and I was wondering if it's possible to solve transaction handling using "Ninject.Extensions.Interception" and similar [Transaction] type attributes? Thank You very much!

    Read the article

  • BASH if conditions

    - by Daniil
    Hi, I did ask a question before. The answer made sense, but I could never get it to work. And now I gotta get it working. But I cannot figure out BASH's if statements. What am I doing wrong below: START_TIME=9 STOP_TIME=17 HOUR=$((`date +"%k"`)) if [[ "$HOUR" -ge "9" ]] && [[ "$HOUR" -le "17" ]] && [[ "$2" != "-force" ]] ; then echo "Cannot run this script without -force at this time" exit 1 fi The idea is that I don't want this script to continue executing, unless forced to, during hours of 9am to 5pm. But it will always evaluate the condition to true and thus won't allow me to run the script. ./script.sh [action] (-force) Thx Edit: The output of set -x: $ ./test2.sh restart + START_TIME=9 + STOP_TIME=17 ++ date +%k + HOUR=11 + [[ 11 -ge 9 ]] + [[ 11 -le 17 ]] + [[ '' != \-\f\o\r\c\e ]] + echo 'Cannot run this script without -force at this time' Cannot run this script without -force at this time + exit 1 and then with -force $ ./test2.sh restart -force + START_TIME=9 + STOP_TIME=17 ++ date +%k + HOUR=11 + [[ 11 -ge 9 ]] + [[ 11 -le 17 ]] + [[ '' != \-\f\o\r\c\e ]] + echo 'Cannot run this script without -force at this time' Cannot run this script without -force at this time + exit 1

    Read the article

  • How to estimate tomcat server requirements?

    - by Daniil
    We have a brand new webapp written that runs on Tomcat. So far, only one client is using it through the day. They run about 180 unique logins a day. Not really a lot IMO. Now, we managed to sell it to a brand new client who likes and wants to roll it out to 50,000 clients. How many of them will login at the same time - no idea. But I need to do the whole thing - allocate, create, config and maintain. OK - last is simple(errrr). The application runs off of Tomcat 5.5 on Gentoo (I'm thinking to upgrade to Tomcat 6) with MSSQL & mySQL behind. I do realize that a more enterprise ready application would be a better fit, but that's not an option at the moment. Since I've never done this before, I'm a bit lost. Can someone advice on how to go about estimating the equipment requirements for this client? Tomcat does have clustering, so that I can do. MS SQL - I'm sure they have something too. I'm thinking to stick it behind LVS (which we do use at the moment for something else too). Any help from people who deal with these details is greatly appreciated!

    Read the article

  • WPF Listbox display next element after SelectedItem

    - by Daniil Harik
    I have TextBox and ListBox with bunch of elements. TextBox has KeyDown event handler, the idea behind this is to allow user to press up and down keys to scroll inside ListBox while focus is on TextBox. When user presses "down key" several times, selected element becomes last visible element on screen. If user has reached bottom of visible list element on screen, I want him to see next element after selected element as well.

    Read the article

  • Running Endpoint locally could not provide access to API explorer when HTTP proxy is enabled

    - by harik
    I'm using Android Studio(0.5.8) on Window7 x64 for developing my Android App with Google AppEngine backend. If my machine is having direct internet access and I launch backend locally (as DevApp Server) and access my API Endpoints through webbrowser (chrome) it is all working as expected. Accessing api explorer is also working fine from webbrowser. http://localhost:8080/_ah/api/explorer But if I have configured internet through http proxy (in Android Studio and also in webbrowser) then webbrowser displays initial page of backend but can't access endpoint api explorer. And deploying appbackend in Google AppEngine also fails with errors. gradlew backend:appengineUpdate Same is working fine if direct internet access is available (not via http proxy). How can we make it work with http proxy also? Any help is appreciated, Thanks.

    Read the article

  • Considering modified files for rebuild

    - by harik
    I have a C++ project, I am using Bakefile for build process, Makefiles are generated for msvc, mingw, gnu etc for cross-platform support. Now the problem is that if I change any .h files (which are included in other .cpp files) and performing a rebuild does not recompile modified files. But changing any .cpp file gets recompiled. Based on modified time-stamp of any file which is included in the project I expect to consider that file for rebuild. Am I missing something which required to be added as a tag in .bkl files? Please help.

    Read the article

1