Posts

Showing posts from February, 2014

opengl es 2.0 - Multisampling on iOS can't get depth texture? -

i have set rendering framebuffer color , depth textures on ios, works ok. tried add multisampling via apple extensions (i used code rendering texture on ios opengl es—works on simulator, not on device ) there's catch apparently. after resolving multisampled buffer original framebuffer (which use post processing effects), have color buffer resolved. glresolvemultisampleframebufferapple() apparently not touch depth texture @ all, if use multisampling have give on depth texture effects. there no way depth texture if use multisampling ? know how multisampling works, want depth texture alongside color texture. spec on apple_framebuffer_multisample tells glresolvemultisampleframebufferapple resolves color attachment, means have write depth color renderbuffer in additional render pass , resolve depth information.

hibernate - When using Access from within an Excel spreadsheet, the PC won't go to sleep -

i've stumbled accross problem unable solve :( neither google nor stackoverflow have given me usable answers, i'm turning you. the problem this: i've created spreadsheet loads data access database stored on network drive. data-loading part done once, i.e. when opening file. i open connection this: dim con adodb.connection dim rs new adodb.recordset dim sql string set con = getconstring() rs.open "select id, somevalue sometable", con where connection string this "provider=microsoft.jet.oledb.4.0;data source='" & (network path file) & "'" then dump information in spreadsheet , terminate connection this: rs.close con.close however, when try hibernate pc while excel spreadsheet still open, error message. translates along lines of "excel has prevented computer going sleep". this seems happen when using constellation... have idea on how prevent behavior? i'd pc go sleep, when tell - though excel spr...

java - Layout using the transformed bounds -

Image
i have scaled node in pane. layout of pane take account bounds without transformation. want take account transformed bounds. for example : and code : import javafx.application.application; import javafx.geometry.pos; import javafx.scene.scene; import javafx.scene.control.label; import javafx.scene.layout.hbox; import javafx.scene.layout.vbox; import javafx.scene.shape.circle; import javafx.scene.transform.scale; import javafx.scene.transform.translate; import javafx.stage.stage; public class hboxapp extends application { public static void main(string[] args) { launch(args); } @override public void start(stage stage) throws exception { double scale = 0.75; hbox box1 = createbox(); box1.getchildren().add(new circle(20)); box1.getchildren().add(new label("test without scale")); hbox box2 = createbox(); circle c2 = new circle(20); c2.setscalex(scale); ...

asp.net mvc - Why does Chrome DevTools hit my Login page? -

Image
i noticed login action being called every page load in chrome when have devtools open, how find out calling it? happens when load page , after little while press f12 open dev tools - login action receives hit! i added breakpoint , checked locals referrer null. looking @ chrome network tab looks like happens @ seemingly random time, during image load. if open images in new tabs start download expected , breakpoint not hit. disabled of extensions - can next?

ruby on rails - Mock a class's local method -

i trying write test case in rpec class this class abc def method_1( arg ) #does , return value based on arg end def initialize @service = method_1( arg ) end def getsomething_1 return @service.get_seomthing_1 end def getsomething_2 return @service.get_seomthing_2 end end now want initiate @service instance variable mocked object can use mocked object return values against can validate unit tests. i tried like describe abc before(:each) myobject = double() myobject.stub(:get_something_1).and_return("somevalue") abc.any_instance.stub(:method_1).and_return(myobject) end "checks correctness of getsomething_1 method of class abc" @abc = abc.new @abc.getsomething_1.should eql("somevalue") end end now when trying run test @service not getting initialized object want to. seems method_1 not getting mocked behaviour defined. can how assign @service...

serialization - How should C++ objects be serialized? -

we doing project on high performance computing, using mpi parallel computing framework. there few algorithms implemented on legacy platform. rewriten original serial algorithm parallel version based on mpi. i encounter performance problem: when running parallel algorithm based on mpi, there lot of comunication overhead between multiple process. inter-process comunication consist of 3 steps: process serialize c++ objects binary format. process send binary format data process b mpi. process b deserialize binary format data c++ objects. we found these comunication steps, serialize/deserialize steps, cost huge amount of time. how hand performance issue? by way, in our c++ code, use lot of stl, more complex c-like struct. p.s. doing this(serialization) written code traversing fields of objects , copy them sequentially byte array. to demonstrate doing, there code snippet. note single feature construction process: sic::geometryfeature *ptfeature = (geometryfeature *)...

c# - Moq simple example required- database connection and file handling -

i quite new unit testing. though can simple unit test, finding difficult understand dependency injection part. have 2 scenarios not create test database connection log file handling though searched internet , not find simple example follow , implement these mocking. can moq supports concrete class or should need change implementation virtual unit testing. example code or link sample code appreciated first of all, moq not support mocking concrete classes. abstract classes , interfaces can mocked. however, not hard sounds. let's take log file handling example. say start following concrete logging class: public class log { public void writetolog(string message) { ... } } we have classes uses log class logging: public class loggenerator { public void foo() { ... var log = new log(); log.writetolog("my log message"); } } the problem unit testing foo method have no control on creation of...

delphi - Why are condensed fonts not displayed properly in FireMonkey? -

Image
(and can it?) if create 2 labels in vcl , set 1 use arial , arial narrow i'll see expected result. if same in firemonkey, second label not displayed in arial narrow. not displayed in arial (dots on i's round, shape of 's' wrong etc.). does know why fm (i testing delphi xe4) not displaying font properly? there can it? source vcl form: object form3: tform3 left = 0 top = 0 caption = 'form3' clientheight = 198 clientwidth = 475 color = clbtnface font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = 'tahoma' font.style = [] oldcreateorder = false pixelsperinch = 96 textheight = 13 object label1: tlabel left = 24 top = 32 width = 134 height = 14 caption = 'this label using arial @11' font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = 'arial' font.style = [] parentfont = false end o...

javascript - What's the best way to seperate the first line of a string from the rest in JS? -

in python, there old firstline, rest = text.split("\n", 1) . after painful discovery, realized javascript gives different meaning limit property, , returns many "splits" (1 means returns first line, 2 returns first 2 lines, , forth). what's best way wanted? have make slice , indexof ? probably efficient way: function getfirstline(text) { var index = text.indexof("\n"); if (index === -1) index = undefined; return text.substring(0, index); } then: // "some string goes here" console.log(getfirstline("some string goes here\nsome more string\nand more\n\nmore")); // "asdfasdfasdf" console.log(getfirstline("asdfasdfasdf")); edit: function newsplit(text, linesplit) { if (linesplit <= 0) return null; var index = -1; (var = 0; < linesplit; i++) { index = text.indexof("\n", index) + 1; if (index === 0) return null; } return { 0: te...

asp.net mvc - Jquery dialogbox 'X' image not showing? a -

Image
i using jquery 1.9.1 , jquery ui 1.10.2 in asp.net mvc4 project. have downloaded these js , css nuget tool. missing jquery dialogbox 'x' image in box. how on dialogbox? project folder structure this. project | |-content | | | |-themes | | | |- base | | | |-images | | | jquery.ui.* files | --- | ---- | | |-scripts | jquery-1.9.1.js files jquery-ui-1.10.2.js files when searched jquery-ui-1.10.2.js, found below code inserting image. this.uidialogtitlebarclose = $("<button></button>") .button({ label: this.options.closetext, icons: { primary: "ui-icon-closethick" //this image }, text: false }) .addclass("ui-dialog-titlebar-close") .appendto( this.uidialogtitlebar ); this._on( this.uidialogtitleba...

user interface - Good free book to learn how to build apps with GUI in C#? -

i have been looking around while haven't found resource teaching how use c# build windows apps gui. can point me towards resources topic? i recommend http://www.wpftutorial.net/wpfintroduction.html wpf uses xaml lay out interface , c# code-behind. allows build interfaces applications , starting point depending on type of application want make.

Send php variable to a class and run mysql query with Smarty -

i send php variable class runs mysql query. typical search via html form. have use smarty. how can pass variable "$minta" sql query , how result array php display? the smarty tpl file ok (lista_keres.tpl ingatlank variable). thank in advance. tuwanbi the php: if (isset($_post['keresoszo'])){ include_once "classes/ingatlan.class.php"; include_once "classes/main.class.php"; include_once "classes/felhasznalo.class.php"; $ingatlan = new ingatlan(); $felhasznalo = new felhasznalo(); $minta = $_post['keresoszo']; $kereses = new main(); $kereses->getkeresingatlan($minta); $smarty->assign("kapcsolattartok", $ingatlan->getkapcsolattartok()); $smarty->assign("ingatlank", $main->getkeresingatlan()); $smarty->assign("include_file", lista_keres); echo $minta; } the class: <?php class main{ private $keresoszo; ... public funct...

sql - Merge two xml strings in java -

i'm trying merge/combine 2 xml strings got parsing object xml using castor marshalling/unmarshalling. here 2 xml strings have: <?xml version="1.0" encoding="utf-8"?> <abc:abcresponse xmlns:abc="http://www.abc.com/schema/abctransaction"> <abc:code>0</abc:code> <abc:description>blah</abc:description> </abc:abcresponse> <?xml version="1.0" encoding="utf-8"?> <abc:abcrequest xmlns:abc="http://www.abc.com/schema/abctransaction"> <abc:id>99999</abc:id> <abc:idstring>abc</abc:idstring> </abc:abcrequest> i want able combine these 2 strings 1 can insert database (mssql) column has data type xml. tried using solution suggested link java merge 2 xml strings in java , doesn't seem recognize valid xml string since no records inserted database table, , there's error in console: com.microsoft.sqlserver.jdbc.sqlserverexce...

android - intent filter without action -

android's documentation says: http://developer.android.com/reference/android/content/intentfilter.html "action matches if of given values match intent action, or if no actions specified in filter." i tried test it. in test application set such filter 1 of activities: <intent-filter> <action android:name="ma" /> <category android:name="android.intent.category.default" /> <category android:name="mk1" /> </intent-filter> i try send such intent: intent = new intent(); i.setaction("ma"); i.addcategory("mk1"); startactivity(i); it works - activity gets started. then comment out action in filter: <intent-filter> <!-- <action android:name="ma" /> --> <category android:name="android.intent.category.default" /> <category android:name="mk1" /> </intent-filter> again send same intent. activity...

android - Keyboard doesn't show up when EditText is in focus -

i want following. user should able input 1 letter (only letter) standard keyboard (hardware or software). if typing letter, previous letter should replaced one. current letter should displayed. user should able dismiss dialog , activity. , if clicked "done" button in keyboard activity should know letter entered. so thought alert dialog , edit text extensions display current char. easy. however, , gets me mad already, although edit text in focus keyboard not appear on screen until edit text clicked. why so? should be, should not? i won't take following answer, because shouldn't have manually. should automatic. besides, i'm not sure how work hardware keyboard. inputmethodmanager imm = inputmethodmanager)getsystemservice(context.input_method_service); imm.hidesoftinputfromwindow(youredittext.getwindowtoken(), 0); i want know why keyboard not shown after edit text has focus? , should functionality without manually enabling , disabling software keyboard. ...

c# - Reading Strings From An Uploaded File -

this question has answer here: looping trough lines of txt file uploaded via fileupload control 6 answers i have file containing column of numbers wish read string. file, however, not being imported using location on hard disk, rather it's being uploaded via fileupload control. i wondering if there way read in text file. i've looked streamreader, requires have string that's path name of file. is there way around this? thanks :) a streamreader requires stream, not path. based on documentation on msdn ( http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.filecontent.aspx ) can use filecontent member of fileupload control , feed streamreader.

A well formed java string -

a friend had interview question asking following: given string comprising of characters (,),{,},[,], determine if formed or not. in mind have answered no string , "/" character required print said characters. correct or way off base? if well-formed means each brace closed matching brace , there no incidents ({)}, suggest use stack go through each character in string if opening brace, push on stack if closing brace, pop stack , look, if match -> if go through chars in string , stack empty, string formed

efi - How to access command line arguments in UEFI? -

what part of specification details how command line arguments can obtained? you need careful one. as aware, there uefi loadedimage protocol - protocol returns structure called efi_loaded_image in turn has loadoptions member. the uefi shell set loadoptions variable whatever type on command line. alternatively, believe can set through bootoptions efi variable, care needed - first "argument" not process path in case. so need process one-long-string deduce "arguments" want them. to use loadedimage protocol, this: efi_status status = efi_success; efi_loaded_image* loaded_image; efi_guid loaded_image_protocol = loaded_image_protocol; status = gbs->handleprotocol(imagehandle, &loaded_image_protocol, (void**) &loaded_image); you can length of (0-terminated) string passed in by: loaded_image->loadoptionssize; be aware size in bytes, not length. that, use library function:...

java - merge_oracle_ORA-01747: invalid user.table.column, table.column, or column specification -

i trying merge in oracle: preparedstatement = dbconnection.preparestatement("merge dev_corpus " + "using (select ? corpusid, ? corpus_name, ? corpusdesc, ? corpusimageids, ? rocf1, ? rocf2, ? rocf3, ? rocc1, ? rocc2, ? rocc3, ? corpusactive, ? corpusrunfrequency, ? corpuslastrun, ? corpuslastsync, ? rocsettingid, ? corpusaffinity, ? corpusterms, ? corpusdomain dual) incoming " + "on (a.corpusid = incoming.corpusid ) " + "when matched " + "update set (a.corpus_name = incoming.corpus_name , a.corpusdesc = incoming.corpusdesc , a.corpusimageids = incoming.corpusimageids , a.rocf1 = incoming.rocf1 , a.rocf2 = incoming.rocf2 , a.rocf3 = incoming.rocf3 , a.rocc1 = incoming.rocc1 , a.rocc2 = incoming.rocc2 , a.rocc3 = incoming.rocc3 , a.corpusactive = incoming.corpusactive , a.corpusrunfrequency = incoming.corpusrunfrequency , a.corpuslastr...

math - repeating variable issue in windows batch file -

i have following code in batch file: set /p user="enter username: " %=% cd w:\files @echo off setlocal enabledelayedexpansion set /a value=0 set /a sum=0 set /a vala=0 /r %1 %%i in (*) ( set /a value=%%~zi/1024 set /a sum=!sum!+!value! set /a sum=!sum!/1024 ) @echo size of "files" is: !sum! mb @echo off /r %1 %%i in (*) ( set /a sum=!sum!/1024 set /a vala=!sum! ) @echo size of "files" is: !sum! gb cd w:\documents , settings\%user%\desktop @echo off setlocal enabledelayedexpansion set /a value=0 set /a sum=0 set /a valb=0 /r %1 %%i in (*) ( set /a value=%%~zi/1024 set /a sum=!sum!+!value! set /a sum=!sum!/1024 ) @echo size of desktop is: !sum! mb @echo off /r %1 %%i in (*) ( set /a sum=!sum!/1024 set /a valb=!sum! ) @echo size of desktop is: !sum! gb there few other folders checks, sh...

multithreading - Passing subroutine references to perl threads -

i trying pass subroutine references perl threads implement threadmap subroutine. in environment have 'roll own' of things; installing new perl packages not option. also, running perl version 5.10. in work environment, versions of perl > 5.10 not available. i can pass subroutine references around without trouble. however, once try pass subroutine reference thread, thread not appear understand it. here proposed threadmap subroutine, comments are, believe, sufficiently explanatory interested question-answerers. #input: hash keys l (listref), f (function can apply each element of l), , optionally nthreads #default nthreads 50 #divides l sublists each thread, kicks off threads #each thread applies f each element of sublist #and returns result of $f on each item #output: map{ &$f($_) } @{$l}, done threadily sub threadmap{ %arg = @_; ($l,$f,$nthr) = ($arg{l},$arg{f},$arg{nthreads}); $maxthreads = 50; if(not defined $nthr or $nthr > $maxthreads){ $nthr ...

php - Use variable's string into class names or other -

i want use variables inside class names. for example, let's set variable named $var "index2". want print index2 inside class name this: controller_index2 , instead of doing manually, can print var name there this: controller_$var; but assume that's syntax error. how can this? function __construct() { $this->_section = self::path(); new controller_{$this->_section}; } it's hideous hack, but: php > class foo { function x_1() { echo 'success'; } }; php > $x = new foo; php > $one = 1; php > $x->{"x_$one"}(); ^^^^^^^^^^^^ success instead of trying build method name on-the-fly string, array of methods may more suitable. use variables array's key.

render - Top and bottom button clicked the obj model is flipped in opengl? -

@anton stucked flipping. i downloaded project here . have 4 buttons each button set title right,left,bottom,top str variable. in rendering initial rotation axis teapotnode_.rotationaxis = cc3vectormake(0.1, 1, 0.3); - (void)update:(float)dt { if ([str isequaltostring:@"right"]) { teapotnode_.rotationaxis = cc3vectormake(0.1, 1, 0.3); angle +=2.0; } else if ([str isequaltostring:@"left"]) { teapotnode_.rotationaxis = cc3vectormake(0.1, 1, 0.3); angle -=2.0; } else if ([str isequaltostring:@"bottom"]) { teapotnode_.rotationaxis = cc3vectormake(1,0,0); angle +=2.0; } else if ([str isequaltostring:@"top"]) { teapotnode_.rotationaxis = cc3vectormake(1,0,0); angle -=2.0; } else{ angle +=2.0; } teapotnode_.rotationangle = angle; } i touch top(or)down rotation button change axis teapotnode_.rota...

java - An internal error occurred during: "JPA Facet File Change Event Handler" -

i new jpa 2.0. using eclipse juno create jpa project(eclipselink 2.0.2). when creating jpa project getting error as an internal error occurred during: "jpa facet file change event handler". on checking log this: java.lang.noclassdeffounderror: org/eclipse/persistence/jpa/jpql/abstractjpqlqueryhelper @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:791) @ org.eclipse.osgi.internal.baseadaptor.defaultclassloader.defineclass(defaultclassloader.java:188) @ org.eclipse.osgi.baseadaptor.loader.classpathmanager.defineclassholdinglock(classpathmanager.java:632) @ org.eclipse.osgi.baseadaptor.loader.classpathmanager.defineclass(classpathmanager.java:607) @ org.eclipse.osgi.baseadaptor.loader.classpathmanager.findclassimpl(classpathmanager.java:568) @ org.eclipse.osgi.baseadaptor.loader.classpathmanager.findlocalclassimpl(classpathmanager.java:492) @ org.eclipse.osg...

java - Cannot establish RMI connection to remote machine -

this question has answer here: rmi cannot connect remote server 2 answers i can't seem connect 2 machines using rmi. make sure there wasn't wrong code copied simple example wikipedia ( http://en.wikipedia.org/wiki/java_remote_method_invocation ) , edited code print out simple int. i tried giving permissions , turning firewalls off , still error: java.rmi.connectexception: connection refused host 55.229.xx.xxx; nested exception is:java.net.connectexception: connection timed out: connect i've been trying past 3 days , still can't seem past basic configuration problems. the problem rmi server sending local address, instead of wan address. system.setproperty("java.rmi.server.hostname", *host ip*); also take @ security policies regarding rmi: http://docs.oracle.com/javase/tutorial/rmi/running.html

asp.net - How to tell a javascript function what element to manipulate? -

i new asp.net , javascript , , supposed following task in couple of days. know have learn basics, before asking, don't know need in short time. lot in advance! here's number cities, shown on country map: each city has it's own style (since city positions different), defined in css . <div class="node"> <div class="taxonomy"> </div> <div class="content"> <div id="contact_map" runat="server"> <ul> <li id="city1" onmouseover= "onmouseoveragent(this)" onmouseout="onmouseoutagent(this)"> <a href="someaddress"><span class="hideme">some city name</span> </a> <p class="hideme">some city name<strong class="tel">0123456789</strong> ...

Different number parameters calling C routine from FORTRAN 90 -

i calling c routine fortran 90 code. works fine, wondering why , how when call c routine less parameters should compiler not complain. compiler doing here? using cray compiler. test.c extern "c" void test_(double* x, double* y, double* z){ // work } driver.f90 module driver ! declare arrays double precision, dimension(dim, dim), intent(in) :: x double precision, dimension(dim, dim), intent(in) :: y ! call c subroutine call test(x, y) end module driver fortran lot different c when comes function calls. when passing arguments c routine, compiler must know type of each argument, can generate appropriate calling sequence - either put arguments on stack in correct order , correct padding or put them in expected registers. c compilers gather information when compile code if callee defined before caller. in other cases, function declaration in form of prototype should provided. in fortran arguments typically (with exceptions) passed address, ...

javascript - how can get div position Based on the percentage? -

whit code can position div based on pixel. $('#div').position(); but how can give div position based on percentage? use window size. var position = $('#div').position(); var percentleft = position.left/$(window).width() * 100; var percenttop = position.top/$(window).height() *100; this code give position percentage top , left sides.

css - Center within navigation -

i can't seem figure out how allow absolute centered logo surrounded navigation links (3 on each side), , navigation fall below logo upon resize seen here: http://testsite.brentthelendesign.com/ . apologize in advance if answered elsewhere. appreciated! here's code: logo css h1.logo {     float: none;     left: 50%;     margin-left: -80px;     text-align: center; } h1.logo {     background: url("images/logo.png") no-repeat scroll 0 0 transparent;     display: block;     float: none;     height: 127px;     text-align: center;     text-indent: -9999px;     width: 181px; } .abs {     position: absolute; } navigation css .nav {     position: relative; } #navigation ul li, #navigation ul li {     border: medium none !important;     color: #3c3f40;     display: block;     float: right;     font-family: 'fjord one',"times new roman",times,serif;     font-weight: normal;     margin: 42px 0 130px !important;     padding: 15px 25px;     position...

sql - sqlcmd truncating row width when export to csv file -

am running sql query using sqlcmd , redirecting output csv file. seems csv file truncating each row 257 characters eventhough gave "-w 8192" argument. sqlcmd -i jira.sql -o jiraqueryresult.csv -h-1 -w 8192 -y 8000 please me fix issue. thanks in advance i fixed following sqlcmd -i jira.sql -o jiraqueryresult.csv -h-1 -y 8000 thanks

Prevent Magento from caching query strings, such as limit param -

the behavior i display 3 products per page. in catalog.xml have <action method="setdefaultgridperpage"><limit>3</limit></action> <action method="addpagerlimit"><mode>grid</mode><limit>3</limit></action> if go /category.html see 3 products. works, great! but want able show products @ once, add catalog.xml following: <action method="addpagerlimit"><mode>grid</mode><limit>999</limit></action> now, if navigate /category.html?limit=999 can see categories products, expected. the problem: when come /category.html, no limit params, displays products instead of 3 wish did. happends because magento caches limit preference. the question: is there configuration prevents magento caching listing options? thank in advance. in toolbar block there method called disableparamsmemorizing . should disable storing of parameters in session. try add ...

linux - Tar Command backup error -

i want take backup hard disk tape drive using nfs server using tar command,but getting error message $ tar -czf /dev/st0 /media/seagate expansion drive/disk/file/ tar:/media/seagate :cannot stat:no such file or directory tar: expansion :cannot stat:no such file or directory tar: drive/disk/file/ :cannot stat:no such file or directory tar: error exit delayed previous error regards s k tar -czf /dev/st0 /media/seagate expansion drive/disk/file/ when given above command, shell considers /media/seagate , expansion , drive/disk/file/ separate arguments, tar considers them different files/directories. if single file, enclose quotes like, tar -czf /dev/st0/file.tar.gz "/media/seagate expansion drive/disk/file/" fixed tar filename

Is there anyway to make a localized python version? -

the problem have right require specific version of python in order source code have work. make source code more accessible everyone, don't want people have go through hassle downloading right python version. instead there way incorporate right python version right program or way localize python? not sure how work out, thing can think of creating virtual environment required python version, , sharing people. not ideal solution, , i'm sure others can suggest better.

java - What happens if you edit a file during compilation? -

sometimes compilation takes long time, , want mess around file while it's compiling. saving new file during compilation affect build? or preloaded? i'm not sure meaningful question: "is case compilers , languages?" it's more meaningful ask, given build system, can edit source during build? with ant build, it's clear ant decides (based on file timestamps) compile, don't know when compile task started. it's surely true compiler reads source file once, don't know when happens. the interesting use case is: when run sbt> ~ test , sbt complete test run while i'm editing code, or stop midstream recompile? i see it's useful have command option determine whether edits abort test run. might want see test result, or maybe you're interested in test results after modification. that's true if compile-and-test cycles seem interminable. here doc testing. doc triggered execution says: monitoring terminated ...

php - ajax $_POST data then redirect to new page -

i have been going crazy last 2 weeks trying work. calling mysql db, , displaying data in table. along way creating href links delete , edit records. delete pulls alert , stays on same page. edit link post data redirect editdocument.php here php: <?php foreach ($query $row){ $id = $row['document_id']; echo ('<tr>'); echo ('<td>' . $row [clientname] . '</td>'); echo ('<td>' . $row [documentnum] . '</td>'); echo "<td><a href='**** need code here ****'>edit</a>"; echo " / "; echo "<a href='#' onclick='deletedocument( {$id} );'>delete</a></td>"; // calls javascript function deletedocument(id) stays on same page echo ('</tr>'); } //end foreach ?> i tried (without success) ajax method: <script> function editdo...

connection string is not working with my database on Microsoft SQL Server in ASP.NET MVC 4 -

i have on web.config file <add name="efdbcontext" connectionstring="data source=(localdb)\v11.0;initial catalog=stadinpeli; integrated security=true" providername="system.data.sqlclient"/> and yes in server explorer in visual studio 2012 professional edition, works efdbcontext (webui) . wrong database. somehow efdbcontext database copy definitions database want connect time, jon-pc\localdb#13158683.stadinpeli.dbo . i checked properties jon-pc\localdb#13158683.stadinpeli.dbo connection string still connects efdbcontext (webui) . where problem, have tried correct 3 hours already. (localdb) data source wrong. try updating (local) connection string looks <add name="efdbcontext" connectionstring="data source=(local)\v11.0;initial catalog=stadinpeli; integrated security=true" providername="system.data.sqlclient"/>

ruby on rails - HABTM with extra attributes on nested form -

i have products have , belong many product_links class product < activerecord::base has_many :map_product_prices has_many :product_links, :through => :map_product_prices accepts_nested_attributes_for :product_links and... class productlink < activerecord::base has_many :map_product_prices has_many :products, :through => :map_product_prices accepts_nested_attributes_for :products i using ryan bates 'nested_form' gem this. here problem cannot wrap brain around. map table has price attribute attached also. class mapproductprice < activerecord::base attr_accessible :product_link_id, :product_id, :price belongs_to :product belongs_to :product_link i had multi-select box working select 1 or many products while on product link form. when switched on ryans gem use nested forms have single select box choose product, text field input price. can add / delete them necessary. here i've got in view: <%= f.fields_for :products |product| %> ...

java - SolrJ - I cannot update a values of concrete fields of all Solr docs -

i have written hardcoded solution problem should ok. need edit values of concrete fields docs in index. have 55500 docs in index. i trying edit fields every document , commit 500 docs. think solution should work (i tried remove 1 document id index , deleted) there no change in index... there still fields bad values (with #0; want remove) (int = 0; < 55501; = + 500) { solrquery query = new solrquery(); query.setparam("start", i+""); query.setparam("q", "*:*"); query.setparam("rows", "500"); string url = "http://myindex"; httpsolrserver solrserver = new httpsolrserver(url); queryresponse qresponse; try { qresponse = solrserver.query(query); solrdocumentlist docs=qresponse.getresults(); (solrdocument solrdocument : docs) { string parsetime = (string) solrdocument.getfieldva...

jdk1.6 - RHEL 6 - 64 bit with 32 bit Libraries from JDK -

i have linux redhat 6 64 bit installed , working application. my problem tried install jdk1.6u30 32bit edition because need it. i installed glibc.i686, glibc-devel.i686 , compat-libstdc++, ... each time have following error : /sbin/ldconfig: libraries libselinux.so , libselinux.so.1 in directory /lib have same soname different type. /sbin/ldconfig: libraries libcidn.so.1 , libcidn.so in directory /lib have same soname different type. /sbin/ldconfig: libraries libm.so.6 , libm.so in directory /lib have same soname different type. /sbin/ldconfig: libraries libanl-2.12.so , libanl.so in directory /lib have same soname different type. /sbin/ldconfig: libraries libdb-4.7.so , libdb.so in directory /lib have same soname different type. /sbin/ldconfig: libraries libutil-2.12.so , libutil.so in directory /lib have same soname different type. /sbin/ldconfig: libraries libcrypt.so.1 , libcrypt.so in directory /lib have same soname different type. /sbin/ldconfig: libraries libgssrpc.s...

android - Double border/frame in some holo components -

Image
i have problem settings holo style using holoeverywhere.using of components can see double frame horrible. i've tried different settings can not find solution. think using badly library. i going attach image clear: i going describe bit how working them: in manifest, not ussing style library. using style: android:theme="@android:style/theme.black.notitlebar.fullscreen" for progress bar not ussing xml, object private progressdialog mpd; which imported import org.holoeverywhere.app.progressdialog; and call using: mpd = progressdialog.show(context, null, progressmessage, true, true); that's all. for timepicker, creating in runtime creating object new timepickerdialog(getactivity(),android.r.style.theme_holo_dialog_noactionbar, timepickerlistener,calendar.get(calendar.hour), calendar.get(calendar.minute), true).show(); i have no idea doing bad...how delete frame under holo objects. subjections? thanks if. you. not use. styles lib...

python - Counting number of unique items from a dictionary -

my program reads in large log file. searches file ip , time(whatever in brackets). 5.63.145.71 - - [30/jun/2013:08:04:46 -0500] "head / http/1.1" 200 - "-" "checks.panopta.com" 5.63.145.71 - - [30/jun/2013:08:04:49 -0500] "head / http/1.1" 200 - "-" "checks.panopta.com" 5.63.145.71 - - [30/jun/2013:08:04:51 -0500] "head / http/1.1" 200 - "-" "checks.panopta.com" i want read whole file, , summarize entries follows: num 3 ip 5.63.145.1 time [30/jun/2013:08:04:46 -0500] number of entries, ip, time , date what have far: import re x = open("logssss.txt") dic={} line in x: m = re.search(r"\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b",line).group().split() c = re.search(r"\[(.+)\]",line).group().split() in range(len(m)): try: dic[m[i]] += 1 except: dic[m[i]] = 1 k = dic.keys() in range(len(k)): print d...

Using a Static Class Method to *Quickly* Sort an Array By Key Value in PHP -

this question different others, it's focus on sorting array static class method rather typical procedural approach. i performant way implement function sortbykeyvalue below. other related answers focused on getting job done, question more getting job done , getting done (as static method). anyone want take crack @ it? i'll throw bounty on question squeeze out performance junkies. :) <?php $data = array( array('name' => 'b', 'cheesy' => 'bacon'), array('name' => 'c', 'delicious' => 'tacos'), array('name' => 'a', 'lovely' => 'viddles'), ); class myarray { public static function sortbykeyvalue($array, $key, $direction = 'asc') { // thing // me! return $array; } } $data = myarray::sortbykeyvalue($data, 'name'); // should output name key in order // not including garbage keys threw in, should th...