Posts

Showing posts from January, 2013

javascript - CKEDITOR.inline first load -

ckeditor giving me hard time first load, use: ckeditor.inline on first load takes 2 seconds load, on these 2 seconds if user edit div's content, when ckeditor loads restores before edit :\ there way fix or maybe read-only text untill ckeditor loads? right use opacity0 untill ckeditor ready cheap hack , doesnt good. on first load, toolbar starts @ left side of screen, on other loads doesnt happen when appears above div being eddited. i cant figure out how on ckeditor inline demo did perfectly. the question little vague grasp single underlying question. post comment, long, i'll go ahead , add answer. mean preloading editor? want stop user editing content or want load editor before loading html body content? both same "use opacity0 until ckeditor ready cheap hack , doesn't good.", difference? i wasn't talking server performance in comment, talking client performance. there many, many things try build prettier fake preloader; example mas

html - PHP isset() usage -

okay let me sum briefly. have 2 textboxes made in html. want whatever typed there stored 2 variables, want page 2 things, one, want set submit button(using isset) not display error @ beginning. how this, suppose 2 variables $textbox1 , $textbox2. error undefined variable on line 26 html textbox2 located. note value of textbox variable. if don't understand me, scroll bottom of code see i'm talking about. <?php if (isset($_post['submit'])) { $textbox1 = $_post['txtbox1'] && $textbox2=$_post['txtbox2']; if ($textbox1=="john" && $textbox2="doe") { print ("welcome friend"); } else { print ("you're not member of site"); } } else { $textbox1="" && $textbox2=""; } print($textbox1 && $textbox2); ?> <input type="text" value="<?php print($textbox2); ?>" name=txtbox2> &&

java - Trouble in finding difference between 2 sound frames in a wav file -

i wanted compare how 2 sound frames similar, can distinguish between them. i doing because, when had video playing , advertisement comes up, there either sound drop or increase in sound. so want compare sound frames wav file find difference. the following code finds amplitude of sound wave per video frame 1 video frame corresponds 2000 sound frames. code ----> for (offset=wavefileheaderoffset; ((offset < raf.length()) && (videoframes < videofile.max_possible_frames)); offset+=2*audio_per_frame) { audioamplitude = 0.0; (offset2=0; offset2 < 2*audio_per_frame; offset2+=2 ) { double temp = 0.0; raf.seek(offset+offset2); raf.read(bytes); temp = (double) math.abs((double)( ( ( bytes[1] << 8 ) | ( bytes[0] & 0xff ) ) / 32768.0 )); audioamplitude += temp; } audioamplitude /= audio_per_frame;//we taking avera

c# - How do I make this Func work with Linq to SQL? -

i have abstract, generic repository class encapsulates lot of logic, , able because knows how isolate unique data row , keycompare property, injected repository's constructor: func<t, t, bool> keycompare { get; } the role of property tell base class fields use fetch unique record - it's "id" , keycompare can assigned (passed constructor): (item1, item2) => item1.id == item2.id however gives me flexibility of using linq sql classes have keys span several columns, this: (item1, item2) => item1.field1 == item2.field1 && item1.field2 == item2.field2 and works in unit tests, because i'm testing mock repo uses linq object . production code uses linq sql , since i've been told keycompare property won't behave expected (because func won't translated sql), should using expression instead. started googling around (and apparently func won't translated sql), , saw many examples, nothing i'm doing (is sign of somet

Perl Hash of Hashes Storing References To Within - Can't use string ("") as a HASH ref -

alright have function generates hash tree dumper prints out this: $var1 = { 'shaders' => { 'stock_gui.vert' => '', 'stock_font.vert' => '', 'stock_gui.frag' => '', 'stock_font.frag' => '' }, 'textures' => {}, 'fonts' => { 'droidsansmono.ttf' => '', 'small' => { 'droidsansmono.ttf' => '' } } }; now trying dfs iterate example fonts sub tree: push (@stack, \%{$myhash->{'fonts'}}); then in loop: my $tmphash = pop(@stack); then dumper of $tmphash shows: $var1 = { 'droidsansmono.ttf' => '', 'small' => { 'droidsansmono.ttf' => '' } }; the problem trying access children of hash reference. can count keys , see children. dumper output looks okay. trying like: foreach $childkey ( keys $tmphash ){ $subc

Simple translation from bash to perl - Bitcoin private key import format -

i'm working on bitcoin brain wallet generator in perl. wasn't able make last step correctly (base58 encode) generate private key (import format). i have found simple bash script job, , have translated perl can make key generation entirely on perl. can me translate following bash code perl sub? #!/bin/bash base58=({1..9} {a..h} {j..n} {p..z} {a..k} {m..z}) bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3a ; n/=3a }" | tac | while read n echo -n ${base58[n]} done edit: thank barmar! it's closer, not working. did closest result was: sub encode_base58sp { $in = shift; $out = ''; @base58 = (1 .. 9, 'a' .. 'h', 'j' .. 'n', 'p' .. 'z', 'a' .. 'k', 'm' .. 'z'); $n = hex($in); while ($n > 1) { $remain = $n % 58; $out = $base58[$remain] . $out; $n /= 58; } return $out; } with first 9 chars okay, rest wrong..

php - Android & MySQL: Get mysql_insert_id() and retrieve it in Android Activity -

hi have connected mysql in server , android application using json. have table called products primary key , id auto_increment. when insert new product id in android activity don't know how retrieve in php nor android. here code: create product script if (isset($_post['name']) && isset($_post['price']) && isset($_post['description'])) { $name = $_post['name']; $price = $_post['price']; $description = $_post['description']; // include db connect class require_once __dir__ . '/db_connect.php'; // connecting db $db = new db_connect(); // mysql inserting new row $result = mysql_query("insert products(name, price, description) values('$name', '$price', '$description')"); where should put mysql_insert_id() ? finally, how mysql_insert_id() in android activity? thanks in advance well, easy: // mysql inserting new row $res

php - Web Service through Intranet -

i have simple intranet wamp @ work setup myself (nothing fancy, few pages shared local computers use share data, search modify database , upload stuff on) one of functionalities log people add stuff in , shows on home page new information. make web service, wondering: can make web service display last log entry intranet online? example, if leave work , use phone activate web service displays last inserted log in intranet. if want access web service internet have following 2 options: use vpn working net. can access web service as if @ work establish nat forward works router web server hosts service. access service http://outer_ip_or_dyndns_at_work:service_port i advice use vpn industry standard such things , more secure.

C# HTTP request to PHP file to JSON -

i write class in c# should send http request (post) php file on server in order retrieve json object. this code i've got: public void sendrequest(){ httpwebrequest request = (httpwebrequest) webrequest.create("url"); // execute request httpwebresponse response = (httpwebresponse) request.getresponse(); } is need? think should change or improve? thank help. you need post data , read response: httpwebrequest request = (httpwebrequest)webrequest.create("url"); string yourpostdata = "your post data"; string sreverresponsetext; byte[] postdatabytes = encoding.utf8.getbytes(yourpostdata); request.contentlength = yourpostdata.length; request.contenttype = "application/x-www-form-urlencoded"; request.method = "post"; using (stream requeststream = request.getrequeststream()) requeststream.write(postdatabytes, 0, postdatabytes.length); using (response = (httpwebresponse)reques

An easy way to program an Android keyboard layout app -

i program android app replaces standard keyboard 1 one-hand optimized coffee++ keyboard layout. what special problems have face in progress? guess such project go deep android core, cause keyboard such essential thing. is wise start android developer tools (adt)—eclipse plugin described in this tutorial ? or there better way achieve goal? i new android programming, firm in php, mysql , javascript , use eclipse php i guess such project go deep android core, cause keyboard such essential thing. no. can create inputmethodservice implementation of keyboard. there sample soft keyboard in android sdk installation (if chose download sample code sdk manager), , there open source input methods floating around well, such hacker's keyboard. inputmethodservice distributed part of ordinary android application, , user can elect activate input method if user chooses. is wise start android developer tools (adt)—eclipse plugin described in tutorial? that fine s

visual studio 2010 - Creating a rectangle within a class -

so i'm trying figure out how implement rectangles in class around each bullet fire. it's missile command type game. can't figure out declare rectangle , how pass game. here code rocket class... using system; using system.collections.generic; using system.linq; using system.text; using microsoft.xna.framework; using microsoft.xna.framework.graphics; namespace shootingrocket { public class rocket { public texture2d drawtexture { get; set; } public vector2 position { get; set; } public vector2 direction { get; set; } public float rotation { get; set; } public float speed { get; set; } public bool isshooting { get; set; } int timebetweenshots = 100; int shottimer = 0; public rocket(texture2d texture, vector2 position, vector2 direction, float rotation, float speed) { this.drawtexture = texture; this.position = position; this.direction = direction; this.rotation = rotation; this.speed = sp

android - application may be doing too much work on main thread even after using a different thread -

hello new android , following yamba application posts , status twitter. working fine before added new part. i used different thread perform post. once run project, logcat says"application may doing work on main thread".when type in status,"thread exiting uncaught exception",due nullpointexception in doinbackground method. anyone can me??i have registered twitter account make sure not null.but alot answer!! public class mainactivity extends activity implements onclicklistener,textwatcher { private static final string tag="statusactivity"; edittext edittext; button buttonupdate; textview textcount; private yambaapplication yamba; //constructor @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); edittext=(edittext) findviewbyid(r.id.edittext); buttonupdate=(button) findviewbyid(r.id.buttonupdate); textcount=(textview) fin

c - Mental block on fprintf string termination -

i @ total loss one. can't figure out why isn't working. simple character array null terminator - except when output it, doesn't terminate! int file_create(const char *path) { //trying trap situations path starts /.goutputstream char path_left_15[16]; strncpy(path_left_15, path, 15); printf("%d\n", strlen("/.goutputstream")+1); path_left_15[strlen("/.goutputstream")+1] = '\0'; printf("%d\n", strlen(path_left_15)); printf("path_left_15: %s\n", path_left_15); //continue on... } this output: > 16 > 16 >/.goutputstream\b7<random memory stuff> i can't figure out why isn't terminating correctly. i've tried making array longer, same result every time. i'm losing mind! anyone see it? thanks. you out of bound array. instead of path_left_15[strlen("/.goutputstream")+1] = '\0'; try path_left_15[15] = '\0'; you

Plone 4 - History for second workflow won't show in @@historyview -

i have dexterity content type in plone 4.2.4. versioning works fine default workflow content type, although not workflow shipped plone, custom made. however, when enable second workflow same type, versioning works fine. additional permissions managed second workflow working the state changes working the difference: i used different state_variable names workflows, seems make sense, have catalogable field state of second workflow. i've tried use same state variable name, didn't help. have workflow variable review_history set in 2nd workflow , sufficient permissions in context. (mostly) shure, got permission concept, have no clou, how permissions calculated, when multiple workflows involved. any idea, why second workflow not leave trace in content types history? thanks in advance. udate i've reordered workflows ida ebkes suggested , did see, transitions 2nd workflow stored properly. seems issue historyview. since these workflows indeed describe

performance - Is there a better way of getting elements with x,y coordinates from a numpy array? -

it possible index numpy array tuple of sequences such tpl[0] a sequence of x coordinates , tple[1] sequence of y coordinates. 1 needs index array tuple, thus: other_array[tpl] . i have coordinates stored in 2d array such vector ar[0] corresponds x values , ar[1] corresponds y values. right now, i'm indexing other_array creating tuple: other_array((ar[0], ar[1])) . unfortunately, operation running in tight loop, amount of performance can squeeze out highly beneficial. creating tuple can add bit of overhead if performed 10^8 times! there faster, numpythonic way of indexing such matrix of xy coordinates? thank much! you can index numpy array array, don't have create tuple. example: in [199]: other_array out[199]: array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14]]) in [200]: ar out[200]: array([[0, 2, 1], [1, 3, 0]]) in [201]: other_array[ar[0], ar[1]] out[201]: array([ 1, 13, 5]) if doesn't

java - Javamail Could not convert socket to TLS GMail -

i trying send email using javamail through gmails smtp server. code. final string username = "mygmail@gmail.com"; final string password = "mygmailpassword"; properties props = new properties(); props.put("mail.smtp.auth", true); props.put("mail.smtp.starttls.enable", true); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "587"); session session = session.getinstance(props, new javax.mail.authenticator() { protected passwordauthentication getpasswordauthentication() { return new passwordauthentication(username, password); } }); try { message message = new mimemessage(session); message.setfrom(new internetaddress("no-reply@gmail.com")); message.setrecipients(message.recipienttype.to, internetaddress.parse("test@g

javascript - Strange jQuery radio button show/hide bug -

i want username text field show when op1 , op2 selected , both text fields if op3 selected. have strange bug on radio button selected show username , password text fields. why happening? html: <div>please select operation:<br /> <input type="radio" id="op1" name="op" value="check_username">check username<br /> <input type="radio" id="op2" name="op" value="find_profile">find profile<br /> <input type="radio" id="op3" name="op" value="check_credentials">check credentials </div><br /> <div id="un">username:<br /><input type="text" /></div> <div id="pwd">password:<br /><input type="text" /></div> jquery: $(document).ready(function() { $('#un, #pwd').hide(); $('input[name="op"]&#

How to use grails.plugin.location? -

i have plugin project created grails create-plugin myplugin . created 'normal' grails project grails create-app myplugindemo . i'm trying install myplugin plugin in myplugindemo don't understand how use grails.plugin.location . where put grails.plugin.location inside buildconfig.groovy ? inside plugins section? inside repositories section? what should append grails.plugin.location ? should grails.plugin.location.myplugin ? or grails.plugin.location.grails-my-plugin ? else? grails.plugin.location not dependency resolution, goes outside grails.project.dependency.resolution . it should below, if both myplugindemo , myplugin in same directory. moreover, not install plugin app, application refer file system plugin convenient in development mode. in order use packaged plugin has referred in plugins inside grails.project.dependency.resolution grails.plugin.location.myplugin = "../myplugin" grails.project.dependency.resolution = { rep

Susy media query output & "screen" -

is there particular reason susy doesn't use common @media screen , (min-width: 460px) syntax media queries? (or perhaps better asked "why use @media screen or @media screen media queries?") quoting mdn, https://developer.mozilla.org/en/docs/css/media_queries the keyword prevents older browsers not support media queries media features applying given styles. so if use only keyword old browsers doesn't support media query ignore line @ all. guess of time use polyfill media query, example respond.js , it's quite safe ignore only keyword.

How to share functions in Delphi? -

for example, have couple of functions written form. now, need exact same functions in form. so, how can share them between 2 forms? please, provide simple example if possible. don't put them in form. separate them , put them in common unit, , add unit uses clause need access them. here's quick example, can see many of delphi rtl units (for instance, sysutils ) this. (you should learn use vcl/rtl source , demo apps included in delphi; answer many of questions you've posted more waiting answer here.) sharedfunctions.pas: unit sharedfunctions; interface uses sysutils; // add other units needed function dosomething: string; implementation function dosomething: string; begin result := 'something done'; end; end. unita.pas unit yourmainform; uses sysutils; interface type tmainform = class(tform) procedure formshow(sender: tobject); // other stuff end; implementation uses sharedfunctions; procedure tmainform.

subquery - mySQL, need help getting many sub-queries into 1 SELECT query (displays 13 columns) -

this first post. know horribly inefficient , repetitive code won't work, need combine these outputs 1 select statement. new @ this, i've been @ day , can't started in right direction, each snippet works on own...please help! essentially i'm working db many tables, , right data each column, have account 3 tables joins. thanks insight or help! select product.productid, ( select abbreviation country product left join productcountry on product.productid = productcountry.productid left join location on productcountry.locationid = location.locationid group product.productid ), ( select r.resourcename manufacturer, rr.resourcename brand product p left join resource r on p.manufacturecode = r.resourceid inner join resource rr on p.brandcode = rr.resourceid ), product.name, product.upc, product.size, ( select unit.abbreviation measure product left join unit on product.unit = unit.unitid ), (

php - Deleting Elements In An Array Only When They Are Next To Each Other -

i have array composed of information looks following: ['jay', 'jay', 'jay', 'spiders', 'dogs', 'cats', 'john', 'john', 'john', 'dogs', 'cows', 'snakes'] what i'm trying remove duplicate entries if occur right next each other. the correct result should following: ['jay', 'spiders', 'dogs', 'cats', 'john', 'dogs', 'cows', 'snakes'] i'm using php kind of logic able me out problem. here code i've tried far: $clean_pull = array(); $counter = 0; $prev_value = null; foreach($pull_list $value) { if ($counter == 0) { $prev_value = $value; $clean_pull[] = $value; } else { if ($value != $pre_value) { $pre_value = value; } } echo $value . '<br>'; } francis, when run following code: $lastval = end($pull_list); ($i=count($pull_list

vb.net - Extracting numbers from a PostRequest -

i posting web form using postreq() in vb.net. the response contains string, "sessionid= wxyz " , wxyz 4 digits. how can extract these numbers? here's code: public sub btn1_click(byval sender system.object, byval e system.eventargs) handles btn1.click dim postdata string = "some post data" dim url string = "http://localhost/form.php" dim tempcookies new cookiecontainer dim encoding new utf8encoding dim bytedata byte() = encoding.getbytes(postdata) dim postreq httpwebrequest = directcast(webrequest.create(url), httpwebrequest) postreq.method = "post" postreq.keepalive = true postreq.cookiecontainer = tempcookies postreq.contenttype = "application/x-www-form-urlencoded" postreq.referer = url postreq.useragent = "mozilla/5.0 (windows; u; windows nt 6.1; ru; rv:1.9.2.3) gecko/20100401 firefox/4.0 (.net clr 3.5.30729)" postreq.contentlength = bytedata.length

c++ - Can't include header file -

i need include header files sqlite3x library (or sqlite) in project. i've created new project in qt creator , added following lines in .pro-file: includepath += $$quote(d:/libs/libsqlite3x-2007.10.18) includepath += $$quote(d:/libs/sqlite-amalgamation-3071502) then i've tried include #include <sqlite3x.hpp> and compile. cannot open include file: 'sqlite3.h': no such file or directory why? if write #include <sqlite3.h> i've got same error. when write preprocessing directive, qt creator gives me autocompletion , if press f2 on line it'll open file. http://pastie.org/7670341 http://pastie.org/7670574 you need includepath += $$quote(d:/libs/libsqlite3x-2007.10.18) $$quote(d:/libs/sqlite-amalgamation-3071502) if see http://pastie.org/7670574 these include directives -i"d:\libs\libsqlite3x-2007.10.18" -i"d:\libs\qt\qt5.0.0\5.0.0\msvc2010\include" -i"d:\libs\qt\qt5.0.0\5.0.0\ms

jquery - Validating two dropdowns in a single anchor tag click event -

i have validate 2 dropdowns in anchor tag click event. $(".viewmore").on('click',function(event){ return requiredvalidation($(this).parents('.box01').find(".color")); return requiredvalidation($(this).parents('.box01').find(".size")); }); function requiredvalidation(ddl) { ddl = $(ddl); var isvalid = true; if (jquery.trim(ddl.val()) == 'vÆlg' ) { isvalid = false; ddl.addclass("error"); } else { ddl.removeclass("error"); } return isvalid; } but first 1 validating here.can 1 give clue? use $(".viewmore").on('click',function(event) { var valid1 = requiredvalidation($(this).parents('.box01').find(".color")); var valid2 = requiredvalidation($(this).parents('.box01').find(".size")); return valid1 && valid2; }); you returning after first select val

visual studio 2010 - Check for non-numeric inputs in a C++ program -

how check non-numeric input using c++? using cin read in float value, , want check if non-numerical input entered via stdin. have tried use scanf using %d designator, output corrupted. when using cin, correct format, when enter, string such "dsffsw", infinite loop. commented code attempt capture float, , type cast string, , check if valid float, check comes false. i have tried using other methods have found on message boards, want use scanf in c , not cin in c++. how do in c++? or in c if not feasible. while (!flag) { cout << "enter amount:" << endl; cin >> amount; cout << "begin amount entered is: " << strtod(&end,&pend) << endl; //if (!strtod(((const char *)&amount), null)) { // cout << "this not float!" << endl; // cout << "i = " << strtod(((const char *)&amount), null) << endl; // //am

javascript - js / jquery: How to randomize images -

i have script replaces image every time countdown reaches 0. although wondering if possible, , how, these images (i have listed in order) randomize each time page refreshed ect. here of code (the images located before " // fill in images in array") : <div id="counter_2" class="counter"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript" charset="utf-8"></script> <script src="js/jquery.countdown.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> <!-- ready() function force browser run wait running javascript until entire page has loaded --> $(document).ready(function() { // jquery code constructing , starting counter // has been wrapped inside function can call whenever want function startcounter(imagel

java - Android: How Reliable is InputStream.read() and its "-1" return? -

my question related method inputstream.read() - socket programming. every source have found states when server or client closes connection, "-1" returned. but, "what if", saying, "what if" connection is closed read() not return "-1"? rely on else's code. reason worried because in order read remote end's input, 1 have create infinite loop , have been thought stay away infinite loops. java however, looks not have choice! here sample: int b = 0; while (true) { b = inputstream.read() if (b == -1) break; // connection closed } or while (b > -1) b = inputstream.read() what if happens, , -1 never becomes true? 1 end in infinite loop increasing temperature of someone's device , wasting cpu cycles! how can 1 certain? references: [http://developer.android.com/reference/java/io/inputstream.html#read%28%29][1] , [http://docs.oracle.com/javase/6/docs/api/java/io/inputstream.html#read%28byte[],%20i

php - Composer check local repository instead online repository like Maven -

how composer http://getcomposer.org work maven in java. instead of getting repository online, can local repository. so, don't have download again. i don't know maven, @ least 2 options in composer's world come mind: access local git repository let's want use local git repository of braincrafted's bootstrap bundle. add following entry composer.json: "repositories": [ { "type": "vcs", "url": "/home/user/braincrafted/bootstrap-bundle" } ] "require":{ "braincrafted/bootstrap-bundle":"dev-master" } satis another alternative satis - makes have private packagist.com it's explained in documentation this talk worth watching learn more composer, satis etc: https://www.youtube.com/watch?v=p3nwf8rv1ly

php - How to display the logfile in a browser YII -

i need display logfile in browser. if(isset($_get['showlog'] && $_get['showlog']==1){ $this_>redner('output', application.log); } is possible in yii? , how it? thanks lot :) if (isset(yii::app()->request->getquery('showlog')) { $this->render('output', application.log); } documentation

android - JSON parsing with Java -

i created android app involving json parsing. when run application in emulator worked, when run in android phone outputs error "unfortunately has stopped". this json class: package com.example.uichandbook; import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstreamreader; import java.net.httpurlconnection; import java.net.malformedurlexception; import java.net.url; import java.util.list; import org.apache.http.httpresponse; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.defaulthttpclient; import org.json.jsonarray; import org.json.jsonobject; import android.app.activity; import android.content.context; import android.content.intent; import android.graphics.paint; import android.net.connectivitymanager; import android.net.networkinfo; import android.os.bundle; import android.util.log; import android.view.gravity; import android.view.view; import android.widget.button; import android.widget.linearlayout;

javascript - Template not updating and $http not firing requests when using custom directive -

i'm trying create custom directive handle paste event , i've come with: app.directive('ngpaste', function(){ var obj = { compile: function(element, attrs) { return function(scope, elem, attrs){ elem.bind('paste', function() { var funcname = attrs.ngpaste.replace('(', '').replace(')', ''); if(typeof(scope[funcname]) == 'function') { settimeout(function(){ scope.$apply(scope[funcname]); }, 10); } }); }; } }; return obj; }); the problem models change on callback don't update template , $http object not fire request. must missing simple but, unfortunately, docs quite lacking on theses matters. how can solve this? thanks, the problem was using angular 1.1.4 unstable. downgraded 1.1.1 (wh

bash - GIT Preview Checkout or Merge -

i want script me release system checkout repo in git. my quest can way test checkout branch identify if got error without rely on file-system. as same, can on easy way preview git merge identify conflict without modify file-system? (the full system run on linux system if help) use git merge --ff-only - merge branch if fast forwarded. means conflicts impossible , work (except of course system failures, e.g. out of disk space). obviously, means branches should not diverged, in cases so, if not should merge potential conflicts in repo, keeping "release repo" untouched. another approach here use symlinks (linux or ntfs). should have 2 repositories repo1 , repo2 , symlink releaserepo point 1 of these. say, have releaserepo -> repo1 . update repo2 , check if works, change symlink it, next time update repo1 , flip symlink back. if avoid system failures too, because create symlink operation atomic.

git - How to create a new Patchset in Gerrit? -

i new gerrit , want create new patch when new changes submitted. setup gerrit guide https://review.typo3.org/documentation/install-quick.html then try create new patch http://gerrit.googlecode.com/svn/documentation/2.0/user-changeid.html , added change-id line @ bottom of commit-message. but getting new change instead of new patchset.. can me..? thanks step 1 : install commit-msg hooks gerrit scp -p -p 29418 localhost:hooks/commit-msg .git/hooks/ step 2 : create normal commit , push (for patchset1) for example: git add server.java git commit -m "server added" git push origin head:refs/for/master step 3 : after doing changes server.java finally create new patchset (patchset 2) git add server.java git commit --amend git push origin head:refs/for/master repeat step 3 further patches

.net - SQLite and Entity Framework -

i'm trying use sqlite database latest entity framework. i've installed sqlite provider x86 .net framework 4.0 here: http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki . i succesfully added sqlite new data source using server explorer in visual studio 2012. then, added new ado.net entity model , tried add tables simple sqlite database. reason these tables can't added , error log says following: the data type 'longchar' not supported target .net framework version; >>the column 'name' in table 'main.person' excluded. i dont understand why it's trying convert sqlite text type longchar , fails. can me problem? i getting issue today after setting development environment project uses sqllite , ado @ work , fix simple. version 1.0.85.0 broken , version 1.0.84.0 works. 32 bit: http://system.data.sqlite.org/downloads/1.0.84.0/sqlite-netfx40-setup-bundle-x86-2010-1.0.84.0.exe 64 bit: http://system

assembly - ASM Floating-point unit giving wrong numbers -

i making bigger program using floating-point unitin asm, getting wrong numbers. made simple code, giving false numbers. got idea why? wrong here? using ubuntu 32b. sysexit = 1 .align 32 .data a: .float 1 b: .float 2 test1: .float 0 .text .global main main: finit fld fld b loop: fmulp fstp test1 mov $sysexit, %eax int $0x80 i using gdb, , after "print a" shows huge number instead of 1 , same other 2 variables (b, test1). what wrong here? you need use print/f a in order interpret , print numbers floating-point values instead of integers. reference .

Spring security concurrent session is not working as desired -

instead of restricting 1 session per user,it restricting 1 session whole application. so if 1 user logged in noone can login . here configuration <session-management invalid-session-url="/login"> <concurrency-control error-if-maximum-exceeded="true" max-sessions="1" /> </session-management> and added listener in web.xml. <?xml version="1.0" encoding="utf-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> <!-- http security configurations -

Pulling out a product only once from a django view -

i'm coming across small problem pulling out list of products django view. have product page pulls through of products in model 'active' tick box ticked. can assign sub products these products. if product has sub product assigned it, rather loading page more content load page list of sub products. @ moment in template loops through , pulls out of products. @ moment if product has 1 or more sub products assigned it, pull through each product more once, depending on how many sub products has assigned it. the reason because i've created chain combines 2 variables in function in view. need in order sub products work. so need limit each product appear once on template, no matter how many sub products has assigned it. if need more info please ask! :) * updated view answer * view: def producthome(request): #prod_info= product.objects.filter(active=true, sub_product__isnull = true) #sub_product = product.objects.filter(sub_product__isnull = false, activ

oracle - wrong query output when using where and having in the same SQL statement -

select currency.currencyname, currency.currencysymbol, countryname.currencycode, currency.exchangerate currency,countryname currency.currencycode=countryname.currencycode having currency.exchangerate >= max(currency.exchangerate) group currency.currencyname, currency.currencysymbol, countryname.currencycode, currency.exchangerate; this output getting , know wrong because trying display maximum exchange rate . resolve query appreciate. oracle sql developer currencyname currencysymbol currencycode exchangerate -------------------- -------------------- ------------ ------------ british pound £ gbp 1, dollar $ usd 1.9626 , danish krone kr dkk 9.9918 , malaysian ringgit rm myr 6.35392 , euro € eur 1.34076 , indian rupee rs

c++ - QObject::moveToThread: Widgets cannot be moved to a new thread -

my ide qt 5.0.1, platform linux i have problem set widgets window.(my opinion) this main.cpp-> int main(int argc, char *argv[]) { qapplication a(argc, argv); qthread cthread; mainwindow w; w.dosetup(cthread); w.movetothread(&cthread); cthread.start(); if(cthread.isrunning()) { qdebug() << " thread running..."; } w.show(); return a.exec(); } this dosetup() method-> void mainwindow::dosetup(qthread &mainthread) { qobject::connect(&mainthread, &qthread::started, this, &mainwindow::activeloopmainc); } i checked signal-slot mechanism , works. slot method-> void mainwindow::activeloopmainc() { qdebug() << " signal-slot structure working successfully.."; mainthreadproc((void*)(instaddr)); } i call function main.c slot method. in debugging there no problem working codes. window blank. there frame. i receive error message: qobject::moveto

canvas - Python Tkinter scrollbar in multiple tabs -

i learned how make scrollable frame embedding frame in canvas , adding scrollbar this: def __add_widget_features(self, feat_tab): table_frame = ttk.frame(feat_tab) table_frame.pack(fill=both, expand=true) self.__make_grid(table_frame) ####subframe#### self.canvas = canvas(table_frame, borderwidth=0, background="#ffffff") self.frame = labelframe(self.canvas, background="#ffffff", text="timetable") self.vsb = ttk.scrollbar(table_frame, orient="vertical", command=self.canvas.yview) self.canvas.configure(yscrollcommand=self.vsb.set) self.vsb.pack(side="right", fill="y") self.canvas.pack(side="right", fill="both", expand=true) self.canvas.create_window((4,4), window=self.frame, anchor="nw", tags="self.frame") self.frame.bind("<configure>", self.onframeconfigure) my program h