Posts

Showing posts from June, 2012

r - melt function applied to json input replaces some values with factors -

i have following json file: { "observations": [ { "type": "ob_type_1", "data": { "dynamic": { "sensor": [ { "timestamp": 552625694285098, "a": 1.4921862, "b": 8.613739 }, { "timestamp": 552625699285098, "a": 0.6907272, "b": 7.6243353 } ] }, "static": { "class1": "abc", "class2": "xyz" } } } ] } i import using rjson: library(rjson) raw_json <- fromjson(file=json_file) to reproduce please use: raw_json <- structure(list(observations = list(structure(list(type = "ob_type_1", data = structure(list(dynamic = structure(list(sensor = list( str...

android - BitmapFactory.decodeFile in asset doesn't work (FileNotFindException) -

i don't know why decodefile doesn't work when param point file inside asset folder. // load images file path string[] dir = null; try { dir = genericmaincontext.sharedcontext.getassets().list("drawable"); // dir log => [ic.png, ic_info_dark.png, ic_launcher_default.png] } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } (string uri : dir){ // stuff here if (uri!=null) { bitmap bitmap = null; try { bitmap = bitmapfactory.decodefile("file:///android_asset/drawable/"+uri); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } any explanation ? file:///android_asset/ used webview load assets. load assets programmatically use getassets() method returns assetmanager on context object such activity . open(fil...

concurrency - MySQL CDR Concurrent Call Query -

i trying construct query concurrent calls of of asterisk cdr uploaded mysql. i have tried following examples located on these threads: mysql query - peak concurrent calls cdr data results not expected. fetch max number of concurrent phone calls call_log , seems take forever , results not expected either. i cant rewrite them because base not expected wouldnt know start. what following: 1 - query peak calls system whole day 2015-06-01 | 134 2 - query list of times of top 10 concurrent calls selected period. 2015-06-01 9:32:21 | 50 2015-06-01 10:15:11 | 43 2015-06-01 15:45:14 | 40 ....... i have other complex queries me started. eventually, want max concurrent calls of specified day src or dst equals pool of specified dids my mysql database in format of source destination calldate endtime duration uniqueid any appreciated. here required query find max concurrent calls on specified day. set @start = '2015-12-03 00:00:00'...

Gulp Sass Compile Issue -

my gulp scss compiler below works fine single files, , when including files single output e.g. styles.scss & _base.scss output styles.css. however if 2 output files e.g. styles.css & base.css upon making scss file 'base.scss' complies dest still .scss extension. not till rerun compile task till base.css file base.scss file in dest folder... gulp.task('build-css', function() { return gulp.src('source/scss/**/*.scss', { style: 'expanded' }) .pipe(plugins.sass()) .pipe(gulp.dest('public_html/css')); }); im using node-sass. not want use ruby-sass output in public_html/css/ what i'm getting css/ - base.scss - base.css - style.css what want css/ - base.css - style.css there no such option { style: 'expanded' } available in gulp.src to control output style, need specify outputstyle , pass argument plugins.sass(options) call.

HTML/CSS: Styling a checkbox inside a form -

Image
i have following form: using html: <form id="user_form" name="user_form"> <input id="firstname" type="text" name="firstname" placeholder="vorname" required> <br> <input id="lastname" type="text" name="lastname" placeholder="nachname" required> <br> <input id="nickname" type="text" name="nickname" placeholder="nickname" required> <br> <input id="email" type="email" name="email" placeholder="email" required> <br> <input id="conditions" type="checkbox" name="conditions" required>ich bin mit den <a id="show_2">teilnahmebedingungen</a> einverstanden! <br> <input id="user_save" type="submit" value="speichern"> ...

mongodb - Undefined is not a Function-Sails Mongoose -

hi trying write logic in sails using mongoose find , update parameters in mongoose database using serial no in string format.the parameters passing in the body of dhc app(used posting data api). while posting data, getting following error typeerror: undefined not function @ object.module.exports.createorupdatestatus (/users/febinp/downloads/shubham_application/taqua-parser/api/controllers/status-packetcontroller.js:66:26) @ bound (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21) @ routetargetfnwrapper (/usr/local/lib/node_modules/sails/lib/router/bind.js:179:5) @ callbacks (/usr/local/lib/node_modules/sails/node_modules/express/lib/router/index.js:164:37) @ param (/usr/local/lib/node_modules/sails/node_modules/express/lib/router/index.js:138:11) @ pass (/usr/local/lib/node_modules/sails/node_modules/express/lib/router/index.js:145:5) @ nextroute (/usr/local/lib/node_modules/sails/node_modules/express/lib/router/index.js:100:7) @ callbacks (/usr/local/l...

Firebase group security rule configuration -

i new firebase, , trying setup security rules want users grouped dynamically created groups. want user able read content same group, not other groups. when create new users , assign them groups using push, data following: { "groups" : { "default" : { "-jtcdyniz1yvwnqcgsar" : { "user" : "simplelogin:5" }, "-jtd114knq-rqh6-rlni" : { "user" : "simplelogin:7" } } }, "users" : { "simplelogin:5" : { "group" : "default", "name" : "123" }, "simplelogin:6" : { "group" : "default1", "name" : "1" }, "simplelogin:7" : { "group" : "default", "name" : "23" } } } can here? how can setup authentication rules? have tried following doesn't seem work... { "rules": { "users" : { ...

javascript - jQuery replace() flickers in Safari -

i have script following code executed on mousemove restart css animation: var $clone = $(this).clone(true, true); $(this).replacewith($clone); this works smooth in browsers, except safari mac flickers while replacing. do have ideas how avoid issue?

linux kernel - How to find driver under inode? -

suppose have pointer struct inode, references special file. how can found driver placed under inode? generally, cannot deduce driver inode object. if driver compiled module, way below may help. you can check inode->i_fop->owner field. if non-null, refers module ( struct module ), implements it. macro module_name(mod) returns name of module.

How to set rack environment variable from inside Rails -

rack-cache gem relies on @env['rack.errors'] setting log error messages: 78: # write log message rack.errors 79: if verbose? 80: binding.pry 81: message = "cache: [%s %s] %s\n" % 82: [@request.request_method, @request.fullpath, trace] => 83: @env['rack.errors'].write(message) 84: end it set @env['rack.errors'] #⇒ #<io:<stderr>> . i need change use rails.logger . obvious opportunity hack rack-cache initializer rails_cache.logger = ... . wonder whether there common way access rack environment rails , (pseudocode): rails.rack_env['rack.errors'] = rails.logger the rack environment accessible within context of request, hence in controller or view. to access environment can use request.env['whatever'] be careful when modify rack environment other pieces of rails stack may rely on it.

You can access private variables in Java without getters from a class that's not an inner class -

this question has answer here: how read private field in java? 9 answers i have clue of serialversionuid for, , in far don't can up. can private variable that's not used inside class. there construct or behind that? there other examples of private variables / methods not used inside same class? can access private variables in java without getters class that's not inner class, serialization does? you can access values, , manipulate them via reflection . mechanism can check fields , invoke methods.

how to retrieve and display photos from facebook using javascript? -

i trying retrieve images facebook through javascript api not getting @ actual problem in code. help appreciated :) in advance. function testapi() { console.log('welcome! fetching information.... '); fb.api('/me', function (response) { console.log('successful login for: ' + response.name); document.getelementbyid('status').innerhtml = 'thanks logging in, ' + response.name + '!'; fb.api('/me/albums', function (response) { (var = 0; < response.data.length; i++) { var album = response.data[i]; fb.api('/me/' + album.id + '/photos', function (photos) { if (photos && photos.data && photos.data.length) { (var j = 0; j < photos.data.length; j++) { ...

java - How to map a database view without a primary key when using JPA -

i have views in sql database no obvious primary key (composite or otherwise) i access them through jpa i've read should able treat views in jpa treat tables (using @table annotation etc.). without primary key have make composite key out of every column (in fact, in hibernate's reverse-engineering tool seems default). however if there undesirable side effects. e.g. having write code pointing primary key's attributes rather views: myviewobject.getprimarykey().getfirstname() not being able use "findby..." methods on spring repository (since attribute part of view's "identifier" , not 1 of it's attributes). my question is: how map views in such can access attributes using jpa? note: i'm quite happy told i'm using wrong approach. seems such common problem there's bound better solution. you can add uuid column every row of views can use uuid column @id .

reference - Selecting specific cells from a column in excel based on another column -

Image
here table trying reference from: **a** **b** ---------------------- true id 100 false 0 false 0 false 0 false 0 true id 811 false 0 false 0 false 0 true id 742 basically want able here list cells in row b row true. or row b not 0. result should this: **a** id 100 id 811 id 742 i'm sure there must easy way can't seem work out? many in advance. in c1 enter: =if( a1,1,"") in c2 enter: =if(a2,1+max($c$1:c1),"") and copy down. column c "marks" desired values. in d1 enter: =if(rows($1:1)>max(c:c),"",index(b:b,match(row(),c:c,0))) and copy down. example: note: this method avoids using array formula. edit#1: if don't mind array formula s, in c1 enter array formula: =iferror(index($b$1:$b$15,small(if($a$1:$a$15,row($a$1:$a$15)-min(row($a$1:$a$15))+1,""),row(a1))),"") ...

.net - OCR to return size of FEW words only inside image -

Image
is there ocr tool read coordinates of words inside image. e.g. refer attached image, require coordinate of 2 words, namely, 1)"measurements" 2) "999999.9mi" is achievable? i think of passing required words input ocr tool tessnet2, did not find suitable function ? other suggestions help.. i answering own question. need loop through words detected tessnet2 tool match words want. resolve issue. however, noticed tessnet2 tool not reading words correctly. above image should return following words: 1)trailer blind spot 2) measurements 3) have been saved 4) 999999.9mi but tessnet2 returns following , which wrong. .. 1)trailer 2) blind 3) spot 4) measurements 5) have 6) been 7) saved can here?

html - DIV fit width content in parent -

i have list of object slider - when clicking on right arrow, left param animates i.e. -500px. html <div id="container"> <div id="list"> <div class="elem"></div> <div class="elem"></div> <div class="elem"></div> <div class="elem"></div> // more ... </div> </div> styles #container { width: 500px; overflow: hidden; } #list { position: relative; left: 0px; } .item { float: left; } i want #list fit content - moves overflowed children next line. setting display: inline-block work without parent fixed width. how can achieve this? you should use white-space: nowrap #container div. #container { width: 500px; overflow: hidden; white-space: nowrap; } #list { position: relative; left: 0px; } .item { float: left; } .elem { background: orange; width: 200p...

Nginx SSL Certificate failed SSL: error:0B080074:x509 (Google Cloud) -

Image
my server hosted in bluehost (apache), certificate working fine. now, i'm using google cloud multiple pages in nodejs on different port using proxy_pass . trying configure ssl have problems. looking similar questions, still shows same error. created key file following link /var/log/nginx/error.log : 2015/07/08 10:47:20 [emerg] 2950#0: sl_ctx_use_privatekey_file("/etc/nginx/ssl/domain_com/domain_com.key") failed (ssl: error:0b080074:x509 certificate routines:x509_check_private_key:key values mismatch) when put on console: openssl rsa -noout -modulus -in domain_com.key shows me this: modulus=d484dd1......512 characters in total......5a8f3def999005f openssl x509 -noout -modulus -in ssl-bundle.crt : modulus=b1e3b0a.......512 characters in total......afc79424be139 this nginx setup: server { listen 443; server_name www.domain.com; ssl_certificate /etc/nginx/ssl/domain_com/ssl-bundle.crt; ssl_certificate_key /etc/nginx/ssl/domain_com/d...

Creating a Mutable string class in python -

i trying create class in python have str characteristics , mutable. example: >>> = mutablestring("my string") >>> print +"c" "my stringc" >>> a[0] = "a" >>> "ay string" how possible inheriting str ? edit: have done far is: class mutablestring(object): def __init__(self, string): self.string = string def __setitem__(self, item, value): self.string = self.string[:item] + value + self.string[item + len(value):] print type(self.string) def __repr__(self): return self.string in case, can do: a = mutablestring("aaa") a[2] = "b" print #prints aab but can't do: print + "c" #unsupported operand type(s) +: 'mutablestring' , 'str' so, i'm trying creating class keep str characteristics, allow me setitem. i believe give functionality want: class mutablestring(): def __i...

python - Retrieve List Index for all Items in a Set -

i have big, huge, dictionary (it isn't pretend because easier , not relevant) contains same strings on , on again. have verified can store lot more in memory if poor man's compression on system , instead store ints correspond string. animals = ['ape','butterfly,'cat','dog'] exists in list , therefore has index value such animals.index('cat') returns 2 this allows me store in object bobspets = set(2,3) rather cat , dog number of items memory savings astronomical. (really don't try , dissuade me tested. currently convert ints strings loop tempwordlist = set() integofindex in tempset: tempwordlist.add(animals[integofindex]) return tempwordlist this code works. feels "pythonic," feels there should better way. in python 2.7 on appengine if matters. may since wonder if numpy has missed. i have 2.5 million things in object, , each has average of 3 of these "pets" , there 7500-ish ints represent pets....

javascript - Get location of the group marker with Leafletjs + markercluster plugin -

i using leafletjs draw rental houses on map (using openstreetmap too) , i'm using leaflet.markercluster group these markers on marker cluster, until user zooms in map. on grouped icons show number of rental houses grouped in cluster, , want draw circle when put mouse on grouped icon. circle size depends on number of markers grouped, , need center of circle in same location of marker cluster. my problem can't location of cluster marker, tried catch onmouseover event , location it's location of first marker of group. in ideal case, need cluster marker icon in middle of grouped markers , radius of circle cover of grouped markers position problem is, how grouped marker position. this markercluster code. var markers = new l.markerclustergroup(); (var = 0; < addresspoints.length; i++) { var = addresspoints[i]; var title = a[2]; var marker = l.marker(new l.latlng(a[0], a[1]), { title: title }); var htmlpopup = '<div><...

python - Cannot write a specific string into a mssql database -

i new databases , python. read many logfiles script , write data mssql express database , use pymssql. logfiles in .csv format , looks this: id;request 3gix2v2h2mjmmybrf4p5blbm;49db032f0a144efeb1e0e690b4e6a26f; kzbcaakb2ex44dnhrqi4kgvt;28042afb61b44c539fbaa1ac4c303665; the id , request defined varchar(50) in database. my script works fine , write 70000 entries in db, till in 1 of logfiles line values: 0xaf3azaza5sb1ztogqfdmwb;934d4978a40c451b8f4080791f752453 appears. error: pymssql.programmingerror: (102, "incorrect syntax near 'zaza5sb1ztogqfdmwb'.db-lib error message 20018, severity 15) this script: for filename in os.listdir(sfolderlocation): if "archive" in filename: open(sfolderlocation + os.sep + filename, 'r') f: reader = csv.reader(f,delimiter=';') skipfirstline = true row in reader: werte=[] if skipfirstlin...

c - Why is printf with a single argument (without conversion specifiers) deprecated? -

in book i'm reading, it's written printf single argument (without conversion specifiers) deprecated. recommends substitute printf("hello world!"); with puts("hello world!"); or printf("%s", "hello world!"); can tell me why printf("hello world!"); wrong? written in book contains vulnerabilities. these vulnerabilities? printf("hello world!"); imho not vulnerable consider this: const char *str; ... printf(str); if str happens point string containing %s format specifiers, program exhibit undefined behaviour (mostly crash), whereas puts(str) display string is. example: printf("%s"); //undefined behaviour (mostly crash) puts("%s"); // displays "%s"

PHP CURL - get response text -

i making curl request external site. in response text message , boolean. want format message displayed in site, cannot access text. request code: $ch = curl_init(); curl_setopt($ch,curlopt_url,'url goes here'); curl_setopt($ch,curlopt_post,count($_post)); curl_setopt($ch,curlopt_postfields,$fields_string); $result = curl_exec($ch); var_dump($result); the response "this response textbool(true)" - detects bool , cannot access text. there way access it? thanks you need set option: curl_setopt($ch, curlopt_returntransfer, true);

Two Android apps with different package names using one Facebook app for sharing -

when creating app on facebook requires android apps' google play package name , main class name. have com.myapp , com.myapp.pro possible use same facebook app sharing? or need create 1 pro version? as see works both apps if specify "com.myapp". there reason specify package name , class? you have create facebook account application because in when cannot install both app in same device. <provider android:name="com.facebook.facebookcontentprovider" android:authorities="com.facebook.app.facebookcontentprovider{app_id}" android:exported="true" /> in device if same facebook id 1 appliaction cannot installed.so better create facebook app second app.

php - echo html contents with some css -

i have been trying echo html css styles in css destroys main html layout other css. how suppose without destroying main layout try this echo '<style>/* styles want */</style>'; echo '<div><!-- html code --></div>';

apache - AJP Connector not working? (404 error) -

i'm trying connect apache webserver (2.4.10) tomcat 7, both located in 2 different vms. it's first time using tools. understood method check if connection working try access tomcat using url ip/instance instead of, if have tomcat on 8080 port, ip:8080/instance . however, everytime try that, 404 error returned apache. here's configuration: on tomcat's vm, server.xml has line: <connector port="8009" protocol="ajp/1.3" redirectport="8443 /> on apache's vm, have set files: apache2.conf (in apache main folder) servername apache include httpd.conf serverroot "/etc/apache2" mutex file:${apache_lock_dir} default pidfile ${apache_pid_file} timeout 300 keepalive on maxkeepaliverequests 100 keepalivetimeout 5 user ${apache_run_user} group ${apache_run_group} hostnamelookups off errorlog ${apache_log_dir}/error.log loglevel warn # include module configuration: includeoptional mods-enabled/*.load includeoptional mo...

Android studio: connect Android emulator to private network -

i'm new android development , hope can me out. i use android studio in linux develop upnp application. on pc, there 2 networks, 1 connects internet eth0 , connects private network eth1. when launch application, can find upnp servers locate in network connect eth0 not 1 connect eth1. by looking @ setting redirection through emulator console , found way redirect network port 1900 android emulator , application can find upnp server in private network. android console: type 'help' list of commands ok redir add udp:1900:1900 ok redir add udp:51844:51844 ok redir add tcp:80:80 ko: can't setup redirection, port used program on host the problem it's not possible redirect protocol tcp port 80 streaming video. my questions are: 1- there way tell android emulator listen on eth1 , not eth0. or if possible listen both eth0 , eth1. 2- if not, how can redirect port 80 in order streaming video app? thanks help. i've got similar problem before. (bu...

Iboutlets not working inside block swift -

i fetching request server , trying display in tablview. in process want hide spinner after fetching records. problem : associated self inside block not work. @iboutlet weak var spinner: uiactivityindicatorview! @iboutlet weak var customtableview: customtableview! var widgetarray :nsmutablearray = [] override func viewdidload() { super.viewdidload() print(dataobjects.sharedinstance.mainarray) let appdelegate = uiapplication.sharedapplication().delegate as! appdelegate spinner.hidden = false spinner.startanimating() customnetworkhit.networkhitforurl("http://winjitwinds.cloudapp.net/windapi/windapiservice.svc/getcategorydatapagewise?categoryid=1944&pageno=1", completion: {(arrayresult) -> void in // spinner not stop animating , not hide self.spinner.stopanimating() self.spinner.hidden = true print("disable spinner man") dataobjects.sharedinstance.mainarray.addobjectsfromarray(arrayresul...

.net - Where is the Azure Storage queue connection string specified in NserviceBus configuration? -

when using azurestoragequeuetransport error message: system.collections.generic.keynotfoundexception: given key (nservicebus.localaddress) not present in dictionary. @ nservicebus.settings.settingsholder.get(string key) in c:\buildagent\work\1b05a2fea6e4cd32\src\nservicebus.core\settings\settingsholder.cs:line 91 @ nservicebus.settings.settingsholder.get[t](string key) in c:\buildagent\work\1b05a2fea6e4cd32\src\nservicebus.core\settings\settingsholder.cs:line 23 @ nservicebus.azure.transports.windowsazurestoragequeues.azurequeuenamingconvention.<.cctor>b__0(readonlysettings settings) in c:\buildagent\work\4e5353dd260f0a07\src\transport\namingconventions\azurequeuenamingconvention.cs:line 13 @ nservicebus.transports.configuretransport.<.ctor>b__1(settingsholder s) in c:\buildagent\work\1b05a2fea6e4cd32\src\nservicebus.core\transports\configuretransport.cs:line 21 @ nservicebus.features.featureactivator.setupfeatures(featureconfigurationcontext context) i...

asp.net - Is it OK to use WPF assemblies in a web app? -

i have asp.net mvc 2 app targeting .net 4 needs able resize images on fly , write them response. i have code , works. using system.drawing.dll. however, want enhance code not resizing image, dropping 24bpp down 4bit grayscale. not, life of me, find code on how system.drawing.dll. but did find bunch of wpf stuff. working/sample code (runs in linqpad). // load original 24 bit image var bitmapimage = new bitmapimage(); bitmapimage.begininit(); bitmapimage.urisource = new uri(@"c:\temp\resized\18_appa2_015.png", urikind.absolute); //bitmapimage.decodepixelwidth = 600; bitmapimage.endinit(); // create destination image var formatconvertedbitmap = new formatconvertedbitmap(); formatconvertedbitmap.begininit(); formatconvertedbitmap.source = bitmapimage; formatconvertedbitmap.destinationformat = pixelformats.gray4; formatconvertedbitmap.endinit(); // encode , dump image disk var encoder = new pngbitmapencoder(); encoder.frames.add(bitmapframe.create(formatconvertedbitm...

php - nginx : differentiate urls with rewrite rules -

i differentiate urls, structure : http://domain/category 1/ /category n/ /region 1/ /region n/ /city 1/ /city n/ the number of different possibilities minimum 40k, wondered how know if parameter in url chosen city, region or category? any idea ? or maybe parameter rewrite rule , make tests queries in database? better? how many rewrite rules nginx can support ? i suspect want along lines of: rewrite ^/(\w+)\%20(\d+)/$ index.php?category=$1&id=$2 last; this should rewrite url parameters on php script. should easier maintain 40k of rules. (note above untested, off top of head)

How to get values of multiselect box in PHP -

my multiselect box created this: <?php ini_set('display_errors',"1"); $select = '<select multiple>'; $lines = file('project-list.txt'); $fifth_column = array(); foreach ($lines $line){ $parts = preg_split('/\s+/', $line); $count = 0; foreach ($parts $partval){ if ((in_array($partval, $fifth_column) == false) && $count == 4){ $fifth_column[] = $partval; } $count++; } } foreach($fifth_column $value){ $select .= "<option value='".$value."'>".$value."</option>"; } $select .= '</select>'; echo $select; ?> <form action="" form method="post"> <input type="submit" class="ym-button ym-small" name = "apply" style="margin-top:1em;max-width:11em" value="...

How to send Json POST request using Volley in android in the Given Tutorial? -

hi beginner in android , learning make api calls. got tutorial of volley uses receive response. want send post request using volley. don't know how that, code post in given tutorial. please guide me send post request.the link tutorial learning http://www.truiton.com/2015/02/android-volley-example/ you have used below code send request // instantiate requestqueue. requestqueue queue = volley.newrequestqueue(this); string url ="http://www.google.com"; // request string response provided url. stringrequest stringrequest = new stringrequest(request.method.post, url, new response.listener<string>() { @override public void onresponse(string response) { // display first 500 characters of response string. mtextview.settext("response is: "+ response.substring(0,500)); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { mtextview.settext("that did...

c# - How to display push notification for user in windows 8.1? -

i working on windows 8.1 push notification part. have read different links , found first need register app , information sid , client secret , send our server team can send push notification. then after this, implemented following code @ side channeluri , expiration date of uri wns. pushnotificationchannel channel = null; try { channel = await pushnotificationchannelmanager.createpushnotificationchannelforapplicationasync(); if (channel != null) { var notificationuri = channel.uri; var expiration_time = channel.expirationtime; } channel.pushnotificationreceived += channel_pushnotificationreceived; } catch (exception ex) { if (ex != null) { system.diagnostics.debug.writeline(ex.hresult); } } i have received values , server team added logic send me push notification. now, problem facing...

c# - strange error in razor -

i have this: <tr class="@(item.id == (int)(session["id"] ?? 0) ? "sfs-selected sfs-selectable" : string.empty)"> but meesage: operator '==' cannot applied operands of type 'method group' , 'int' but cast int. if this: <tr class="@if (item.id == (string)(session["id"] )) {@("sfs-selected sfs-selectable") } @string.empty "> then error: unable cast object of type 'system.int32' type 'system.string'. so how check on null value? thank you if this: <tr class="@(item.id == (session["id"] ?? 0) ? "sfs-selected sfs-selectable" : string.empty)"> i warning: warning error: possible unintended reference comparison; value comparison, cast right hand side type 'string' so this: <tr class="@(item.id == (string)(session["id"] ?? 0) ? "sfs-selected sfs-selectable" : string.empty...

Apache/PHP segmentation fault in debug_backtrace() -

when performing specific action in drupal project, php crashes. in /var/log/apache2/error.log , can see: [wed jul 08 09:51:13.068078 2015] [core:notice] [pid 9130] ah00051: child pid 9135 exit signal segmentation fault (11), possible coredump in /etc/apache2 using xdebug.auto_trace=on , i've been able determine crash occurs when debug_backtrace() called (and not every time). i've managed core dump. here's when running sudo gdb /usr/sbin/apache2 /tmp/coredumps/core-apache2.9135 : program terminated signal sigsegv, segmentation fault. #0 0x00007f12e1c7422a in zend_std_object_get_class_name () /usr/lib/apache2/modules/libphp5.so what can further troubleshoot issue?

operating system - How to get all os installed in a computer using C#? -

all i trying detect operating system name , version computer using c#. for example, if user installed windows 7 , windows 8.1 in 1 computer. i have 2 items os names , versions. i have searched google, cannot find information this. any has idea how approach? i use following: osinfo.name this give name of operating system. osinfo.edition this give edition. osinfo.versionstring this give version. i'm sure can play around want.

Turn off Flashlight on Android Lollipop version -

kcamera = camera.open(); kcamera.parameters cam1= k.camera.getparameters(); cam1.setflashmode(parameters.flash_mode_torch); kcamera.setparameters(cam1); surfacetexture mpreviewtexture = new surfacetexture(0); try { kcamera.setpreviewtexture(mpreviewtexture); } catch { } mcam.startpreview(); this works fine, opens flashlight. but how can turn off ? from documentation: public static final string flash_mode_off added in api level 5 flash not fired. constant value: "off" so, can define function this: public void turnoffflashlight(camera camera){ camera.parameters cam1 = camera.getparameters(); cam1.setflashmode(camera.parameters.flash_mode_off); kcamera.setparameters(cam1); } and then, use when need: turnoffflashlight(kcamera);

java - HTML content in JSON object -

when try send html content in json object response servlet, ie 10 not receive html content tags. response type application/json java: string summaryrpthtml = sum.generatesummarytable(summary, false); jsonobj.put("haserror", false); jsonobj.put("message", "file proceesed"); jsonobj.put("summary", summaryrpthtml ); javascript : client: "processfileservlet", function(responsejson) { system.hideloadingscreen(""); responsejson = eval(responsejson); responsejson.summary; // nothing } do json_encode html sending , using json decoder on java side? json_encode($your_html)

ios - Animating UIBezierPath in custom UIView doesn't work -

i trying animate uibezierpath (from 1 path another)) in custom uiview when user touches view (touchesended . my drawing code: - (void)drawrect:(cgrect)rect { // drawing code [self createstartpath]; [self createendpath]; cgcontextref currentcontext = uigraphicsgetcurrentcontext(); cgcontextaddpath(currentcontext, _startpath.cgpath); cgcontextdrawpath(currentcontext, kcgpathstroke); } - (void) createstartpath { _startpath = uibezierpath.bezierpath; [_startpath movetopoint: cgpointmake(18, 22.5)]; [_startpath addcurvetopoint: cgpointmake(18.38, 22.32) controlpoint1: cgpointmake(18.14, 22.5) controlpoint2: cgpointmake(18.29, 22.44)]; [_startpath addcurvetopoint: cgpointmake(18.32, 21.62) controlpoint1: cgpointmake(18.56, 22.11) controlpoint2: cgpointmake(18.53, 21.79)]; [_startpath addlinetopoint: cgpointmake(6.78, 12)]; [_startpath addlinetopoint: cgpointmake(18.32, 2.38)]; [_startpath addcurvetopoint: cgpointmake(18.38, 1.68) controlpoint1: cgpointmake(18.53, 2.21) controlpoin...

java - Big spikes in Google App Engine caused by idle time between internal GAE calls -

Image
we have api googe app engine. process follows. have 2 calls datastore objetify , call urlfetch (to external api). in many of request see response takes long because there empty time spaces between datastore call , urlfetch call. times empty time after calls, before , in between. may have spikes of 10s. example when idle time between calls: example when idle time before calls: this current configuration: <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>${appengine.web.application}</application> <version>1</version> <threadsafe>true</threadsafe> <module>default</module> <instance-class>f4_1g</instance-class> <automatic-scaling> <min-idle-instances>3</min-idle-instances> <max-idle-instances>automatic</max-idle-instances> <min-pending-latency>30ms</min-pending-latency> <max-pending-latency>automatic</max-pending-latency> ...

java - Using custom LinearLayoutManager -

i tried use custom linearlayoutmanager (for using wrap content on recyclerview) : https://github.com/serso/android-linear-layout-manager also, when compiled, app crash , have error : java.lang.nosuchmethoderror: android.support.v7.widget.recyclerview$layoutparams.getviewlayoutposition this xml : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:custom="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:weightsum="10" android:orientation="vertical" android:background="@color/hypred_noir"> <relativelayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="4.5" android:background="@color...

javascript - How to disable two button while processing -

hi want disable 2 button while processing. if click button both of them disabled. i tried code doesn't work : btnexport.attributes.add("onclick", "this.value='processing...';this.disabled = true; " + clientscript.getpostbackeventreference(btnexport, nothing) + ";" + btnhitung.enabled = false + clientscript.getpostbackeventreference(btnhitung, nothing) + ";") what right code? better disable buttons on client side instead of server side using jquery @atlay suggested, use fiddle: fiddle disable buttons on click have include jquery library work under solution. $(document).ready(function() { $("#button1").click(function() { // disabling buttons.. $("#button2").prop("disabled", true); $("#button1").prop("disabled", true); }); }); and if want server side. have put above script function on client side , vb code can call this: dim scrip...

diskspace - SonarQube Temp Disk Space -

i'm finding sonarqube using lot of disk space in it's temp directory. there sort of clean-up routine runs regularly purge this? --- /opt/codehaus/releases`/sonarqube/sonarqube-5.1/temp ------------------------------------------------------------------------------------------- /.. 29.7gib [######### ] /tmp 92.0kib [ ] jffi6092968669040435416.tmp 60.0kib [ ] liblz4-java2192651176366163015.so 20.0kib [ ] /tc e 4.0kib [ ] /ror 4.0kib [ ] sharedmemory if not, have advice on how manage this? restarting service seems clear all, don't want have write restarts on timer. using v5.1 this limitation fixed in 5.2. feedback , sorry inconvenience. see http://jira.sonarsource.com/browse/sonar-6700

Kendo UI Grid settings -

this grid settings: $scope.documentsources = new kendo.data.datasource({ transport: { read: { fun: console.log("read"), url: servicebase + "documents/getlistdocuments", type: "post", datatype: "json", contenttype: 'application/json', beforesend: function (req) { req.setrequestheader('authorization', authglobalservice.getauthorizationdata().token); } }, update: { fun: console.log("update"), url: servicebase + "documents/getlistdocuments", type: "post", datatype: "json", contenttype: 'application/json', beforesend: function (req) { req.setrequestheader('authorization', authglobalservi...

Access-VBA check if the cursor in a Textbox is in the first or last line -

the goal: i've got access database continuous form , want add functionality can go next or previous record pressing up- or down-arrow. the problem: i've got multiline textbox named txtprojekt , want database check if textbox filled multi-lined text , jump next record if cursor in last line of textbox. likewise want jump previous record if cursor in first line of textbox. i can check current cursor position selstart , can't find out in line cursor is. do have ideas? current code: private sub form_keydown(keycode integer, shift integer) on error goto err_form_keydown if me.activecontrol.name = "txtprojekt" if not (me.txtprojekt.selstart = 0 , me.txtprojekt.sellength = len(me.txtprojekt.text)) goto exit_form_keydown end if end if if keycode = vbkeyup docmd.gotorecord acactivedataobject, record:=acprevious keycode = 0 elseif keycode = vbkeydown docmd.gotorecord acactivedataobject, record:=acnext keycode = 0 end if e...

How to stop .htaccess ReWrite rules affecting Subdomains -

i have code in .htaccess file rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(online-shop)/?$ $1/home [l,nc] rewriterule ^(my)/?$ $1/home [l,nc] rewriterule ^(blog)/(post|tags)/([\w-]+)/?$ index.php?id=$1&type=$2&unique=$3 [l,qsa,nc] rewriterule ^(blog)/(archives)/([0-9]{4})/([0-9]{2})?$ index.php?id=$1&type=$2&year=$3&month=$4 [l,qsa,nc] rewriterule ^([\w/-]+)/?$ index.php?id=$1 [l,qsa] so following urls rewritten: domain.com/home domain.com/index.php?id=home however if @ subdomain ( cp.domain.com ) following error: the requested url /home/user/public_html/index.php not found on server. additionally, 404 not found error encountered while trying use errordocument handle request. so subdomains looking in root directory domain should looking in directory set in control panel as remove line of code: rewriterule ^([\w/-]+)/?$ index.php?id=$1 [l,qsa] the subdomains start working fine ...

jmeter - javax.net.ssl.SSLException: Received fatal alert: internal_error -

how resolve javax.net.ssl.sslexception: received fatal alert: internal_error when using jmeter through gui mode. have changed https.default.protocol=sslv3 in jmeter.properties file still not able resolve it. pls advice. can show full stacktrace ? read from: http://jmeter.apache.org/usermanual/component_reference.html#http_request this: you may encounter following error: java.security.cert.certificateexception: certificates not conform algorithm constraints if run https request on web site ssl certificate (itself or 1 of ssl certificates in chain of trust) signature algorithm using md2 (like md2withrsaencryption) or ssl certificate size lower 1024 bits. error related increased security in java 7 version u16 (md2) , version u40 (certificate size lower 1024 bits), , java 8 too. allow perform https request, can downgrade security of java installation editing java jdk.certpath.disabledalgorithms property. remove md2 value or constraint on size, depending on cas...

c# - How do i get Process.MainMoudle.FileName? -

i have class: using system; using system.collections.generic; using system.linq; using system.text; using system.runtime.interopservices; using system.windows.forms; using system.componentmodel; namespace hardwaremonitoring { public class getprocesses: iwin32window { internal intptr handle; internal string title; internal string filename; public intptr handle { { return handle; } } public string title { { return title; } } public string filename { { return filename; } } public static readonly int32 gwl_style = -16; public static readonly uint64 ws_visible = 0x10000000l; public static readonly uint64 ws_border = 0x00800000l; public static readonly uint64 desired_ws = ws_border | ws_visible; public delegate boolean enumwindowscallback(intptr hwnd, int32 lparam); public static list<get...