Tuesday, 15 July 2014

database - How to open an .accdb file in Ubuntu? -


The development machine I work on is Ubuntu Janny Zaloplop as its operating system. I was created by Microsoft Access Working as a .accdb file is presented with data for a project. I have no copy of Microsoft Access. I have open office installed and will be ready to install any software package available on my operating system. Is there a way that I can open or change this file so that I can view and edit the data on my computer? Is there another format that access database can be saved, as I would be able to open?

There are two open source devices available, however they only work on MDB format files. Can you ask the supplier of the ACCDB file to give it in MDB format?

Microsoft Access is a set of open-source libraries and utilities to export data from MS Access database (MDB file) without DLLs.

The MS Java Access Database has a pure Java library for reading and writing. This is part of the OpenHMS project from Health Market Science, Inc. This is not an application. There is no GUI. This is a library that aims to use to create Java developers. It appears to be much newer than MDB devices, it is more active and support is written.


Calling Java library from Objective C on Mac -


I want to create the original Mac OS X application using Cocoa + Objective C but I have to connect to the proprietary data source, And this, the owner of the data source only provides the Java Library so I have to import the Java Library to my Java and Java functions in my Java classes. (Or create Java wrapper around this library and then call your cover through Objective-C).

Now, how do I do this? Quick Google Search takes me JNI but I have not found any good and real (current) articles / tutorials. I actually have some articles, how to load this Java library, if necessary, start VM and how to create Java objects and call functions on them. Actually something is simple and I can move forward from there. Thank you.

Just to clarify, I repeat: I want to call Java-C to Objective-C, I do not want to call original functions from Java.

You are probably looking for a small known corner, from which you can run Java Runtime In-Process Can load.

That said, you may have an easy time with a Java service application that communicates more with your objective-C application.


Haskell List Comprehension -


I get the "not missing: x" error when it happens ...

  Blanks: Sudoku - & gt; [Pos] Spaces (Sudoku su) = [FST X | X & LT; - POSSED | IsBlank (snd x)] Where is nothing mismatched = true is black_ = false posz = zip ixPos (concat su) ixPos = zip ixRows ixCols ixCols = concat (9 [0..8] repeat) ixRows = [floor (X / 9). X & lt; - [0..81]]  

However, if I compile the security of 2: ND line GHCI without any errors.

Can you help me understand what I am doing?

Try [fst x | X & LT; - POSASSAD, ISBN (sd)]


c++ - Matrix classes Directx & OpenGL -


I have the following C ++ matrix class:

I I am using coupled with a renderer, for which there is an OpenLog and DirectX implementation.

I have a test example where within the window the coordinates of the mouse are used in the graphic position under the cursor. This works as expected under OpenGL.

Because the DirectX line head and OpenGell columns are the main, I reverse the matrix in the following way and pass it to the DirectX before rendering:

  if ( O-> Tree) {CObjectTransform * t = o- & gt; Tree-> gatetransform (O-> transgenied); D3d Matrix D; Float * M = (Float *) & amp; D; For (int u = 0; u & lt; 4; u ++) {for (int v = 0; v <4; v ++) {m [u + v * 4] = t-> ; Worldtransform.matrix [v + u * 4]; }} Pd3dDevice-> SetTransform (D3DTS_WORLD, & amp; d); }  

The result of this is nothing shown in the area visible from the graphics, here I have placed my cursor.

Like this:

  1. Is my change class correctly implemented?
  2. How do I work with DirectX? Edit:

    The following code setup was:

      float * m = (float *) & amp; D; For (int u = 0; u & lt; 4; u ++) {for (int v = 0; v <4; v ++) {m [u + v * 4] = t-> ; Worldtransform.matrix [v + u * 4]; }} Float test [16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 , 0,0}}; Memcpy (test, & amp; d, sizeof (d));  

    Matrix class values:

    1,0,0,0 - 0,1,0,0 - 0,0,1, 0
    47 , -30,0,1

    Values ​​of Swap Matrix:

    1,0,0,47 = 0,1,0, -30
    0,1,1 0,0,0,1

    Then the matrix is ​​being swaped around. Owing to the problem, swapping out the round code.

OpenGL and DirectX matrix represent against representation, but they have the opposite vector * matrix < / Code> is the command:

  • OpenGL: M * v . The main column in the M memory is
  • DirectX: v * m . M is the key in memory

Because the multiplication is reversed, you have to move your OpenGL matrix to pass the DX. But since DX uses the key of the line, you have to move again. Twice infected is actually the identity.

Why do not you try to make any changes about everyone?


Cannot show the downloaded webpage with proper encoding using PHP -


I have to get the content of a Persian page and some users have to show a part of that page. The problem is that after filtering the content of the page I can not show the content with the proper encoding. The webpage is located on sena.ir and here is the screen shot of the original webpage which I want to show:

And here's what I found:

", $ Header =" ") {if (! Isset ($ timeout)) $ timeout = 30; $ Curl = curl_init (); If (strrest ($ Referrer, ": //")) {curl_setopt ($ curl, CURLOPT_REFERER, $ referer); } $ Header [] = 'Accept: Image / GIF, Image / X-bitmap, Image / JPEG, Image / PJPAG'; $ Header [] = 'Connection: Keep' Elive '; $ Header [] = 'content-type: app / x-www-form-urlencoded; Charset = utf-8 '; // I have tried - as soon as there is no chance $ user_agent = 'Mozilla / 4.0 (compatible; MSIE 7.0; Windows NT 5.1; NAT CLR 1.0.3705; NAT CLR 1.1.4322; Media Center PC 4.0) ; $ Compression = "jizip"; Curl_setopt ($ curl, CURLOPT_HTTPHEADER, $ header); Curl_setopt ($ curl, CURLOPT_HEADER, 0); Curl_setopt ($ curl, CURLOPT_USERAGENT, $ user_agent); Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ curl, CURLOPT_FOLLOWLOCATION, 1); Curl_setopt ($ curl, CURLOPT_POST, 0); Curl_setopt ($ curl, CURLOPT_ENCODING, $ compression); Curl_setopt ($ curl, CURLOPT_TIMEOUT, 300); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYHOST, 0); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYPEER, 0); Curl_setopt ($ curl, CURLOPT_URL, $ url); $ Html = curl_xax ($ curl); Curl_close ($ curl); Return $ Html; } $ Content = getPage ("http://sena.ir/"); $ P1 = Straps ($ content, '' table cell spacing = "3" cellpadding = "3" width = "100%" range = "0" & ​​gt; '); $ P2 = Stropo ($ Content, "& lt; / table & gt;", $ p1); $ Content = substr ($ content, $ p1, $ p2- $ p1); Counterpart $ content; The output problem was not a problem since the proxy-like function, HTML and encoding declaration. Deletes the header, so you need to add these lines before filtering the filtered data:

  & lt; Html lang = "fa" & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt;  

multithreading - incorrect function being called on multiple fast calls to python's threading.Thread() -


I'm having some problems launching threads from the list of jobs, they are on a list because they are configurable-specific I am wrapping up the tasks so that I can store the results of the work in 'Self', but in the non-threadsof manner something is going wrong so that I get the correct number of threads, but some examples are not correct. Here is the example code:

  import threading, time class run parallelest (): def __init __ (self): pass def runList (self, functionList): threadList = [] LISTIndex category for function In (0, Len (functionList)): newThread = threading.Thread (target = lambda: self._run_parallel_job (functionList [functionListIndex]) newThread.start () threadList.append (newThread) # sleep delay which all works well is. # Time.sleep (2) # We all wait to complete the thread and if none of them we report the failure for the thread in thread: Thread: thread (3600 * 24) # 1 day may be better if thread.isAlive () == true: increase exception ("thread.isAlive == true") def _run_parallel_job (self, function): result = function () # results Self thread itself # (I promise that I am using SACPHERS) DEF F (X): print "F (% d) run"% x returns x if __name__ == '__main__': RF (RP) = RunPalell Test = (Lambda: F (0), Lambda: F (1), Lambda: F (2), Lambda: F (3), Lambda: F (4), Lambda: F (5) / Code>  

When I run, I see things like this:

    & gt; Python thread_problem.py f (1) run f (2) run f (4) run f (5) run f (5) run f (6) run f (7) run & gt;  

I expect different commands in print, I think I should see 0-7 numbers with no duplication, but I do not. If I add time. Sleep (2), the problem goes magically away, but I would really like to know that the way I think it should do is not working.

Thanks a bunch!

The problem is that functionList [functionListIndex] is evaluated only When it is in Lambda (inside the thread) it is running. Until then the value of functionListIndex can change.

To fix this, you can pass a parameter to lambda that will be evaluated at the definition time:

  newThread = threading. Thread (target = lambda throw = function list index: self._run_parallel_job (func))  

The default parameter values ​​of the function are evaluated at the definition time, so this work Will do

Another Pythonic solution is to avoid the lambda and use the args parameter:

  newThread = threading.Thread (target = self._run_parallel_job , Args = (functionalist [function list index],))  

changelog - major changes in python since version 2.2.3 -


I wrote a short dragon script to create a file and calculate the time. I tested it on Fedora 10, and Ubuntu 8.x and it worked well. Python version was 2.5.x

I tried to run it on my production server (an old red hat based Linux server), version 2.2.3 of Python. The script does not work and generates a syntax error in class definition.

To define disk writing speed, the script defines a class with methods to create files on the disc. It starts like this:

  class TestDiskSpeed ​​(): def __init __ (self, round = 1, speed mode = SPEED_MODE_MEGABYTE):  
< P> The definition of class is as error by Python 2.2.3.

What are the major changes in Python 2.2.3 that potentially crash my application? I am using these modules: os, sys, time, stat, gc

Update:

By removing and accepting Python Class from class class definition. But it raises another error on this line:

  size = long (size) size! = No more self._size  

I have entered a PHP developer, just Python programming (maybe a month), and that is very useful for th Used in:

  $ var = (condition)? $ ValueIfTrue: $ valueIfFalse;  

I searched and found that it was done in python as I used for my size variable though it does not look like Python 2.2.3 is.

I was going to insert all the code here (I'm going to release script as LGPL as well), but the code is more than 150 lines (still in development).

This is strange, because it compiles if you delete ) In class definition, however, it says that the empty feet are fine.

Since you are using a lot of Python 2.5 features, so it will have to work hard to find them all. I recommend reading "what's new in python" for every version between 2.2 and 2.5, then coming up with a list of features that you can do your search, like:

  • New style classes
  • Good luck

  • New style classes
  • Understanding and generator
  • Tornieri expression
  • From, most of the new features have a new language keyword (or a new way of using a keyword, in the case of Ternary x if pyy ) Come on, it should not be difficult for them to grep.